Configuration

The configuration file and reader is one of the most important of qosst-core. In particular it provides the reader of the documentation to create a convenient object that can be used by Alice and Bob.

A word on TOML

The configuration file is written in TOML. The choice of this is mainly motivated from the PEP 518 file format choice, from which the following table has been extracted:

Feature

TOML

YAML

JSON

CFG/INI

Well-defined

yes

yes

yes

Real data types

yes

yes

yes

Reliable unicode

yes

yes

yes

Reliable comments

yes

yes

Easy for humans to edit

yes

??

??

Easy for tools to edit

yes

??

yes

??

In standard library

yes

yes

Easy for pip to vendor

yes

n/a

n/a

(also see this reference).

Although TOML is not in the python standard library for versions ranging from 3.7 to 3.10, it was included in version 3.11 (see PEP 680). The choice is also motivated as it know the language to provide the specifications to build python projects (pyproject.toml).

In qosst however, since the software officially supports versions 3.7.2 and above, the choice of the toml package was made.

Reader

The main class of the reader is qosst_core.configuration.config.Configuration and can be used in the following way

from qosst_core.configuration import Configuration

config = Configuration("config.example.toml")

print(config)

print(config.frame.quantum.modulation)

When initialized, this class reads the TOML file, and feed it the from_dict method. It will then called subclasses that will also be using the from_dict method to load the value on the class. More information can be found here.

Note

For most of the section and subsections, if the section or parameter is not present, default(s) value(s) is (are) used. However, in some cases, the entire section is also left to None (for instance, Alice doesn’t need to have the config.bob filled with default values). The table below summarize if the values are auto-filled with the default values if the section is absent from the configuration file:

Section

Auto filled ?

logs

yes

notifications

no

authentication

no

clock

no

channel

no

channel.voa

yes

local_oscillator

no

alice

no

alice.signal_generation

yes

alice.network

yes

alice.dac

yes

alice.powermeter

yes

alice.voa

yes

alice.modulator_bias_control

yes

alice.laser

yes

alice.polarisation_recovery

yes

bob

no

bob.network

yes

bob.adc

yes

bob.switch

yes

bob.laser

yes

bob.polarisation_recovery

yes

bob.polarisation_recovery.polarisation_controller

yes

bob.polarisation_recovery.powermeter

yes

bob.dsp

yes

bob.dsp.equalizer

yes

bob.parameters_estimation

yes

bob.electronic_noise

yes

bob.electronic_shot_noise

yes

frame

no

frame.pilots

yes

frame.quantum

yes

frame.zadoff_chu

yes

Parameters in the configuration file

This section will describe each section of the configuration file alongside with the description of every parameter in the file.

Warning

This section reflects the purpose of each configuration variable as it was intended in the configuration file. More details can be found in the documentation of qosst-alice and qosst-bob for the specific implementation.

The default value is also given.

label: str = "Example config"

Name of the configuration. This is useful when several configuration file exists to quickly check which one is used.

serial_number: str = ""

Identifier of the hardware.

Logs

This section holds the configuration for file logging.

The configuration for console logging is done when calling the scripts (with the -v option).

The configuration for GUI logging is also done when calling them GUI script.

logging: bool = True

If True, logs will be saved to a file. If False, logs will not be saved to a file. This option does not concern the console or GUI logs.

path: str = "qosst.log"

Path of the file where the logs should be saved.

level: str = "info"

Log level. Possible choices are: debug, info, warning, error and critical. Any log level will save its level and the higher level.

Notifications

This section holds the configuration for the notifications that can be sent to tue user to inform of the progress of the experiment.

notify: bool = False

If True, notifier will be initialized and used. If False, notifier will not be initialized.

notifier_class: str = "qosst_core.notifications.FakeNotifier"

Import path of the notifier to use. The notifier should be a valid class, inheriting from qosst_core.notifications.QOSSTNotifier.

notifier_args: dict = {}

Dict of arguments that will be passed as kwargs to the __init__ method of the notifier. For instance, the dict {token="abc"} would be equivalent to the python call notifier = Notifier(token="abc").

Authentication

This section holds the configuration for the authentication, in particular deciding which algorithm will be used to sign the digest and give the parameters to sign the digest and check the digests of the other party.

authentication_class: str = "qosst_core.authentication.NoneAuthenticator"

Import path of the authentication class to use for the control protocol for the classical channel. The authenticator should be a valid class, inheriting from qosst_core.authentication.base.BaseAuthenticator.

authentication_params: dict = {}

Dict of arguments that will be passed as kwargs to the __init__ method of the authenticator. For instance, the dict {secret_key="abc"} would be equivalent to the python call authenticator = Authenticator(secret_key="abc").

Note

For this particular dict of parameters, the special directive from_file can be used. This is done to be able to load a private and public key from a file instead of putting in the configuration file. The syntax is the following: {secret_key = "from_file(my_secret_file)"}.

Clock

This section holds the configuration for clock sharing.

sharing: bool = False

If True, it will be assumed that the clock is shared between Alice and Bob’s DAC and ADC. In particular this can be used to simplify the digital signal processing. In some cases, the hardware will be also configured to actually enable the clock sharing. If False, not clock sharing is assumed and no steps are done to enable clock sharing.

Warning

The automatic configuration of the clock sharing should be checked and considered not working.

master: str = "alice"

Master of the clock sharing (i.e.) the party that emits the clock reference. Possible choice are “alice” and “bob”. This parameter is ignored if the clock sharing is not enable.

Local oscillator

This section holds the configuration for local oscillator sharing.

shared: bool = False

If True, it will be assumed that the local oscillator is shared between Alice and Bob, i.e. that the same laser is used for the signal generation and the local oscillator for Bob. In particular this can be used to simplify the digital signal processing.

