Skip to content

GaussianSampling ​

Homodyne/heterodyne sampling moments and seeded reproducibility

5/5 passed in 83ms

TestWhat it doesResult
test_heterodyne_vacuumHeterodyne on vacuum returns (shots, 2) with per-quadrature variance 1.0, the vacuum 1/2 plus the 1/2 Husimi penalty.✅ pass
test_homodyne_angleHomodyne at angle pi/2 measures p: mean 0.0 for Coherent(1.0, 0.0).✅ pass
test_homodyne_coherentHomodyne x on Coherent(1.0, 0.0) has sample mean 1.0 and variance 1/2.✅ pass
test_homodyne_squeezedHomodyne x on Squeezed(0.5) has variance e^-1/2 = 0.184, below vacuum.✅ pass
test_seedingThe same seed reproduces identical samples and a different seed does not.✅ pass