pub struct GeometricErrorCorrection {
pub code_space_dimension: usize,
pub logical_operators: Vec<Array2<Complex64>>,
pub stabilizers: Vec<Array2<Complex64>>,
pub geometric_phases: HashMap<String, f64>,
}Expand description
Geometric quantum error correction integration
Fields§
§code_space_dimension: usize§logical_operators: Vec<Array2<Complex64>>§stabilizers: Vec<Array2<Complex64>>§geometric_phases: HashMap<String, f64>Implementations§
Source§impl GeometricErrorCorrection
impl GeometricErrorCorrection
Sourcepub fn new(code_space_dimension: usize) -> Self
pub fn new(code_space_dimension: usize) -> Self
Create a new geometric error correction instance
Sourcepub fn add_logical_operator(&mut self, operator: Array2<Complex64>, phase: f64)
pub fn add_logical_operator(&mut self, operator: Array2<Complex64>, phase: f64)
Add a logical operator with associated geometric phase
Sourcepub fn add_stabilizer(&mut self, stabilizer: Array2<Complex64>)
pub fn add_stabilizer(&mut self, stabilizer: Array2<Complex64>)
Add a stabilizer generator
Sourcepub fn is_correctable(&self, error: &Array2<Complex64>) -> bool
pub fn is_correctable(&self, error: &Array2<Complex64>) -> bool
Check if an error is correctable using geometric phases
Sourcepub fn correct_error(
&self,
corrupted_state: &Array1<Complex64>,
syndrome: &[bool],
) -> Result<Array1<Complex64>, QuantRS2Error>
pub fn correct_error( &self, corrupted_state: &Array1<Complex64>, syndrome: &[bool], ) -> Result<Array1<Complex64>, QuantRS2Error>
Perform error correction using geometric phases
Sourcepub fn syndrome_phase(&self, syndrome: &[bool]) -> f64
pub fn syndrome_phase(&self, syndrome: &[bool]) -> f64
Compute the geometric phase for error syndrome
Trait Implementations§
Source§impl Clone for GeometricErrorCorrection
impl Clone for GeometricErrorCorrection
Source§fn clone(&self) -> GeometricErrorCorrection
fn clone(&self) -> GeometricErrorCorrection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GeometricErrorCorrection
impl RefUnwindSafe for GeometricErrorCorrection
impl Send for GeometricErrorCorrection
impl Sync for GeometricErrorCorrection
impl Unpin for GeometricErrorCorrection
impl UnwindSafe for GeometricErrorCorrection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more