Skip to content

Bivector Exponential Methods

A simple Euclidean bivector describes one oriented plane. Its exponential has a familiar trigonometric form. A general bivector is harder: it can contain several independent planes, hyperbolic components, and null components, and its exponential can occupy several even grades.

Clifra therefore plans more than one exponential method. Low-dimensional cases use finite closed forms, intermediate cases use a matrix representation, and eligible high-dimensional cases use a bounded spectral-local construction.

A bivector is not necessarily a single plane

For a simple bivector \(B\), \(B^2\) is scalar. Its power series separates into even and odd powers and reduces to a combination of \(1\) and \(B\):

\[ \exp(B) = \sum_{k=0}^{\infty}\frac{B^k}{k!}. \]

The scalar sign of \(B^2\) selects circular or hyperbolic functions, with a series treatment near zero.

A general bivector need not satisfy this closure. It may decompose into several orthogonal simple planes. Products between their components generate grade 4, grade 6, and higher even grades. The number of possible even blades is \(2^{n-1}\), so a universal representation based on left multiplication grows exponentially with dimension.

Signature adds further cases:

  • positive- and negative-square directions produce elliptic and hyperbolic spectral behavior;
  • a mixed positive/negative signature can combine both;
  • null directions introduce nilpotent components and non-semisimple blocks;
  • repeated or nearly repeated spectral values make eigenvector derivatives numerically delicate.

There is no single short scalar formula that covers these cases efficiently at arbitrary dimension.

The planned executor families

Family Normal selection Character
closed_simple \(n \le 3\) Exact closure over scalar and bivector terms.
closed_biquadratic \(4 \le n \le 5\) Exact finite closure using scalar and grade-4 structure.
left_matrix_exp General fallback Exact for the represented operator up to floating-point error; potentially expensive.
cpu_matrix_exp MPS fallback for unsupported matrix cases Same construction executed on CPU.
spectral_local Eligible higher dimensions Local dominant-plane construction, exact only when the retained local spectrum is complete.

The low-dimensional formulas are possible because the relevant powers close in a small subspace. For \(n \le 3\), \(B^2\) is scalar. For \(4 \le n \le 5\), the calculation closes over terms generated by \(1\), \(B\), the grade-4 part of \(B^2\), and their product.

The matrix route constructs left multiplication by \(B\) on the even subalgebra, applies torch.matrix_exp, and evaluates the resulting operator at the scalar identity. It is general, but its operator width follows the even algebra. Increasing \(n\) by one approximately doubles that width and can make both the forward and backward passes impractical.

spectral_local computation

For an eligible signature, clifra maps the bivector coefficients to a skew generator on the nondegenerate vector space. The spectral-local executor then:

  1. obtains dominant invariant plane pairs from the symmetric problem based on \(-G^2\);
  2. reconstructs a simple bivector for each retained plane;
  3. evaluates the closed exponential of each simple plane;
  4. multiplies the commuting local factors;
  5. lifts the resulting local even multivector into the requested output layout.

The computation is local because its working algebra is formed from the retained planes and any supported null ideal, not from every blade of the ambient algebra. Clifra retains at most four planes. Degenerate handling also has a bounded null-ideal dimension of four.

This removes the exponential dependence on ambient dimension when the useful generator is spectrally local. Arbitrary high-rank bivectors still require more than a constant-cost local representation for an exact exponential.

Eligibility and fallback constraints

Spectral-local selection is constrained deliberately:

  • dimensions at or below five use the closed formulas;
  • mixed positive and negative nondegenerate signatures do not use spectral_local;
  • float16 and bfloat16 are not eligible;
  • the nondegenerate space must contain at least one plane;
  • the transition dimension is policy-controlled and defaults to 10;
  • degenerate signatures require enabled degenerate handling;
  • more than four null directions exceed the supported local ideal;
  • disabling truncated-degenerate handling also rejects cases whose kernel or plane rank cannot be represented completely.

An ineligible case uses matrix exponentiation. On MPS, a mixed-signature matrix case is routed through the CPU fallback. The underlying Clifford algebras remain supported; only the available numerical methods carry these constraints.

Truncation and diagnostics

If the bivector has at most four active orthogonal planes, retaining four planes can represent its complete plane spectrum, subject to numerical tolerance. If energy is spread across more planes, the executor omits a tail and is approximate.

Energy concentration in learned generators

Spectral concentration can occur when the task has low intrinsic geometric dimension. Correlated gradients, small residual updates, explicit norm penalties, or a low-rank parameterization can leave most of a generator in a small number of planes. Ambient dimension alone provides no such concentration.

