## An Open-Source Library for Information Reconciliation in Continuous-Variable QKD

Erdem Eray Cil and Laurent Schmalen Communications Engineering Lab, Karlsruhe Institute of Technology Karlsruhe, Germany erdem.cil@kit.edu

Abstract -This paper presents an easy-to-use open-source software library for continuous-variable quantum key distribution (CV-QKD) systems. The library, written in C++, simplifies the crucial task of information reconciliation, ensuring that both communicating parties share the same secret key despite the noise. It offers a comprehensive set of tools, including modules for multidimensional reconciliation, error correction, and data integrity checks. Designed with user-friendliness in mind, the library hides the complexity of error correction, making it accessible even to users without knowledge of error-correcting codes.

DSP techniques are crucial for mitigating the impact of imperfections in the devices.

- 4) Post-processing: The final stage involves information reconciliation (IR) to reconcile discrepancies between Alice's and Bob's data due to channel noise. Privacy amplification (PA) extracts a final secret key from the reconciled data, accounting for potential information leakage during the reconciliation process.

Index Terms -CV-QKD, information reconciliation, library, open source, C++

## I. INTRODUCTION

The rapid progress in quantum computing threatens the security of many current encryption methods that rely on complex mathematical problems [1]. Quantum key distribution (QKD) offers a powerful alternative, relying on the laws of physics to create and share secret keys for secure communication. This approach promises strong security, even against attacks from powerful quantum computers.

Among the different QKD approaches, continuous-variable quantum key distribution (CV-QKD) stands out due to its potential for long-distance communication and costeffectiveness [2]. CV-QKD, in contrast to discrete-variable QKD, encodes information onto continuous properties of light, such as the amplitude and phase of electromagnetic field quadratures. This method often relies on readily available, offthe-shelf optical components, rendering it more practical and cost-effective.

- A typical CV-QKD system comprises several stages to establish a secure key, which are briefly explained as follows:
- 1) State preparation and transmission: One party, often referred to as Alice, prepares and transmits a series of quantum states.
- 3) Digital signal processing: Both Alice and Bob perform digital signal processing (DSP) on their respective data.
- 2) Reception and measurement: The receiving party, typically called Bob, measures the received quantum states, often subject to noise introduced by the quantum channel and imperfections in the devices.

This work was funded by the German Federal Ministry of Education and Research (BMBF) under grant agreement 16KISQ056 (DE-QOR).

Implementing a complete CV-QKD system from the ground up is a challenging endeavor that often requires expertise across multiple disciplines. Recent initiatives, such as the open-source library QOSST [3], aim to streamline this process by providing tools for various CV-QKD implementation stages. However, QOSST does not cover the crucial postprocessing stage.

The library incorporates modules for multidimensional reconciliation (MDR), decoding, and cyclic redundancy check (CRC), offering a comprehensive toolkit for IR. To make the library accessible to a broader audience, including researchers new to CV-QKD, we provide a user-friendly, black-box module. This module requires minimal user input (quantum states, noise variance, and desired code rate) and performs the entire IR process. Furthermore, for ease of use, the library includes Python bindings, allowing users to integrate it into their CVQKD systems without needing in-depth knowledge of C++.

Recognizing this gap, we present an open-source C++ library [4] explicitly tailored for IR in CV-QKD systems. This library offers a rate-adaptive error-correcting code with rates ranging from R = 0 2 . down to R = 0 01 . . This flexibility is especially beneficial for practical CV-QKD systems, where the signal quality can vary, requiring the use of codes with different rates. In addition to being rate-adaptive, the code also provides high reconciliation efficiencies, making the coding scheme included in the library suitable for middle- and longrange CV-QKD applications.

The paper is organized as follows: In Section II, we provide a concise overview of IR and the specifics of reverse reconciliation, including the MDR, error correction, and CRC. Section III presents simulation results, highlighting the performance of our library.

## II. INFORMATION RECONCILIATION

