Skip to main content

StatePairing

Enum StatePairing 

Source
pub enum StatePairing {
    Real,
    ComplexInterleaved {
        num_pairs: usize,
    },
    ComplexHalfHalf {
        num_pairs: usize,
    },
    QuaternionBlocks {
        num_blocks: usize,
    },
}
Expand description

How the state_rank axis of a (realified) SSM state groups into complex / quaternionic coordinates — the realification layout the Mamba-3 rotation applies to B/C (and hence to the state). Consumed by StateMoments::pr_complex.

Construct it with Mamba3::state_pairing() (the single source of truth, mirroring exactly what rotate_bc_forward applies) — never re-derive the layout by hand.

Variants§

§

Real

No rotation pairing: every coordinate is real (rope_fraction = 0); StateMoments::pr_complex then equals StateMoments::pr.

§

ComplexInterleaved

Complex pairs, interleaved (NeoX-style; Mamba-3 SISO): coordinate 2a is the real and 2a + 1 the imaginary part of complex coordinate a, for a < num_pairs; the tail [2·num_pairs, state_rank) stays real.

Fields

§num_pairs: usize

Number of rotated complex pairs (rope_dim / 2).

§

ComplexHalfHalf

Complex pairs, half-and-half (GPT-J-style; Mamba-3 MIMO): coordinate a is the real and state_rank/2 + a the imaginary part, for a < num_pairs; the remainder of both halves stays real.

Fields

§num_pairs: usize

Number of rotated complex pairs (rope_dim / 2).

§

QuaternionBlocks

Quaternion blocks (Mamba-3 Quaternion4D): coordinates [4j, 4j + 4) form quaternion coordinate j (components ordered w, x, y, z), for j < num_blocks; the tail stays real.

Fields

§num_blocks: usize

Number of rotated quaternion blocks (rope_width / 4).

Trait Implementations§

Source§

impl Clone for StatePairing

Source§

fn clone(&self) -> StatePairing

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 StatePairing

Source§

impl Debug for StatePairing

Source§

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

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

impl Eq for StatePairing

Source§

impl PartialEq for StatePairing

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StatePairing

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
§

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,

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 = Infallible

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.