diff options
| author | hachem <im@hachem.wtf> | 2024-10-18 09:34:36 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2024-10-18 09:34:36 +0200 |
| commit | 5f058c9b67e0f96e0dd89bbeff0afe8e08bde25b (patch) | |
| tree | 7546702edc4d6e2c66c1440753c31387b38dea9f /libpsi-core/src/runtimes/basic_rt.rs | |
| parent | 7cc3c78a24b51a58d44e1baff20b86292662390e (diff) | |
Allow named registers and tiny refactor
Diffstat (limited to 'libpsi-core/src/runtimes/basic_rt.rs')
| -rw-r--r-- | libpsi-core/src/runtimes/basic_rt.rs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/libpsi-core/src/runtimes/basic_rt.rs b/libpsi-core/src/runtimes/basic_rt.rs deleted file mode 100644 index b8c412f..0000000 --- a/libpsi-core/src/runtimes/basic_rt.rs +++ /dev/null @@ -1,39 +0,0 @@ -use crate::{Instruction, QuantumCircuit, QuantumState, Runtime, RuntimeData}; - -pub struct BasicRT<'a> { - circuit: &'a QuantumCircuit<'a>, -} - -impl<'a> Runtime<'a> for BasicRT<'a> { - fn new(circuit: &'a QuantumCircuit) -> BasicRT<'a> { - BasicRT { circuit } - } - - fn execute(&self, repeat: usize) -> Vec<RuntimeData> { - let mut result: Vec<RuntimeData> = Vec::with_capacity(repeat); - for _ in 0..repeat { - let executation_data = RuntimeData::new( - self.circuit.get_quantum_register(), - self.circuit.get_classical_registers(), - ); - - for instruction in self.circuit.get_instructions() { - match instruction { - Instruction::ApplyGate(_gate, _control_bits, _target) => print!(""), - Instruction::Measure(_bit) => print!(""), - } - } - - result.push(executation_data); - } - result - } - - fn get_state(&self) -> QuantumState { - todo!() - } - - fn get_circuit(&self) -> &QuantumCircuit { - &self.circuit - } -} |