IR is a critical step in CV-QKD systems, enabling Alice and Bob to establish a shared secret key even in the presence of

Fig. 1: Illustration of the reverse reconciliation algorithm employing multidimensional reconciliation (MDR). QRNG, LLR, and H denote a random number generator, log-likelihood ratio, and parity check matrix of the error correcting code, respectively. Variables x and y represent the quantum states of Alice and Bob, respectively.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00569v1-figure-f8caf7c7-1b87-47c0-886d-2f0627f151ff.jpg)

channel noise. This process involves exchanging information, often through a classical authenticated channel, to reconcile discrepancies between their correlated data. These discrepancies arise from the noisy nature of quantum channels and imperfections in the measurement devices.

- 1) Raw key generation: Using a quantum random number generator (QRNG), Bob generates a sequence of random bits. This sequence serves as the basis for the raw key.

The choice of the IR method impacts the system's overall performance, particularly the achievable secret key rate and the maximum operational distance of the system. One key consideration is whether to employ direct error correction, where raw measurement data is reconciled, or to use an intermediate step like MDR to map the continuous data to a more manageable form.

- 2) MDR: Bob and Alice perform MDR on their respective quantum states, denoted by y and x , respectively. MDR aims to map the continuous-variable quantum channel to a BI-AWGN channel, simplifying the subsequent error correction process.

MDR, proposed in [5], enables us to transform the reconciliation problem into an equivalent problem over a binary-input additive white Gaussian noise (BI-AWGN) channel, which is well-studied in classical coding theory. This transformation allows the use of efficient error correction codes designed for BI-AWGN channels.

Another crucial aspect of IR is determining which party performs the reconciliation. In forward reconciliation , Bob, the receiver, takes the lead in correcting errors based on the information received from Alice. Conversely, in reverse reconciliation , Alice, the sender, assumes the role of error correction, using information fed back from Bob. Reverse reconciliation has been shown to be advantageous for achieving longer operational distances [6], and hence, implemented in the library.

## A. Reverse Reconciliation

Figure 1 illustrates the reverse reconciliation process employed in our system. The following steps outline the process in detail:

- 4) Syndrome calculation and transmission: Bob calculates the syndrome s of his generated raw key using the parity-check matrix H of the error-correcting code which is known to both parties. The syndrome is a compressed representation of the information required by the decoder to infer the correct raw key. Bob transmits this syndrome to Alice over the classical authenticated channel.
- 3) Log-likelihood ratio (LLR) calculation and decoding: Based on the received quantum states and the outcome of MDR, Alice calculates the LLRs for each bit in the raw key. These LLRs are then fed into a channel decoder to correct potential errors introduced during transmission.
- 5) Convergence check and CRC calculation: Alice's decoder processes the calculated LLRs and the syndrome from Bob. If the decoder converges to a sequence that satisfies the parity check equations defined by the syndrome, Alice considers this sequence a candidate for the key material because it is a possible solution that satisfies the parity checks. To verify that this potentially corrected sequence matches the one selected by Bob, Alice calculates the CRC of the sequence and sends it to Bob.
- 6) CRC comparison and key storage/discarding: Bob compares the received CRC with the CRC he computes

for his version of the raw key. If both CRCs match, it indicates that both parties have successfully agreed on the same sequence, which is then stored for further processing in the privacy amplification stage. If the CRCs do not match, the reconciliation attempt for the current block of data is considered unsuccessful. The block is discarded, and the process can be repeated.

It is important to highlight that both the syndrome and the CRC information transmitted from Bob to Alice represent information leakage. This leakage, while necessary for reconciliation, must be carefully accounted for during privacy amplification to ensure the security of the final secret key.

## B. Multidimensional Reconciliation

MDR is a technique used to adapt the continuous-variable quantum channel for use with error correction codes primarily designed for BI-AWGN channels. It involves rotating the quantum states in higher-dimensional space before transmission and reversing the rotation after reception. This process, as the dimensions of rotation ( d ) approach infinity ( d → ∞ ), effectively transforms the channel into a BI-AWGN channel, making it compatible with conventional error-correction codes.