Channel

This section holds the configuration for the channel, in particular if a Variable Optical Attenuator (VOA) is used to emulate the channel.

VOA

This section holds the configuration of a VOA that is used to emulate the channel.

This particular section can be used when a Variable Optical Attenuator (VOA) is used to emulate the channel.

Note

In general, in QOSST, VOA are assumed to be controlled by a voltage, and this is usually what you configure in the configuration file as the VOA value. However, it is possible to code hardware classes taking the attenuation as an input.

use: bool = False

If True, the VOA will be initialized using the VOA device, and the attenuation/voltage will be applied to the VOA. If False, all this section is ignored.

applier: str = "alice"

The party that will apply the value to the VOA. Possible choices are “alice” and “bob”. The party that is not the applier will ignore this section.

device: str = "qosst_hal.voa.FakeVOA"

Import path of the VOA class to use to emulate the channel. The VOA should be a valid class, inheriting from qosst_hal.voa.GenericVOA.

location: str = ""

Location of the VOA device. The format depends on the specific VOA class that is used.

value: float = 0

Value to use for the VOA. Depending on the VOA class that is used, this value can represent an attenuation, a voltage, etc

extra_args: dict = {}

Dict of arguments that will be passed as kwargs to the __init__ method of the VOA. For instance, the dict {min_value=0} would be equivalent to the python call voa = VOA(min_value=0).

Alice

This section holds configuration relative to Alice.

photodiode_to_output_conversion: float = 1

This represent the ratio between the power that is detected by Alice’s monitoring photodiode and Alice’s output. In practice this value will be used by Alice to compute the average number of photons per symbol at the output of Alice.

Note

This is explained in more details in qosst-alice documentation but the average number of photons per symbols can be computed as

\[\langle n \rangle = \frac{P_{out}}{E_{ph}\cdot R_s} \]

where \(P_{out}\) is the optical power at Alice’s output, \(E_{ph} = \frac{hc}{\lambda}\) the energy of a photon and \(R_s\) is the symbol rate.

\(P_{out}\) is computed as

\[P_{out} = r_{conv}\cdot P_{monitoring}\]

where \(r_{conv}\) is th photodiode to output conversion ratio and \(P_{monitoring}\) is the optical power at the monitoring photodiode, yielding the final formula

\[\langle n \rangle = \frac{r_{conv}\cdot P_{monitoring}}{E_{ph}\cdot R_s} \]
artificial_excess_noise: float = 0

This parameter will be used as the variance of a white noise that will be added to the generated quantum symbols that will be applied to the IQ modulator but not saved in the actual symbols of Alice. This is useful to check that we indeed detect the artificial excess noise.

Warning

This should also be 0 for real tests.

schema: str = "qosst_core.schema.emission.SINGLE_POLARISATION"

Emission schema. The list of possible emission schemas is available here. The schema should be a valid instance of qosst_core.schema.emission.EmissionSchema.

Signal generation

This section holds configuration to load and/or save data during the signal generation algorithm.

symbols_path: str = "symbols.npy"

Path to load the symbols from if load_symbols is True. Path to save the symbols if save_symbols is True. This parameter is ignored if both parameters are False.

final_sequence_path: str = "final_sequence.npy"

Path to load the final sequence from if load_final_sequence is True. Path to save the final sequence if save_final_sequence is True. This parameter is ignored if both parameters are False.

quantum_sequence_path: str = "quantum_sequence.npy"

Path to save the symbols if save_quantum_sequence is True. This parameter is ignored if save_quantum_sequence is False.

load_symbols: bool = False

If True, the symbols are not generated but loaded from a file, using the path provided in symbols_path.

load_final_sequence: bool = False

If True, the finale sequence is not generated but loaded from a file, using the path provided in final_sequence_path.

save_symbols: bool = True

If True, the symbols are saved using the path provided in symbols_path.

save_final_sequence: bool = True

If True, the final sequence is saved using the path provided in final_sequence_path.

save_quantum_sequence: bool = True

If True, the quantum sequence are saved using the path provided in quantum_sequence_path.

Note

The symbols represent the actual complex symbols that encode the information. They are then inputted into the digital signal processing of Alice to be processed for emission, yielding the quantum sequence. Finally, the pilots and the Zadoff-Chu sequence (classical signals) are added to form the final sequence. This is explained in more detail in the qosst-alice documentation.

Network

This section holds the network configuration for Alice.

bind_address: str = "127.0.0.1"

Network address to bind to for the server.

port: int = 8181

Network port to bind to for the server.

DAC

This section holds the DAC configuration for Alice.

rate: int = 500e6

Rate of the DAC of Alice in Samples/second. The scientific notation e (500e6 for instance) is available.

amplitude: float = 0

Amplitude to use for the DAC. In particular this value will be passed to the DAC class. If this is set to \(A\) V, it should mean that a +1 in the final sequence will generate a voltage of \(+A\) V and a -1 will generate \(-A\) V. It should be set to stay in the limit of the linearity range of the modulator and the specifications of the DAC.

device: str = "qosst_hal.dac.FakeDAC"

Import path of the DAC class to use. The DAC should be a valid class, inheriting from qosst_hal.dac.GenericDAC.

channels: List[int] = [0, 1]

List of channels to use for the DAC.

extra_args: dict = {}

Dict of arguments that will be passed as kwargs to the __init__ method of the DAC. For instance, the dict {"erase":true} would be equivalent to the python call dac = DAC(erase=True).

Powermeter

This section holds the configuration for the monitoring photodiode for Alice that is used to compute the average num,ber of photons at the output of Alice.

device: str = "qosst_hal.powermeter.FakePowerMeter"

