pub struct SymplecticMatrix {
pub entries: Vec<Vec<f64>>,
pub dim: usize,
}Expand description
A 2n×2n symplectic matrix M satisfying MᵀΩM = Ω.
Fields§
§entries: Vec<Vec<f64>>Matrix entries (row-major)
dim: usizeHalf the matrix dimension (matrix is 2n×2n)
Implementations§
Source§impl SymplecticMatrix
impl SymplecticMatrix
Sourcepub fn new(dim: usize) -> Self
pub fn new(dim: usize) -> Self
Create the 2n×2n standard symplectic identity matrix J = [[0, Iₙ], [-Iₙ, 0]].
Sourcepub fn is_symplectic(&self) -> bool
pub fn is_symplectic(&self) -> bool
Check whether this matrix is symplectic: MᵀΩM = Ω. For the canonical J itself this is always true.
Sourcepub fn determinant(&self) -> f64
pub fn determinant(&self) -> f64
Determinant of the symplectic matrix. For Sp(2n) matrices det = 1.
Auto Trait Implementations§
impl Freeze for SymplecticMatrix
impl RefUnwindSafe for SymplecticMatrix
impl Send for SymplecticMatrix
impl Sync for SymplecticMatrix
impl Unpin for SymplecticMatrix
impl UnsafeUnpin for SymplecticMatrix
impl UnwindSafe for SymplecticMatrix
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