However, practical implementations of MDR are limited to finite dimensions, typically d = 1 , 2 , 4 , and 8 . Consequently, the assumption of a perfect BI-AWGN channel holds only approximately, and performance degrades as the dimension decreases. It is worth noting that, in principle, any orthogonal transformations could be used as long as they maintain information secrecy. However, the complexity of such general transformations often makes them impractical for CVQKD systems [5]. Our library utilizes the Cayley-Dickson construction for implementing the rotations in MDR [7].

## C. Error Correction

Error correction is a crucial part of the IR process in CVQKD, directly impacting the achievable secret key rate. To maximize the secret key rate, the error correction scheme must operate efficiently at low signal-to-noise ratio (SNR)s typical for CV-QKD. This section elaborates on the specific error correction strategy used in our library, focusing on the code design and the decoding algorithm.

1) Forward error correcting code: CV-QKD systems typically operate at much lower SNRs than traditional communication systems. Consequently, the IR process requires errorcorrecting codes with significantly lower rates. Multi-edge type (MET)-low-density parity-check (LDPC) codes are wellsuited for such low to ultra-low code rate scenarios due to their excellent performance in these regimes.

Numerous MET-LDPC code designs have been proposed for CV-QKD, each with its advantages and limitations [8], [9]. However, to optimize performance over varying channel conditions, the code rate must be adaptable. While rate adaptation can be achieved using techniques like puncturing and shortening [10], these methods often result in performance degradation compared to codes explicitly designed for a specific rate [11].

Our library addresses this challenge by incorporating a raptor-like LDPC code [11], optimized for a wide range of code rates, from 0 2 . down to 0 01 . . This code, designed to perform well over a range of rates, eliminates the need for puncturing or shortening, thereby achieving higher efficiencies for the target rates. This code covers rates R = 2 10 · 4 / (10 + ) 5 i , where i can take any integer value from 0 to 1 900 000 .

Simulations demonstrate that this code can support distances up to 110 km for rates between 0 2 . and 0 01 . [12], making it particularly attractive for practical CV-QKD systems aiming for medium to long-distance communication. This motivated us to include this code in our library.

One potential drawback of this specific code construction is that the block length is not independent of the rate. Choosing a particular rate implicitly determines the block length. This interdependence might appear restrictive, but it is not a major concern for CV-QKD systems. The high number of quantum states typically required for key distillation, driven by finitesize effects, implies that inherently long block lengths must be employed. Therefore, the fixed relationship between the rate and block length in our chosen code does not pose a practical limitation.

2) Decoding: The sum-product algorithm (SPA) has emerged as the dominant decoding algorithm for LDPC codes in CV-QKD. Its popularity stems from its near-optimal performance. The SPA operates by iteratively exchanging messages, representing beliefs about the encoded bits, along the edges of a graph that represents the LDPC code.

The library implements both flooding and layered scheduling for the SPA. In flooding scheduling, all check nodes (CNs) update their outgoing messages in parallel based on incoming messages, followed by all variable nodes (VNs) updating their outgoing messages. This process of CN updates followed by VN updates constitutes one iteration. In contrast, layered scheduling updates messages serially along specific connections in the graph representation of the code, rather than processing all nodes in parallel. This approach can lead to faster convergence by exploiting dependencies between messages and reducing redundant computations.

Our library's SPA implementation utilizes LLRs as the message values to ensure numerical stability. The use of LLRs is particularly important for low code rates, where the magnitudes of probability values can become extremely small, leading to numerical instability if not handled appropriately.

