pub struct CartanSubalgebra { /* private fields */ }Expand description
Cartan subalgebra of a semisimple Lie algebra.
The Cartan subalgebra 𝔥 is the maximal abelian subalgebra consisting of simultaneously diagonalizable elements. For SU(n+1) (type Aₙ), it consists of traceless diagonal matrices.
§Mathematical Background
- Dimension: rank of the Lie algebra
- Basis: {H₁, …, Hₙ} where [Hᵢ, Hⱼ] = 0 (all commute)
- For SU(n+1): Hᵢ = Eᵢᵢ - Eᵢ₊₁,ᵢ₊₁ (diagonal matrices)
- Roots are functionals α: 𝔥 → ℝ
§Example
use lie_groups::root_systems::CartanSubalgebra;
// SU(3) Cartan subalgebra (2-dimensional)
let cartan = CartanSubalgebra::type_a(2);
assert_eq!(cartan.dimension(), 2);
let basis = cartan.basis_matrices();
assert_eq!(basis.len(), 2);Implementations§
Source§impl CartanSubalgebra
impl CartanSubalgebra
Sourcepub fn type_a(n: usize) -> Self
pub fn type_a(n: usize) -> Self
Create Cartan subalgebra for type Aₙ (SU(n+1)).
The Cartan subalgebra consists of traceless diagonal matrices. Basis: Hᵢ = Eᵢᵢ - Eᵢ₊₁,ᵢ₊₁ for i = 1, …, n
§Example
use lie_groups::root_systems::CartanSubalgebra;
// SU(2) Cartan subalgebra: 1-dimensional
let h = CartanSubalgebra::type_a(1);
assert_eq!(h.dimension(), 1);
// First basis element: diag(1, -1)
let h1 = &h.basis_matrices()[0];
assert!((h1[(0,0)].re - 1.0).abs() < 1e-10);
assert!((h1[(1,1)].re + 1.0).abs() < 1e-10);Sourcepub fn basis_matrices(&self) -> &[Array2<Complex64>] ⓘ
pub fn basis_matrices(&self) -> &[Array2<Complex64>] ⓘ
Basis matrices for the Cartan subalgebra.
Sourcepub fn matrix_size(&self) -> usize
pub fn matrix_size(&self) -> usize
Matrix size (N for SU(N)).
Sourcepub fn evaluate_root(&self, root: &Root, coefficients: &[f64]) -> Complex64
pub fn evaluate_root(&self, root: &Root, coefficients: &[f64]) -> Complex64
Sourcepub fn project_matrix(&self, matrix: &Array2<Complex64>) -> Option<Vec<f64>>
pub fn project_matrix(&self, matrix: &Array2<Complex64>) -> Option<Vec<f64>>
Project a matrix onto the Cartan subalgebra.
For a matrix M, finds coefficients [c₁, …, cₙ] such that Σ cᵢ Hᵢ best approximates M in the Frobenius norm.
Since the basis {H₁, …, Hₙ} is not necessarily orthogonal, we solve the linear system: G c = g where Gᵢⱼ = ⟨Hᵢ, Hⱼ⟩.
§Arguments
matrix- Matrix to project
§Returns
Some(coefficients) in the Cartan basis for rank ≤ 2,
None for rank > 2 (Gaussian elimination not yet implemented).
§Limitations
Currently only supports rank 1 (SU(2)) and rank 2 (SU(3)) systems. Higher rank systems require general Gaussian elimination.
Sourcepub fn from_coefficients(&self, coefficients: &[f64]) -> Array2<Complex64>
pub fn from_coefficients(&self, coefficients: &[f64]) -> Array2<Complex64>
Construct a Cartan element from coefficients.
Given coefficients [c₁, …, cₙ], returns H = Σ cᵢ Hᵢ.
Sourcepub fn contains(&self, matrix: &Array2<Complex64>, tolerance: f64) -> bool
pub fn contains(&self, matrix: &Array2<Complex64>, tolerance: f64) -> bool
Check if a matrix is in the Cartan subalgebra.
Returns true if the matrix is diagonal (or nearly diagonal within tolerance).
Sourcepub fn killing_form(&self, coeffs1: &[f64], coeffs2: &[f64]) -> f64
pub fn killing_form(&self, coeffs1: &[f64], coeffs2: &[f64]) -> f64
Sourcepub fn dual_basis(&self) -> Vec<Root>
pub fn dual_basis(&self) -> Vec<Root>
Dual basis in 𝔥* (root space).
Returns roots {α₁, …, αₙ} such that αᵢ(Hⱼ) = δᵢⱼ.
For type A_n, these correspond to the simple roots.
Auto Trait Implementations§
impl Freeze for CartanSubalgebra
impl RefUnwindSafe for CartanSubalgebra
impl Send for CartanSubalgebra
impl Sync for CartanSubalgebra
impl Unpin for CartanSubalgebra
impl UnsafeUnpin for CartanSubalgebra
impl UnwindSafe for CartanSubalgebra
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<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.