Simulator
Simulator module for the simulation package.
Finite size simulator
Simulations with finite size effect.
- class qosst_sim.simulator.finite_size_simulator.FiniteSizeSimulator(modulation: QAM, channel: GaussianChannel, detector: Detector, n_symbols: int, beta: float = 0.95)
Class inheriting from simulator, describing the case where the numbner of symbols transmitted between Alice and Bob is supposed to be finite. No hypothesis needs to be made on the channel, nor on the type of detection, and the modulation only need to be discrete. One can have good oestimated values of the parameters c1, c2 and n_B (defined in Denys, A., Brown, P., & Leverrier, A. (2021). Explicit asymptotic secret key rate of continuous-variable quantum key distribution with an arbitrary modulation. Quantum, 5, 540.), in the asymptotical limit, which is when Alice and Bob exchange an infinite number of symbols.
- Parameters:
modulation (QAM) – class QAM object modulation chosen by Alice, which must be discrete (QAM).
channel (GaussianChannel) – class Channel object channel used.
detector (Detector) – class Detector object detecor used by Bob, which can be ideal or noisy.
n_symbols (int) – number of symbols exchanged.
beta (float) – reconciliation efficiency; a parameter that quantifies how much extra information Bob needs to send to Alice through the authenticated classical channel for her to correctly infer the value of Y, typically equal to 0.95 in practice.
- snr() float
- Returns:
Shot Noise Ratio of the protocol, which is computed with the empirical estimator.
- Return type:
float
Gaussian channel asymptotic calculator
Simulator for the asymptotic case with a Guassian channel.
- class qosst_sim.simulator.gaussian_channel_asymptotic_calculator.GaussianChannelAsymptoticCalculator(modulation: QAM, channel: GaussianChannel, detector: Detector, beta: float = 0.95)
Class inheriting from simulator, describing the particular case where the channel is supposed to be gaussian. In this special case, one can have theorical values of the parameters c1, c2 and nB (defined in Denys, A., Brown, P., & Leverrier, A. (2021). Explicit asymptotic secret key rate of continuous-variable quantum key distribution with an arbitrary modulation. Quantum, 5, 540.), in the asymptotical limit, which is when Alice and Bob exchange an infinite number of symbols.
- Parameters:
modulation (QAM) – class QAM object modulation chosen by Alice, which must be discrete (QAM).
channel (GaussianChannel) – class GaussianChannel object channel used, which must be gaussian
detector (Detector) – class Detector object detecor used by Bob, which can be ideal or noisy.
beta (float) – reconciliation efficiency; a parameter that quantifies how much extra information Bob needs to send to Alice through the authenticated classical channel for her to correctly infer the value of Y, typically equal to 0.95 in practice.
- snr() float
- Returns:
Shot Noise Ratio of the protocol, which is computed with the theoretical formula above, and which depends on detection.
- Return type:
float
Gaussian modulation asymptotic calculator
Class for simulating the case of a Gaussian modulation and a Gaussian channel.
- class qosst_sim.simulator.gaussian_modulation_asymptotic_calculator.GaussianModulationAsymptoticCalculator(modulation: GaussianModulation, channel: GaussianChannel, detector: Detector, beta: float = 0.95)
Class inheriting from simulator, describing the particular case where the channel and the modulation are supposed to be gaussian. In this very special case, one can have theorical values of the parameters c1, c2 and nB (defined in Denys, A., Brown, P., & Leverrier, A. (2021). Explicit asymptotic secret key rate of continuous-variable quantum key distribution with an arbitrary modulation. Quantum, 5, 540.), in the asymptotical limit, which is when Alice and Bob exchange an infinite number of symbols.
- Parameters:
modulation (GaussianModulation) – class GaussianModulation object modulation chosen by Alice, which must be gaussian.
channel (GaussianChannel) – class GaussianChannel object channel used, which must be gaussian.
detector (Detector) – class Detector object detecor used by Bob, which can be ideal or noisy.
beta (float) – reconciliation efficiency; a parameter that quantifies how much extra information Bob needs to send to Alice through the authenticated classical channel for her to correctly infer the value of Y, typically equal to 0.95 in practice.
- snr() float
- Returns:
Shot Noise Ratio of the protocol, which is computed with the theoretical formula above, and which depends on detection.
- Return type:
float
Simulator
Abstract simulator class.
- class qosst_sim.simulator.simulator.Simulator(modulation: Modulation, channel: GaussianChannel, detector: Detector, beta: float = 0.95)
Abstract class meant to be sub-classed, containing the general functions that does not depend on the choice of the detector(ideal/noisy), nor on the type of simulation (asymptotic/finite size).
- Parameters:
modulation (Modulation) – class modulation object modulation chosen by Alice to sample the state that she wil send to Bob.
channel (GaussianChannel) – Instance of gaussian channel with given transmittance and excess noise.
detector (Detector) – detector instance used by Bob to measure the states.
beta (float) – reconciliation efficiency; a parameter that quantifies how much extra information Bob needs to send to Alice through the authenticated classical channel for her to correctly infer the value of Y, typically equal to 0.95 in practice.
- c1: float
Quantity defined in Denys, A., Brown, P., & Leverrier, A. (2021).
- c2: float
Quantity defined in Denys, A., Brown, P., & Leverrier, A. (2021).
- modulation: Modulation
Modulation instance (Gaussian, QAM, Binomial QAM, Gaussian QAM).
- beta: float
Efficiency of the reconciliation algorithm.
- covariance() Tuple[float, float, float]
Thanks to the Gaussian extremality properties of Gaussian states, it is known that this quantity can be upper bounded by its value computed for a Gaussian state with the same covariance matrix as the true state. Symmetry arguments (see : Anthony Leverrier. Composable security proof for continuous-variable quantum key distribution with coherent states. Phys. Rev. Lett., 114:070501, 2015. DOI: 10.1103/PhysRevLett.114.070501.) show that the covariance matrix of the entenglement-based version of the protocol can be safely replaced by a gaussian state matrix of the form :
- Gamma = [[ V * Id_2 Z * sigma_z ]
[ Z * sigma_z W * Id_2 ]]
when computing the secret key rate.
- The scalar parameters V := 1/2(<x_A**2> + <p_A**2>) = 1 + 2*<N_A>
W := 1/2(<x_B**2> + <p_B**2>) = 1 + 2*<N_B>
can be estimated easily, and one need their upper bounds to compute the Holevo bound. As for Z := 1/4(<x_A , x_B> + <p_A, p_B>) = <a*b + a_dag*b_dag>
one needs a lower bound on this quantity, which is very difficult to precisely estimante. A bound is given by the Denys-Brown-Leverrier bound Z_star defined above.
- Returns:
V, W, Z_star. V: exact value af V known by Alice. W: estimate of W based on the estimation of nB. Z_star: Denys-Brown-Leverrier’s bound on Z
- Return type:
Tuple[float, float, float]
- skr() float
Estimate of the Secret Key Rate of the protocol, based on the Holevo bound of the mutual information between Bob and Eve, computed from the bounds on the covariance matrix, and on the value of the matual information between Alice and Bob, computed form the Shot Noise Ratio of the simulation.
- Returns:
estimate of the secret key rate.
- Return type:
float
- abstract snr() float
- Returns:
Shot Noise Ratio of the protocol, which is computed with the theoretical formula above, and which depends on detection.
- Return type:
float