pub trait QuantumAlgorithm: Send + Sync {
// Required methods
fn build_circuit(&self) -> Result<Circuit, AlgorithmError>;
fn run(&self, shots: u32) -> Result<AlgorithmResult, AlgorithmError>;
fn num_qubits(&self) -> usize;
fn name(&self) -> &str;
}Expand description
Trait for quantum algorithms.
Implement this trait to create custom quantum algorithms that integrate with the LogosQ ecosystem.
Required Methods§
Sourcefn build_circuit(&self) -> Result<Circuit, AlgorithmError>
fn build_circuit(&self) -> Result<Circuit, AlgorithmError>
Build the quantum circuit for this algorithm.
Sourcefn run(&self, shots: u32) -> Result<AlgorithmResult, AlgorithmError>
fn run(&self, shots: u32) -> Result<AlgorithmResult, AlgorithmError>
Execute the algorithm with the specified number of shots.
Sourcefn num_qubits(&self) -> usize
fn num_qubits(&self) -> usize
Get the number of qubits required.