For completeness, we describe the flooding schedule for the SPA with LLR messages. We use the following notation: LLR values are represented by L . The synthetic channel LLR value ( l in Fig.1) for VN i is denoted as L ch ,i . In the context of an LDPC code with parity check matrix H , the set N ( ) = i { j : H j,i = 1 } represents the connection set of VN i . Conversely, the set M ( j ) = { i : H j,i = 1 } represents the connection set of CN j . Messages passed from CN/VN j to VN/CN i are denoted by L [c] i ← j and L [v] j → i , respectively. The block length of the code is represented by N ∈ N , while s is the syndrome of the symbol sequence, with s j being its j th element.

- 1) Initialization: For each VN i , where i ∈ { 1 , . . . , N } and for each j in N ( ) i , initialize the message passed from VN i to CN j as L [v] i → j = L ch ,i .
- 2) CN update: For each CN j and each VN i in M ( j ) , the message passed from CN j to VN i is

$$L _ { i \leftarrow j } ^ { [ c ] } = 2 s _ { j } \tanh ^ { - 1 } \left ( \prod _ { \ell \in \mathcal { M } ( j ) \smallsetminus \{ i \} } \tanh \left ( \frac { L _ { \ell \to j } ^ { [ v ] } } { 2 } \right ) \right ). \ \ ( 1 ) \quad \text{To } \xi \text{condu}, \\ \sim \ \pi \pi \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \dots \end{array}$$

- 3) VN update: For each VN i and each CN j in N ( ) i , the message from VN i to CN j is updated as:

$$L _ { i \to j } ^ { [ \text{v} ] } & = L _ { \text{ch}, i } + \sum _ { k \in \mathcal { N } ( i ) \vee \{ j \} } L _ { i \leftarrow k } ^ { [ \text{c} ] }. \\. & \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot \cdot.$$

- 4) A posteriori LLR calculation: For each VN i , where i ∈ { 1 . . . N } , the a posteriori LLR is

$$L _ { i } ^ { [ \text{total} ] } & = L _ { \text{ch}, i } + \sum _ { k \in \mathcal { N } ( i ) } L _ { i \leftarrow k } ^ { [ \text{c} ] }. \\ \cdot \, \cdots \, \quad \cdot \, \cdot \, \cdot \, \cdot \, \cdot \, \cdot \,.$$

The decoded bits are obtained by hard-deciding on these a posteriori LLR values:

$$\hat { x } _ { i } = \frac { 1 - \text{sgn} \left ( L _ { i } ^ { [ \text{total} ] } \right ) } { 2 }.$$

- 5) Stopping criteria: The decoding process terminates if either of the following conditions is met:
- · Valid codeword: The decoded sequence ˆ x , formed by concatenating the decoded bits as ˆ x = (ˆ x , . . . , x 1 ˆ N ) , satisfies the parity check equation: Hx ˆ T = s .
- · Maximum iterations: The number of decoding iterations reaches a predefined limit.

If neither condition is met, the algorithm proceeds back to Step 2, the CN update.

The calculation of the tanh and tanh -1 functions in (1) can be computationally intensive. To address this, our library provides an option to store the values of these functions in a lookup table, which can be pre-computed. During the decoding process, the decoder can retrieve the function values from the table instead of recalculating them, thereby speeding up the decoding process.

## D. Cyclic Redundancy Check

A CRC, a widely used error-detection mechanism, is employed to ensure the integrity of data transmitted over a channel. It operates by generating a short checksum from a data sequence using polynomial division. By comparing the checksums calculated independently by the sender and receiver, any discrepancy indicates an error during transmission.

In the context of our library, the CRC plays a crucial role in verifying if the decoder has converged to the correct codeword, that is, if the reconciled sequence at the receiver matches the original raw key generated by the sender. A CRC mismatch indicates a decoding failure. Upon detecting a CRC error, the current block of data is discarded.

Our library implements a CRC-32 check for error detection. This choice is motivated by observations made in [7], where a 32 -bit CRC was found to be sufficient for detecting misdecoded words in CV-QKD information reconciliation.

## III. RESULTS

