Struct Angle
pub struct Angle {
pub constant: FreeRational,
pub radians: Option<BigRational>,
pub symbols: BTreeMap<u32, FreeRational>,
}Fields§
§constant: FreeRational§radians: Option<BigRational>Exact decimal-radian part of the source angle. Symbolic pi remains in constant.
symbols: BTreeMap<u32, FreeRational>Implementations§
§impl Angle
impl Angle
pub const ZERO: Self
pub const HALF: Self
pub const QUARTER: Self
pub const THREE_QUARTERS: Self
pub const fn new_constant(constant: FreeRational) -> Self
pub fn new_symbolic(symbol_id: u32, weight: FreeRational) -> Self
pub fn to_phase_coeff(&self) -> PhaseCoeff
pub fn from_qasm_str(input: &str) -> Result<Self, String>
pub fn from_qasm_str(input: &str) -> Result<Self, String>
Parse supported OpenQASM 2 angle expressions without binary64 coercion.
Decimal constants are exact rational radians; pi factors are symbolic. Unsupported/non-linear expressions and pi fractions exceeding the legacy fixed-width pi domain are errors rather than lossy approximations.
Trait Implementations§
impl Eq for Angle
§impl Ord for Angle
impl Ord for Angle
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 PartialOrd for Angle
impl PartialOrd for Angle
impl StructuralPartialEq for Angle
Auto Trait Implementations§
impl Freeze for Angle
impl RefUnwindSafe for Angle
impl Send for Angle
impl Sync for Angle
impl Unpin for Angle
impl UnsafeUnpin for Angle
impl UnwindSafe for Angle
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