|
| 1 | +# Matrix exponential benchmarks |
| 2 | + |
| 3 | +`bench_exponential.jl` times and accuracy-tests every applicable `MatrixAlgebraKit.exponential` |
| 4 | +algorithm (`MatrixFunctionViaTaylor`, `MatrixFunctionViaLA`, `MatrixFunctionViaEig`, |
| 5 | +`MatrixFunctionViaEigh`) for `Float64`, `ComplexF64`, `BigFloat` and `Complex{BigFloat}`. |
| 6 | + |
| 7 | +Accuracy inputs are built from a *known* spectrum as `A = V · Diag(λ) · V⁻¹`, so the exact |
| 8 | +`exp(A) = V · Diag(exp λ) · V⁻¹` is available analytically (computed at high precision). |
| 9 | +Eigenvalue families (`small`, `wide`, `imaginary`, `stiff`, `illconditioned`, `hermitian`) |
| 10 | +and eigenvector families (`unitary`, `general`, `illconditioned`) are chosen to stress or |
| 11 | +favor particular algorithms. |
| 12 | + |
| 13 | +## Setup (once) |
| 14 | + |
| 15 | +From the repository root: |
| 16 | + |
| 17 | +```sh |
| 18 | +julia --project=benchmark -e 'using Pkg; Pkg.develop(path=pwd()); Pkg.instantiate()' |
| 19 | +``` |
| 20 | + |
| 21 | +This `dev`s the in-tree `MatrixAlgebraKit` into the benchmark's own environment. |
| 22 | + |
| 23 | +## Run |
| 24 | + |
| 25 | +```sh |
| 26 | +julia --project=benchmark benchmark/bench_exponential.jl # full run |
| 27 | +julia --project=benchmark benchmark/bench_exponential.jl --quick # fast smoke run |
| 28 | +julia --project=benchmark benchmark/bench_exponential.jl --csv out.csv |
| 29 | +``` |
| 30 | + |
| 31 | +Results are printed as per-type accuracy and timing tables and written to two CSVs derived |
| 32 | +from the `--csv` path (default base `benchmark/results.csv`): `*-accuracy.csv` and |
| 33 | +`*-timing.csv`. They are separate files because the accuracy and timing passes report |
| 34 | +disjoint quantities — a single combined table would leave the timing columns empty on the |
| 35 | +accuracy rows and vice-versa. |
| 36 | + |
| 37 | +## Accuracy columns |
| 38 | + |
| 39 | +- `analytic_err` — relative error vs the analytic `V·Diag(exp λ)·V⁻¹` reference (primary). |
| 40 | +- `recomp_err` — relative error vs an independent high-precision `exp` of the exact input. |
| 41 | +- `expexp_err` — `‖exp(A)·exp(−A) − I‖₁` (reference-free consistency check). |
| 42 | +- `det_err` — relative error of `det(exp A)` against `exp(tr A)`. |
| 43 | +- `condV` — designed condition number of the eigenvector basis (context for non-normal cases). |
0 commit comments