lie_groups/lib.rs
1#![allow(clippy::needless_range_loop)]
2
3//! Lie groups and Lie algebras for computational mathematics.
4//!
5//! This crate provides concrete implementations of the classical Lie groups
6//! used in physics and geometry, with emphasis on correctness, numerical
7//! stability, and ergonomic APIs.
8//!
9//! # Implemented Groups
10//!
11//! | Group | Algebra | Representation | Dimension |
12//! |-------|---------|----------------|-----------|
13//! | [`U1`] | [`U1Algebra`] | Phase (complex unit) | 1 |
14//! | [`SU2`] | [`Su2Algebra`] | 2×2 complex unitary | 3 |
15//! | [`SO3`] | [`So3Algebra`] | 3×3 real orthogonal | 3 |
16//! | [`SU3`] | [`Su3Algebra`] | 3×3 complex unitary | 8 |
17//! | [`SUN`]`<N>` | [`SunAlgebra`]`<N>` | N×N complex unitary | N²−1 |
18//! | [`RPlus`] | [`RPlusAlgebra`] | Positive reals | 1 |
19//!
20//! # Trait Abstractions
21//!
22//! The [`LieGroup`] and [`LieAlgebra`] traits provide a uniform interface:
23//!
24//! ```
25//! use lie_groups::{LieGroup, LieAlgebra, SU2, Su2Algebra};
26//!
27//! let g = SU2::identity();
28//! let h = SU2::exp(&Su2Algebra::new([0.1, 0.2, 0.3]));
29//! let gh = g.compose(&h);
30//! let inv = h.inverse();
31//! ```
32//!
33//! # Features
34//!
35//! - **Quaternion-optimized SU(2)**: Rotation operations via unit quaternions
36//! - **Baker-Campbell-Hausdorff**: Lie algebra composition up to 5th order
37//! - **Root systems**: Type Aₙ (other families planned)
38//! - **Representation theory**: Casimir operators, characters, Clebsch-Gordan
39//! - **Numerical stability**: Conditioned logarithms, scaling-and-squaring exp
40
41pub mod bch;
42pub mod error;
43pub mod quaternion;
44pub mod representation;
45pub mod root_systems;
46pub mod rplus;
47pub mod so3;
48pub mod su2;
49pub mod su3;
50pub mod sun;
51pub mod traits;
52pub mod u1;
53
54pub use bch::{
55 bch_checked, bch_error_bound, bch_fifth_order, bch_fourth_order, bch_is_practical, bch_safe,
56 bch_second_order, bch_split, bch_third_order, bch_will_converge, BchError, BchMethod,
57};
58pub use error::{
59 ConditionedLogResult, LogCondition, LogError, LogQuality, LogResult, RepresentationError,
60 RepresentationResult,
61};
62pub use quaternion::UnitQuaternion;
63pub use representation::casimir::Casimir;
64pub use representation::su3_irrep::Su3Irrep;
65pub use representation::{character, character_su2, clebsch_gordan_decomposition, Spin};
66pub use root_systems::{Alcove, CartanSubalgebra, Root, RootSystem, WeightLattice, WeylChamber};
67pub use rplus::{RPlus, RPlusAlgebra};
68pub use so3::{So3Algebra, SO3};
69pub use su2::{Su2Algebra, SU2};
70pub use su3::{Su3Algebra, SU3};
71pub use sun::{SU2Generic, SU3Generic, SunAlgebra, SU4, SU5, SUN};
72pub use traits::{
73 Abelian, AntiHermitianByConstruction, Compact, LieAlgebra, LieGroup, SemiSimple, Simple,
74 TracelessByConstruction,
75};
76pub use u1::{U1Algebra, U1};