pub struct Root { /* private fields */ }Expand description
A root in the dual space of a Cartan subalgebra.
Mathematically: α ∈ 𝔥* represented as a vector in ℝⁿ (rank n). For SU(n+1) (type Aₙ), roots are differences of standard basis vectors: eᵢ - eⱼ.
§Example
use lie_groups::Root;
// SU(3) root: e₁ - e₂
let alpha = Root::new(vec![1.0, -1.0, 0.0]);
assert_eq!(alpha.rank(), 3);
assert!((alpha.norm_squared() - 2.0).abs() < 1e-10);Implementations§
Source§impl Root
impl Root
Sourcepub fn inner_product(&self, other: &Root) -> f64
pub fn inner_product(&self, other: &Root) -> f64
Inner product ⟨α, β⟩ (standard Euclidean).
Sourcepub fn norm_squared(&self) -> f64
pub fn norm_squared(&self) -> f64
Squared norm ⟨α, α⟩.
Sourcepub fn cartan_integer(&self, beta: &Root) -> i32
pub fn cartan_integer(&self, beta: &Root) -> i32
Cartan integer ⟨β, α^∨⟩ = 2⟨β,α⟩/⟨α,α⟩.
Sourcepub fn is_positive(&self) -> bool
pub fn is_positive(&self) -> bool
Check if this root is positive (first nonzero coordinate is positive).
Trait Implementations§
impl StructuralPartialEq for Root
Auto Trait Implementations§
impl Freeze for Root
impl RefUnwindSafe for Root
impl Send for Root
impl Sync for Root
impl Unpin for Root
impl UnsafeUnpin for Root
impl UnwindSafe for Root
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
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.