qkd_key_rate.protocols.quantum.bb84_single_photon module
Classes to perform key error rate estimate for the single photon BB84 QKD protocol.
The analysis is adjusted to using a single photon source.
This code is based on TNO’s BB84 key-rate paper (doi: 10.1007/s11128-021-03078-0):
This setting is most similar to the originally proposed BB84 protocol, where single photon quantum states are send. Generating single photon states is hard in practice, hence the general approach is to use an attunable laser source and use multiple intensity settings. If we instead use single photon states, much of the analysis simplifies as we know each pulse is safe against for instance photon-number splitting (PNS) attacks.
- Asymptotic Key Rate
The number of pulses is asymptotic and we use only a single intensity setting, which we optimize. The other functions are similar to the standard BB84 protocol.
Example usage:
from tno.quantum.communication.qkd_key_rate.protocols.quantum.bb84_single_photon import ( BB84SingleAsymptoticKeyRateEstimate, ) from tno.quantum.communication.qkd_key_rate.test.conftest import standard_detector detector_Alice = standard_detector.customise( dark_count_rate=1e-8, polarization_drift=0, error_detector=0.1, efficiency_party=1, ) detector_Bob = standard_detector.customise( dark_count_rate=1e-8, polarization_drift=0, error_detector=0.1, efficiency_party=1, ) asymptotic_key_rate = BB84SingleAsymptoticKeyRateEstimate( detector=detector_Bob, detector_Alice=detector_Alice ) mu, rate = asymptotic_key_rate.optimize_rate(attenuation=0.2)
- class qkd_key_rate.protocols.quantum.bb84_single_photon.BB84SingleAsymptoticKeyRateEstimate(detector, **kwargs)[source]
Bases:
AsymptoticKeyRateEstimate
Key-rate modules when a single photon source is used. We may then assume all states remain save and photon number splitting attacks are impossible.
- __init__(detector, **kwargs)[source]
- Parameters:
detector (
Detector
) – The detector used at Bob’s sidekwargs – protocol specific input
- compute_rate(mu, attenuation)[source]
Computes the key-rate given an intensity and an attenuation.
- Parameters:
mu (
ArrayLike
) – Intensityattenuation (
float
) – Attenuation
- Return type:
float
- Returns:
Key-rate
- optimize_rate(*, attenuation, x_0=None, bounds=None)[source]
Function to optimize the key-rate
- Parameters:
attenuation (
float
) – Loss in dB for the channelx_0 (
Optional[ArrayLike]
) – Initial search value, default value [0.5] is chosen.bounds (
Optional
[List
[ArrayLike
]]) – Bounds on search range, default [(0.1, 0.9)]
- Return type:
Tuple
[ndarray
[Any
,dtype
[float64
]],float
]- Returns:
Optimized intensity and key-rate
- Raises:
ValueError – When x_0 or bounds are given with invalid dimensions.
ValueError – when the found key-rate is negative.
- qkd_key_rate.protocols.quantum.bb84_single_photon.compute_gain_and_error_rate(detector, attenuation)[source]
Computes the total gain and error rate of the channel
These computations are straight-forward and have a closed expression for single photon sources.
- Parameters:
detector (
Detector
) – Bob’s detectorattenuation (
float
) – Attenuation of the channel
- Return type:
Tuple
[float
,float
]- Returns:
The gain per intensity. The probability of an event, given a pulse.
The error rate per intensity.