zilla-muf 0.1.1

Shared structured-matrix and numerical primitives for sparse attention and state space models (SSMs).
Documentation
//! zilla-muf: shared structured-matrix and numerical primitives
//! for sparse attention and state space models (SSMs).
//!
//! The unifying idea (Mamba-2's "SSD" duality): sparse attention and
//! SSMs both reduce to multiplying by a *structured matrix*
//! (semiseparable / low-displacement-rank) instead of a dense one.
//! Everything here is a reusable, tensor-framework-agnostic piece of
//! that shared engine — every public function takes plain slices, so the
//! attention and SSM crates can wrap these calls with their own tensor
//! types (`candle`, `burn`, raw `Vec<f32>`, ...).

/// Linear-recurrence scans: `h_t = a_t * h_{t-1} + b_t`.
/// Holds the sequential reference and the chunked (optionally parallel)
/// scan that both architectures actually call.
pub mod scan;

/// Numerically stable elementwise ops shared by both architectures:
/// softmax / log-sum-exp, segment-sum (`segsum`), and gating activations.
pub mod stable_ops;

/// Structured matrix-vector products — the unifying object:
/// semiseparable, Toeplitz, Cauchy, and Vandermonde matvecs.
pub mod structured;

/// Continuous -> discrete state-space conversion (zero-order hold, ...).
pub mod discretize;

/// Complex-arithmetic helpers for S4-style models, which diagonalize the
/// state matrix into complex eigenvalues.
pub mod complex_ops;

/// FFT-based long convolution (S4 kernels, FNet-style attention).
/// Feature-gated because it pulls in `rustfft`.
#[cfg(feature = "fft")]
pub mod fft_conv;