QuantumCode

Trait QuantumCode 

Source
pub trait QuantumCode: Send + Sync {
    // Required methods
    fn encode(
        &self,
        logical_state: &Array1<f64>,
    ) -> Result<Array1<f64>, QECError>;
    fn decode(
        &self,
        physical_state: &Array1<f64>,
        syndrome: &Array1<u8>,
    ) -> Result<Array1<f64>, QECError>;
    fn extract_syndrome(
        &self,
        physical_state: &Array1<f64>,
    ) -> Result<Array1<u8>, QECError>;
    fn get_stabilizers(&self) -> Vec<Array1<i8>> ;
    fn get_parameters(&self) -> CodeParameters;
    fn is_correctable(&self, error: &Array1<u8>) -> bool;
    fn get_logical_operators(&self) -> LogicalOperators;
}
Expand description

Quantum code trait

Required Methods§

Source

fn encode(&self, logical_state: &Array1<f64>) -> Result<Array1<f64>, QECError>

Encode logical qubits into physical qubits

Source

fn decode( &self, physical_state: &Array1<f64>, syndrome: &Array1<u8>, ) -> Result<Array1<f64>, QECError>

Decode physical qubits to logical qubits

Source

fn extract_syndrome( &self, physical_state: &Array1<f64>, ) -> Result<Array1<u8>, QECError>

Extract error syndrome

Source

fn get_stabilizers(&self) -> Vec<Array1<i8>>

Get stabilizer generators

Source

fn get_parameters(&self) -> CodeParameters

Get code parameters

Source

fn is_correctable(&self, error: &Array1<u8>) -> bool

Check if error is correctable

Source

fn get_logical_operators(&self) -> LogicalOperators

Get logical operators

Implementors§