QuantumErrorCorrection

Struct QuantumErrorCorrection 

Source
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: usize

Number of logical qubits

§code: ErrorCorrectionCode

Error correction code

§noise_parameters: NoiseParameters

Noise parameters

§syndrome_history: Vec<Array1<i8>>

Syndrome history for improved decoding

Implementations§

Source§

impl QuantumErrorCorrection

Source

pub fn new(n_logicalqubits: usize, code: ErrorCorrectionCode) -> Self

Create new quantum error correction system

Source

pub fn encode( &self, logicalstate: &Array1<Complex64>, ) -> Result<Array1<Complex64>>

Encode logical state into physical qubits

Source

pub fn apply_logical_x( &self, state: &Array1<Complex64>, qubit: usize, ) -> Result<Array1<Complex64>>

Apply quantum gates with error correction

Source

pub fn apply_hadamard( &self, state: &Array1<Complex64>, _qubit: usize, ) -> Result<Array1<Complex64>>

Apply Hadamard gate with error correction

Source

pub fn apply_pauli_x( &self, state: &Array1<Complex64>, qubit: usize, ) -> Result<Array1<Complex64>>

Apply Pauli-X gate with error correction

Source

pub fn apply_cnot( &self, state: &Array1<Complex64>, _control: usize, _target: usize, ) -> Result<Array1<Complex64>>

Apply CNOT gate with error correction

Source

pub fn error_correction_cycle( &mut self, state: &mut Array1<Complex64>, ) -> Result<f64>

Perform error correction cycle

Source

pub fn estimate_logical_error_rate(&self) -> f64

Estimate logical error rate

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V