{'fraction_non_alphanumeric': 0.025072005288257235, 'fraction_numerical': 0.009065583833042165, 'mean_word_length': 4.868661679135495, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Machine learning aided carrier recovery in continuous-variable quantum key distribution

The secret key rate of a continuous-variable quantum key distribution (CV-QKD) system is limited by excess noise. A key issue typical to all modern CV-QKD systems implemented with a reference or pilot signal and an independent local oscillator is controlling the excess noise generated from the frequency and phase noise accrued by the transmitter and receiver. Therefore accurate phase estimation and compensation, so-called carrier recovery, is a critical subsystem of CV-QKD. Here, we explore the implementation of a machine learning framework based on Bayesian inference, namely an unscented Kalman filter (UKF), for estimation of phase noise and compare it to a standard reference method. Experimental results obtained over a 20 km fibre-optic link indicate that the UKF can ensure very low excess noise even at low pilot powers. The measurements exhibited low variance and high stability in excess noise over a wide range of pilot signal to noise ratios. This may enable CV-QKD systems with low implementation complexity which can seamlessly work on diverse transmission lines.

Continuous-variable quantum key distribution (CV-QKD) enables information-theoretically secure key exchange between two parties using the continuous-variable properties of the quantized electromagnetic light field [1][2][3][4][5]. The quantum information used for generating the secret key can be imprinted onto coherent states in the amplitude and phase quadratures of laser light using electrooptical modulators at the transmitter. These quantum states are transmitted through an insecure channel -typically assumed to be fully controlled by an adversaryand measured by some form of coherent detection, e.g. radio-frequency heterodyne or phase-diverse homodyne detection at the reciever. The use of technology quite similar to that employed in classical coherent telecommunications [6] is an attractive feature of CV-QKD with respect to integrability in existing telecom networks.
A CV-QKD coherent receiver uses a local oscillator (LO) to measure the quantum information carrying signal. Modern CV-QKD implementations generate the LO from a laser at the receiver, which is independent of the transmitter laser. This simplifies the CV-QKD implementation and increases security, however, at the cost of requiring to recover the frequency and phase of the quantum signal. This process, commonly known as carrier recovery in telecommunication [7], is of utmost importance for the performance of CV-QKD implementations as an impairment cannot be distinguished from excess noise generated by an eavesdropper.
The quantum signal operates in a significantly lower power regime than a typical optical telecommunications signal and correspondingly it is detected at a much lower signal-to-noise ratio (SNR). This regime is one in which traditional telecommunication algorithms for carrier recovery [7] function quite poorly, if at all. Additionally, CV-QKD systems typically use a Gaussian modulation format that does not contain features present in traditional telecommunication formats, e.g. phase shift keying (PSK), which enable such algorithms to work. Therefore pilot-aided techniques in which a reference signal is transmitted together with the quantum signal have been developed and studied for CV-QKD systems [8][9][10][11].
The 'classical' reference and the quantum signal are usually time [8][9][10] or frequency multiplexed [12,13] and phase noise estimation is carried out on this reference, henceforth called the 'pilot tone'. It is advantageous to have a pilot tone with as low power as possible to minimize interference with the quantum signal. Besides undesirable scattering effects in the fibre, a high power pilot tone has a negative effect on the signal to noise and distortion ratio of the digital-to-analog converter in the transmitter as well the analog-to-digital conversion in the receiver, thus decreasing the effective number of bits. To avoid some of these side effects the pilot tone and the quantum signal could be multiplexed in polarization, however, at the expense of (at least) doubling implementation complexity [14].
Here, we present a machine learning framework based on Bayesian inference, implementing an unscented Kalman filter (UKF) [15] to estimate the phase of a pilot tone. The UKF's performance is investigated experimentally in a Gaussian-modulated CV-QKD protocol [2] operating over a 20 km fibre link using an ultralow linewidth laser and a standard telecommunications laser at the transmitter. The UKF achieves exceptional performance with excess noise figures below 1% of the shot noise variance for a wide range of pilot tone SNRs. For instance, with the ultra-low linewidth laser, the UKF performs consistently well down to 3.5 dB pilot tone SNR (SNR pilot ), which considerably relaxes the constraints on the filtering bandwidth. The UKF therefore not only enables higher secret key rates but also promises a more robust CV-QKD system with regards to environmental factors that may deteriorate SNR pilot . Moreover, it enables secret key generation using systems that would otherwise be unable to do so using the reference method.
Phase tracking in CV-QKD systems using Bayesian inference based on an extended Kalman filter or extended Kalman smoother has recently been studied on a CV-QKD system with a discrete modulation format using 8 coherent states [16]. In contrast to their implementation the UKF described here does not require careful fine tuning of algorithm parameters and is thus more stable under changing conditions. Gaussian modulation in comparison to discrete modulation has more mature security proofs [17] but is more susceptible to phase noise (see Methods) because the optimum mean photon number of the transmitted quantum states is an order of magnitude higher. The UKF removes this as a significant limiting factor. Bayesian inference based methods have also been used for the measurement and characterization of laser phase noise, outperforming traditional methods in particular in the low laser power regime [18,19].

MACHINE LEARNING AIDED PHASE TRACKING ALGORITHM FOR CARRIER RECOVERY
The phase noise associated with a time-varying pilot signal y(t) acquired by a radio-frequency heterodyne receiver at discrete time instants t = t k can be corrected by evaluating where H denotes the Hilbert transform. The linear trend in θ k is removed to compensate for the frequency offset of the pilot tone leaving the phase noise. This method is standard for extracting the phase from a pilot signal and is equivalent to calculating the frequency offset, frequency shifting the pilot to baseband and then taking its argument, see Fig. 1a. In coherent detection systems the additive noise caused by the beating of the LO laser with vacuum fluctuations within the measurement bandwidth limit the efficacy of this method [20]. In principle, this can be solved by increasing the pilot signal power, however as previously mentioned, this may be undesirable in a practical CV-QKD system. To overcome this pilot power limitation, we investigated a machine learning framework based on Bayesian inference. This approach allows inference of the phase from the noisy measurements y k := y(k). In theory such an approach is statistically optimal with respect to the y e -jωt arg( . ) θ  [15]. To implement this method, a state space model that describes the evolution of the system in time is required in addition to a model that describes the measured values y k .
For the state space model, the phase of the quantum signal evolves with discrete Markovian dynamics and can be represented as where X k is the system state at symbol k, θ k is the phase at the same symbol and q is the unknown (phase) process noise. The measurement model of the pilot signal in a heterodyne detection system is given by a noisy measurement outcome y k , where A is the amplitude of the pilot signal, ∆ω is the frequency offset between the LO laser and the pilot tone, T s is the sampling time granularity and n k is the shot noise corrupting the measurement. For each symbol k Bayesian inference aims to obtain a filtering distribution approximating q.
The filtering distribution is the marginal distribution of the current θ k given current and previous measurements y 1:k = [y 1 , ...y k ]. The mean of this distribution is the statistically optimal estimated phase.
A direct implementation of the problem can be intractable, and hence there are implementations of Bayesian inference which are less optimal but tractable. The UKF handles the non-linear system (Eqn. 3) by taking a Gaussian approximation of the process noise. As shown in Fig. 1 (b), it does this by calculating some sigma points using the mean and standard deviation of the the approximating Gaussian distribution. These points are propagated through the measurement model which then are used to calculate the predicted mean and covariance. Similarly the mean and covariance of the measured noisy measurement are caluclated to estimate the error between the predicted state and the measured pilot. The Gaussian approximation is then updated using a Metropolis-Hastings algorithm and used to estimate the symbol phase. The updated distribution is then fed into the next symbol's estimation. In essence this allows for completely blind estimation without known system parameters. Should the given system parameters be significantly wrong, the major impact would be that convergence time to the optimum posterior distribution would be longer. Figure 2 shows the convergence time of the UKF when the initial process noise parameter (described by the laser linewidth) is varied for a simulated 2 kHz combined linewidth system. Underestimating the laser linewidth increases the convergence time of the UKF since under-estimating limits the size of the steps the UKF can take towards the actual phase. This may restrict the UKF's ability to track the phase. Overestimating the linewidth can cause the UKF to overshoot as (barely) seen for the 100 kHz input but then settles to the system phase. The color tints on the figure show the standard deviation of the approximating Gaussian used by the UKF.

RESULTS
We investigated the algorithm's performance in a CV-QKD experiment, the setup for which is depicted in Fig. 3a. The transmitter and receiver used commercially available telecom equipment and were connected by a 20 km SMF-28 fibre channel. The transmitter prepared a 50 MBaud quantum signal and a frequency-multiplexed pilot tone, both inscribed into single sidebands of the electromagnetic field by an electro-optic in-phase and quadrature modulator. After suitable attenuation, the optical signal was sent to the receiver, either directly or through the 20 km channel. Details about the modulation format at the transmitter and the coherent heterodyne detection at the receiver are described in the Methods. After acquiring the detection signal with an oscilloscope we performed several digital-signal-processing (DSP) steps (see Methods for further details), one of which is the proposed machine learning based carrier recovery algorithm, to recover the transmitted symbols.
Using the transmitted and recovered symbols, we performed channel parameter estimation to obtain e, the excess noise mean photon number, and η, the combined optical efficiency of the transmission channel and the receiver's measurement device. We also estimated N , the mean photon number of the transmitted thermal state, with the transmitter and receiver connected directly. In Methods we describe in further detail how to estimate these parameters and calculate the achievable secret key rate.
In the experiment we implemented two different transmitter lasers, a 100 Hz low linewidth fibre laser and a standard telecom external cavity diode laser with 10 kHz linewidth. The receiver's LO laser was always an identical model to the fibre laser. The lasers were free running, i.e. they were neither locked in frequency nor phase. Figure 3b shows an example time trace of estimated phases. While for the fibre laser the phase varied only slightly over the course of 125k symbols (2.5 ms), the 10 kHz linewidth laser's phase drifted over a significantly larger range, requiring a larger standard deviation of the approximating Gaussian distribution. Figure 4 a, c show the excess noise mean photon number e versus SNR pilot obtained from experimental measurements using the 100 Hz and the 10 kHz laser, respectively. Since the contribution to the excess noise caused by the electronic noise of the detector is assumed to be trusted, it was removed from the final result. The measurement set was divided into 1000 frames with 100k symbols per frame and channel parameter estimation was performed individually on each frame. The pilot tone SNR was varied by changing the filter bandwidth centred around the pilot tone frequency. This method was chosen in lieu of changing the pilot power at the transmitter to ensure a constant N across different measurements and to isolate potential effects such as receiver saturation, optical non-linearity and bleeding of pilot power into the quantum signal that could have happened from adjusting the pilot power along a wide range. From the plots the superiority of the UKF is clear compared to the reference method. The inset in Fig. 4a shows that the UKF has no significant performance degradation using a 100 Hz linewidth laser at SNR pilot as low as 4 dB, with e reaching 2 × 10 −3 at high SNR pilot . On the other hand, the reference method performs much worse than the UKF at low SNR pilot and is still outperformed at the highest SNR pilot . Substituting in the 10 kHz linewidth laser gives overall worse results with the UKF deteriorating quickly at lower than 7 dB SNR pilot , though it still achieves e < 0.01 in the best case. This is further put into perspective by the graphs in Fig. 4b,d that display the secret key rate calculated in the asymptotic regime using both phase compensation methods. Using the UKF it is always possible to extract a secret key using either transmitter laser, while even at a SNR pilot = 26 dB, the reference method could achieve at best e = 0.015, which is still too high for key generation with the 100 Hz laser. For the 10 kHz linewidth laser, e ≈ 0.06 was the best result. The worse performance may be due to the fast changing beat mode frequency of the lasers rendering the Gaussian approximation less accurate, however this requires further investigation.
Higher SNRs are limited by the pilot power in this experiment but theoretically the difference between the UKF and reference method should become negligible at sufficiently high SNR. In fact, the reference method has been used for successful key generation [12][13][14] albeit this was for discrete modulations formats and/or different experimental settings.

CONCLUSION
This work shows the performance increase achieved by employing a machine learning Bayesian inference framework for the compensation of laser phase noise in a Gaussian modulation CV-QKD setup operating over a distance of 20 km. Using a relatively low pilot power the machine learning approach enabled secret key generation in our system for two very low linewidth lasers (100 Hz) as well as for a system using one comparatively larger linewidth laser (10 kHz). The demonstrated performance is consistent over SNR pilot range exceeding 10 dB. Future CV-QKD systems operating in telecom networks that use fibres with varying attenuation and noise, e.g. stemming from wavelength division multiplexed data transmission, would experience a degradation of the available SNR pilot . In such environments, the UKF may be the only method that guarantees key generation without having to adapt the pilot power. Finally, given the moderate symbol rates employed in CV-QKD, real-time implementations of the UKF should be feasible, thus making it a substantial element in all CV-QKD systems that implement the LO using an independent laser.

Experimental setup
The experimental setup used to perform CV-QKD is shown in Fig. 3. The transmitted symbols were drawn from independently seeded pseudo random Gaussian distributions with variance of 1 and zero mean at a rate of 50 MBaud. These digital symbols were upsampled to the 500 MSamples/s sampling rate of the arbitrary wave-form generator (AWG) after which they were frequency shifted to Ω q = 60 MHz, i.e. multiplied with exp(jΩ q t), for single sideband modulation. A reference pilot tone at a frequency of Ω p = 130 MHz was also multiplexed with the quantum signal for the purpose of phase noise compensation and frequency offset estimation. This radio frequency signal and a π/2-phase shifted version thereof drove the two arms of an I-Q electro-optical modulator to simultaneously modulate the quantum signal in both quadratures onto the output of laser centered at 1550.13 nm. The optical signal was then attenuated such that the mean photon number from only the quantum signal (i.e. excluding the pilot tone) was ≈ 2.73 at the quantum channel input.
At the channel output, the transmitted optical signal was detected using a balanced heterodyne coherent receiver with a free-running LO generated by laser separate from the transmitter with an offset frequency ≈ 200 MHz. The LO power was 9 dBm, giving a shot noise clearance of ≈ 13 dB over the electronic noise. The output of the balanced receiver passed through a 200 MHz low pass filter and was then digitized by a 10 bit digital storage oscilloscope (DSO) whose clock synchronized to that of the AWG to avoid additional penalties from clock recovery algorithm. The optical efficiency of the balanced detector (due to the non-unity quantum efficiency of the photodiodes and optical loss from connectors) was measured to be ≈ 0.84.
The measurement time was divided into frames, each consisting of 100k complex values, or the 'quantum symbols'. A 10k symbol long CAZAC sequence [21], appended to the quantum symbol sequence, aided in timing recovery, synchronization and bulk phase offset compensation.

Digital-signal-processing (DSP)
Additional DSP is performed to facilitate QKD system operation. The transmitted quantum symbols are shaped with a root raised cosine filter with roll-off of 0.4 and matched filtering is performed at the receiver. The pilot signal is filtered using a wide band pass filter centred on its approximate location, calculated through the power spectrum of the received signal. The frequency offset is estimated through a Hilbert transform of the pilot and a linear fit of the extracted phase profile. This is re-estimated once more using the desired bandwidth filter which then shifts the pilot to baseband using the frequency offset estimate. The time varying phase is left when taking the argument of the pilot tone. Note that this baseband pilot is the input to the UKF after downsampling to symbol rate. The received quantum signal, vacuum and electronic noise calibration measurements were whitened with respect to the measurement of the combined vacuum and electronic noise power spectrum.

Excess noise and secret key rate calculations
To quantify the performance we use the secret key rate achievable in the asymptotic limit as well as the excess noise mean photon number at the channel output following an entangling-cloner attack model as depicted in Fig. 5. The prepare-and-measure covariance matrix between the symbols chosen from a Gaussian probability distribution at the transmitter and measurement outcomes from a heterodyne (or phase diverse) receiver is where N is the mean photon number of the transmitted thermal state, e is the excess noise mean photon number at the transmission channel output, η is the combined optical efficiency of the transmission channel and the receiver's measurement device [14]. In a practical CV-QKD implementation the covariance matrix is estimated from the symbols as follows.
It is assumed that the transmitted thermal state has been previously characterized, i.e. N is known. The parameters η and e, inferred from the estimated covariance matrix asη e =ŷ −ẑ give the asymptotic secret key rate, K = βI(A : B) − S(B : E) .
Here, A, B, E denote the modes of the transmitter, receiver, and eavesdropper, respectively, I is the mutual information, S is the Holevo information and β is the information reconciliation efficiency. For the sake of simplicity, we ignore finite-size effects here but more details can be found in [17]. Phase noise stemming from imperfect phase tracking effectively reduces the covariance termẑ by a factor κ = exp(−σ 2 pn /2), assuming Gaussian-distributed phase noise with σ pn as the standard deviation. If the phase noise is untrusted, i.e. κ is unknown and unaccounted for, we obtain (via the entangling cloner model) a reduction of the actual physical transmittance of the channel to a virtual one, η = κ 2 η. Simultaneously, the increased excess noise is given by e = e + (1 − κ 2 )N η. Thus, the larger the mean photon number of the ensemble of coherent states, the larger the effect of the phase noise.