Import path of the powermeter class for the power monitoring. The powermeter should be a valid class, inheriting from qosst_hal.powermeter.GenericPowerMeter.

location: str = ""

Location of the powermeter device. The format depends on the specific powermeter class that is used.

extra_args: dict = {}

Dict of arguments that will be passed as kwargs to the __init__ method of the powermeter.

VOA

This section holds the configuration of the VOA of Alice.

device: str = "qosst_hal.voa.FakeVOA"

Import path of the VOA class to tune Alice’s variance. The VOA should be a valid class, inheriting from qosst_hal.voa.GenericVOA.

location: str = ""

Location of the VOA device. The format depends on the specific VOA class that is used.

value: float = 0

Value to use for the VOA. Depending on the VOA class that is used, this value can represent an attenuation, a voltage, etc

extra_args: dict = {}

Dict of arguments that will be passed as kwargs to the __init__ method of the VOA.

Modulator bias controller

This section holds the configuration for the modulation bias controller of Alice.

device: str = "qosst_hal.modulator_bias_control.FakeModulatorBiasController"

Import path of the bias controller class to use to lock the IQ modulator. The bias controller should be a valid class, inheriting from qosst_hal.modulator_bias_control.GenericModulatorBiasController.

location: str = ""

Location of the bias controller device. The format depends on the specific VOA class that is used.

extra_args: dict = {}

Dict of arguments that will be passed as kwargs to the __init__ method of the bias controller.

Laser

This section holds the configuration for the laser of Alice.

device: str = "qosst_hal.laser.FakeLaser"

Import path of the laser class of Alice. The laser should be a valid class, inheriting from qosst_hal.laser.GenericLaser.

location: str = ""

Location of the laser device. The format depends on the specific laser class that is used.

parameters: dict = {}

Dict of arguments that will be passed to the set_parameters method of the laser. This could be the power, the frequency, etc… This depends on the specific laser class that is used.

Polarisation recovery

The polarisation recovery is done by Alice sending a strong classical signal for Bob to optimize the polarisation recovery. This section holds the parameters for the generation of this classical signal.

signal_frequency: float = 20e6

Frequency of the tone, in Hz, to send as the classical recovery signal.

signal_amplitude: float = 1

Amplitude of the tone to send (this will then be multiplied by the amplitude of the DAC to get the physical amplitude).

Bob

This section holds the configuration relative to Bob.

export_directory: str = "export"

Path of the directory for the auto-export features of Bob.

eta: float = 0.8

Value of the receiver’s globale efficiency (on the signal path). This will be used to compute the excess noise at Alice’s side, the transmittance and the secret key rate.

automatic_shot_noise_calibration: bool = "False"

If True, an automatic shot noise calibration, Bob will automatically perform a shot noise calibration before the start of each Quantum Information Exchange (QIE). If False, the shot noise calibration should either done once prior to exchanges or using the automatic calibration with the switch (see later).

Warning

It is highly recommended to use one of the two automatic calibration method for the shot noise.

schema: str = "qosst_core.schema.detection.SINGLE_POLARISATION_RF_HETERODYNE"

Detection schema. The list of possible detection schemas is available here. The schema should be a valid instance of qosst_core.schema.detection.DetectionSchema.

Network

This section holds the network configuration of Bob.

server_address: str = "127.0.0.1"

Network address to connect to.

server_port: int = 8181

Network port to connect to.

ADC

This section holds the ADC configuration of Bob.

rate: int = 2500e6

Rate of the ADC of Bob in Samples/second. The scientific notation e (2500e6 for instance) is available.

device: str = "qosst_hal.dac.FakeADC"

Import path of the DAC class to use. The DAC should be a valid class, inheriting from qosst_hal.dac.GenericDAC.

channels: List[int] = [0]

List of channels to use for the ADC.

location: Any = ""

Location of the ADC device.

acquisition_time: float = 0

Duration of the acquisition, in seconds. If 0 is given, the acquisition time will be computed as

\[t = \frac{N_{sym}}{R_s} + t_{overhead}\]

where \(N_{sym}\) is the number of symbols, \(R_s\) the rate of symbols and t_{overhead} the overhead time define as the next parameter.

overhead_time: float = 0

Overhead time, in seconds, that will be added to the symbols emission time. If the acquisition_time parameter is 0, this parameter is ignored.

If the acquisition_time parameter is 0, he acquisition time will be computed as

\[t = \frac{N_{sym}}{R_s} + t_{overhead}\]

where \(N_{sym}\) is the number of symbols, \(R_s\) the rate of symbols and t_{overhead} the overhead time define as the next parameter.

Warning

For an experimental system, it’s always better to use the acquisition_time parameter to have a better control on what is done.

extra_args: dict = {}

Dict of arguments that will be passed as kwargs to the __init__ method of the ADC. For instance, the dict {"erase":true} would be equivalent to the python call adc = ADC(erase=True).

extra_acquisition_parameters: dict = {}

Dict of arguments that will be passed as kwargs to the set_acquisition_parameters method of the ADC. For instance, the dict {"paths":"test.npy"} would be equivalent to the python call adc.set_acquisition_parameters(..., paths="test.npy").

Switch

This section holds the configuration for the switch of Bob, that is used to “cut” the signal input for calibration.

device: str = "qosst_hal.switch.FakeSwitch"

Import path of the switch class to use. The switch should be a valid class, inheriting from qosst_hal.switch.GenericSwitch.

location: Any = ""

Location of the switch device.

timeout: int = 100

Timeout for communication with the switch, in seconds.

signal_state: int = 100

State that will be used for the signal (i.e. the switch is ON).

calibration_state: int = 100

State that will be used for the calibration (i.e. the switch is OFF).

switching_time: int = 0

Time to wait before switching back to the signal state and send the trigger to Alice.

