Struct PhaseCoeff
pub struct PhaseCoeff {
pub constant: Rational,
pub radians: Option<BigRational>,
pub symbols: BTreeMap<u32, FreeRational>,
}Fields§
§constant: Rational§radians: Option<BigRational>Exact rational radians divided by pi in the phase exponent. None represents zero without allocating BigRational for Clifford paths.
symbols: BTreeMap<u32, FreeRational>Implementations§
§impl PhaseCoeff
impl PhaseCoeff
pub const ZERO: Self
pub const HALF: Self
pub const QUARTER: Self
pub const THREE_QUARTERS: Self
pub const fn new_constant(constant: Rational) -> Self
pub fn new_symbolic(symbol_id: u32, weight: FreeRational) -> Self
pub fn is_zero(&self) -> bool
pub fn is_pure_half(&self) -> bool
pub fn is_pure_quarter(&self) -> bool
pub fn is_pure_three_quarters(&self) -> bool
pub fn is_pure_fraction(&self, numer: i64, denom: i64) -> bool
pub fn add_logic(&mut self, rhs: &Self)
pub fn sub_logic(&mut self, rhs: &Self)
pub fn mul_scalar_logic(&mut self, rhs: i64)
pub fn div_scalar_logic(&mut self, rhs: i64)
Trait Implementations§
§impl Add for PhaseCoeff
impl Add for PhaseCoeff
§impl AddAssign for PhaseCoeff
impl AddAssign for PhaseCoeff
§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read more§impl AddAssign<&PhaseCoeff> for PhaseCoeff
impl AddAssign<&PhaseCoeff> for PhaseCoeff
§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
Performs the
+= operation. Read more§impl AddAssign<PhaseCoeff> for PhasePolynomial
impl AddAssign<PhaseCoeff> for PhasePolynomial
§fn add_assign(&mut self, rhs: PhaseCoeff)
fn add_assign(&mut self, rhs: PhaseCoeff)
Performs the
+= operation. Read more§impl Clone for PhaseCoeff
impl Clone for PhaseCoeff
§impl Debug for PhaseCoeff
impl Debug for PhaseCoeff
§impl Display for PhaseCoeff
impl Display for PhaseCoeff
§impl Div<i64> for PhaseCoeff
impl Div<i64> for PhaseCoeff
§impl DivAssign<i64> for PhaseCoeff
impl DivAssign<i64> for PhaseCoeff
§fn div_assign(&mut self, rhs: i64)
fn div_assign(&mut self, rhs: i64)
Performs the
/= operation. Read moreimpl Eq for PhaseCoeff
§impl Hash for PhaseCoeff
impl Hash for PhaseCoeff
§impl Mul<i64> for PhaseCoeff
impl Mul<i64> for PhaseCoeff
§impl MulAssign<i64> for PhaseCoeff
impl MulAssign<i64> for PhaseCoeff
§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
Performs the
*= operation. Read more§impl Ord for PhaseCoeff
impl Ord for PhaseCoeff
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
§impl PartialEq for PhaseCoeff
impl PartialEq for PhaseCoeff
§impl PartialOrd for PhaseCoeff
impl PartialOrd for PhaseCoeff
impl StructuralPartialEq for PhaseCoeff
§impl Sub for PhaseCoeff
impl Sub for PhaseCoeff
§impl SubAssign for PhaseCoeff
impl SubAssign for PhaseCoeff
§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read more§impl SubAssign<&PhaseCoeff> for PhaseCoeff
impl SubAssign<&PhaseCoeff> for PhaseCoeff
§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
Performs the
-= operation. Read moreAuto Trait Implementations§
impl Freeze for PhaseCoeff
impl RefUnwindSafe for PhaseCoeff
impl Send for PhaseCoeff
impl Sync for PhaseCoeff
impl Unpin for PhaseCoeff
impl UnsafeUnpin for PhaseCoeff
impl UnwindSafe for PhaseCoeff
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