pub enum RotationKind {
Real1D,
Complex2D,
Quaternion4D,
Rotor4D,
}Expand description
Which rotational-state algebra the block uses for the data-dependent
transition rotation absorbed into B/C.
Real1D— the trivial group: no rotation at all. The transition is the plain scalar decay, i.e. a real SSM (Mamba-2’s transition under Mamba-3’s trapezoid). The in-projection spends no channels on rotation and the cache carries no accumulator (RotationState::Real) — this is the rotation ablation, which is whyrope_fractionhas no0.0setting.Complex2D— the abelianSO(2)/complex RoPE that Mamba-3 ships: cumulative angles viacumsum, applied byapply_rope. The default; behaviourally unchanged.Quaternion4D— the non-abelianSU(2) ⊂ SO(4)quaternion rotation of this module: cumulative product viaquat_cumprod, applied byrotate_state_rank_blocks. Richer state-tracking; selects theRotationState::Quaternioncache accumulator.Rotor4D— the whole rotation group of a 4-block,SO(4) ≅ (SU(2)×SU(2))/±1: a two-sided quaternion productv ↦ q ⊗ v ⊗ p̄. Two per-step quaternions instead of one (twice the generator channels, one scan over a doubled block axis); selects theRotationState::Rotoraccumulator.
The kinds are a ladder — Real1D ⊂ Complex2D ⊂ Rotor4D and
Real1D ⊂ Quaternion4D ⊂ Rotor4D — but the middle two are
incomparable, which is why Rotor4D exists.
Left multiplication is isoclinic: L_q turns both invariant planes of the
block by the same angle (L_i sends 1↦i and j↦k), so
Quaternion4D cannot express two independent per-pair angles — it does not
contain the abelian rotation it generalises. The right factor opens the full
maximal torus (plane angles a−b and a+b for half-angles a, b), and
with it every element of SO(4).
Variants§
Real1D
No rotation: a real transition (the trivial group). No rotation
channels, no cumulative accumulator, B/C pass through untouched.
Complex2D
Abelian complex (SO(2)) RoPE — the current default behaviour.
Quaternion4D
Non-abelian quaternion (SU(2), left-isoclinic) rotation.
Rotor4D
The full SO(4) rotation of each 4-block: two-sided v ↦ q ⊗ v ⊗ p̄.
Implementations§
Source§impl RotationKind
impl RotationKind
Sourcepub fn quat_factors(self) -> usize
pub fn quat_factors(self) -> usize
How many cumulative-rotation quaternions the accumulator carries per
(head, 4-block): one for Quaternion4D,
two for Rotor4D (the left and right
factors). Meaningless for the non-quaternion kinds
(Complex2D accumulates angles,
Real1D accumulates nothing) — reported as 1.
The factors are stacked along one block axis, so every quaternion
primitive — the generator split, quat_from_scaled_axis, the
quat_cumprod scan, quat_normalize — runs once over
quat_factors · blocks blocks and needs no Rotor4D branch of its own.
Only the application to B/C differs.
Trait Implementations§
Source§impl Clone for RotationKind
impl Clone for RotationKind
Source§fn clone(&self) -> RotationKind
fn clone(&self) -> RotationKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RotationKind
Source§impl Debug for RotationKind
impl Debug for RotationKind
Source§impl Default for RotationKind
impl Default for RotationKind
Source§fn default() -> RotationKind
fn default() -> RotationKind
Source§impl<'de> Deserialize<'de> for RotationKind
impl<'de> Deserialize<'de> for RotationKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RotationKind
Source§impl PartialEq for RotationKind
impl PartialEq for RotationKind
Source§impl Serialize for RotationKind
impl Serialize for RotationKind
impl StructuralPartialEq for RotationKind
Auto Trait Implementations§
impl Freeze for RotationKind
impl RefUnwindSafe for RotationKind
impl Send for RotationKind
impl Sync for RotationKind
impl Unpin for RotationKind
impl UnsafeUnpin for RotationKind
impl UnwindSafe for RotationKind
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.