If this value is not 0, the first part of the acquired signal will be used to calibrate the shot noise (the part that is ensured to be before the switch).

If 0 the calibration should be done manually (the switch won’t automatically switch in the calibration state before).

Laser

This section holds the configuration for the laser of Bob.

device: str = "qosst_hal.laser.FakeLaser"

Import path of the laser class to use. The laser should be a valid class, inheriting from qosst_hal.laser.GenericLaser.

location: str = ""

Location of the laser device.

parameters: dict = {}

Dict of arguments that will be passed to the set_parameters method of the laser. This could be the power, the frequency, etc… This depends on the specific laser class that is used.

Polarisation recovery

The polarisation recovery is done by Alice sending a strong classical signal and Bob searching for the optimal position using a motorised polarisation controller, a polarisation beam splitter and a powermeter.

use: bool = False

Whether or not to use the polarisation recovery algorithm.

step: float = 1

Step to use for the search. The unit depends on the polarisation controller used.

start_course: float = 0

First value of the search. The unit depends on the polarisation controller used.

end_course: float = 0

Last value of the search. The unit depends on the polarisation controller used.

wait_time: float = 0

Wait time, in seconds, between two positions of the search.

Polarisation Controller

This section is for the polarisation controller to use for polarisation recovery.

device: str = "qosst_hal.polarisation_controller.FakePolarisationController"

Class of the device to use for the polarisation controller.

location: str = ""

Location of the polarisation controller.

Powermeter

This section is for the powermeter to use for polarisation recovery.

device: str = "qosst_hal.polarisation_controller.FakePowerMeter"

Class of the device to use for the powermeter.

location: str = ""

Location of the powermeter.

timeout: int = 10

Timeout for the powermeter.

DSP

This section holds the different parameters that will be used during the Digital Signal Processing of Bob.

This section holds the parameters for the Digital Signal Processing of Bob. A brief discussion of each parameter is present for each of them, but the reader should also refers to the documentation of the Digital Signal Processing of Bob in qosst-bob.

debug: bool = True

If True, a qosst_bob.dsp.dsp.DSPDebug object is returned by the DSP with more information.

Note

The information contained in this object is:

  • Begin and end of the Zadoff-Chu sequence;

  • Begin and end of the data;

  • Arrays containing the tones;

  • Uncorrected data;

  • Frequencies of pilots and beat;

  • Difference of frequencies between the pilots and clock correction.

fir_size: int = 500

Number of taps for the Finite Impulse Response (FIR) filters.

Note

Those filters are mainly used to filter the tones.

tone_filtering_cutoff: float = 10e6

Cut-off frequency for the filtering of the pilots in Hz.

Note

Once the pilot as been detected by a maximum peak searching in frequency, yielding the frequency \(f_{tone}\), the tone is filtered with a FIR filter on the frequency region

\[\left[f_{tone} - f_{cutoff}, f_{tone}+f_{cutoff}\right]\]
process_subframes: bool = False

In general, the Digital Signal Processing algorithm can operate in two ways:

  1. In the first way, the whole process is done on the whole data

  2. In the second way, the data is separated into smaller chunk to apply the carrier frequency estimation, the phase compensation, the downsampling for each chunk.

The second way is called subframes and is useful if some parameters are varying, as for instance the beat frequency between the two lasers.

This parameter controls if the data should be processed as subframes (True) or not (False).

subframes_size: int = 0

The size of the subframes can be adjusted by choosing how many symbols should be recovered in each subframes.

This parameter should not be 0 if process_subframes is True.

abort_clock_recovery: float = 0

The clock recovery algorithm uses the difference pilots frequencies to estimate the clock difference. However, in some cases this algorithm can fail, and it is better to leave the clock uncorrected than corrected with the wrong correction. This parameters determine the maximum ratio between the two clocks allowed for clock correction before it aborts.

Letting the value of 0 will ensure that the algorithm never aborts.

alice_dac_rate: int = 500e6

Rate of the DAC of Alice in Samples per second.

Bob’s Digital Signal Processing requires the knowledge of Alice’s rate.

exclusion_zone_pilots: List[List[float, float]] = [[0.0, 100e3]]

Exclusion zone for the search of the pilots. This is represented as a list of lists. The insides tuple should be a of length 2, where the first element is the beginning of the exclusion zone (included) and the second element is the end of the exclusion zone (also included).

Note

If you consider this as being \([[a_1, b_1], [a_2, b_2], ..., [a_n, b_n]]\), then the union of intervals

\[U = \bigcup_{1\leq i \leq n} [a_i, b_i]\]

will be ignored for pilots searching.

pilot_phase_filtering_size: int = 0

Before phase compensation, the phase is filtered using an uniform filter. This parameter represents the size of this filter.

If this parameter is 0, then the filter is not applied.

num_samples_fbeat_estimation: int = 100000

In the general case, the carrier frequency should be found before precise synchronisation. For this, the synchronisation sequence is found with low precision and a chunk of data is used to estimate the beat frequency. This parameter controls the size of this chunk.

Equalizer

This section holds the parameters for the equalizer, that is part of the Digital Signal Processing (experimental).

More information on the equalizer can be found in the documentation of qosst-bob.

Warning

Equalizer is marked as experimental for now.

equalize: bool = False

If True, the Constant Modulus Algorithm (CMA) equalizer will be used.

length: int = 100

Length of the equalizer filter.

step: float = 0.01

Step of the equalizer.

p: int = 2

Parameter p for the equalizer.

q: int = 2

Parameter q for the equalizer.

Parameters estimation

This section hodls the configuration to perform parameters estimation.

estimator: str = "qosst_core.parameters_estimation.NoneEstimator"

Import path of the estimator class to use. The estimator should be a valid class, inheriting from qosst_core.parameters_estimation.BaseEstimator.

