pub trait MultiVector<T> {
// Required methods
fn grade_projection(&self, k: u32) -> Self
where T: Field + Copy + Clone;
fn reversion(&self) -> Self
where T: Field + Copy + Clone + Neg<Output = T>;
fn squared_magnitude(&self) -> T
where T: Field + Copy + Clone + AddAssign + SubAssign + Neg<Output = T>;
fn inverse(&self) -> Result<Self, CausalMultiVectorError>
where T: Field + Copy + Clone + AddAssign + SubAssign + Neg<Output = T> + Div<Output = T> + PartialEq,
Self: Sized;
fn dual(&self) -> Result<Self, CausalMultiVectorError>
where T: Field + Copy + Clone + AddAssign + SubAssign + Neg<Output = T> + Div<Output = T> + PartialEq,
Self: Sized;
fn geometric_product(&self, rhs: &Self) -> Self
where T: Field + Copy + Clone + AddAssign + SubAssign + Neg<Output = T>;
fn outer_product(&self, rhs: &Self) -> Self
where T: Field + Copy + Clone + AddAssign + SubAssign;
fn inner_product(&self, rhs: &Self) -> Self
where T: Field + Copy + Clone + AddAssign + SubAssign;
fn commutator_lie(&self, rhs: &Self) -> Self
where T: Field + Copy + Clone + AddAssign + SubAssign + Neg<Output = T>;
fn commutator_geometric(&self, rhs: &Self) -> Self
where T: Field + Copy + Clone + AddAssign + SubAssign + Neg<Output = T> + Div<Output = T>;
fn basis_shift(&self, index: usize) -> Self
where T: Clone;
}Required Methods§
Sourcefn grade_projection(&self, k: u32) -> Self
fn grade_projection(&self, k: u32) -> Self
Projects the multivector onto a specific grade $k$.
$$ \langle A \rangle_k = \sum_{I : |I|=k} a_I e_I $$
Sourcefn reversion(&self) -> Self
fn reversion(&self) -> Self
Computes the reverse of the multivector, denoted $\tilde{A}$ or $A^\dagger$.
Reverses the order of vectors in each basis blade. $$ \tilde{A} = \sum_{k=0}^N (-1)^{k(k-1)/2} \langle A \rangle_k $$
Sourcefn squared_magnitude(&self) -> T
fn squared_magnitude(&self) -> T
Computes the squared magnitude (squared norm) of the multivector.
Sourcefn inverse(&self) -> Result<Self, CausalMultiVectorError>
fn inverse(&self) -> Result<Self, CausalMultiVectorError>
Computes the inverse of the multivector $A^{-1}$.
Sourcefn dual(&self) -> Result<Self, CausalMultiVectorError>
fn dual(&self) -> Result<Self, CausalMultiVectorError>
Computes the dual of the multivector $A^*$.
Sourcefn geometric_product(&self, rhs: &Self) -> Self
fn geometric_product(&self, rhs: &Self) -> Self
Computes the Geometric Product $AB$.
This is the fundamental operation of Clifford Algebra, combining the inner (contraction) and outer (expansion) products.
$$ AB = A \cdot B + A \wedge B $$
It is associative and distributive over addition.
Sourcefn outer_product(&self, rhs: &Self) -> Self
fn outer_product(&self, rhs: &Self) -> Self
Computes the outer product (wedge product) $A \wedge B$.
The outer product of two multivectors of grades $r$ and $s$ is the grade $r+s$ part of their geometric product. $$ A \wedge B = \langle AB \rangle_{r+s} $$
For basis blades $e_I$ and $e_J$, $e_I \wedge e_J$ is non-zero only if $I \cap J = \emptyset$.
Sourcefn inner_product(&self, rhs: &Self) -> Self
fn inner_product(&self, rhs: &Self) -> Self
Computes the inner product (left contraction) $A \cdot B$ (or $A \rfloor B$).
The inner product of a grade $r$ multivector $A$ and a grade $s$ multivector $B$ is the grade $s-r$ part of their geometric product. $$ A \cdot B = \langle AB \rangle_{s-r} $$
For basis blades $e_I$ and $e_J$, $e_I \cdot e_J$ is non-zero only if $I \subseteq J$.
Sourcefn commutator_lie(&self, rhs: &Self) -> Self
fn commutator_lie(&self, rhs: &Self) -> Self
Computes the Lie Bracket commutator $[A, B] = AB - BA$.
This is the standard definition for Lie Algebras (Particle Physics). For orthogonal basis vectors: $[e_1, e_2] = 2e_{12}$.
Sourcefn commutator_geometric(&self, rhs: &Self) -> Self
fn commutator_geometric(&self, rhs: &Self) -> Self
Computes the Geometric Algebra commutator product $A \times B = \frac{1}{2}(AB - BA)$.
This projects the result onto the subspace orthogonal to the inputs. For orthogonal basis vectors: $e_1 \times e_2 = e_{12}$.
Requirement: Type T must support division by 2 (e.g. 1 + 1).
Sourcefn basis_shift(&self, index: usize) -> Selfwhere
T: Clone,
fn basis_shift(&self, index: usize) -> Selfwhere
T: Clone,
Cyclically shifts the basis coefficients.
This effectively changes the “viewpoint” of the algebra,
making the coefficient at index the new scalar (index 0).
Used for Comonadic ‘extend’ operations.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.