Math rendering test

If you can read every equation below cleanly, the KaTeX integration is wired correctly. This page exercises every macro defined in src/lib/katex-macros.ts.

Continuous-time state space model

The continuous-time linear SSM:

ddth(t)=Ah(t)+Bx(t),y(t)=Ch(t)+Dx(t)\ddt \statevec(t) = \statemat \statevec(t) + \inputmat \bm{x}(t), \qquad \bm{y}(t) = \outputmat \statevec(t) + \feedmat \bm{x}(t)

Zero-order-hold discretization

With step size Δ\stepsize, the discretized SSM is:

hk=Aˉhk1+Bˉxk,Aˉ=exp(ΔA)\statevec_k = \discA \statevec_{k-1} + \discB \bm{x}_k, \qquad \discA = \exp(\stepsize \statemat)

Dimensions

A diagonal SSM has N\statedim state dimensions over L\seqlen time steps with input dimension D\inputdim.

Scan operator

The associative binary operator for diagonal SSMs combines pairs via:

(a1,b1)(a2,b2)=(a1a2,  a2b1+b2)(a_1, b_1) \scanop (a_2, b_2) = (a_1 \elemwise a_2,\; a_2 \elemwise b_1 + b_2)

Dynamical systems quantities

Stability is governed by the spectral radius ρ(A)<1\spectralradius(\statemat) < 1, the largest Lyapunov exponent λmax\lyapexp_{\max}, and the monodromy matrix Z\monodromy with Floquet multipliers μi\floquet_i. The Jacobian J\jacobian measures local linearization.

Calculus

The total derivative ddtf\ddt f and the partial derivative fx\pderiv{f}{x} should both render with proper spacing.

Common sets and probability

The state lives in RN\R^{\statedim}, complex eigenvalues in C\C, time indices in N\N, and shifts in Z\Z. Expectations E[x]\E[\bm{x}] and probabilities P(hS)\Prob(\statevec \in S) use the standard blackboard fonts.

Norms, inner products, absolute values

The training objective minimizes yy^2\norm{\bm{y} - \hat{\bm{y}}}^2 over x,y\bm{x}, \bm{y} pairs. Inner products u,v\ip{\bm{u}}{\bm{v}} and absolute values xx0\abs{x - x_0} render with paired delimiters.

Operators

Optimization searches via arg maxθL(θ)\argmax_{\theta} \mathcal{L}(\theta) and arg minθL(θ)\argmin_{\theta} \mathcal{L}(\theta). Matrix structure operators: diag(v)\diag(\bm{v}), tr(A)\tr(\statemat), spec(A)\spec(\statemat), rank(A)\rank(\statemat).

Complexity

Naïve attention costs O(L2N)\bigO{\seqlen^2 \statedim}. The associative scan reduces this to O(LlogLN2)\bigO{\seqlen \log \seqlen \cdot \statedim^2}.


If any equation above shows unrendered LaTeX source or a red error box, check that:

  1. npm install completed without errors.
  2. astro.config.mjs includes remarkPlugins: [remarkMath] and rehypePlugins: [[rehypeKatex, { macros: ssmMacros, ... }]].
  3. src/layouts/Base.astro imports 'katex/dist/katex.min.css'.