Skip to content

TruncatedCutoff ​

Phase 5c API: the cutoff as part of the state, and the volume that carries it

5/5 passed in 654ms

TestWhat it doesResult
test_error_movesA state too big for its cutoff shows in discarded(), one pushed against the ceiling in tail(), and loss moves both back.✅ pass
test_no_cheap_guardExactly Gaussian states pass physical() and outscore Number(10) at a lower volume/trunc_error ratio (no Volume.ratio), rebuilt at cutoff 120 an artefact moves and Number(3) does not, and a bare density matrix has no recipe.✅ pass
test_purity_truncatedThermal(200) at cutoff 40 keeps 18% of its norm and reports ten times the true 1/(1 + 2*nbar), with least = kept^2 * value below it.✅ pass
test_volume_carries_gridA negativity comes back as a Volume carrying the window, step and truncation error, and reads as its number under float().✅ pass
test_window_explicitThe default window is five sigma of the moments capped at sqrt(2*cutoff) + 5, a half-width of 2.0 reports a smaller volume, and Coherent(11, 0) at cutoff 40 asks for 25.65 and is held to 13.94, outside which its Wigner is 5e-33.✅ pass