Skip to content

Commit 4259e08

Browse files
committed
Add crate preludes + make convenience
1 parent da1d619 commit 4259e08

13 files changed

Lines changed: 99 additions & 57 deletions

File tree

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ pip-install-uv: ## Install uv using pip and create a venv. (Recommended to inst
183183
@echo "Creating venv and installing dependencies..."
184184
uv sync
185185

186+
.PONY: dev
187+
dev: clean build test ## Run the typical sequence of commands to check everything is running correctly
188+
189+
.PONY: devl ## Run the commands to make sure everything runs + lint
190+
devl: dev lint
191+
186192
# Help
187193
# ----
188194

crates/pecos-core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub mod errors;
1616
pub mod gate;
1717
pub mod pauli;
1818
pub mod phase;
19+
pub mod prelude;
1920
pub mod qubit_id;
2021
pub mod rng;
2122
pub mod sets;

crates/pecos-core/src/prelude.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2025 The PECOS Developers
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
4+
// in compliance with the License.You may obtain a copy of the License at
5+
//
6+
// https://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software distributed under the License
9+
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10+
// or implied. See the License for the specific language governing permissions and limitations under
11+
// the License.
12+
13+
pub use crate::{
14+
IndexableElement, Set, VecSet,
15+
errors::PecosError,
16+
rng::{RngManageable, rng_manageable::derive_seed},
17+
};

crates/pecos-engines/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub mod byte_message;
22
pub mod core;
33
pub mod engines;
4+
pub mod prelude;
45

56
// Re-exports for commonly used types
67
pub use byte_message::{ByteMessage, ByteMessageBuilder, GateType, QuantumGate};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2025 The PECOS Developers
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
4+
// in compliance with the License.You may obtain a copy of the License at
5+
//
6+
// https://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software distributed under the License
9+
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10+
// or implied. See the License for the specific language governing permissions and limitations under
11+
// the License.
12+
13+
pub use crate::{
14+
ByteMessage, ByteMessageBuilder, ClassicalEngine, ControlEngine, DepolarizingNoiseModel,
15+
Engine, EngineStage, EngineSystem, HybridEngine, MonteCarloEngine, NoiseModel,
16+
PassThroughNoiseModel, QuantumEngine, QuantumSystem, ShotResult, ShotResults,
17+
byte_message::dump_batch,
18+
core::shot_results::OutputFormat,
19+
engines::noise::general::GeneralNoiseModel,
20+
engines::quantum::{SparseStabEngine, StateVecEngine, new_quantum_engine_arbitrary_qgate},
21+
};

crates/pecos-phir/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
pub mod common;
22
pub mod version_traits;
33

4+
pub mod prelude;
5+
46
// Version-specific implementations
57
#[cfg(feature = "v0_1")]
68
pub mod v0_1;

crates/pecos-phir/src/prelude.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub use crate::{PHIREngine, setup_phir_engine};

crates/pecos-qasm/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub mod engine;
4747
pub mod engine_builder;
4848
pub mod includes;
4949
pub mod parser;
50+
pub mod prelude;
5051
pub mod preprocessor;
5152
pub mod util;
5253

crates/pecos-qasm/src/prelude.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2025 The PECOS Developers
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
4+
// in compliance with the License.You may obtain a copy of the License at
5+
//
6+
// https://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software distributed under the License
9+
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10+
// or implied. See the License for the specific language governing permissions and limitations under
11+
// the License.
12+
13+
pub use std::str::FromStr;
14+
15+
pub use crate::engine::QASMEngine;
16+
pub use crate::engine_builder::QASMEngineBuilder;

crates/pecos-qir/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
// Re-export the QIR engine components
21
pub mod command_generation;
32
pub mod common;
43
pub mod compiler;
54
pub mod engine;
65
pub mod library;
76
pub mod measurement;
87
pub mod platform;
8+
pub mod prelude;
99
pub mod runtime;
1010
pub mod state;
1111

12-
// Public exports
1312
pub use engine::QirEngine;

0 commit comments

Comments
 (0)