GBSKernels v0.1.0
GBSKernels v0.1.0 — initial public release
A GPU-native, batched library of the four #P-hard matrix functions behind photonic quantum sampling — the permanent, hafnian, loop hafnian, and torontonian — with an explicit floating-point accuracy model ranging from native double precision to rigorous a-posteriori error bounds.
Highlights
- All four functions, batched, on CPU and CUDA, each validated against independent combinatorial ground truth.
- Explicit precision model:
fp64(measured accuracy boundary),dd(double-double),ref(arbitrary precision),auto(heuristic cancellation guard), andcertified— a rigorous per-evaluation error bound whose enclosure of the true value is a hard test invariant. - Structure-aware kernels: a repeated-row finite-difference sieve for the loop hafnian and a recursive prefix-Cholesky torontonian (with a single-large mode to 32 modes).
- A conditional GBS sampler validated distributionally against The Walrus.
- A five-layer verification suite (independent ground truth, differential oracle, property-based invariants, end-to-end physics, numerical-accuracy characterization).
Install
pip install gbskernels # once on PyPI — CPU library, numpy + mpmath only
The CUDA extension is a separate, optional build (bindings/).
Complements The Walrus; Apache-2.0 licensed.