skr_calculator: str = "qosst_core.skr_computations.NoneSKRCalculator"

Import path of the Secret Key Rate (SKR) calculator class to use. The calculator should be a valid class, inheriting from qosst_core.skr_computations.BaseCVQKDSKRCalculator.

ratio: float = 0.5

Ratio of data to use for the estimation of the parameters. For instance, if the value is 0.5, 50% of the data will be used for the estimations. If it’s 0.10, 10% will be used for the estimations.

Warning

This value should be be between 0 and 1.

Electronic noise

This section holds the configuration to load and save the electronic noise calibration.

path: str = "electronic_noise.qosst"

Path used to load and save the electronic noise object (qosst_bob.data.ElectronicNoise).

Electronic shot noise

This section holds the configuration to load and save the electronic and shot noise calibration.

path: str = "electronic_shot_noise.qosst"

Path used to load and save the electronic and shot noise object (qosst_bob.data.ElectronicShotNoise).

This will not be used in case automatic shot noise calibration is used.

Frame

This section holds the description of the CV-QKD frame, that is common to Alice and Bon.

num_zeros_start: int = 0

Number of zeros to prepend to the final sequence before emission.

num_zeros_end: int = 0

Number of zeros to append to the final sequence before emission.

Pilots

This section holds the configuration for the classical pilots that are used for clock correction, carrier frequency recovery and phase compensation.

num_pilots: int = 2

Number of pilots to multiplex to the quantum data.

Note

In the general case, two pilots are required.

frequencies: List[float] = [200e6, 220e6]

List of frequencies for the pilots, in Hz. The scientific notation e is available.

Warning

The length of the list should be the equal to the number of pilots.

amplitudes: List[float] = [0.4, 0.4]

List of amplitudes for the pilots.

Warning

The length of the list should be the equal to the number of pilots.

Note

The sequence at Bob side is always generated between +1 and -1, and those amplitudes are relative to those limits.

Quantum

This section holds the configuration for the quantum data ion the frame.

num_symbols: int = 1000000

Number of symbols to generate / to expect to receive.

frequency_shift: float = 100e6

Frequency shift of the quantum data in Hz.

pulsed: bool = False

If True, the pulse shaping will be regular pulses in time. If False, Nyquist pulse shaping is used.

Warning

Not real exchange were made in the pulsed regime.

symbol_rate: int = 100e6

Symbol rate in Symbols/second (Baud).

roll_off: float = 0.5

Value of the Roll-Off factor for the Root Raised Cosine (RRC) filter.

Warning

This value should be between 0 and 1.

variance: float = 0.01

Variance for the generation of the quantum symbols, again relative to the +1 and -1 limits.

Warning

This value is not directly \(V_a\) but \(V_a\) is proportional to this value.

modulation_type: str = qosst_core.modulation.GaussianModulation

Import path of the modulation class to use. The modulation should be a valid class, inheriting from qosst_core.modulation.modulation.Modulation .

modulation_size: int = 0

Size of the modulation for discrete modulations. This value is ignored for continuous modulations such as the Gaussian modulation.

Warning

Depending of the modulation, there might be additional constraints on this number such as being a power of 2 (PSK and QAM), or being a perfect square (QAM).

Zadoff-Chu

This configuration holds the configuration for the Zadoff-Chu sequence that is used for synchronisation.

root: int = 5

Root of the Zadoff-Chu sequence. This value should be coprime with the length of the Zadoff-Chu sequence.

length: int = 3989

Length of the Zadoff-Chu sequence. This value should be coprime with the root of the Zadoff-Chu sequence.

rate: int = 0

Rate of the Zadoff-Chu sequence in Samples/second. The notation e is available.

If 0 is used, the Zadoff-Chu is emitted at the maximal rate (i.e. the rate of Alice’s DAC).

Example configuration file

Below is displayed the example configuration file as provided in the qosst-core package.

# QOSST configuration file.
# This is an example configuration file that can be inputted
# to the configuration parser.
# Please refer to the documentation for more details.

# The label of your config
# in case you have different configuration
# Default : Example config
label = "Example config"

# Serial number
# Default : ""
serial_number = ""

[logs]

# If true, logs are saved in a file. If false
# logs are not saved in a file.
# This does not concern console or GUI logs.
# Default : true
logging = true

# The path where to save the logs.
# Default : "qosst.log"
path = "qosst.log"

# Log level. Choices are (in ascending order): debug, info, warning, 
# error, critical.
# Any level includes the logs of the level and above (for instance
# warning includes warning, error and critical).
# Default : "info"
level = "info"

[notifications]

# Notify
# If true, notifications will be enabled. If false,
# they will be disabled.
# Default : false
notify = false

# Notifier class.
# The notifier should be a valid class, inheriting from 
# qosst_core.notifications.QOSSTNofitier.
# Default : "qosst_core.notifications.FakeNotifier"
notifier_class = "qosst_core.notifications.FakeNotifier"

# Notifier args.
# to pass to initiate the notifier. For instance, using 
# {token = "plop"} would call the notifier with Notifier(token="plop")
# Default : {}
notifier_args = {}

[authentication]
# Authentication class
# The authenticator should be a valid class, inheriting from
# qosst_core.authentication.base.BaseAuthenticator.
# Default : "qosst_core.authentication.NoneAuthenticator"
authentication_class = "qosst_core.authentication.NoneAuthenticator"

# Authentication params
# You can use the special from_file to read values from a file
# Example : {secret_key = "from_file()", remote_public_key = "from_file()"}
# Default : {}
authentication_params = {}

[clock]
# Assume physical clock sharing or not ?
# Default : false
sharing = false

