pub struct Tableau { /* private fields */ }
Expand description
Represents a stabilizer group with logical dimension 1; that is, a single stabilizer state expressed in terms of the generators of its stabilizer group, and those generators of the Pauli group that anticommute with each stabilizer generator (colloquially, the destabilizers of the represented state).
Implementations§
Source§impl Tableau
impl Tableau
Sourcepub fn assert_meas(
&self,
idx_target: usize,
expected: bool,
) -> Result<(), String>
pub fn assert_meas( &self, idx_target: usize, expected: bool, ) -> Result<(), String>
Asserts whether a hypothetical single-qubit $Z$-basis measurement would agree with an expected result.
If the assertion would pass, Ok(())
is returned, otherwise an Err
describing the assertion failure is returned.
Source§impl Tableau
impl Tableau
Sourcepub fn apply_h_mut(&mut self, idx_target: usize)
pub fn apply_h_mut(&mut self, idx_target: usize)
Applies a Hadamard operation in-place to the given qubit.
Sourcepub fn apply_s_mut(&mut self, idx_target: usize)
pub fn apply_s_mut(&mut self, idx_target: usize)
Applies a phase operation ($S$) in-place to the given qubit.
Sourcepub fn apply_cnot_mut(&mut self, idx_control: usize, idx_target: usize)
pub fn apply_cnot_mut(&mut self, idx_control: usize, idx_target: usize)
Applies a controlled-NOT operation in-place, given control and target qubits.
Sourcepub fn apply_x_mut(&mut self, idx_target: usize)
pub fn apply_x_mut(&mut self, idx_target: usize)
Applies a Pauli $X$ operation in-place to the given qubit.
Sourcepub fn apply_s_adj_mut(&mut self, idx_target: usize)
pub fn apply_s_adj_mut(&mut self, idx_target: usize)
Applies an adjoint phase operation ($S^{\dagger}$) in-place to the given qubit.
Sourcepub fn apply_y_mut(&mut self, idx_target: usize)
pub fn apply_y_mut(&mut self, idx_target: usize)
Applies a Pauli $Y$ operation in-place to the given qubit.
Sourcepub fn apply_z_mut(&mut self, idx_target: usize)
pub fn apply_z_mut(&mut self, idx_target: usize)
Applies a Pauli $Z$ operation in-place to the given qubit.
Sourcepub fn apply_swap_mut(&mut self, idx_1: usize, idx_2: usize)
pub fn apply_swap_mut(&mut self, idx_1: usize, idx_2: usize)
Applies a SWAP operation in-place between two qubits.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tableau
impl<'de> Deserialize<'de> for Tableau
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Tableau
impl RefUnwindSafe for Tableau
impl Send for Tableau
impl Sync for Tableau
impl Unpin for Tableau
impl UnwindSafe for Tableau
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
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>
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>
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