pub struct SUN<const N: usize> { /* private fields */ }Expand description
Implementations§
Source§impl<const N: usize> SUN<N>
impl<const N: usize> SUN<N>
Sourcepub fn verify_unitarity(&self, tolerance: f64) -> bool
pub fn verify_unitarity(&self, tolerance: f64) -> bool
Sourcepub fn determinant(&self) -> Complex64
pub fn determinant(&self) -> Complex64
Compute determinant
For SU(N), the determinant should be exactly 1 by definition.
§Implementation
- N=2: Direct formula
ad - bc - N=3: Sarrus’ rule / cofactor expansion
- N>3: Returns
1.0(assumes matrix is on SU(N) manifold)
§Limitations
For N > 3, this function does not compute the actual determinant.
It returns 1.0 under the assumption that matrices constructed via
exp() or reorthogonalize() remain on the SU(N) manifold.
To verify unitarity for N > 3, use verify_special_unitarity() instead,
which checks U†U = I (a stronger condition than det=1).
For actual determinant computation with N > 3, enable the ndarray-linalg
feature (not currently available) or compute via eigenvalue product.
Sourcepub fn distance_to_identity(&self) -> f64
pub fn distance_to_identity(&self) -> f64
Distance from identity: ||U - I||_F
Frobenius norm of difference from identity.
Trait Implementations§
Source§impl<const N: usize> LieGroup for SUN<N>
impl<const N: usize> LieGroup for SUN<N>
Source§fn adjoint_action(&self, algebra_element: &Self::Algebra) -> Self::Algebra
fn adjoint_action(&self, algebra_element: &Self::Algebra) -> Self::Algebra
Source§fn exp(tangent: &Self::Algebra) -> Self
fn exp(tangent: &Self::Algebra) -> Self
Exponential map: exp: su(N) → SU(N)
§Algorithm: Scaling-and-Squaring
For X ∈ su(N) with ||X|| large:
- Scale: X’ = X / 2^k such that ||X’|| ≤ 0.5
- Taylor: exp(X’) ≈ ∑_{n=0}^{15} X’^n / n!
- Square: exp(X) = [exp(X’)]^{2^k}
§Properties
- Preserves unitarity: exp(X) ∈ SU(N) for X ∈ su(N)
- Preserves det = 1 (Tr(X) = 0 ⟹ det(exp(X)) = exp(Tr(X)) = 1)
- Numerically stable for all ||X||
§Performance
- Time: O(N³·log(||X||))
- Space: O(N²)
§Accuracy
- Relative error: ~10⁻¹⁴ (double precision)
- Unitarity preserved to ~10⁻¹²
Source§const MATRIX_DIM: usize
const MATRIX_DIM: usize
Source§type Algebra = SunAlgebra<N>
type Algebra = SunAlgebra<N>
Source§fn conjugate_transpose(&self) -> Self
fn conjugate_transpose(&self) -> Self
Source§fn distance_to_identity(&self) -> f64
fn distance_to_identity(&self) -> f64
Source§fn log(&self) -> LogResult<Self::Algebra>
fn log(&self) -> LogResult<Self::Algebra>
Source§fn distance(&self, other: &Self) -> f64
fn distance(&self, other: &Self) -> f64
Source§fn is_near_identity(&self, tolerance: f64) -> bool
fn is_near_identity(&self, tolerance: f64) -> bool
Source§fn trace_identity() -> f64
fn trace_identity() -> f64
Source§fn reorthogonalize(&self) -> Self
fn reorthogonalize(&self) -> Self
Source§impl<const N: usize> MulAssign<&SUN<N>> for SUN<N>
impl<const N: usize> MulAssign<&SUN<N>> for SUN<N>
Source§fn mul_assign(&mut self, rhs: &SUN<N>)
fn mul_assign(&mut self, rhs: &SUN<N>)
*= operation. Read moreimpl<const N: usize> Compact for SUN<N>
SU(N) is compact for all N ≥ 2.
impl<const N: usize> SemiSimple for SUN<N>
SU(N) is semi-simple (implied by simple) for all N ≥ 2.
impl<const N: usize> Simple for SUN<N>
SU(N) is simple for all N ≥ 2.
impl<const N: usize> StructuralPartialEq for SUN<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for SUN<N>
impl<const N: usize> RefUnwindSafe for SUN<N>
impl<const N: usize> Send for SUN<N>
impl<const N: usize> Sync for SUN<N>
impl<const N: usize> Unpin for SUN<N>
impl<const N: usize> UnsafeUnpin for SUN<N>
impl<const N: usize> UnwindSafe for SUN<N>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.