pub struct Metric<S: Scalar> { /* private fields */ }Expand description
The metric of a possibly degenerate Clifford algebra.
For i < j, the stored data means
B(e_i,e_i) = q[i], B(e_i,e_j) = a[(i,j)], and
B(e_j,e_i) = b[(i,j)] - a[(i,j)]. Thus b is the polar or
anticommutator form and a selects a general bilinear representative.
Implementations§
Source§impl<S: Scalar> Metric<S>
impl<S: Scalar> Metric<S>
Sourcepub fn diagonal(q: Vec<S>) -> Self
pub fn diagonal(q: Vec<S>) -> Self
Orthogonal metric from a list of squares (b = 0). Cl(p,q,r) style.
Sourcepub fn grassmann(n: usize) -> Self
pub fn grassmann(n: usize) -> Self
The fully-null metric: exterior/Grassmann algebra on n generators.
Sourcepub fn new(q: Vec<S>, b: impl IntoIterator<Item = ((usize, usize), S)>) -> Self
pub fn new(q: Vec<S>, b: impl IntoIterator<Item = ((usize, usize), S)>) -> Self
An ordinary Clifford metric with squares q, anticommutators b, and
no in-order contraction (a empty).
b may be any IntoIterator of ((i, j), value) pairs (a BTreeMap,
a Vec, a slice, …) so call sites need not build the map explicitly.
Sourcepub fn general(
q: Vec<S>,
b: impl IntoIterator<Item = ((usize, usize), S)>,
a: impl IntoIterator<Item = ((usize, usize), S)>,
) -> Self
pub fn general( q: Vec<S>, b: impl IntoIterator<Item = ((usize, usize), S)>, a: impl IntoIterator<Item = ((usize, usize), S)>, ) -> Self
A general-bilinear-form metric: squares q, polar form b (i<j), and the
in-order contraction a (i<j). See the struct docs.
Both b and a may be any IntoIterator of ((i, j), value) pairs.
Sourcepub fn dim(&self) -> usize
pub fn dim(&self) -> usize
The represented dimension, i.e. the length of the quadratic diagonal.
Sourcepub fn b(&self) -> &BTreeMap<(usize, usize), S>
pub fn b(&self) -> &BTreeMap<(usize, usize), S>
Polar/anticommutator entries b[(i,j)] = {e_i,e_j} with i < j.
Sourcepub fn a(&self) -> &BTreeMap<(usize, usize), S>
pub fn a(&self) -> &BTreeMap<(usize, usize), S>
Strictly-upper/in-order contraction entries with i < j.
Sourcepub fn into_parts(
self,
) -> (Vec<S>, BTreeMap<(usize, usize), S>, BTreeMap<(usize, usize), S>)
pub fn into_parts( self, ) -> (Vec<S>, BTreeMap<(usize, usize), S>, BTreeMap<(usize, usize), S>)
Consume the metric into its invariant-carrying parts.
Sourcepub fn direct_sum(&self, other: &Metric<S>) -> Metric<S>
pub fn direct_sum(&self, other: &Metric<S>) -> Metric<S>
Orthogonal direct sum M ⟂ M': a block-diagonal metric on the disjoint
union of the two generator sets.
Source§impl<S: ClassifyForm> Metric<S>
Ergonomic methods so callers can write metric.classify() /
algebra.classify() instead of S::classify(&metric).
impl<S: ClassifyForm> Metric<S>
Ergonomic methods so callers can write metric.classify() /
algebra.classify() instead of S::classify(&metric).
These methods return Result<_, ClassifyError> so callers can distinguish
why a classification failed (unsupported field, diagonalizer failure, …).
The underlying trait methods stay Option for partial operations with a
single failure meaning.
Sourcepub fn classify(&self) -> Result<S::Class, ClassifyError>
pub fn classify(&self) -> Result<S::Class, ClassifyError>
Classify the form (see ClassifyForm).
Source§impl<S: ClassifyWitt> Metric<S>
impl<S: ClassifyWitt> Metric<S>
Sourcepub fn witt_class(&self) -> Result<WittClassG, ClassifyError>
pub fn witt_class(&self) -> Result<WittClassG, ClassifyError>
The unified Witt class (see ClassifyWitt).
Source§impl<S: ClassifyIsometry> Metric<S>
impl<S: ClassifyIsometry> Metric<S>
Sourcepub fn isometric_to(&self, other: &Self) -> Result<bool, ClassifyError>
pub fn isometric_to(&self, other: &Self) -> Result<bool, ClassifyError>
Test isometry against another form over the same scalar world.
Source§impl<S: DecomposeWitt> Metric<S>
impl<S: DecomposeWitt> Metric<S>
Sourcepub fn witt_decompose(&self) -> Result<S::Decomp, ClassifyError>
pub fn witt_decompose(&self) -> Result<S::Decomp, ClassifyError>
Split the form into hyperbolic planes plus anisotropic kernel data.
Source§impl<S: ClassifyBrauerWall> Metric<S>
impl<S: ClassifyBrauerWall> Metric<S>
Sourcepub fn bw_class(&self) -> Result<S::BrauerWallClass, ClassifyError>
pub fn bw_class(&self) -> Result<S::BrauerWallClass, ClassifyError>
The Brauer-Wall class of the attached Clifford algebra.
Source§impl<S: ClassifyMilnor> Metric<S>
impl<S: ClassifyMilnor> Metric<S>
Sourcepub fn milnor_e0(&self) -> Result<MilnorK0Class, MilnorInvariantError>
pub fn milnor_e0(&self) -> Result<MilnorK0Class, MilnorInvariantError>
The strict degree-zero mod-two Milnor invariant.
Sourcepub fn milnor_e1(&self) -> Result<S::K1Class, MilnorInvariantError>
pub fn milnor_e1(&self) -> Result<S::K1Class, MilnorInvariantError>
The strict e_1 : I/I^2 -> K^M_1/2 invariant.
Sourcepub fn milnor_e2(&self) -> Result<S::K2Class, MilnorInvariantError>
pub fn milnor_e2(&self) -> Result<S::K2Class, MilnorInvariantError>
The strict e_2 : I^2/I^3 -> K^M_2/2 invariant.
Source§impl<S: ClassifyCliffordCenters> Metric<S>
impl<S: ClassifyCliffordCenters> Metric<S>
Sourcepub fn clifford_centers(
&self,
) -> Result<CliffordCenterInvariants<S, S::CenterDiscriminant, S::CenterBrauerWallClass>, CliffordCenterError>
pub fn clifford_centers( &self, ) -> Result<CliffordCenterInvariants<S, S::CenterDiscriminant, S::CenterBrauerWallClass>, CliffordCenterError>
Construct the full and even Clifford centers and compare them with the Brauer–Wall coordinates.