Skip to content

Getting .bsparse from Çil matrices

create_bsparse_from_cil is a build tool that converts a CIL matrix file from the Çil & Schmalen repository into a .bsparse file ready to be consumed by the simulator. It optionally applies a target code rate and a quasi-cyclic (QC) expansion.

The binary is built alongside the main simulator — after a successful build it is available at build/bin/create_bsparse_from_cil.

Parameters

Matrix path -p REQUIRED

Type path
Example -p ../data/cil_matrices/

Path to the directory containing the input CIL matrix file.


Matrix filename -f REQUIRED

Type string
Example -f R_0p2_R_0p01_RA_SPPCOM_2

Filename of the CIL matrix (without extension).


Choose of the Code Rate -r REQUIRED

Type float
Example -r 0.9

Target code rate. The tool will augment the base matrix to reach this rate.

Note

Must satisfy the \(n \equiv 0 \pmod{d}\) constraint for CVQKD channels.


Output Directory -o REQUIRED

Type path
Example -o ../data/h_matrices/

Path to the output directory where the .bsparse file will be written.


Output Filename -n REQUIRED

Type string
Example -n n200000r0p1_cil_RA_SPPCOM_2.bsparse

Filename of the output .bsparse file.


QC Expansion -e OPTIONAL

Type integer
Default 1
Example -e 64

Quasi-cyclic (QC) expansion factor. When greater than 1, the tool applies a QC lifting.


Display Help -h HELP

Usage ./bin/HDirac -h

Print the help message and exit.

Example Command

Example

./bin/create_bsparse_from_cil \
    -p ../data/cil_matrices/ \
    -f R_0p2_R_0p01_RA_SPPCOM_2 \
    -r 0.1 \
    -e 2 \
    -o ../data/h_matrices/ \
    -n q2_n400000r0p1_cil.bsparse