E2: Randomized Numerical Linear Algebra (RandNLA)
Module: sci_form::experimental::rand_nlaFeature flag: experimental-randnla
Overview
Replaces the
Theory
Nyström Approximation
Given a symmetric matrix
- Sketch: Generate
with Gaussian entries - Project: Compute
via sparse-dense multiplication - Reconstruct:
The rank parameter
Randomized
Via randomized SVD:
Randomized Diagonalization
The transformed Hamiltonian
API
use sci_form::experimental::rand_nla::*;
// Nyström approximation
let config = NystromConfig { rank: 50, seed: 42 };
let approx = nystrom_approximate(&matrix, &config);
// Randomized SVD
let rsvd = randomized_svd(&matrix, rank, seed);
// Randomized S^{-1/2}
let s_inv_sqrt = randomized_inverse_sqrt(&overlap, rank, seed);
// Full randomized EHT pipeline
let result = rand_eht_calculate(&elements, &coords, &config);
// result.homo_energy, result.gap, result.rand_nla_errorError Control
The module includes automatic error estimation:
If the error exceeds 0.1%, the module falls back to exact diagonalization and reports in the rand_nla_error field.
Tests
cargo test --features experimental-randnla --test regression -- test_randnlaCovers: sketch matrix statistics, Nyström reconstruction error, randomized SVD accuracy, and EHT eigenvalue comparison against exact diagonalization for benzene and naphthalene.