pub struct StabilizerState<const W: usize> { /* private fields */ }Expand description
A stabilizer state on num_qubits qubits, held as a reduced tableau of signed generators.
Read it out with crate::PauliSum::expectation_stabilizer; a product state reads faster through crate::ProductBasis.
Implementations§
Source§impl<const W: usize> StabilizerState<W>
impl<const W: usize> StabilizerState<W>
Sourcepub fn from_generators(
num_qubits: usize,
generators: &[(PauliString<W>, bool)],
) -> Result<Self, StabilizerError>
pub fn from_generators( num_qubits: usize, generators: &[(PauliString<W>, bool)], ) -> Result<Self, StabilizerError>
Build the state stabilized by generators, each (key, minus) standing for (-1)^minus · key.
Generators must number num_qubits, lie within num_qubits, pairwise commute and be independent, or a StabilizerError says which failed.
§Panics
Panics if num_qubits > 64 · W.
Sourcepub fn num_qubits(&self) -> usize
pub fn num_qubits(&self) -> usize
Number of qubits the state is defined on.
Trait Implementations§
Source§impl<const W: usize> Clone for StabilizerState<W>
impl<const W: usize> Clone for StabilizerState<W>
Source§fn clone(&self) -> StabilizerState<W>
fn clone(&self) -> StabilizerState<W>
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<const W: usize> Freeze for StabilizerState<W>
impl<const W: usize> RefUnwindSafe for StabilizerState<W>
impl<const W: usize> Send for StabilizerState<W>
impl<const W: usize> Sync for StabilizerState<W>
impl<const W: usize> Unpin for StabilizerState<W>
impl<const W: usize> UnwindSafe for StabilizerState<W>
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