To assess the performance of our open-source library, we conduct simulations emulating the reverse reconciliation scenario illustrated in Fig. 1. We employ Gaussian-modulated coherent states and heterodyne detection. The SNR is defined as 1 /σ 2 n of the quantum measurements. These measurements are subject to Gaussian noise. To accelerate the simulations, we design the use case to decode multiple frames concurrently, leveraging the processing power of multi-core CPUs.

The simulations are conducted for different code rates and MDR dimensions to assess the performance across various operating points relevant to CV-QKD. We focus on two code rates, R = 0 01 . and R = 0 2 . , representing ultra-low and low rate regimes, respectively. For each rate, simulations are performed for MDR dimensions of d = 1 , 2 , 4 , and 8 .

Furthermore, we evaluate the impact of using a lookup table for the tanh and tanh -1 functions in the SPA decoder.

For these simulations, we use SPA decoding with a flooding schedule. The performance is evaluated using four metrics: Frame error rate (FER), bit error rate (BER), average number of decoding iterations (NoI), and decoding duration of one decoding frame per CPU core.

Figure 2 presents the simulation results, illustrating the interplay between code rate and MDR dimension. The FER/BER curves reveal a consistent trend: increasing the MDR dimension, d , leads to improved decoding performance, particularly notable for the higher code rate, R = 0 2 . . For instance, at R = 0 2 . , using d = 8 provides an SNR gain of approximately 1 5 dB . compared to d = 1 for an FER target of 0 1 . . However, this gain diminishes as the code rate decreases. For the ultralow rate of R = 0 01 . , the performance difference between d = 1 and d = 8 shrinks to about 0 1 dB . at the FER of 0 1 . .

Examining the curves for R = 0 01 . , it becomes evident that using d = 8 pushes the performance close to the theoretical limit achievable over a true BI-AWGN channel. This suggests that for ultra-low rates, increasing the MDR dimension beyond 8 offers diminishing returns. However, for R = 0 2 . , a performance gap of roughly 0 2 dB . persists between d = 8 and the theoretical BI-AWGN limit at FER 0 1 . . This observation indicates that further performance improvements for higher code rates might be achievable by employing MDR with dimensions greater than 8 .

Comparing the decoding durations of the real-time calculation versus the lookup table approach reveals a significant difference. Utilizing a lookup table for tanh and tanh -1 functions results in a remarkable 2 × speedup without compromising decoding performance. Both approaches yield identical decoding performances and require almost the same number of decoding iterations. This underscores the effectiveness of the lookup table method.

Fig. 2: Performance of the rate-adaptive LDPC code for code rates R = 0 2 . (left) and R = 0 01 . (right) and reconciliation dimensions ( d ) of 1, 2, 4, and 8. Frame error rate (FER), bit error rate (BER), average number of decoding iterations (NoI), and decoding duration per frame per CPU core are plotted as a function of the signal-to-noise ratio (SNR). Performance over a binary-input additive white Gaussian noise (BI-AWGN) channel is shown for comparison. Solid and dashed lines (-/ ---) represent decoders employing lookup tables, while markers (·) indicate direct calculation. Simulations were performed on an AMD EPYC TM 7713P 64-Core Processor.

