pub struct CausalMultiVector<T> { /* private fields */ }Expand description
A MultiVector in a Clifford Algebra $Cl(p, q, r)$.
A multivector $A$ is a linear combination of basis blades $e_I$: $$ A = \sum_{I} a_I e_I $$ where $I$ is an ordered subset of ${1, \dots, N}$ and $a_I$ are scalar coefficients.
The data is stored in a flat vector of size $2^N$. Indexing is based on bitmaps: index 3 (binary 011) corresponds to the basis blade $e_1 \wedge e_2$.
Implementations§
Source§impl CausalMultiVector<Complex<f64>>
impl CausalMultiVector<Complex<f64>>
Sourcepub fn new_complex_pauli(data: Vec<Complex64>) -> Self
pub fn new_complex_pauli(data: Vec<Complex64>) -> Self
Cl_C(2): Complex Quaternions / Pauli Algebra over C Note: The Clifford factor L_C ~ Cl(0, 1) and L_H ~ Cl(0, 2) are negative definite. However, the canonical complex Pauli Algebra is often taken as Cl(2, 0). We retain Euclidean(2) here for the canonical Cl_C(2) ~ Cl(2, 0) definition.
Sourcepub fn new_complex_clifford_2(data: Vec<Complex64>) -> Self
pub fn new_complex_clifford_2(data: Vec<Complex64>) -> Self
Cl_C(2): Complex Quaternions / Pauli Algebra over C Note: The Clifford factor L_C ~ Cl(0, 1) and L_H ~ Cl(0, 2) are negative definite. However, the canonical complex Pauli Algebra is often taken as Cl(2, 0). We retain Euclidean(2) here for the canonical Cl_C(2) ~ Cl(2, 0) definition.
Sourcepub fn new_quaternion_operator(data: Vec<Complex64>) -> Self
pub fn new_quaternion_operator(data: Vec<Complex64>) -> Self
Cl_C(4) (Full Multiplication Algebra of the Quaternions, M_H ~ Cl(0, 4)). This algebra hosts the Spin(4) ~ SU(2)_L * SU(2)_R symmetries of the Pati-Salam and LR Symmetric models. It is a key building block for the electroweak sector.
Sourcepub fn new_complex_clifford_4(data: Vec<Complex64>) -> Self
pub fn new_complex_clifford_4(data: Vec<Complex64>) -> Self
Cl_C(4) (Full Multiplication Algebra of the Quaternions, M_H ~ Cl(0, 4)). This algebra hosts the Spin(4) ~ SU(2)_L * SU(2)_R symmetries of the Pati-Salam and LR Symmetric models. It is a key building block for the electroweak sector.
Sourcepub fn new_octonion_operator(data: Vec<Complex64>) -> Self
pub fn new_octonion_operator(data: Vec<Complex64>) -> Self
Cl_C(6): The algebra acting on Octonions (via Left Multiplication), L_O ~ Cl(0, 6) Used for the initial decomposition in the paper (Spin(10) -> Pati-Salam).
Sourcepub fn new_complex_clifford_6(data: Vec<Complex64>) -> Self
pub fn new_complex_clifford_6(data: Vec<Complex64>) -> Self
Cl_C(6): The algebra acting on Octonions (via Left Multiplication), L_O ~ Cl(0, 6) Used for the initial decomposition in the paper (Spin(10) -> Pati-Salam).
Sourcepub fn new_dixon_state_space(data: Vec<Complex64>) -> Self
pub fn new_dixon_state_space(data: Vec<Complex64>) -> Self
Cl_C(6): The algebra of the Dixon state space, A = CHO ~ Cl(0, 6) This is used to host the 64 complex components of the Standard Model generations.
Sourcepub fn new_dixon_algebra_left(data: Vec<Complex64>) -> Self
pub fn new_dixon_algebra_left(data: Vec<Complex64>) -> Self
Cl_C(8): The Left Multiplication Algebra of the Dixon Algebra, L_A ~ Cl(0, 8) L_A = L_C * L_H * L_O ~ Cl(0, 1) * Cl(0, 2) * Cl(0, 6) ~ Cl(0, 8). This is used to host Spin(8) triality and the Cl(6) decomposition.
Sourcepub fn new_complex_clifford_8(data: Vec<Complex64>) -> Self
pub fn new_complex_clifford_8(data: Vec<Complex64>) -> Self
Cl_C(8): The Left Multiplication Algebra of the Dixon Algebra, L_A ~ Cl(0, 8) L_A = L_C * L_H * L_O ~ Cl(0, 1) * Cl(0, 2) * Cl(0, 6) ~ Cl(0, 8). This is used to host Spin(8) triality and the Cl(6) decomposition.
Sourcepub fn new_gut_algebra(data: Vec<Complex64>) -> Self
pub fn new_gut_algebra(data: Vec<Complex64>) -> Self
Cl_C(10): The Grand Unified Algebra (Spin(10)) ~ L_A * R_H ~ Cl(0, 10) This is the full multiplication algebra of A = RCH*O.
Sourcepub fn new_complex_clifford_10(data: Vec<Complex64>) -> Self
pub fn new_complex_clifford_10(data: Vec<Complex64>) -> Self
Cl_C(10): The Grand Unified Algebra (Spin(10)) ~ L_A * R_H ~ Cl(0, 10) This is the full multiplication algebra of A = RCH*O.
Source§impl CausalMultiVector<f64>
impl CausalMultiVector<f64>
Sourcepub fn new_point(x: f64, y: f64, z: f64) -> Self
pub fn new_point(x: f64, y: f64, z: f64) -> Self
Creates a point in 3D Projective Geometric Algebra (PGA).
The point $\mathbf{P}=(x, y, z, w)$ is represented as a tri-vector (dual basis).
$$\mathbf{P} = x \mathbf{e}{032} + y \mathbf{e}{013} + z \mathbf{e}{021} + w \mathbf{e}{123}$$
For a homogeneous point at $(x, y, z)$ (i.e., $w=1$), the internal data mapping is:
| Component | Mathematical Blade | Canonical Blade (Index) | Coefficient |
|---|---|---|---|
| $w$ | $\mathbf{e}_{123}$ | $\mathbf{e}_{123}$ (Index 14) | $1.0$ |
| $x$ | $\mathbf{e}_{032}$ | $-\mathbf{e}_{023}$ (Index 13) | $-x$ |
| $y$ | $\mathbf{e}_{013}$ | $\mathbf{e}_{013}$ (Index 11) | $y$ |
| $z$ | $\mathbf{e}_{021}$ | $-\mathbf{e}_{012}$ (Index 7) | $-z$ |
Note: The signs for $x$ and $z$ are flipped to align $\mathbf{e}{032}$ and $\mathbf{e}{021}$ with the canonical basis ordering assumed by the multivector indices.
Sourcepub fn translator(x: f64, y: f64, z: f64) -> Self
pub fn translator(x: f64, y: f64, z: f64) -> Self
Creates a translator (motor) in 3D PGA.
A translator $T$ moves geometry by a vector $d = (x, y, z)$. $$ T = 1 - \frac{1}{2} (x e_{01} + y e_{02} + z e_{03}) $$
Indices:
- Scalar (0): 1.0
- e01 (3): -x/2
- e02 (5): -y/2
- e03 (9): -z/2
Source§impl CausalMultiVector<f64>
impl CausalMultiVector<f64>
Sourcepub fn new_euclidean(data: Vec<f64>, dim: usize) -> Self
pub fn new_euclidean(data: Vec<f64>, dim: usize) -> Self
Cl(N, 0): Generic N-dimensional Euclidean algebra. All basis vectors square to +1.
Source§impl CausalMultiVector<f64>
impl CausalMultiVector<f64>
Sourcepub fn new_complex_number(real: f64, imag: f64) -> Self
pub fn new_complex_number(real: f64, imag: f64) -> Self
Cl(0, 1): Isomorphic to Complex Numbers C Basis: {1, e1} where e1^2 = -1 (acts as i)
Sourcepub fn new_split_complex(a: f64, b: f64) -> Self
pub fn new_split_complex(a: f64, b: f64) -> Self
Cl(1, 0): Isomorphic to Split-Complex (Hyperbolic) Numbers Basis: {1, e1} where e1^2 = +1 (acts as j)
Source§impl CausalMultiVector<f64>
impl CausalMultiVector<f64>
Sourcepub fn new_aps_vector(data: Vec<f64>) -> Self
pub fn new_aps_vector(data: Vec<f64>) -> Self
Cl(3, 0): Algebra of Physical Space (APS) / Pauli Algebra Used for non-relativistic quantum mechanics (Pauli Matrices).
Sourcepub fn new_spacetime_algebra_1_3(data: Vec<f64>) -> Self
pub fn new_spacetime_algebra_1_3(data: Vec<f64>) -> Self
Cl(1, 3): Space-Time Algebra (STA) / Dirac Algebra Physics Convention: Time-like vector is positive. Metric: (+ - - -) This is a specialized case of Metric::Generic { p: 1, q: 3, r: 0 }.
Sourcepub fn new_spacetime_algebra_3_1(data: Vec<f64>) -> Self
pub fn new_spacetime_algebra_3_1(data: Vec<f64>) -> Self
Cl(3, 1): Spacetime Algebra (STA) / Dirac Algebra Mathematics/GR Convention: Space-like vectors are positive. Metric: (- + + +) This is a specialized case of Metric::Generic { p: 3, q: 1, r: 0 }.
Sourcepub fn new_cga_vector(data: Vec<f64>) -> Self
pub fn new_cga_vector(data: Vec<f64>) -> Self
Cl(4, 1): Conformal Geometric Algebra (CGA) Used for computer graphics and advanced robotics. 5 Dimensions. Metric (+ + + + -).
Basis: e1, e2, e3, e+ (e4), e- (e5). e5^2 = -1.
Source§impl<T> CausalMultiVector<T>where
T: AbelianGroup + Copy,
impl<T> CausalMultiVector<T>where
T: AbelianGroup + Copy,
Source§impl<T> CausalMultiVector<T>
impl<T> CausalMultiVector<T>
Source§impl<T> CausalMultiVector<T>where
T: AssociativeRing + Copy,
impl<T> CausalMultiVector<T>where
T: AssociativeRing + Copy,
Sourcepub fn geometric_product_general(&self, rhs: &Self) -> Self
pub fn geometric_product_general(&self, rhs: &Self) -> Self
Generalized Geometric Product.
Unlike the standard product, this does NOT assume coefficients commute. $ (a e_i) (b e_j) = (a b) (e_i e_j) $
It strictly preserves the order lhs * rhs for coefficients.
This allows CausalMultiVector<Quaternion> or CausalMultiVector<Matrix>.
Source§impl<T> CausalMultiVector<T>
impl<T> CausalMultiVector<T>
Source§impl<T> CausalMultiVector<T>
impl<T> CausalMultiVector<T>
Sourcepub fn commutator(&self, rhs: &Self) -> Self
pub fn commutator(&self, rhs: &Self) -> Self
Computes the Lie Commutator: $[A, B] = AB - BA$. Valid for all associative algebras.
Sourcepub fn inverse(&self) -> Result<Self, CausalMultiVectorError>
pub fn inverse(&self) -> Result<Self, CausalMultiVectorError>
Computes the Multiplicative Inverse. $A^{-1} = \tilde{A} / |A|^2$ (For Versors). Requires Division (Field).
Sourcepub fn geometric_product(&self, rhs: &Self) -> Self
pub fn geometric_product(&self, rhs: &Self) -> Self
The Geometric Product for Commutative Coefficients. This is the standard CPU implementation.
Sourcepub fn euclidean_squared_magnitude_3d(&self) -> T
pub fn euclidean_squared_magnitude_3d(&self) -> T
Computes the Euclidean squared magnitude of a 3D spatial vector.
For 4D Lorentzian multivectors with spatial components at indices 2, 3, 4 (corresponding to x, y, z), this returns:
$$ |v|^2_{\text{Euclidean}} = v_x^2 + v_y^2 + v_z^2 $$
This differs from squared_magnitude() which applies the Lorentzian metric
signature, potentially yielding negative values for spatial vectors.
§Use Case
Use this for classical EM quantities like energy density where the physical norm must be positive-definite.
Sourcepub fn euclidean_magnitude_3d(&self) -> T
pub fn euclidean_magnitude_3d(&self) -> T
Computes the Euclidean magnitude of a 3D spatial vector.
$$ |v|_{\text{Euclidean}} = \sqrt{v_x^2 + v_y^2 + v_z^2} $$
Sourcepub fn euclidean_cross_product_3d(&self, rhs: &Self) -> Self
pub fn euclidean_cross_product_3d(&self, rhs: &Self) -> Self
Computes the 3D Euclidean cross product of two spatial vectors.
For vectors with spatial components at indices 2, 3, 4 (x, y, z):
$$ \mathbf{a} \times \mathbf{b} = (a_y b_z - a_z b_y, a_z b_x - a_x b_z, a_x b_y - a_y b_x) $$
The result is returned in the same multivector format with the cross product components at indices 2, 3, 4.
§Use Case
Use this for classical EM quantities like the Poynting vector S = E × B.
Source§impl<T> CausalMultiVector<T>
impl<T> CausalMultiVector<T>
Sourcepub fn to_matrix(&self) -> CausalTensor<T>
pub fn to_matrix(&self) -> CausalTensor<T>
Converts this multivector to matrix representation.
Sourcepub fn from_matrix(matrix: CausalTensor<T>, metric: Metric) -> Self
pub fn from_matrix(matrix: CausalTensor<T>, metric: Metric) -> Self
Converts Matrix Representation back to coefficients.
Uses trace projection: aᵢ = Tr(M · Γᵢ†) / matrix_dim
Sourcepub fn get_gamma_matrix(&self, blade_idx: usize) -> CausalTensor<T>
pub fn get_gamma_matrix(&self, blade_idx: usize) -> CausalTensor<T>
Gets the gamma matrix for a specific blade index.
Source§impl<T> CausalMultiVector<T>
impl<T> CausalMultiVector<T>
pub fn unchecked(data: Vec<T>, metric: Metric) -> Self
Sourcepub fn get(&self, idx: usize) -> Option<&T>
pub fn get(&self, idx: usize) -> Option<&T>
Gets a specific component by basis blade bitmap.
§Arguments
idx- The bitmap index of the basis blade (e.g., 3 for $e_1 \wedge e_2$).
Sourcepub fn scalar(val: T, metric: Metric) -> Self
pub fn scalar(val: T, metric: Metric) -> Self
Creates a scalar multivector (grade 0).
$$ A = s \cdot 1 $$
§Arguments
val- The scalar value.metric- The metric signature.
Sourcepub fn pseudoscalar(metric: Metric) -> Self
pub fn pseudoscalar(metric: Metric) -> Self
Constructs the pseudoscalar $I$ for the algebra.
The pseudoscalar is the highest grade element, corresponding to the product of all basis vectors: $$ I = e_1 \wedge e_2 \wedge \dots \wedge e_N $$
pub fn data(&self) -> &Vec<T>
pub fn metric(&self) -> Metric
Trait Implementations§
Source§impl<'b, T> Add<&'b CausalMultiVector<T>> for &CausalMultiVector<T>
impl<'b, T> Add<&'b CausalMultiVector<T>> for &CausalMultiVector<T>
Source§type Output = CausalMultiVector<T>
type Output = CausalMultiVector<T>
+ operator.Source§impl<T> Add for CausalMultiVector<T>
Implements component-wise addition of multivectors.
$$ A + B = \sum_{I} (a_I + b_I) e_I $$
impl<T> Add for CausalMultiVector<T>
Implements component-wise addition of multivectors. $$ A + B = \sum_{I} (a_I + b_I) e_I $$
Source§impl<'a, T> AddAssign<&'a CausalMultiVector<T>> for CausalMultiVector<T>
impl<'a, T> AddAssign<&'a CausalMultiVector<T>> for CausalMultiVector<T>
Source§fn add_assign(&mut self, rhs: &'a CausalMultiVector<T>)
fn add_assign(&mut self, rhs: &'a CausalMultiVector<T>)
+= operation. Read moreSource§impl<T> AddAssign for CausalMultiVector<T>
impl<T> AddAssign for CausalMultiVector<T>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<T: Clone> Clone for CausalMultiVector<T>
impl<T: Clone> Clone for CausalMultiVector<T>
Source§fn clone(&self) -> CausalMultiVector<T>
fn clone(&self) -> CausalMultiVector<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for CausalMultiVector<T>
impl<T: Debug> Debug for CausalMultiVector<T>
Source§impl<T> Div<T> for &CausalMultiVector<T>
impl<T> Div<T> for &CausalMultiVector<T>
Source§impl<T> Div<T> for CausalMultiVector<T>
Implements scalar division.
$$ A / s = \sum_{I} (a_I / s) e_I $$
impl<T> Div<T> for CausalMultiVector<T>
Implements scalar division. $$ A / s = \sum_{I} (a_I / s) e_I $$
Source§impl<'b, T> Mul<&'b CausalMultiVector<T>> for &CausalMultiVector<T>
Reference geometric product &A * &B (CPU-only).
impl<'b, T> Mul<&'b CausalMultiVector<T>> for &CausalMultiVector<T>
Reference geometric product &A * &B (CPU-only).
Source§type Output = CausalMultiVector<T>
type Output = CausalMultiVector<T>
* operator.Source§impl<T> Mul<T> for &CausalMultiVector<T>
impl<T> Mul<T> for &CausalMultiVector<T>
Source§impl<T> Mul<T> for CausalMultiVector<T>
Implements scalar multiplication.
$$ A s = \sum_{I} (a_I s) e_I $$
impl<T> Mul<T> for CausalMultiVector<T>
Implements scalar multiplication. $$ A s = \sum_{I} (a_I s) e_I $$
Source§impl<T> Mul for CausalMultiVector<T>
Geometric product via * operator (CPU-only).
impl<T> Mul for CausalMultiVector<T>
Geometric product via * operator (CPU-only).
Source§impl<T> MulAssign<T> for CausalMultiVector<T>
impl<T> MulAssign<T> for CausalMultiVector<T>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
*= operation. Read moreSource§impl<T> MultiVector<T> for CausalMultiVector<T>
impl<T> MultiVector<T> for CausalMultiVector<T>
Source§fn grade_projection(&self, k: u32) -> Self
fn grade_projection(&self, k: u32) -> Self
Source§fn reversion(&self) -> Self
fn reversion(&self) -> Self
Source§fn squared_magnitude(&self) -> T
fn squared_magnitude(&self) -> T
Source§fn inverse(&self) -> Result<Self, CausalMultiVectorError>
fn inverse(&self) -> Result<Self, CausalMultiVectorError>
Source§fn dual(&self) -> Result<Self, CausalMultiVectorError>
fn dual(&self) -> Result<Self, CausalMultiVectorError>
Source§fn geometric_product(&self, rhs: &Self) -> Self
fn geometric_product(&self, rhs: &Self) -> Self
Source§fn outer_product(&self, rhs: &Self) -> Self
fn outer_product(&self, rhs: &Self) -> Self
Source§fn inner_product(&self, rhs: &Self) -> Self
fn inner_product(&self, rhs: &Self) -> Self
Source§fn commutator_lie(&self, rhs: &Self) -> Self
fn commutator_lie(&self, rhs: &Self) -> Self
Source§fn commutator_geometric(&self, rhs: &Self) -> Self
fn commutator_geometric(&self, rhs: &Self) -> Self
Source§impl<T> MultiVectorL2Norm<T> for CausalMultiVector<T>
impl<T> MultiVectorL2Norm<T> for CausalMultiVector<T>
Source§type Output = <T as ScalarEval>::Real
type Output = <T as ScalarEval>::Real
Complex<f64>)Source§fn norm_l2(&self) -> Self::Output
fn norm_l2(&self) -> Self::Output
Source§fn normalize_l2(&self) -> Self
fn normalize_l2(&self) -> Self
Source§impl<T: PartialEq> PartialEq for CausalMultiVector<T>
impl<T: PartialEq> PartialEq for CausalMultiVector<T>
Source§impl<'b, T> Sub<&'b CausalMultiVector<T>> for &CausalMultiVector<T>
impl<'b, T> Sub<&'b CausalMultiVector<T>> for &CausalMultiVector<T>
Source§type Output = CausalMultiVector<T>
type Output = CausalMultiVector<T>
- operator.Source§impl<T> Sub for CausalMultiVector<T>
Implements component-wise subtraction of multivectors.
$$ A - B = \sum_{I} (a_I - b_I) e_I $$
impl<T> Sub for CausalMultiVector<T>
Implements component-wise subtraction of multivectors. $$ A - B = \sum_{I} (a_I - b_I) e_I $$