pub struct Complex {
pub re: f32,
pub im: f32,
}Expand description
Complex number for density matrix operations. No external deps.
Fields§
§re: f32§im: f32Implementations§
Source§impl Complex
impl Complex
pub const ZERO: Self
pub const ONE: Self
pub fn new(re: f32, im: f32) -> Self
pub fn from_real(r: f32) -> Self
pub fn conj(self) -> Self
pub fn norm_sq(self) -> f32
pub fn norm(self) -> f32
pub fn mul(self, other: Self) -> Self
pub fn add(self, other: Self) -> Self
pub fn sub(self, other: Self) -> Self
pub fn scale(self, s: f32) -> Self
Trait Implementations§
impl Copy for Complex
Auto Trait Implementations§
impl Freeze for Complex
impl RefUnwindSafe for Complex
impl Send for Complex
impl Sync for Complex
impl Unpin for Complex
impl UnsafeUnpin for Complex
impl UnwindSafe for Complex
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