Skip to content

KeyrateConditioning ​

Cancellation-sensitive steps against a 60-digit evaluation

6/6 passed in 1ms

TestWhat it doesResult
test_entropy_largeWith G(x) = log2(x) + (x+1)log2(1 + 1/x) above x = 1, V_A = 1e50 gives the 60-digit chi_BE 81.610030 and key -3.956908, where the literal form (zero past x ~ 9e15) gives 0 and +77.65.✅ pass
test_overflow_safeOver V_A = 1e3 to 1e300 the key is never positive, and at 1e200, past f64 range (~1e78 homodyne, ~1e154 heterodyne), chi_BE is +inf and the key -inf.✅ pass
test_perfect_channelAt T = 1, xi = 0 (A^2 = 4B, C^2 = 4D) chi_BE is exactly 0 and the key positive and continuous across the corner.✅ pass
test_small_eigenvalueThe small symplectic eigenvalue is sqrt(B)/nu1, not (A - sqrt(A^2 - 4B))/2, whose lost digits past A^2 ~ 4.5e15 B understate Eve: keys +4.542207 and 0.205440 against 60-digit -2.385982 and 0.053971.✅ pass
test_transparent_joinsApproaching T = 1 the Holevo bound falls monotonically to its T = 1 value, the last decade moving it under 1e-4, where the textbook form is non-monotone at V_A = 1e4.✅ pass
test_transparent_limitchi_BE matches transparent to 7.2e-15 over V_A 5 to 1e4, xi 1e-9 to 0.5 and three detectors, where the textbook A, B, C, D miss by 3.6e-4 and by -2.6e-7 (wrong sign).✅ pass