# Clock master.
# The clock master is the one emitting the clock reference.
# Valid choices are "alice" and "bob"
# Default : "alice"
master = "alice"

[local_oscillator]
# Is the local oscillator shared between Alice and Bob ?
# Default : false
shared = false

[channel]

[channel.voa]

# Use VOA to emulate a channel.
# Default : false
use = false

# Applier
# This can be either Alice or Bob. The other party will ignore this section.
# It's also possible to not configure this section on the inactive party.
# Default : "alice"
applier = "alice"

# The class of the VOA to use.
# This should be a valid class, inheriting from qosst_hal.voa.GenericVOA.
# Default : "qosst_hal.voa.FakeVOA"
device = "qosst_hal.voa.FakeVOA"

# Location of the device
# Default : ""
location = ""

# Value to apply to the VOA
# Default : 0
value = 0

# Extras arguments to the VOA class.
# They will be passed as kwargs.
# For instance having extra_args = {"min_value": 0}
# would be equivalent to call the VOA with VOA(..., min_value=0)
# Default : {}
extra_args = {}


[alice]

# The conversion factor from the monitoring photodiode to 
# Alice's actual output.
# Default : 1
photodiode_to_output_conversion = 1


# Emission wavelength in m.
# This wavelength is used to compute the energy of the single
# photon when computing <n>.
# Default: 1550e-9
emission_wavelength = 1550e-9

# Artificial excess noise.
# Warning : this parameter should always be put to 0
# for most of the software operation since this parameter will add
# noise to the data generated by Alice, that will not be registered in
# Alice's symbol.
# Default : 0
artificial_excess_noise = 0

# Schema for the emission
# See the list of possible schema in qosst_core.schema.emission
# Default : "qosst_core.schema.emission.SINGLE_POLARISATION_SINGLE_SIDEBAND"
schema = "qosst_core.schema.emission.SINGLE_POLARISATION_SINGLE_SIDEBAND"

[alice.signal_generation]

# Symbols path
# Path for the symbols.
# If save_symbols is true, this will 
# be used as location to save the symbols
# If load_symbols is true, this will
# be used as the location to load the symbols from.
# Default : "symbols.npy"
symbols_path = "symbols.npy"

# Final sequence path
# Path for the final sequence.
# If save_final_sequence is true, this will
# be used as location to save the final sequence
# If load_final_sequence is true, this will
# be used as the location to load the final sequence from.
# Default : "final_sequence.npy"
final_sequence_path = "final_sequence.npy"

# Quantum sequence path.
# To be used when the quantum sequence is saved.
# Default : "quantum_sequence.npy"
quantum_sequence_path = "quantum_sequence.npy"

# Load symbols
# If true, symbols will be loaded from a numpy file and not
# the entropy source.
# The parameter symbols_path will be used.
# Default : false
load_symbols = false

# Load final sequence
# If true, the final sequence will be loaded from the numpy
# file, and the DSP will be bypassed.
# The parameter final_sequence_path will be used.
# Default : false
load_final_sequence = false

# Save symbols
# If true, symbols will be saved to a numpy file.
# The parameter symbols_path will be used.
# Default : true
save_symbols = true

# Save final sequence
# If true, the final sequence will be saved to a numpy file.
# The parameter final_sequence_path will be used.
# Default : false
save_final_sequence = false

# Save quantum sequence
# If true, the quamtum sequence (i.e. only composed of the quantum symbols
# after DSP) will be saved to a numpy file.
# The parameter quantum_sequence_path will be used.
# Default : false
save_quantum_sequence = false

[alice.network]
# The address on which Alice listens
# Default : "127.0.0.1"
bind_address = "127.0.0.1"

# The port on which alice listens
# Default : 8181
bind_port = 8181

[alice.dac]
# Rate of the DAC (in Samples/second)
# Default : 500e6
rate = 500e6

# Amplitude, in V
# The generated data by the DSP will be between +1 and -1
# If the amplitude is A, then this means that the +1 will be
# mapped to +A V and the -1 to -A V.
# For this reason, the amplitude should be between 0 V and 
# the maximum output voltage
# Default : 0
amplitude = 0

# The class of the DAC to use.
# This should be a valid class, inheriting from qosst_hal.dac.GenericDAC.
# Default : "qosst_hal.dac.FakeDAC"
device = "qosst_hal.dac.FakeDAC"

# List of channels to use.
# Default : [0,1]
channels = [0,1]

# Extras arguments to the DAC class.
# They will be passed as kwargs.
# For instance having extra_args = {"erase": true}
# would be equivalent to call the dac with DAC(..., erase=True)
# Default : {}
extra_args = {}

[alice.powermeter]

# The class of the power meter to use.
# This should be a valid class, inheriting from qosst_hal.powermeter.GenericPowerMeter.
# Default : "qosst_hal.powermeter.FakePowerMeter"
device = "qosst_hal.powermeter.FakePowerMeter"

# Location of the device
# Default : ""
location = ""

# Timeout of the device
# Default : 10
timeout = 10

[alice.voa]

# The class of the VOA to use.
# This should be a valid class, inheriting from qosst_hal.voa.GenericVOA.
# Default : "qosst_hal.voa.FakeVOA"
device = "qosst_hal.voa.FakeVOA"

# Location of the device
# Default : ""
location = ""

# Value to apply to the VOA
# Default : 0
value = 0

# Extras arguments to the VOA class.
# They will be passed as kwargs.
# For instance having extra_args = {"min_value": 0}
# would be equivalent to call the VOA with VOA(..., min_value=0)
# Default : {}
extra_args = {}

[alice.modulator_bias_control]

# The class of the bias controller to use.
# This should be a valid class, inheriting from qosst_hal.modulator_bias_controller.GenericModulatorBiasController.
# Default : "qosst_hal.modulator_bias_control.FakeModulatorBiasController"
device = "qosst_hal.modulator_bias_control.FakeModulatorBiasController"

