Skip to main content

RotationKind

Enum RotationKind 

Source
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 why rope_fraction has no 0.0 setting.
  • Complex2D — the abelian SO(2)/complex RoPE that Mamba-3 ships: cumulative angles via cumsum, applied by apply_rope. The default; behaviourally unchanged.
  • Quaternion4D — the non-abelian SU(2) ⊂ SO(4) quaternion rotation of this module: cumulative product via quat_cumprod, applied by rotate_state_rank_blocks. Richer state-tracking; selects the RotationState::Quaternion cache accumulator.
  • Rotor4D — the whole rotation group of a 4-block, SO(4) ≅ (SU(2)×SU(2))/±1: a two-sided quaternion product v ↦ q ⊗ v ⊗ p̄. Two per-step quaternions instead of one (twice the generator channels, one scan over a doubled block axis); selects the RotationState::Rotor accumulator.

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

Source

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

Source§

fn clone(&self) -> RotationKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RotationKind

Source§

impl Debug for RotationKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RotationKind

Source§

fn default() -> RotationKind

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RotationKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for RotationKind

Source§

impl PartialEq for RotationKind

Source§

fn eq(&self, other: &RotationKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for RotationKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RotationKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Boilerplate for T
where T: Copy + Send + Sync + Debug + PartialEq + 'static,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> StoreValue for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.