Skip to content

Commit 918ee16

Browse files
committed
moving PHIR capabilities to pecos-phir crate
1 parent f29d17c commit 918ee16

File tree

25 files changed

+2822
-1225
lines changed

25 files changed

+2822
-1225
lines changed

Cargo.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pest = "2.7"
4646
pecos-core = { version = "0.1.1", path = "crates/pecos-core" }
4747
pecos-qsim = { version = "0.1.1", path = "crates/pecos-qsim" }
4848
pecos-qasm = { version = "0.1.1", path = "crates/pecos-qasm" }
49+
pecos-phir = { version = "0.1.1", path = "crates/pecos-phir" }
4950
pecos-engines = { version = "0.1.1", path = "crates/pecos-engines" }
5051
pecos-qir = { version = "0.1.1", path = "crates/pecos-qir" }
5152
pecos-qec = { version = "0.1.1", path = "crates/pecos-qec" }

crates/pecos-cli/src/engine_setup.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ pub fn setup_cli_engine(
3434
}
3535
ProgramType::PHIR => {
3636
debug!("Setting up PHIR engine");
37-
let engine = PHIREngine::new(program_path)?;
38-
Ok(Box::new(engine))
37+
setup_phir_engine(program_path)
3938
}
4039
ProgramType::QASM => {
4140
debug!("Setting up QASM engine");

crates/pecos-engines/src/engines.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ pub mod classical;
22
pub mod hybrid;
33
pub mod monte_carlo;
44
pub mod noise;
5-
pub mod phir;
65
pub mod quantum;
76
pub mod quantum_system;
87

crates/pecos-engines/src/engines/classical.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
use crate::byte_message::ByteMessage;
22
use crate::core::shot_results::ShotResult;
3-
use crate::engines::{ControlEngine, Engine, EngineStage, phir};
3+
use crate::engines::{ControlEngine, Engine, EngineStage};
44
use dyn_clone::DynClone;
5-
use log::debug;
65
use pecos_core::errors::PecosError;
76
use std::any::Any;
8-
use std::path::Path;
97

108
/// Classical engine that processes programs and handles measurements
119
pub trait ClassicalEngine:
@@ -187,20 +185,3 @@ impl Engine for Box<dyn ClassicalEngine> {
187185
ClassicalEngine::reset(&mut **self)
188186
}
189187
}
190-
191-
/// Sets up a basic PHIR engine.
192-
///
193-
/// This function creates a PHIR engine from the provided path.
194-
///
195-
/// # Parameters
196-
///
197-
/// - `program_path`: A reference to the path of the PHIR program file
198-
///
199-
/// # Returns
200-
///
201-
/// Returns a `Box<dyn ClassicalEngine>` containing the PHIR engine
202-
pub fn setup_phir_engine(program_path: &Path) -> Result<Box<dyn ClassicalEngine>, PecosError> {
203-
debug!("Setting up PHIR engine for: {}", program_path.display());
204-
let engine = phir::PHIREngine::new(program_path)?;
205-
Ok(Box::new(engine))
206-
}

0 commit comments

Comments
 (0)