diff options
| author | hachem <im@hachem.wtf> | 2024-10-13 15:13:17 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2024-10-13 15:13:17 +0200 |
| commit | 7cc3c78a24b51a58d44e1baff20b86292662390e (patch) | |
| tree | ea7bcb1c6493287abc75f4df55458ed8f4abc1e5 /libpsi-core/src/core/runtime.rs | |
| parent | 00c4b7c44b1364381c65dccbb190d64b3ff4c1e8 (diff) | |
Mass refactor
Diffstat (limited to 'libpsi-core/src/core/runtime.rs')
| -rw-r--r-- | libpsi-core/src/core/runtime.rs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/libpsi-core/src/core/runtime.rs b/libpsi-core/src/core/runtime.rs index 19ac191..f3e52ac 100644 --- a/libpsi-core/src/core/runtime.rs +++ b/libpsi-core/src/core/runtime.rs @@ -1,25 +1,22 @@ -use super::{ClassicalRegister, QuantumCircuit, QuantumRegister}; +use super::{ClassicalRegister, QuantumCircuit, QuantumRegister, QuantumState}; -#[allow(unused)] -pub struct ExecutionData { +pub struct RuntimeData { pub quantum_register: QuantumRegister, pub classical_states: ClassicalRegister, } -impl ExecutionData { +impl RuntimeData { pub fn new(quantum_register: QuantumRegister, classical_states: ClassicalRegister) -> Self { - ExecutionData { + RuntimeData { quantum_register, classical_states, } } } -pub trait RuntimeBase { - fn get_circuit(&self) -> &QuantumCircuit; -} - -pub trait Runtime<'a, T: RuntimeBase = Self> { +pub trait Runtime<'a> { fn new(circuit: &'a QuantumCircuit) -> Self; - fn execute(&self, repeat: usize) -> Vec<ExecutionData>; + fn execute(&self, repeat: usize) -> Vec<RuntimeData>; + fn get_state(&self) -> QuantumState; + fn get_circuit(&self) -> &QuantumCircuit; } |
