Repository contains simulation of symmetric blind reconciliation algorithm realized in Python 3.
Launches a simulation of the symmetric blind reconciliation for the current number of tries and QBER values. Keeps the result in output.txt.
Contains basic procedures for performing a test of reconciliation protocol. It includes:
- generation of random keys (bit strings);
- adding errors in accordance with given level of quantum bit error rate (QBER);
- choosing an appropriate rate of LDPC code among a given range and numbers of shortened and punctured bits;
- generation of positions for shortened and punctured bit;
- extending key with shortened and punctured bits;
- syndrome encoding;
- syndrome decoding;
- performing symmetric blind reconciliation for given pair keys;
- testing of the full procedure of information reconciliation, including generation of keys, adding errors, and collection of statistics.
Pool of four standard LDPC codes of block length 1944 together with positions for untainted puncturing. The set of code rates is {5/6, 3/4, 2/3, 1/2}.
Pool of nine LDPC codes with block length 4000, constructed with improved progressive edge growing algorithm with particular distribution polynomials. The set of code rates is {0.9, 0.85, ..., 0.5}.
Contains some auxiliary procedures for reading files with codes.
The storage of parity-check matrices is based on two variables: s_y_joins
and y_s_joins
. They contains positions of nonzero elements for each row and column correspondingly.
For example, for the matrix
H =
1 1 0 1
1 0 1 1
0 1 1 0
one has
s_y_joins = [[0,1,3], [0,2,3],[1,2]]
y_s_joins = [[0,1],[0,2], [1,2],[0,1]]
To run the code you need to first install a python 3 distribution. We recommend Anaconda or Miniconda if you have space limitations. However, this is not strictly required and any other python 3 installation will work.
To avoid messing up with your environment, we suggest to create a separate python environment for experimenting with the code. This can be done using the virtualenv package
Fist, install the virtualenv pacakage with pip
pip install virtualenv
create the virtual env
virtualenv LDPC
Each time you want to activate the virtual env you must run: For Linux/Mac
source LDPC/bin/activate
for Windows
LDPC\Scripts\activate
then, only for the first time you need to install the dependencies:
pip install numpy scipy
or via the requirements file
pip install -r .\requirements.txt
and you should be ready to go.
Optionally you can also install useful libraries via
pip install -r .\requirements-optional.txt
where matplotlib can be used for plotting while numba can be used to compile via a JIT some functions for a speedup (see develop brach)
To exit form the virtualenv just type:
deactivate
All the code is taken from RQC-QKD-Software with minor modifications to make it work under python 3