From 5f058c9b67e0f96e0dd89bbeff0afe8e08bde25b Mon Sep 17 00:00:00 2001 From: hachem Date: Fri, 18 Oct 2024 09:34:36 +0200 Subject: Allow named registers and tiny refactor --- libpsi-core/src/runtimes/basic_rt.rs | 39 ------------------------------------ 1 file changed, 39 deletions(-) delete mode 100644 libpsi-core/src/runtimes/basic_rt.rs (limited to 'libpsi-core/src/runtimes/basic_rt.rs') 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 { - let mut result: Vec = 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 - } -} -- cgit v1.3