A dense grade-2 parameter has \(n(n-1)/2\) independent coordinates. Standard initialization, Adam, and SGD leave its skew rank unconstrained. Isotropic random initialization tends to distribute energy across the available planes, and gradient noise or composition can populate weak planes. Concentration must be measured on trained parameters.

Two cases are relevant:

  • Concentrated spectrum: most squared angle energy lies in the retained planes.
  • Small absolute spectrum: omitted angles are negligible even if their fraction of total energy is large.

Geometric variance captured measures the first case. The tail-angle sum measures the second. A low GVC can be harmless when every angle is small. A high GVC can still leave a material tail when the generator is large.

Static stress and measured spectra

spectral_exp_uniform_tail_stress evaluates a deliberately demanding pre-training case in which a fixed bivector norm is distributed uniformly across \(M = \lfloor n/2 \rfloor\) planes. With four retained planes, its GVC is \(4/M\) and the tail bound grows with the number of omitted planes. It serves as a stress case, not as a prediction of training behavior.

spectral_exp_angle_diagnostics evaluates an angle spectrum obtained from a specific generator or checkpoint. Its input expects one angle magnitude per orthogonal plane; raw bivector coefficients must first be converted into that spectrum. For a definite nondegenerate signature, the angles can be obtained from the paired spectrum of the skew generator representing the bivector. In a supported degenerate signature, these angles describe the nondegenerate block; mixed and nilpotent ideal components require separate validation. Mixed positive/negative signatures are not eligible for the spectral-local route.

import torch

from clifra.core import (
    AlgebraSpec,
    spectral_exp_angle_diagnostics,
    spectral_exp_uniform_tail_stress,
)

stress = spectral_exp_uniform_tail_stress(
    [AlgebraSpec(63, 0, 0)],
    max_planes=4,
    bivector_norm=1.0,
)[0]

# One magnitude per plane, computed during checkpoint analysis.
angles = torch.tensor([[0.72, 0.21, 0.05, 0.01, 0.002, 0.001]])
measured = spectral_exp_angle_diagnostics(angles, max_planes=4)

print(stress.tail_angle_sum_bound)
print(measured.geometric_variance_captured)
print(measured.tail_angle_sum_bound)

Retain layer, channel, and checkpoint axes until aggregation. Report the maximum or upper quantiles of tail_angle_sum_bound and the minimum or lower quantiles of GVC. A global mean can hide a small set of generators with persistent tails.

Useful checkpoints include initialization, the end of warm-up, learning-rate or curriculum changes, and the final model. Repeated measurements determine whether concentration is stable. The diagnostic detaches its input and is not a differentiable regularizer. A training-time tail penalty requires a separate differentiable spectrum calculation.

spectral_exp_angle_diagnostics reports:

  • the sorted absolute plane angles;
  • the number of selected and total planes;
  • whether selection truncates the spectrum;
  • geometric variance captured, the retained squared-angle energy divided by total squared-angle energy;
  • tail_angle_sum_bound, the sum of omitted absolute angles.

The tail-angle sum reports cumulative omitted angle. Treat it as a bound on the norm of an omitted multivector factor only after specifying the representation, norm, and assumptions behind that inequality.

GVC measures spectral concentration and supplies no approximation-error bound. A small amount of squared energy distributed across many planes can still produce a material cumulative angle. Interpret the tail bound with the coefficient scale, step count, and downstream sensitivity.

The diagnostic is intended for checkpoint analysis or inference logging. Keep it outside a compiled training step; scalar extraction and reporting can synchronize execution.

Backward behavior

The matrix and closed routes differentiate their implemented tensor programs. The spectral route uses a filtered symmetric eigendecomposition. Near repeated eigenvalues, its backward suppresses unstable inverse eigenvalue gaps instead of allowing them to diverge. This gives a finite derivative convention through locally non-unique eigenspaces.

When the plane spectrum is truncated, backward differentiates the retained spectral-local computation; omitted parts of the full exponential contribute no derivative. A small forward discrepancy alone says little about whether long-horizon optimization follows the exact exponential's path.

Validation criteria for spectral_local

Use it when all of the following have been established for the intended workload:

  1. The signature, dtype, and null dimension are eligible.
  2. Measured angle spectra fit within the retained plane cap or have an acceptable tail-angle bound.
  3. Generator norms and integration or layer step counts keep accumulated drift within the application's tolerance.
  4. Representative forward values and gradients have been compared with a higher-precision matrix-exponential reference at tractable dimensions.
  5. Required invariants hold for the complete model as well as for the individual exponential.

The route applies when ambient dimension is high and measured generators remain low-rank or dominated by a few planes. Persistent tails require a different design: a constrained low-rank generator, a sequence of local exponentials, a smaller integration step, or an exact fallback where its cost is tractable. A sequence of exponentials changes the parameterization and generally differs from the exponential of their summed generators.