Skip to content

KeyrateQuantile ​

z_pe: two-sided normal quantiles, branch seam, tails and guards

5/5 passed in 0ms

TestWhat it doesResult
test_z_extremesThe tail branch survives eps to 1e-300 without hitting the 1 - eps/2 == 1 rounding wall, and eps near 1 gives a small positive z.✅ pass
test_z_finite_sizeAt the eps = 1e-10 the CV-QKD literature uses, z_pe gives 6.466951.✅ pass
test_z_guardseps outside (0, 1), NaN and infinity included, raises ValueError.✅ pass
test_z_seamAcklam's approximation switches branch at eps = 0.0485; straddling it by 1e-10 does not step z or reverse the ordering.✅ pass
test_z_textbookz_pe reproduces the textbook two-sided quantiles 1.959964 at 5%, 2.575829 at 1% and 3.290527 at 0.1%, to 1e-5.✅ pass