Skip to content

What is Numra?

Numra is a comprehensive numerical methods library for Rust. It provides production-quality implementations of algorithms for differential equations, optimization, linear algebra, signal processing, statistics, and more — all in pure Rust with no mandatory C or Fortran dependencies.

The scientific computing ecosystem in Rust is growing rapidly, but most libraries focus on a single domain: ODE solvers, or linear algebra, or FFT. Numra takes a different approach. It provides a unified workspace where crates are designed to work together, sharing common traits and types across the entire stack.

This means you can:

  • Solve a stiff ODE system with Radau5, then analyze the frequency content of the solution with fft::psd
  • Fit model parameters to data with optim::lm_minimize, where the model itself is an ODE integration
  • Propagate parameter uncertainty through a differential equation solve
  • Design an optimal controller using ocp::shooting that calls the ODE solver internally

All of this works seamlessly because every crate in Numra speaks the same language: the Scalar trait for generic f32/f64 computation, the Vector trait for BLAS-like operations, and consistent error types throughout.

DomainCrateHighlights
Core traitsnumra-coreScalar, Vector, Signal, uncertainty propagation
Linear algebranumra-linalgDense/sparse matrices, LU/QR/Cholesky/SVD, iterative solvers
Nonlinear solversnumra-nonlinearNewton-Raphson with Wolfe line search
ODE solversnumra-ode11 solvers: DoPri5, Tsit5, Vern6/7/8, Radau5, ESDIRK, BDF, Auto
SDE solversnumra-sdeEuler-Maruyama, Milstein, SRA1/SRA2
DDE solversnumra-ddeMethod of Steps with discontinuity tracking
FDE solversnumra-fdeL1 scheme for Caputo fractional derivatives
IDE solversnumra-ideVolterra equations, Prony series kernels
PDE solversnumra-pdeMethod of Lines, moving boundary (Stefan) problems
SPDE solversnumra-spdeMOL + stochastic time stepping
Autodiffnumra-autodiffForward-mode (Dual) and reverse-mode (tape-based)
Optimizationnumra-optimBFGS, L-BFGS, LM, SQP, CMA-ES, LP, MILP, QP, NSGA-II
Optimal controlnumra-ocpShooting, collocation, adjoint methods
Integrationnumra-integrateGauss-Kronrod, Gauss-Legendre/Laguerre/Hermite, Romberg
Interpolationnumra-interpLinear, cubic spline, PCHIP, Akima, barycentric Lagrange
Special functionsnumra-specialGamma, Bessel, Erf, elliptic integrals, Airy, hypergeometric
FFTnumra-fftFFT/IFFT, PSD, Welch, STFT, convolution
Statisticsnumra-stats11 distributions, hypothesis tests, regression, correlation
Curve fittingnumra-fitNonlinear least squares, polynomial fitting
Signal processingnumra-signalButterworth/Chebyshev filters, FIR, Hilbert transform

Generic over scalar type. Every algorithm works with both f32 and f64 through the Scalar trait. Choose precision at the call site, not at the library level.

no_std compatible core. The numra-core crate uses libm for math functions and can run on embedded systems without the standard library.

Pure Rust. No mandatory C, Fortran, or LAPACK dependencies. The linear algebra backend is faer, a high-performance pure-Rust library.

Composable. Crates are designed to interoperate. An ODE solver result can be fed directly into an FFT, an optimizer can call a differential equation solver, and uncertainty propagation works across the entire stack.

Correct first, then fast. Every algorithm is validated against published references, analytical solutions, and cross-checked with established tools like SciPy and MATLAB.