QuantumAlgorithm

Trait QuantumAlgorithm 

Source
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§

Source

fn build_circuit(&self) -> Result<Circuit, AlgorithmError>

Build the quantum circuit for this algorithm.

Source

fn run(&self, shots: u32) -> Result<AlgorithmResult, AlgorithmError>

Execute the algorithm with the specified number of shots.

Source

fn num_qubits(&self) -> usize

Get the number of qubits required.

Source

fn name(&self) -> &str

Get algorithm name for logging.

Implementors§