A toolbox for modelling quantum key distribution between satellites and ground stations.
Qrackling is a flexible object-oriented toolbox for simulating qkd between satellites and ground stations. It is easlily extended allowing users to replicate satellite qkd scenarios presented in the literature and explore the features present within them.
- Multiple qkd protocols:
- BB84
- Decoy state BB84
- Coherent One-Way
- Differential phase shift
- BBM92
- Data for a range of detectors (APD, SNSPD)
- Collected or extrapolated for various of the shelf devices
- Loss models:
- Geometric
- Optical
- Point and Track
- Atmospheric
- Turbulence
- Simulations
- Sifted and Secure key rates with QBER
- Beacon performance
Installation of the toolbox is as simple as ensuring it's on the MATLAB path. First ensure that the requirements are met. Then follow either the simple (recommended) or advanced installation sections.
- MATLAB R2022b (or later)
- Satellite Communications Toolbox
- Navigation Toolbox
- Mapping Toolbox
Optional
- LibRadtran 2.0.4 or later
For best stability we recommend using a tagged release, the following steps show how to install using that.
- Open the location of your MATLAB user path. This can be found by running the following in the MATLAB command window:
By default this should be something like
userpath
C:\Documents\MATLAB
on Windows and~/Documents/MATLAB/
for Linux. - Head over to releases and get the latest version.
- Extract the contents of the downloaded .zip archive into your user path. Qrackling will now be available for use in MATLAB to make use of the included examples follow the next step otherwise have fun!
- (Optional) To use the included examples you will need to add the folder you just placed into folder at your user path manually. To do this you will need to open the path tool by either going to the
HOME
tab and clickingSet Path
or by runningpathtool
in the MATLAB command window. From there clickAdd with Subfolders
and navigate to where you extracted the model to. Click save when you are done.
For those wanting to develop new features (or just use the most up to date version) you can install the toolbox by cloning the repository. It is up to you where you wish to install it, the most convenient is as follows:
-
Change directory to the MATLAB user path
- Windows:
cd C:\Documents\MATLAB
- Linux:
cd ~/Documents/MATLAB
- Windows:
-
Clone the repository
git clone https://github.com/RDonaldson5/QKD_Sat_Link
-
(Optional) Add the examples to the MATLAB path with the pathtool (see step 4 of Easy Installation)
libRadtran - library for radiative transfer - is a collection of C and Fortran functions and programs for calculation of solar and thermal radiation in the Earth's atmosphere. See the libRadtran website for technical details, licensing and operational instructions. Qrackling has been tested with libRadtran 2.0.4 and 2.0.5.
Qrackling has the optional ability to incorporate libRadtran to calculate background light and atmospheric transmission for conditions different to those already provided. This requires building and installing libRadtran from source, details for Linux users and Windows users have been outlined below.
Building and running libRadtran depends on the following:
- make
- gcc, g++, gfortran
- NetCDF (libraries and headers, e.g. on ubuntu (including in WSL) libnetcdff-dev)
- Gnu Scientific Library, gsl (libraries and headers, e.g. on ubuntu (including in WSL) libgsl-dev)
- WSL (Windows Subsystem for Linux, required for Windows only)
Download and unzip libRadtran from its website to an easily accessible folder, if you are building this on Windows then you should be careful not to extract libRadtran into a directory with spaces in the name.
Note: Although untested these steps likely work on MacOS too if anyone using this attemps this and gets it to work please file a PR with updates to the readme.
Install the requirements:
- make
- gcc
- g++
- gfortran
- NetCDF
- Gnu Scientific Library
On Ubuntu with apt
this will be as follows
apt install make gcc g++ gfortran libnetcdff-dev libgsl-dev
Navigate to the directory you have extraced libRadtran into and run the following commands. The will first configure the build system, resulting in errors if any dependencies are missing. Then prepare, verify and finally install to the users system.
./configure
make
make check
sudo make install
Installation on Windows is slightly more involved as it requires the use of Windows Subsystem for Linux, WSL, to properly build libRadtran. By default WSL will install Ubuntu Linux as a virtual machine, this will be plenty for this guide. From Windows 10 onwards this can be installed by openning PowerShell or Command Prompt and running the following command, this will prompt you for your username and password.
WSL --install
Once complete you can enter WSL by running WSL
in either PowerShell or Command Prompt.
Now that Ubuntu is installed it should be updated, the first command will update the list of available packages, the second will update any packages that need it:
sudo apt update
sudo apt upgrade
NOTE: If you are attempting to install WSL on a managed computer you may need to contact your I.T. department to allow WSL to connect to the internet.
Next we will need to install the required dependencies, this can be done as shown
sudo apt install make gcc g++ gfortran libnetcdff-dev libgsl-dev
Now that the dependencies are installed we can begin building libRadtran.
From inside WSL navigate to the directory containing libRadtran, since we are in Linux now the path convention has changed for example if libRadtran was extracted to C:\users\USERNAME\Downloads\libRadtran
this would now become /mnt/c/users/USERNAME/Downloads/libRadtran
.
Drives become lower case and are found in /mnt
and all path delimeters change from \
to /
.
The following commands are then used to build libRadtran. The will first configure the build system, resulting in errors if any dependencies are missing. Then prepare, verify and finally install to the users system.
./configure
make
make check
sudo make install
Dawn and dusk satellite quantum key distribution using time and phase based encoding and polarization filtering (preprint), C. Simmons, P. Barrow, R. Donaldson.
Qrackling and its tutorials/examples are MIT licensed