pub trait ErrorCorrectionCode: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn distance(&self) -> usize;
fn encoding_rate(&self) -> f64;
fn threshold(&self) -> f64;
fn encode(
&self,
logical_state: &Array1<f64>,
) -> Result<Array1<f64>, QECError>;
fn syndrome_extraction(
&self,
state: &Array1<f64>,
) -> Result<Array1<i32>, QECError>;
fn error_lookup(
&self,
syndrome: &Array1<i32>,
) -> Result<Array1<i32>, QECError>;
}Required Methods§
fn name(&self) -> &str
fn distance(&self) -> usize
fn encoding_rate(&self) -> f64
fn threshold(&self) -> f64
fn encode(&self, logical_state: &Array1<f64>) -> Result<Array1<f64>, QECError>
fn syndrome_extraction( &self, state: &Array1<f64>, ) -> Result<Array1<i32>, QECError>
fn error_lookup(&self, syndrome: &Array1<i32>) -> Result<Array1<i32>, QECError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".