CartanMatrix

Struct CartanMatrix 

Source
pub struct CartanMatrix<const N: usize> { /* private fields */ }
Expand description

Cartan matrix for a Lie algebra

The type parameter N encodes the rank at compile time. All entries are exact integers (no floating point).

Implementations§

Source§

impl<const N: usize> CartanMatrix<N>

Source

pub const fn new(entries: [[i8; N]; N]) -> Self

Create a new Cartan matrix

§Examples
use atlas_embeddings::cartan::CartanMatrix;

let g2 = CartanMatrix::new([
    [ 2, -3],
    [-1,  2],
]);
Source

pub const fn rank(&self) -> usize

Get the rank (dimension) of the Cartan matrix

Source

pub const fn get(&self, i: usize, j: usize) -> i8

Get entry at position (i, j)

§Panics

Panics if indices are out of bounds

Source

pub const fn entries(&self) -> &[[i8; N]; N]

Get all entries as a 2D array

Source

pub fn is_valid(&self) -> bool

Check if this is a valid Cartan matrix

Verifies:

  1. Diagonal entries = 2
  2. Off-diagonal entries ≤ 0
  3. Symmetry condition: C[i][j] = 0 ⟺ C[j][i] = 0
Source

pub fn is_simply_laced(&self) -> bool

Check if the Cartan matrix is simply-laced

A Cartan matrix is simply-laced if all off-diagonal entries are in {0, -1}. The simply-laced exceptional groups are E₆, E₇, E₈.

Source

pub fn is_symmetric(&self) -> bool

Check if the matrix is symmetric

A symmetric Cartan matrix corresponds to a simply-laced group.

Source

pub fn determinant(&self) -> i64

Compute determinant of the Cartan matrix

Uses exact integer arithmetic (no floating point). For small ranks (≤ 8), uses direct computation.

Source

pub fn num_connected_components(&self) -> usize

Find connected components in Dynkin diagram

Returns the number of connected components. A connected Cartan matrix has exactly 1 component.

Source

pub fn is_connected(&self) -> bool

Check if Cartan matrix is connected (indecomposable)

Source

pub fn to_dynkin_diagram(&self, group_name: &str) -> DynkinDiagram<N>

Extract Dynkin diagram from Cartan matrix

Computes bonds between simple roots based on Cartan matrix entries. Bond multiplicity is determined by |Cᵢⱼ × Cⱼᵢ|:

  • 1 = single bond (—)
  • 2 = double bond (⇒) for F₄
  • 3 = triple bond (≡) for G₂
§Examples
use atlas_embeddings::cartan::CartanMatrix;

let g2 = CartanMatrix::g2();
let dynkin = g2.to_dynkin_diagram("G₂");

assert_eq!(dynkin.rank(), 2);
assert_eq!(dynkin.bonds().len(), 1);
assert_eq!(dynkin.bonds()[0].2, 3); // Triple bond
Source§

impl CartanMatrix<2>

Standard Cartan matrices for exceptional groups

Source

pub const fn g2() -> Self

G₂ Cartan matrix

[ 2  -3]
[-1   2]
Source§

impl CartanMatrix<4>

Source

pub const fn f4() -> Self

F₄ Cartan matrix

[ 2  -1   0   0]
[-1   2  -2   0]
[ 0  -1   2  -1]
[ 0   0  -1   2]
Source§

impl CartanMatrix<6>

Source

pub const fn e6() -> Self

E₆ Cartan matrix

[ 2  -1   0   0   0   0]
[-1   2  -1   0   0   0]
[ 0  -1   2  -1   0  -1]
[ 0   0  -1   2  -1   0]
[ 0   0   0  -1   2   0]
[ 0   0  -1   0   0   2]
Source§

impl CartanMatrix<7>

Source

pub const fn e7() -> Self

E₇ Cartan matrix

[ 2  -1   0   0   0   0   0]
[-1   2  -1   0   0   0   0]
[ 0  -1   2  -1   0   0   0]
[ 0   0  -1   2  -1   0  -1]
[ 0   0   0  -1   2  -1   0]
[ 0   0   0   0  -1   2   0]
[ 0   0   0  -1   0   0   2]
Source§

impl CartanMatrix<8>

Source

pub const fn e8() -> Self

E₈ Cartan matrix

[ 2  -1   0   0   0   0   0   0]
[-1   2  -1   0   0   0   0   0]
[ 0  -1   2  -1   0   0   0   0]
[ 0   0  -1   2  -1   0   0   0]
[ 0   0   0  -1   2  -1   0  -1]
[ 0   0   0   0  -1   2  -1   0]
[ 0   0   0   0   0  -1   2   0]
[ 0   0   0   0  -1   0   0   2]

Trait Implementations§

Source§

impl<const N: usize> Clone for CartanMatrix<N>

Source§

fn clone(&self) -> CartanMatrix<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> Debug for CartanMatrix<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> Hash for CartanMatrix<N>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const N: usize> PartialEq for CartanMatrix<N>

Source§

fn eq(&self, other: &CartanMatrix<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> Copy for CartanMatrix<N>

Source§

impl<const N: usize> Eq for CartanMatrix<N>

Source§

impl<const N: usize> StructuralPartialEq for CartanMatrix<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for CartanMatrix<N>

§

impl<const N: usize> RefUnwindSafe for CartanMatrix<N>

§

impl<const N: usize> Send for CartanMatrix<N>

§

impl<const N: usize> Sync for CartanMatrix<N>

§

impl<const N: usize> Unpin for CartanMatrix<N>

§

impl<const N: usize> UnwindSafe for CartanMatrix<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.