# Location of the device
# Default : ""
location = ""

# Extras arguments to the bias controller class.
# They will be passed as kwargs.
# For instance having extra_args = {"sleep_time": 30}
# would be equivalent to call the bias controller with Controller(..., sleep_time=30)
# Default : {}
extra_args = {}

[alice.laser]

# The class of the laser to use.
# This should be a valid class, inheriting from qosst_hal.laser.GenericLaser.
# Default : "qosst_hal.laser.FakeLaser"
device = "qosst_hal.laser.FakeLaser"

# Location of the laser.
# Default : ""
location = ""

# The parameters to pass to the set_parameters method.
# This depends on the specific laser used.
# Default : {}
parameters = {}

[alice.polarisation_recovery]

# Section for polarisation recovery through the use of a motorized polarisation controller.

# Frequency of the signal to send to Bob for polarisation recovery, in Hz.
# Default : 20e6
signal_frequency = 20e6

# Amplitude of the signal to send to Bob for polarisation recovery (this does not override 
# the amplitude of the DAC, it has to be seen like the amplitude of the pilots).
# Default : 1
signal_amplitude = 1


[bob]
# Export directory
# For data and figures
# Default : export
export_directory = "export"

# Global efficiency of the receiver
# Must be between 0 and 1.
# Default : 0.8
eta = 0.8

# Automatic shot noise calibration.
# If true the client will automatically calibrate 
# the shot noise just before trigerring Alice.
# Default: false
automatic_shot_noise_calibration = false

# Schema for the detection
# See the list of possible schema in qosst_core.schema.detection
# Default : "qosst_core.schema.detection.SINGLE_POLARISATION_RF_HETERODYNE"
schema = "qosst_core.schema.detection.SINGLE_POLARISATION_RF_HETERODYNE"

[bob.network]
# Address to connect to
# Default : 127.0.0.1
server_address = "127.0.0.1"

# Port to connect to
# Default : 8181
server_port = 8181

[bob.adc]
# Rate of the ADC (in Samples/second)
# Default : 2500e6
rate = 2500e6

# Device to use as the ADC
# This should be a valid class, inheriting from qosst_hal.adc.GenericADC.
# Default : FakeADC
device = "qosst_hal.adc.FakeADC"

# List of channels to use
# Default : [0]
channels = [0]

# Location of the device
# Default : ""
location = ""

# Acquisition time in seconds.
# The acquisition time should be either a strictly
# positive number of 0. If 0 is given, then the acquisition
# time will be automatically computed from the other parameters
# Default : 0
acquisition_time = 0

# Overhead time in seconds.
# Overhead time when you automatically compute the acquisition time
# This globally is the overhead created by the classical communication
# The acquisition time would be computed as nb_samples / rate + overhead
# Default: 0
overhead_time = 0

# Extra arguments to the ADC class.
# They will be passed as kwargs.
# For instance having extra_args = {"erase": true}
# would be equivalent to call the adc with ADC(..., erase=True)
# Default : {}
extra_args = {}

# Extra acquisition parameters to the ADC class.
# They will be passed as kwargs.
# For instance having extra_args = {"paths": "test.npy"}
# would be equivalent to call the method with set_acquisition_parameters(..., paths="test.npy")
# Default : {}
extra_acquisition_parameters = {}

[bob.switch]

# Device for the switch.
# This should be a valid class, inheriting from qosst_hal.switch.GenericSwitch.
# Default : "FakeSwitch"
device = "qosst_hal.switch.FakeSwitch"

# Location of the switch.
# Default : ""
location = ""

# Timeout of the switch in seconds.
# Default : 100
timeout = 100

# State that should be used for the signal.
# Default : 1
signal_state = 1

# State that should be used for calibration.
# Default : 2
calibration_state = 2

# Switch time
# Time to wait before switching back to the signal state
# and send the trigger to Alice.
# If 0 the calibration should be done manually (the switch won't
# automatically switch in the calibration state before).
# Default : 0
switching_time = 0

[bob.laser]

# The class of the laser to use.
# This should be a valid class, inheriting from qosst_hal.laser.GenericLaser.
# Default : "qosst_hal.laser.FakeLaser"
device = "qosst_hal.laser.FakeLaser"

# Location of the laser.
# Default : ""
location = ""

# The parameters to pass to the set_parameters method.
# This depends on the specific laser used.
# Default : {}
parameters = {}

[bob.polarisation_recovery]
# Section for polarisation recovery through the use of a motorized polarisation controller.

# If true, use the polarisation recovery.
# Default : false
use = false

# Step (unit depending on the polarisation controller used) for the 
# optimal polarisation finding algorithm.
# Default : 1
step = 1

# Start course (unit depending on the polarisation controller used) for the
# optimal polarisation finding algorithm (it will start at this value and 
# will go to the end value with a the step set above).
# Default : 0
start_course = 0

# End course (unit depending on the polarisation controller used) for the 
# optimal polarisation finding algorithm (it will end at this value, excluded).
# Default : 0
end_course = 0

# Wait time in seconds between two positions.
# Default : 0
wait_time = 0

[bob.polarisation_recovery.polarisation_controller]

# The class of polarisation controller to use.
# This should be a valid class, inheriting from qosst_hal.polarisation_controller.GenericPolarisationController.
# Default : "qosst_hal.polarisation_controller.FakePolarisationController"
device = "qosst_hal.polarisation_controller.FakePolarisationController"

# Location of the polarisation controller.
# Default : ""
location = ""

[bob.polarisation_recovery.powermeter]

