pub struct QuantumErrorCorrection {
pub n_logical_qubits: usize,
pub code: ErrorCorrectionCode,
pub noise_parameters: NoiseParameters,
pub syndrome_history: Vec<Array1<i8>>,
}Expand description
Quantum error correction system
Fields§
§n_logical_qubits: usizeNumber of logical qubits
code: ErrorCorrectionCodeError correction code
noise_parameters: NoiseParametersNoise parameters
syndrome_history: Vec<Array1<i8>>Syndrome history for improved decoding
Implementations§
Source§impl QuantumErrorCorrection
impl QuantumErrorCorrection
Sourcepub fn new(n_logicalqubits: usize, code: ErrorCorrectionCode) -> Self
pub fn new(n_logicalqubits: usize, code: ErrorCorrectionCode) -> Self
Create new quantum error correction system
Sourcepub fn encode(
&self,
logicalstate: &Array1<Complex64>,
) -> Result<Array1<Complex64>>
pub fn encode( &self, logicalstate: &Array1<Complex64>, ) -> Result<Array1<Complex64>>
Encode logical state into physical qubits
Sourcepub fn apply_logical_x(
&self,
state: &Array1<Complex64>,
qubit: usize,
) -> Result<Array1<Complex64>>
pub fn apply_logical_x( &self, state: &Array1<Complex64>, qubit: usize, ) -> Result<Array1<Complex64>>
Apply quantum gates with error correction
Sourcepub fn apply_hadamard(
&self,
state: &Array1<Complex64>,
_qubit: usize,
) -> Result<Array1<Complex64>>
pub fn apply_hadamard( &self, state: &Array1<Complex64>, _qubit: usize, ) -> Result<Array1<Complex64>>
Apply Hadamard gate with error correction
Sourcepub fn apply_pauli_x(
&self,
state: &Array1<Complex64>,
qubit: usize,
) -> Result<Array1<Complex64>>
pub fn apply_pauli_x( &self, state: &Array1<Complex64>, qubit: usize, ) -> Result<Array1<Complex64>>
Apply Pauli-X gate with error correction
Sourcepub fn apply_cnot(
&self,
state: &Array1<Complex64>,
_control: usize,
_target: usize,
) -> Result<Array1<Complex64>>
pub fn apply_cnot( &self, state: &Array1<Complex64>, _control: usize, _target: usize, ) -> Result<Array1<Complex64>>
Apply CNOT gate with error correction
Sourcepub fn error_correction_cycle(
&mut self,
state: &mut Array1<Complex64>,
) -> Result<f64>
pub fn error_correction_cycle( &mut self, state: &mut Array1<Complex64>, ) -> Result<f64>
Perform error correction cycle
Sourcepub fn estimate_logical_error_rate(&self) -> f64
pub fn estimate_logical_error_rate(&self) -> f64
Estimate logical error rate
Auto Trait Implementations§
impl Freeze for QuantumErrorCorrection
impl RefUnwindSafe for QuantumErrorCorrection
impl Send for QuantumErrorCorrection
impl Sync for QuantumErrorCorrection
impl Unpin for QuantumErrorCorrection
impl UnwindSafe for QuantumErrorCorrection
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> 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