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
sourceimpl 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.
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for Tableau
impl<'de> Deserialize<'de> for Tableau
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Tableau
impl Send for Tableau
impl Sync for Tableau
impl Unpin for Tableau
impl UnwindSafe for Tableau
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more