FuzzFock
FockState: physicality, quasi-probability invariants and truncation error
5/5 passed in 212ms
| Test | What it does | Result |
|---|---|---|
test_fock_boundary | FockState holds at cutoffs 1 and 512 with n = cutoff - 1, GKP delta 0.05 and 2, loss at eta = 0 and 1, thermal(0), and a tail past the ladder, which clamps to 1. | ✅ pass |
test_fock_exterior | Outside the domain every entry point raises: a cutoff of 0 or 513, a state that does not fit, an odd cat at zero amplitude, a GKP delta outside [0.05, 2], a third logical state, and a matrix that is not square, Hermitian, unit-trace or PSD. | ✅ pass |
test_fock_extreme | An amplitude or squeezing too large for its ladder raises, nbar up to 1e300 saturates to maximally mixed, and squeezing to r = 710.4 reports trunc_error above 1/2. | ✅ pass |
test_fock_grids | Over eight states W integrates to 1, Q lies in [0, 1/(2 pi)], the negativity volume is >= 0 and 0 for a thermal state, parity = pi*W(0, 0), and an odd cat has parity -1. | ✅ pass |
test_fock_interior | Over 120 states from every constructor rho is physical with eigenvalues >= 0, purity, parity, entropy, non-Gaussianity and truncation lie in range, and populations survive a from_matrix round trip and a rotation. | ✅ pass |