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§
Sourcefn encode(&self, logical_state: &Array1<f64>) -> Result<Array1<f64>, QECError>
fn encode(&self, logical_state: &Array1<f64>) -> Result<Array1<f64>, QECError>
Encode logical qubits into physical qubits
Sourcefn decode(
&self,
physical_state: &Array1<f64>,
syndrome: &Array1<u8>,
) -> Result<Array1<f64>, QECError>
fn decode( &self, physical_state: &Array1<f64>, syndrome: &Array1<u8>, ) -> Result<Array1<f64>, QECError>
Decode physical qubits to logical qubits
Sourcefn extract_syndrome(
&self,
physical_state: &Array1<f64>,
) -> Result<Array1<u8>, QECError>
fn extract_syndrome( &self, physical_state: &Array1<f64>, ) -> Result<Array1<u8>, QECError>
Extract error syndrome
Sourcefn get_parameters(&self) -> CodeParameters
fn get_parameters(&self) -> CodeParameters
Get code parameters
Sourcefn is_correctable(&self, error: &Array1<u8>) -> bool
fn is_correctable(&self, error: &Array1<u8>) -> bool
Check if error is correctable
Sourcefn get_logical_operators(&self) -> LogicalOperators
fn get_logical_operators(&self) -> LogicalOperators
Get logical operators