![image](https://ac.marcodsn.me/arxiv-markdown-images/2408.00569v1-figure-480e9dd6-af2e-4071-8843-074af310d07f.jpg)

## IV. CONCLUSION

This paper presents an open-source C++ library built for IR in CV-QKD systems. One of the library's core strengths lies in its implementation of a rate-adaptive forward error correction scheme based on raptor-like LDPC codes. This allows the library to address a wide range of code rates, from R = 0 2 . down to R = 0 01 . , with high reconciliation efficiency. This flexibility renders the library suitable for various CV-QKD setups, particularly those targeting middle to long-range distances.

The library offers a set of functionalities, including modules for MDR, high-performance SPA decoding with both flooding and layered scheduling, and CRC for error detection. To facilitate broader adoption, the library includes a user-friendly, black-box module, simplifying the integration into experimental CV-QKD systems, even for users without specialized expertise in channel coding. Python bindings further enhance the library's accessibility, allowing for convenient integration into existing CV-QKD frameworks.

## REFERENCES

- [1] I. B. Djordjevic, Physical-layer Security and Quantum Key Distribution , 1st ed. Springer Nature, Sep. 2019.
- [3] Y. Pi´ etri, M. Schiavon, V. Marulanda Acosta, B. Gouraud, L. Trigo Vidarte, P. Grangier, A. Rhouni, and E. Diamanti, 'QOSST: A Highly-Modular Open Source Platform for Experimental Continuous-Variable Quantum Key Distribution.' [Online]. Available: https://arxiv.org/abs/2404.18637
- [2] Y. Zhang, Z. Chen, S. Pirandola, X. Wang, C. Zhou, B. Chu, Y. Zhao, B. Xu, S. Yu, and H. Guo, 'Long-distance continuous-variable quantum key distribution over 202.81 km of fiber,' Phys. Rev. Lett. , vol. 125, p. 010502, Jun. 2020.
- [4] E. E. Cil and L. Schmalen, 'Information reconciliation library for CVQKD systems,' https://github.com/erdemeray/IR for CVQKD, 2024, [Online].
- [6] C. Silberhorn, T. C. Ralph, N. L¨tkenhaus, and G. Leuchs, 'Continuous u variable quantum cryptography: beating the 3 dB loss limit,' Phys. Rev. Lett. , vol. 89, p. 167901, Sep. 2002.
- [5] A. Leverrier, R. All´ eaume, J. Boutros, G. Z´ emor, and P. Grangier, 'Multidimensional reconciliation for a continuous-variable quantum key distribution,' Phys. Rev. Lett. , vol. 77, no. 4, Apr. 2008.
- [7] M. Milicevic, C. Feng, L. M. Zhang, and P. G. Gulak, 'Quasi-cyclic multi-edge LDPC codes for long-distance quantum cryptography,' npj Quantum Information , vol. 4, no. 1, Apr. 2018.
- [9] K. G¨ um¨ us ¸ and L. Schmalen, 'Low rate protograph-based LDPC codes for continuous variable quantum key distribution,' in Proc. International Symposium on Wireless Communication Systems (ISWCS) , Sep. 2021.
- [8] H. Mani, 'Error reconciliation protocols for continuous-variable quantum key distribution,' Ph.D. dissertation, Technical University of Denmark, Kongens Lyngby, 2020.
- [10] C. Zhou, X. Wang, Z. Zhang, S. Yu, Z. Chen, and H. Guo, 'Rate compatible reconciliation for continuous-variable quantum key distribution using raptor-like LDPC codes,' Science China Physics, Mechanics &amp; Astronomy , vol. 64, no. 6, p. 260311, Apr 2021. [Online]. Available: https://doi.org/10.1007/s11433-021-1688-4
- [12] E. E. Cil, J. Berl, and L. Schmalen, 'Parameter optimization of rateadaptive continuous-variable quantum key distribution systems,' Sep. 2024, submitted to: European Conference on Optical Communications (ECOC) .
- [11] E. E. Cil and L. Schmalen, 'Rate-adaptive protograph-based raptorlike LDPC code for continuous-variable quantum key distribution,' in Proc. Advanced Photonic Congress: Signal Processing in Photonic Communications (SPPCom) , Qu´ ebec City, Canada, Jul. 2024.
Erdem Eray Cil Laurent Schmalen
An Open-Source Library for Information Reconciliation in Continuous-Variable QKD
This paper presents an easy-to-use open-source software library for
continuous-variable quantum key distribution (CV-QKD) systems. The library,
written in C++, simplifies the crucial task of information reconciliation,
ensuring that both communicating parties share the same secret key despite the
noise. It offers a comprehensive set of tools, including modules for
multidimensional reconciliation, error correction, and data integrity checks.
Designed with user-friendliness in mind, the library hides the complexity of
error correction, making it accessible even to users without knowledge of
error-correcting codes.