bbm92-cw

Python package that allows to model the expected keyrates in a BBM92 protocol based on SPDC pumped with a CW laser.


License
Apache-2.0
Install
pip install bbm92-cw==0.0.2

Documentation

BBM92_CW

This project is an implementation of the model laid out in [1].

The model treats a Continuous Wave (CW) source of photon pairs that are perfectly correlated in time, and formalises what the expected asymptotic secure key rate (AKR) is if you use them to perform passive BBM92.

The package is meant to calculate the optimal brightness, coincidence window and corresponding AKR for a given link loss.

Installation

pip install bbm92_cw

Examples

You can now use the module like you would any other python package. To understand better what the functionality offers, have a look at the following examples:

satellite overpass

In an overpass, we assume a constant loss of 20 dB on the terrestrial arm, and a variable loss on the free-space arm. The specs of the detectors are read out from a yaml file

from bbm92_cw.secure_key_rates import secure_key_rates
import numpy as np
import yaml
# read in the detector settings and such from a yml file
with open("settings.yml", "r") as config_file:
params = yaml.safe_load(config_file)
for key, value in params.items():
globals()[key] = value
# Loss profile in an overpass, just example data
loss_terrestrial = 20 # dB
time_step = 5
time = np.arange(-100, 100, step=time_step)
loss_free_space = -10 * np.log10(1e-4 / ((time / 40) ** 2 + 1)) # dB
# Loop through the loss evolution
rate_curve = []
for i, loss_free in enumerate(loss_free_space):
link = secure_key_rates(
name=f"sat overpass link",
d=d,
t_delta=jitters,
eff_A=loss_terrestrial,
eff_B=loss_free,
DC_A=darkcounts_OGS,
DC_B=darkcounts_SAT,
e_b=bit_error,
e_p=phase_error,
f=f,
t_dead=dead_times,
loss_format="dB",
)
tcc, B = link.optimal_params
rate = link.optimal_key_rate
rate_curve.append(rate)
# integrate to find the total key size
integrated_key = (
sum([rate_curve[i] if rate_curve[i] > 0 else 0 for i in range(len(rate_curve))]) * time_step
)
print(f"total asymptotic secure key of {integrated_key:.2e}")

Resulting in the following instantaneous key generation rate, which integrates to 27.6 kbit.

image

Instantaneous figures

Here we illustrate all interesting values that can be extracted from the calculation

tcc, B = link.optimal_params
rate = link.optimal_key_rate
error = link.error_rate([tcc, B])
# We can also calculate the performance for non optimal parameters
tcc, B = 1e-9, 1e7
rate = link.custom_performance([tcc, B])
error = link.error_rate([tcc, B])
raw_rate = link.raw_rate([tcc, B])
# Often the laser doesn't allow for arbitrary tuning so it is useful
# to optimize only the coincidence window.
tcc, rate = link.optimize_tcc_given_B(B)

References

[1] Neumann et al. (2021). Phys. Rev. A 104, 022406 10.1103/PhysRevA.104.022406