TruncatedCutoff
Phase 5c API: the cutoff as part of the state, and the volume that carries it
5/5 passed in 654ms
| Test | What it does | Result |
|---|---|---|
test_error_moves | A 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_guard | Exactly 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_truncated | Thermal(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_grid | A negativity comes back as a Volume carrying the window, step and truncation error, and reads as its number under float(). | ✅ pass |
test_window_explicit | The 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 |