pub struct PauliUtils;
Expand description
Utilities for common Pauli string operations
Implementations§
Source§impl PauliUtils
impl PauliUtils
Sourcepub fn single_qubit(
num_qubits: usize,
qubit: usize,
op: PauliOperator,
coeff: Complex64,
) -> Result<PauliString>
pub fn single_qubit( num_qubits: usize, qubit: usize, op: PauliOperator, coeff: Complex64, ) -> Result<PauliString>
Create a single-qubit Pauli string
Sourcepub fn all_x(num_qubits: usize, coeff: Complex64) -> PauliString
pub fn all_x(num_qubits: usize, coeff: Complex64) -> PauliString
Create an all-X Pauli string
Sourcepub fn all_z(num_qubits: usize, coeff: Complex64) -> PauliString
pub fn all_z(num_qubits: usize, coeff: Complex64) -> PauliString
Create an all-Z Pauli string
Sourcepub fn random(
num_qubits: usize,
weight: usize,
coeff: Complex64,
) -> Result<PauliString>
pub fn random( num_qubits: usize, weight: usize, coeff: Complex64, ) -> Result<PauliString>
Create random Pauli string
Sourcepub fn are_mutually_commuting(pauli_strings: &[PauliString]) -> bool
pub fn are_mutually_commuting(pauli_strings: &[PauliString]) -> bool
Check if a set of Pauli strings are mutually commuting
Sourcepub fn maximal_commuting_set(pauli_strings: &[PauliString]) -> Vec<usize>
pub fn maximal_commuting_set(pauli_strings: &[PauliString]) -> Vec<usize>
Find maximal set of mutually commuting Pauli strings
Auto Trait Implementations§
impl Freeze for PauliUtils
impl RefUnwindSafe for PauliUtils
impl Send for PauliUtils
impl Sync for PauliUtils
impl Unpin for PauliUtils
impl UnwindSafe for PauliUtils
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.