Configuration
This is the configuration module.
- It contains :
the class to read the configuration from a toml file and access it in a nice way;
exceptions that are raised during the reading of the configuration file;
commands to create and check a configuration file, that can be called from the qosst entrypoint;
and the basic configuration example file.
Alice
Configuration for Alice section.
- class qosst_core.configuration.alice.AliceSignalGenerationConfiguration(config: Dict)
Class holding Alice’s Signal Generation Configuration. It should be initialized with the alice.signal_generation section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- symbols_path: str
Symbols path to load or save.
- final_sequence_path: str
Final sequence path to load or save.
- quantum_sequence_path: str
Quantum sequence path to save.
- load_symbols: bool
Boolean to know if symbols have to be generated or loaded.
- load_final_sequence: bool
Boolean to know if the final sequence have to be computed or loaded.
- save_symbols: bool
Boolean to know if the symbols have to be saved.
- save_final_sequence: bool
Boolean to know if the final sequence has to be saved.
- save_quantum_sequence: bool
Boolean to know if the quantum sequence has to be saved.
- DEFAULT_SYMBOLS_PATH: str = 'symbols.npy'
Default symbols path.
- DEFAULT_LOAD_SYMBOLS: bool = False
Default value for load symbols.
- DEFAULT_LOAD_FINAL_SEQUENCE: bool = False
Default value for load final sequence.
- DEFAULT_SAVE_SYMBOLS: bool = True
Default value for save symbols.
- DEFAULT_SAVE_FINAL_SEQUENCE: bool = False
Default value for save final sequence.
- from_dict(config: dict) None
Fill instance from dict.
- Parameters:
config (dict) – dict holding the configuration for the alice.signal_generation function.
- class qosst_core.configuration.alice.AliceNetworkConfiguration(config: Dict)
Class holding the configuration for Alice network. It should be intialized with the alice.network section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- bind_address: str
Address on which Alice listens.
- bind_port: int
Port on which Alice listens
- DEFAULT_BIND_ADDRESS: str = '127.0.0.1'
Default address
- DEFAULT_BIND_PORT: int = 8181
Default port
- from_dict(config: dict) None
Fill instance form dict.
- Parameters:
config (dict) – dict corresponding to the alice.network section.
- class qosst_core.configuration.alice.AliceDACConfiguration(config: Dict)
Class holding the configuration for Alice DAC. It should be initialized with the alice.dac section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- rate: float
Rate of the DAC, in Samples/second.
- amplitude: float
Amplitude of the DAC, in V.
- device: Type[GenericDAC]
Device class of the DAC.
- channels: list
List of channels to use.
- extra_args: dict
Extra args to pass to the DAC class.
- DEFAULT_RATE: float = 500000000.0
Default rate in Samples/second.
- DEFAULT_AMPLITUDE: float = 0
Default amplitude, in V.
- DEFAULT_DEVICE_STR: str = 'qosst_hal.dac.FakeDAC'
Default class of the DAC.
- DEFAULT_CHANNELS: list = [0, 1]
Default channels to use.
- DEFAULT_EXTRA_ARGS: dict = {}
Default extra args for the DAC.
- from_dict(config: dict) None
Fill instance from dict.
- Parameters:
config (dict) – dict corresponding to the alice.dac section
- Raises:
InvalidConfiguration – if the dac class cannot be loaded.
InvalidConfiguration – if the dac device is not a subclass of GenericDAC
- class qosst_core.configuration.alice.AlicePowerMeterConfiguration(config: Dict)
Configuration for Alice’s powermeter section. It should be initialized with the alice.powermeter section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- device: Type[GenericPowerMeter]
Device class to use as powermeter.
- location: str
Location of the powermeter
- timeout: int
Timeout for the connection
- DEFAULT_LOCATION: str = ''
Default location
- DEFAULT_TIMEOUT: int = 10
Default timeout
- from_dict(config: dict)
Fill the instance from dict.
- Parameters:
config (dict) – dict corresponding to the alice.powermeter section.
- Raises:
InvalidConfiguration – if the powermeter class cannot be loaded.
InvalidConfiguration – if the device class is not a subclass of GenericPowerMeter.
- class qosst_core.configuration.alice.AliceVOAConfiguration(config: Dict)
Configuration for Alice’s VOA section. It should be initialized with the alice.voa section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- device: Type[GenericVOA]
Device class to use as VOA.
- location: str
Location of the VOA
- value: float
Value to apply to the VOA.
- extra_args: dict
Extra args to pass to the VOA.
- DEFAULT_DEVICE_STR: str = 'qosst_hal.voa.FakeVOA'
Default device class
- DEFAULT_LOCATION: str = ''
Default location
- DEFAULT_VALUE: float = 0
Default value to apply to the VOA.
- DEFAULT_EXTRA_ARGS: dict = {}
Default extra args to pass as parameters.
- from_dict(config: dict)
Fill the instance from dict.
- Parameters:
config (dict) – dict corresponding to the alice.voa section.
- Raises:
InvalidConfiguration – if the voa class cannot be loaded.
InvalidConfiguration – if the device class is not a subclass of GenericVOA.
- class qosst_core.configuration.alice.AliceModulatorBiasControlConfiguration(config: Dict)
Configuration for Alice’s bias modulator section. It should be intialized with the alice.modulator_bias_control section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- device: Type[GenericModulatorBiasController]
Device class to use as bias controller.
- location: str
Location of the bias controller.
- extra_args: dict
Extra args to pass to the bias controller.
- DEFAULT_LOCATION: str = ''
Default location
- DEFAULT_EXTRA_ARGS: dict = {}
Default extra args to pass as parameters.
- from_dict(config: dict)
Fill the instance from dict.
- Parameters:
config (dict) – dict corresponding to the alice.modulator_bias_control section.
- Raises:
InvalidConfiguration – if the device class cannot be loaded.
InvalidConfiguration – if the device class is not a subclass of GenericModulatorBiasController.
- class qosst_core.configuration.alice.AliceLaserConfiguration(config: Dict)
Configuration for Alice’s laser section. It should be loaded with the alice.laser section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- device: Type[GenericLaser]
Device class to use as laser.
- location: str
Location of the laser.
- parameters: dict
Parameters to pass to the laser.
- DEFAULT_DEVICE_STR: str = 'qosst_hal.laser.FakeLaser'
Default device class
- DEFAULT_LOCATION: str = ''
Default location
- DEFAULT_PARAMETERS: dict = {}
Default parameters to pass to the laser.
- from_dict(config: dict)
Fill the instance from dict.
- Parameters:
config (dict) – dict corresponding to the alice.laser section.
- Raises:
InvalidConfiguration – if the device class cannot be loaded.
InvalidConfiguration – if the device class is not a subclass of GenericLaser.
- class qosst_core.configuration.alice.AlicePolarisationRecoveryConfiguration(config: Dict)
Configuration for automatic polarisation recovery.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- signal_frequency: float
Frequency of the signal to send to Bob.
- signal_amplitude: float
Amplitude of the signal to send to Bob.
- DEFAULT_SIGNAL_FREQUENCY: float = 20000000.0
Default value of 20MHz for the frequency.
- DEFAULT_SIGNAL_AMPLITUDE: float = 1.0
Default value for the amplitude.
- from_dict(config: Dict) None
Load data from a dict.
- Parameters:
config (Dict) – dict corresponding to the alice.polarisation_recovery section.
- class qosst_core.configuration.alice.AliceConfiguration(config: Dict)
Complete Alice configuration. It should be initialized with the alice section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- photodiode_to_output_conversion: float
Ratio of conversion from the monitoring photodiode to Alice’s output.
- emission_wavelength: float
Wavelength of emission used in the measurement of <n>.
- artificial_excess_noise: float
Artificial excess noise to add to the generatred signal but not save symbols.
- schema: EmissionSchema
Schema of emission.
- network: AliceNetworkConfiguration
Network configuration object
- dac: AliceDACConfiguration
DAC configuration object
- signal_generation: AliceSignalGenerationConfiguration
Signal generation configuration object
- powermeter: AlicePowerMeterConfiguration
PowerMeter configuration object
- voa: AliceVOAConfiguration
VOA configuration object.
- modulator_bias_control: AliceModulatorBiasControlConfiguration
Bias controller configuration object.
- laser: AliceLaserConfiguration
Laser configuration object.
- polarisation_recovery: AlicePolarisationRecoveryConfiguration
Polarisation recovery configuration.
- from_dict(config: dict) None
Fill instance from dict
- Parameters:
config (dict) – dict corresponding to the alice section
- Raises:
InvalidConfiguration – if the emission schema cannot be loaded.
InvalidConfiguration – if the emission schema is not an instance of
qosst_core.schema.emission.EmissionSchema.
Authentication
Class for Authentication Configuration.
- class qosst_core.configuration.authentication.AuthenticationConfiguration(config: Dict)
Class for Authentication Configuration. It should be initialized with the authentication section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- authentication_class: Type[BaseAuthenticator]
The authentication class.
- authentication_params: Dict
Dict of parameters to pass to the authentication class.
- DEFAULT_AUTHENTICATION_PARAMS: Dict = {}
Default parameters for the authentication class.
- from_dict(config: Dict) None
Load the class from a dict. The dict should correspond to the authentication section.
For the authentication_params, if the from_file key is present, the value is loaded from the file as a json object. The value associated with the from_file key (which was before the path of the file) is replaced with the loaded value from the file.
- Parameters:
config (Dict) – the authentication section of the configuration file.
- Raises:
InvalidConfiguration – if the authentication class cannot be loaded.
InvalidConfiguration – if the authentication class is not a subclass of
qosst_core.authenticator.BaseAuthenticator.InvalidConfiguration – if the from_file argument was present in the authentication_params and that the file was not readable.
Base
Abstract class for QOSST Configuration.
- class qosst_core.configuration.base.BaseConfiguration(config: Dict)
Base Configuration object for QOSST (Abstract).
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- abstract from_dict(config: Dict) None
Import the configuration from a dictionnary (TOML).
- Parameters:
config (Dict) – dictionnary holding good part of the configuration.
Bob
Configuration for Bob section.
- class qosst_core.configuration.bob.BobNetworkConfiguration(config: Dict)
Class holding the configuration for Bob network. It should correspond to bob.network section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- server_address: str
Address to use for Bob
- server_port: int
Port to use for Bob
- DEFAULT_SERVER_ADDRESS: str = '127.0.0.1'
Default value for address
- DEFAULT_SERVER_PORT: int = 8181
Default value for port
- from_dict(config: dict) None
Fill instance from dict.
- Parameters:
config (dict) – dict correspoding to the bob.network section.
- class qosst_core.configuration.bob.BobADCConfiguration(config: Dict)
Class holding Bob ADC configuration. It should correspond to the bob.adc section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- rate: float
ADC rate
- device: Type[GenericADC]
ADC device to use
- channels: list
List of channels to use.
- location: Any
Location of the device to use.
- acquisition_time: float
Acquisition time, in seconds. If 0 the acquisition time should be computed automatically.
- overhead_time: float
Overhead time, in seconds, to compute the acquisition time.
- extra_args: dict
Extra args to pass to the ADC class
- extra_acquisition_parameters: dict
Extra args to pass to the set_acquisition_parameters method
- DEFAULT_RATE: float = 2500000000.0
Default ADC rate.
- DEFAULT_CHANNELS: list = [0]
Default list of channels to use.
- DEFAULT_LOCATION: str = ''
Default location.
- DEFAULT_EXTRA_ARGS: dict = {}
Default extra args for the ADC.
- DEFAULT_EXTRA_ACQUISITION_PARAMETERS: dict = {}
Default extra acquisition parameters.
- from_dict(config: dict) None
Fill instance from a dict.
- Parameters:
config (dict) – dict correspoding to the bob.adc section
- Raises:
InvalidConfiguration – If the ADC class cannot be loaded.
InvalidConfiguration – If the ADC class is not a subclass of
GenericADC.InvalidTime – if the acquisition time is not valid (strictly below 0).
InvalidTime – if the overhead time is not valid (strictly below 0).
- class qosst_core.configuration.bob.BobSwitchConfiguration(config: Dict)
Class holding switch configuration for Bob. It should correspond to the bob.switch section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- device: Type[GenericSwitch]
Device for the switch.
- location: str
Location of the switch.
- timeout: int
Timeout in seconds.
- signal_state: int
State for the signal.
- calibration_state: int
State for the calibration.
- switching_time: float
Time to wait before switching to the signal state. If 0, not automatic switching is done.
- DEFAULT_DEVICE_STR: str = 'FakeSwitch'
Default device for the switch.
- DEFAULT_LOCATION: str = ''
Default location for the switch.
- DEFAULT_TIMEOUT: int = 100
Default timeout for the switch.
- DEFAULT_SIGNAL_STATE: int = 1
Default signal state for the switch.
- DEFAULT_CALIBRATION_STATE: int = 2
Default calibration state for the switch.
- DEFAULT_SWITCHING_TIME: float = 0
Default value for the switching time.
- from_dict(config: dict)
Read configuration from dict.
- Parameters:
config (dict) – dict holding the switch part of Bob’s configuration.
- Raises:
InvalidConfiguration – if the device class cannot be loaded.
InvalidConfiguration – if the device class is found but is not a subclass of
GenericSwitch.
- class qosst_core.configuration.bob.BobPolarisationRecoveryPolarisationControllerConfiguration(config: Dict)
Class holding the configuration for the motorized polarisation controller device for automatic polarisation recovery.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- device: Type[GenericPolarisationController]
Class of the polarisation controller to use.
- location: str
Location of the device.
- DEFAULT_LOCATION: str = ''
Default location for the polarisation controller.
- from_dict(config: Dict) None
Read the configuration from dict. The dict should correspond to the bob.polarisation_recovery.polarisation_controller section.
- Parameters:
config (Dict) – dict corresponding to the bob.polarisation_recovery.polarisation_controller section.
- Raises:
InvalidConfiguration – if the class for the device cannot be loaded.
InvalidConfiguration – if the class for the device is not a subclass of qosst_hal.polarisation_controller.GenericPolarisationController.
- class qosst_core.configuration.bob.BobPolarisationRecoveryPowermeterConfiguration(config: Dict)
Configuration for the powermeter for the polarisation recovery.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- device: Type[GenericPowerMeter]
Class of device to use for the powermeter for polarisation recovery.
- location: str
Location of the powermeter for polarisation recovery.
- timeout: int
Timeout for the powermeter.
- from_dict(config: Dict) None
Load the data from dict.
- Parameters:
config (Dict) – dict corresponding ot the bob.polarisation_recovery.powermeter section.
- class qosst_core.configuration.bob.BobPolarisationRecoveryConfiguration(config: Dict)
Configuration for the automatic polarisation recovery.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- use: bool
If true, use the automatic polarisation recovery.
- step: float
Step of the polarisation recovery algorithm (unit depends on polarisation controller).
- start_course: float
Value of the first position to test.
- end_course: float
Value of the last position to test (excluded).
- wait_time: float
Wait time, in seconds, between two positions.
- polarisation_controller: BobPolarisationRecoveryPolarisationControllerConfiguration
Configuration for the polarisation controller.
- powermeter: BobPolarisationRecoveryPowermeterConfiguration
Configuration for the powermeter
- DEFAULT_USE: bool = False
Default value for use.
- DEFAULT_STEP: float = 1.0
Default value for the step.
- DEFAULT_START_COURSE: float = 0.0
Default value for the start course.
- DEFAULT_END_COURSE: float = 0.0
Default value for the end course.
- DEFAULT_WAIT_TIME: float = 0.0
Default value for the wait time.
- from_dict(config: Dict) None
Load the data from dict.
- Parameters:
config (Dict) – dict corresponding ot the bob.polarisation_recovery section.
- class qosst_core.configuration.bob.BobDSPEqualizerConfiguration(config: Dict)
Class holding the DSP CMA equalizer configuration for Bob. It should correspond to the bob.dsp.equalizer section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- DEFAULT_EQUALIZE: bool = False
Default value for the use of equalization
- from_dict(config: dict) None
Read configuration from dict.
- Parameters:
config (dict) – dict holding the equalizer part of Bob’s DSP configuration.
- class qosst_core.configuration.bob.BobDSPConfiguration(config: Dict)
Class holding DSP configuration for Bob. It should correspond to the bob.dsp section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- debug: bool
Debug mode.
- tone_filtering_cutoff: float
Cutoff for the FIR filter for the filtering of the pilot tone.
- abort_clock_recovery: float
Maximal value of clock mismatch allowed to be found by clock recovery algorithm.
- alice_dac_rate: float
DAC rate of Alice
- pilot_phase_filtering_size: int
Size of uniform1d filter for the phase recovery.
- num_samples_fbeat_estimation: int
Number of samples to estimate f_beat in general DSP.
- equalizer: BobDSPEqualizerConfiguration
The equalizer part of Bob’s DSP configuration
- DEFAULT_DEBUG: bool = True
Default value fot the debug mode.
- DEFAULT_ABORT_CLOCK_RECOVERY: float = 0
Default value for abort_clock_recovery.
- DEFAULT_ALICE_DAC_RATE: float = 500000000.0
Default value for the DAC rate of Alice.
- DEFAULT_EXCLUSION_ZONE_PILOTS: List[List[float]] = [[0.0, 100000.0]]
Default value for the exclusion zone for the search of the pilots.
- from_dict(config: dict) None
Read configuration from dict.
- Parameters:
config (dict) – dict holding the DSP part of Bob’s configuration.
- class qosst_core.configuration.bob.BobParametersEstimation(config: Dict)
Configuration for parameters estimation of Bob. It should correspond to the bob.parameters_estimation section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- estimator: Type[BaseEstimator]
The class of the estimator.
- skr_calculator: Type[BaseCVQKDSKRCalculator]
The class of the SKR calculator.
- ratio: float
Ratio of data to use for parameters estimation.
- from_dict(config: Dict) None
Load the configuration from dict.
- Parameters:
config (Dict) – dict corresponding the bob.parameters_estimation section.
- Raises:
InvalidConfiguration – if the estimator class cannot be loaded.
InvalidConfiguration – if the skr class cannot be loaded.
- class qosst_core.configuration.bob.BobLaserConfiguration(config: Dict)
Configuration for Bob’s laser section. It should correspond to the bob.laser section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- device: Type[GenericLaser]
Device class to use as laser.
- location: str
Location of the laser.
- parameters: dict
Parameters to pass to the laser.
- DEFAULT_DEVICE_STR: str = 'qosst_hal.laser.FakeLaser'
Default device class
- DEFAULT_LOCATION: str = ''
Default location
- DEFAULT_PARAMETERS: dict = {}
Default parameters to pass to the laser.
- from_dict(config: dict)
Fill the instance from dict.
- Parameters:
config (dict) – dict corresponding to the bob.laser section.
- Raises:
Exception – if the device class cannot be loaded.
Exception – if the device class is not a subclass of qosst_hal.laser.GenericLaser.
- class qosst_core.configuration.bob.BobElectronicNoiseConfiguration(config: Dict)
Class holding the configuration of the bob.electronic_noise section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- path: str
Path to load and save the electronic noise.
- DEFAULT_PATH: str = 'electronic_noise.qosst'
Default path.
- from_dict(config: dict) None
Fill the configuration from a dict.
- Parameters:
config (dict) – dict corresponding to the bob.electronic_noise section.
- class qosst_core.configuration.bob.BobElectronicShotNoiseConfiguration(config: Dict)
Class holding the configuration of the bob.electronic_shot_noise section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- path: str
Path to load and save the electronic and shot noise.
- DEFAULT_PATH: str = 'electronic_shot_noise.qosst'
Default path.
- from_dict(config: dict) None
Fill the configuration from a dict.
- Parameters:
config (dict) – dict corresponding to the bob.electronic_shot_noise section.
- class qosst_core.configuration.bob.BobConfiguration(config: Dict)
Class holding Bob configuration. It should correspond to the bob section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- export_directory: str
Path of directory where to export the data
- eta: float
Global efficiency of the detector. Must be between 0 and 1.
- automatic_shot_noise_calibration: bool
If true, shot nosie calibration is performed automatically before trigger.
- schema: DetectionSchema
Schema of detection.
- network: BobNetworkConfiguration
The netwokr configuration of Bob
- adc: BobADCConfiguration
The ADC configuration of Bob
- switch: BobSwitchConfiguration
The switch configuration
- dsp: BobDSPConfiguration
The DSP configuration
- parameters_estimation: BobParametersEstimation
The parameters estimation configuration.
- laser: BobLaserConfiguration
The laser configuration.
- polarisation_recovery: BobPolarisationRecoveryConfiguration
The polarisation recovery configuration.
- electronic_noise: BobElectronicNoiseConfiguration
The electronic noise configuration.
- electronic_shot_noise: BobElectronicShotNoiseConfiguration
The electronic and shot noise configuration.
- DEFAULT_EXPORT_DIRECTORY: str = 'export'
Default value for the export path
- DEFAULT_ETA: float = 0.8
Default value for eta
- from_dict(config: dict) None
Fill instance from the config.
- Parameters:
config (dict) – dict corresponding to the bob section.
- Raises:
InvalidEta – if eta is not between 0 and 1.
InvalidConfiguration – if the detection schema cannot be loaded.
InvalidConfiguration – if the detection schema is not an instance of
qosst_core.schema.detection.DetectionSchema.
Clock
Configuration for the clock section.
- class qosst_core.configuration.clock.ClockConfiguration(config: Dict)
Clock configuration. It should correspond to the clock section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- sharing: bool
True if clock is shared. False otherwise.
- master: Participant
Master of the sharing.
- DEFAULT_SHARING: bool = False
Default value for sharing.
- DEFAULT_MASTER: str = 'alice'
Default value for master.
- from_dict(config: dict) None
Populate instance from dict.
- Parameters:
config (dict) – part of the configuration corresponding to the clock section.
- Raises:
InvalidClockMaster – if the clock master is not alice or bob.
Config
This is the definition of configuration classes for QOSST.
Each class corresponds to a section in the .toml configuration file.
The mean configuration class is parent to the other configuration classes.
- class qosst_core.configuration.config.PickleableTomlDecoder(_dict=<class 'dict'>)
For some reason (see https://github.com/uiri/toml/issues/362), the default toml decoder is not piclkable only because of the get_empty_inline_table function.
Therefore, we take the solution proposed in the issue to make it pickable.
- get_empty_inline_table()
Reimplementation of the get_empty_inline_table to be pickable.
- class qosst_core.configuration.config.Configuration(config_path: str | PathLike[str])
The main class of the configuration.
The configuration file should be a valid toml file.
Example of use :
c = Configuration("config.toml") print(c.label) print(c.alice.network.address)
- Parameters:
config_path (QOSSTPath) – path of the configuration file.
- label: str
label of the configuration
- serial_number: str
Serial number of the machine.
- logs: LogsConfiguration
Logs configuration.
- notifications: NotificationsConfiguration | None
Notifications configuration.
- authentication: AuthenticationConfiguration | None
Authentication configuration.
- clock: ClockConfiguration | None
Clock configuration.
- channel: ChannelConfiguration | None
Channel configuration.
- local_oscillator: LocalOscillatorConfiguration | None
Local Oscillator configuration.
- alice: AliceConfiguration | None
Alice configuration.
- bob: BobConfiguration | None
Bob configuration.
- frame: FrameConfiguration | None
Frame configuration.
- DEFAULT_LABEL: str = 'Example config'
Default label
- to_dict() dict | None
Return config as a dict.
- Returns:
dict holding the config.
- Return type:
dict
- from_dict(config: dict) None
Fill the config from a dict. It should corresond to the configuration file.
This dict can come from a toml file or from another party.
If the current config is being overwritten, a warning message is issued. Please note here that, for now, the message is issued even if the difference come from sections that will not be overwritten (for instance, if alice section is not present in the overwriting configuration, the alice configuration in the class will not be set to None).
- Parameters:
config (dict) – the dict holding the config.
Exceptions
Exceptions for the reading of the configuration file.
- exception qosst_core.configuration.exceptions.InvalidConfiguration(message: str = '')
Base exception for an invalid configuration of CVQKD.
- Parameters:
message (str, optional) – error message. Defaults to “”.
- exception qosst_core.configuration.exceptions.InvalidTime(time: float)
Exception raised when a time in the configuration is invalid.
Initialization function.
- Parameters:
time (float) – the time that is not right.
- time: float
the time that is not right.
- exception qosst_core.configuration.exceptions.InvalidClockMaster(given_master: str)
Exception for invalid clock master.
Initialization function.
- Parameters:
given_master (str) – master given in the configuration file.
- exception qosst_core.configuration.exceptions.InvalidEta(eta: float)
Exception for invalid eta in the configuration file.
- Parameters:
eta (float) – eta given in the configuration file.
Initialization function.
- Parameters:
eta (float) – eta given in the configuration file.
Frame
Configuration for the frames.
- class qosst_core.configuration.frame.FramePilotsConfiguration(config: Dict)
Class holding the configuration for the pilots.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- num_pilots: int
Number of pilots.
- frequencies: ndarray
np array of the frequency of each pilot.
- amplitudes: ndarray
np array of the amplitude of each pilot.
- DEFAULT_NUM_PILOTS: int = 2
Default number of pilots.
- DEFAULT_FREQUENCIES: list = [200000000.0, 220000000.0]
Default value for the list of frequencies.
- from_dict(config: dict) None
Fill instance from a dict. It should correspond to the frame.pilots section.
- Parameters:
config (dict) – dict corresponding to the frame.pilots section.
- Raises:
InvalidConfiguration – If the length of the frequencies array is not the same as the number of pilots.
InvalidConfiguration – If the length of the amplitudes array is not the same as the number of pilots.
- class qosst_core.configuration.frame.FrameQuantumConfiguration(config: Dict)
Class holding the configuration for the Quantum Data. It should correspond to the frame.quantum section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- num_symbols: int
Number of symbols for quantum data
- frequency_shift: float
Center frequency of the quantum data
- pulsed: bool
If true, use a rectangular filter instead of a root raised cosine filter.
- symbol_rate: int
Symbol rate
- roll_off: float
Roll off factor of the root raised cosine filter
- variance: float
Variance of the quantum data compared to the tone (modulus of 1)
- modulation_cls: Type[Modulation]
Modulation type
- modulation_size: int
Size of the modulation
- DEFAULT_NUM_SYMBOLS: int = 1000000
Default value for the number of symbols
- DEFAULT_PULSED: bool = False
Default value for the pulsed behavior.
- DEFAULT_FREQUENCY_SHIFT: float = 100000000.0
Default value for the center frequency
- DEFAULT_SYMBOL_RATE: float = 100000000.0
Default value for the symbol rate
- DEFAULT_ROLL_OFF: float = 0.5
Default value for the roll off factor
- DEFAULT_VARIANCE: float = 0.01
Default value for the variance
- DEFAULT_MODULATION_SIZE: int = 0
Default value for the size of modulation
- from_dict(config: dict) None
Fill the instance from a dict.
- Parameters:
config (dict) – Corresponds to the frame.quantum section
- Raises:
InvalidConfiguration – If the given modulation class is not a subclass of
ModulationInvalidConfiguration – If the modulation class does not exist in cvqkd_core.modulation.
InvalidConfiguration – If the roll off factor is not between 0 and 1.
- class qosst_core.configuration.frame.FrameZadoffChuConfiguration(config: Dict)
Configuration of the Zadoff-Chu sequence. It should correspond to the frame.zadoff_chu section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- root: int
Root value for the Zadoff-Chu Sequence
- length: int
Length of the Zadoff-Chu sequence
- rate: float
Rate of the Zadoff-Chu sequence. A rate of zero will be understood as the same rate as the DAC.
- DEFAULT_ROOT: int = 5
Default value for the root.
- DEFAULT_LENGTH: int = 3989
Default value for the length.
- DEFAULT_RATE: float = 0
Default rate.
- from_dict(config: dict) None
Fill instance from dict.
- Parameters:
config (dict) – dict corresponding to the frame.zadoff_chu section.
- Raises:
InvalidConfiguration – If the root and length of the Zadoff-Chu sequence are not coprimes.
- class qosst_core.configuration.frame.FrameConfiguration(config: Dict)
The configuration holding the frame configuration.
In particular this holds three importants configuration :
Pilots
Quantum Data
Zadoff-Chu
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
- num_zeros_start: int
Number of zeros to add at the start of the sequence
- num_zeros_end: int
Number of zeros to add at the end of the sequence
- pilots: FramePilotsConfiguration
Pilots configuration
- quantum: FrameQuantumConfiguration
Quantum Data configuration
- zadoff_chu: FrameZadoffChuConfiguration
Zadoff-Chu configuration
- DEFAULT_NUM_ZEROS_START: int = 0
Default number of zeros in the start
- DEFAULT_NUM_ZEROS_END: int = 0
Default number of zeros in the end
- from_dict(config: dict) None
Fill the instance from a dict.
- Parameters:
config (dict) – dict corresponding to the frame section of the configuration file.
Local Oscillator
Module for the local oscillator configuration.
- class qosst_core.configuration.local_oscillator.LocalOscillatorConfiguration(config: Dict)
Local Oscillator configuration. It should correspond to the local_oscillator section.
- Parameters:
config (Dict) – dict corresponding to one the section in the configuration.
True is the LO is shared
- DEFAULT_SHARED: bool = False
Default value for the sharing.
- from_dict(config: dict) None
Fill the instance from a dict.
- Parameters:
config (dict) – dict corresponding to the local_oscillator section of the configuration file.