# The class of powermter to use.
# This should be a valid class, inheriting from qosst_hal.powermeter.GenericPowerMeter.
# Default : "qosst_hal.powermeter.FakePowerMeter"
device = "qosst_hal.powermeter.FakePowerMeter"

# Location of the powermeter
# Default : ""
location = ""

# Timeout for the powermeter
# Default : 10
timeout = 10

[bob.dsp]

# Debug mode.
# If True, a DSPDebug object is returned with additional information.
# Default : true
debug = true

# Size for the FIR filters.
# Default : 500
fir_size = 500

# Value of cutoff for the FIR filter to filter the tone.
# The cutoff means that the filter will filter between tone_freq +/- cutoff
# and have a frequency width of 2*cutoff.
# Default : 10e6
tone_filtering_cutoff = 10e6

# Set true to process the data in subframes
# Default : false
process_subframes = false

# Size of the subframes if process_subframes is true
# Default : 0
subframes_size = 0

# Abort clock recovery
# If the difference of clock mismatch (in ratio)
# is greater than this parameter, then the 
# clock recovery abort and assumes adc_rate
# is the good rate
# If this is 0, never abort.
# Default : 0
abort_clock_recovery = 0

# Alice DAC rate (Samples/second)
# Default : 500e6
alice_dac_rate = 500e6

# Exclusion zone for pilot search
# This is represented as a list of lists. The insides tuple should be a of length 2,
# where the first element is the beginning of the exclusion zone (included)
# and the second element is the end of the exclusion zone (also included).
# Default: [[0.0, 100e3]]
exclusion_zone_pilots = [[0.0, 100e3]]

# Size of filter for the phase recovery
# If not 0, the recovered phase will be filter with
# a uniform1d filter (i.e. moving average) with the size
# defined by this parameter.
# Default: 0
pilot_phase_filtering_size = 0

# Number of samples to estimate properly
# f_beat in general dsp
# Default : 100000
num_samples_fbeat_estimation = 100000

[bob.dsp.equalizer]

# If true, use the CMA equalizer.
# Default: false
equalize = false

# Length of the CMA equalizer.
# Default: 100
length = 100

# Step size for the CMA equalizer.
# Default: 0.01
step = 0.01

# P-parameter of the CMA equalizer.
# Default: 2
p = 2

# Q-parameter of the CMA equalizer.
# Default: 2
q = 2

[bob.parameters_estimation]

# Estimator to use for the estimation of the parameters.
# This should be a valid class, inheriting from 
# qosst_core.parameters_estimation.BaseEstimator.
# Default : qosst_core.parameters_estimation.NoneEstimator
estimator = "qosst_core.parameters_estimation.NoneEstimator"

# Secret key rate calculator to use.
# This should be a valid class, inheriting from 
# qosst_core.skr_computations.BaseCVQKDSKRCalculator
# Default : qosst_core.skr_computations.NoneCalculator
skr_calculator = "qosst_core.skr_computations.NoneSKRCalculator"

# Ratio for parameters estimation. 
# A ratio of 0.1 means that 10% of the data will be used to
# estimate the parameters. A ratio of 0.5 means that 50% of
# the data will be used for parameters estimation.
# Default : 0.5
ratio = 0.5

[bob.electronic_noise]

# Path of the electronic noise file (load and save)
# Default : "electronic_noise.qosst"
path = "electronic_noise.qosst"

[bob.electronic_shot_noise]

# Path of the elctronic and shot noise file (load and save)
# This should only be used of the calibration of the electronic
# and shot noise is not automatic (i.e. the switching time
# is set to 0 in bob.switch).
# Default to electronic_shot_noise.qosst
path = "electronic_shot_noise.qosst"

[frame]

# Number of zeros to add in the start
# Default : 0
num_zeros_start = 0

# Number of zeros to add in the end
# Default : 0
num_zeros_end = 0

[frame.pilots]
# Number of pilots to insert in the signal
# Default : 2
num_pilots = 2

# Frequencies, in Hz, for the pilots as a list
# Default : [200e6, 220e6]
frequencies = [200e6, 220e6]

# List of amplitudes for the pilots.
# Default : [0.4, 0.4]
amplitudes = [0.4, 0.4]

[frame.quantum]

# Number of symbols for the quantum part
# Default : 1000000
num_symbols = 1000000

# Frequency shift, in Hz, for the quantum part
# Default : 100e6
frequency_shift = 100e6

# If true, use a rectangular filter instead of a root raised cosine filter.
# In this case the roll-off value will be used as the duty cycle value/
# Default : false
pulsed = false

# Symbol rate for the symbols, in Baud.
# Default : 100e6
symbol_rate = 100e6

# Roll off factor for the Root-Raised Cosine filter.
# If using a rectangular filter (pulsed regime), this 
# is used as the duty cycle.
# Default : 0.5
roll_off = 0.5

# Variance of Alice (relative to the -1, 1 extremums)
# Default : 0.01
variance =  0.01

# Modulation type.
# This should be a valid class, inheriting from
# qosst_core.modulation.modulation.Modulation.
# Default : "qosst_core.modulation.GaussianModulation"
modulation_type = "qosst_core.modulation.GaussianModulation"

# Size of constellation
# Let 0 for Gaussian
# M should be a power of 2 for PSK
# M should be a power of 2 and a square for QAM and PCS-QAM
# Default : 0
modulation_size = 0

[frame.zadoff_chu]
# The root of the Zadoff-Chu sequence.
# This should be comprime with the length.
# Default : 5
root = 5

# The length of the Zadoff-Chu sequence.
# This should be coprime with the root.
# Default : 3989
length = 3989

# The rate of the Zadoff-Chu sequence in Samples/s.
# A rate of 0 will be understood as to use the same rate as the DAC.
# Default : 0
rate = 0