Skip to content

ApiComponents ​

Component validation paths and frozen-dataclass immutability

16/16 passed in 2ms

TestWhat it doesResult
test_channel_boundsChannel rejects T outside (0, 1] and a negative ξ.✅ pass
test_channel_refA nonzero ξ with no ref is refused, and ref must name one of the two planes, case-sensitively.✅ pass
test_click_opticsThe click-family receivers validate on construction: a delay of at least one symbol, a contrast in [0, 1], a misalignment no worse than chance, a split that leaves a data line.✅ pass
test_click_securityThe per-family security components bound their own inputs: a phase error in [0, 1/2] and every f at or above the Shannon limit.✅ pass
test_dark_rateClickDetector.gated takes the dark floor as a free-running count rate over a gate width and converts it to the per-gate probability the field holds, 1−e−rg, passing every other field through.✅ pass
test_dark_refusalsgated() refuses a dark floor stated twice and a gate of zero width, and leaves the per-gate constructor and its published default untouched.✅ pass
test_decoy_orderingDecoy refuses anything but three positive decreasing intensities with the decoys together weaker than the signal.✅ pass
test_detector_boundsAll three detectors reject η outside (0, 1]; the quadrature ones reject negative vel, the click one a dark rate outside [0, 1).✅ pass
test_fiber_exclusiveFiber takes the hardware description or the derived T, never both and never neither, and validates each.✅ pass
test_frozen_componentsComponents are frozen dataclasses: rebinding a field raises.✅ pass
test_frozen_resultLinkResult is frozen, and on a pinned channel its oracle is the result itself.✅ pass
test_hardware_boundsThe front-end hardware components validate on construction: bit depths, tones, linewidths, symbol rate and Bob's mandatory detector.✅ pass
test_modulation_boundsGaussianModulation rejects VA≤0 and DifferentialPhase rejects μ≤0, each with a ValueError naming the parameter.✅ pass
test_nonfinite_fA non-finite f is refused on every public path that charges one, by the Rust f_ec guard, the components' comparison against 1.0 admitting NaN and +inf.✅ pass
test_qber_domainq.IndividualAttack refuses a QBER outside [0, 1/2) and an f below the Shannon limit.✅ pass
test_security_boundsAsymptotic and FiniteSize reject β outside (0, 1], and FiniteSize also bounds ϵ, n and pe_fraction.✅ pass