Skip to content

KeyrateGuards ​

Degenerate limits stay finite and out-of-domain inputs raise

7/7 passed in 0ms

TestWhat it doesResult
test_bounds_vacuumcv_bounds refuses sigma2_hat below 1, Bob's residual variance in SNU with the vacuum (twice a vacuum-1/2 variance).✅ pass
test_dead_channelAs T goes to zero the rate falls monotonically with every component finite, chi_BE overtaking beta*I_AB at T = 2.16e-10 and cv_rate returning -4.0e-14 unclamped at 1e-12.✅ pass
test_dps_domaindps_rate rejects a click probability outside [0, 1], a negative mean photon number and a negative error-correction factor.✅ pass
test_huge_noiseExcess noise from 1 to 1e12 gives a finite negative rate, not NaN.✅ pass
test_rate_domainOut-of-domain arguments raise ValueError naming the parameter: T <= 0, eta outside (0, 1], non-positive V_A, negative xi, beta outside [0, 1].✅ pass
test_recon_floorf_ec below the Shannon limit 1 is refused (it multiplies h2(e), unlike beta in [0, 1] on I_AB), and dps_rate(0.5, 0.02, 0.2, 1.0) is 0.141516.✅ pass
test_tiny_modulationAs V_A goes to zero the mutual information goes to zero, the rate to a finite negative floor, and nothing diverges.✅ pass