Alice
Main script for QOSST Alice.
It contains Alice server class and the entrypoint of the server.
- class qosst_alice.alice.QOSSTAlice(config_path: str)
This server should be almost indestructible.
- Parameters:
config_path (str) – path of the configuration path.
- socket: QOSSTServer
The socket of the server
- dac: GenericDAC
The DAC of Alice.
- powermeter: GenericPowerMeter
The powermeter of Alice.
- voa: GenericVOA
The VOA of Alice.
- bias_controller: GenericModulatorBiasController
The bias controller for the modulator.
- laser: GenericLaser
The laser of Alice.
- client_connected: bool
True if a client is currently connected, False otherwise.
- client_initialized: bool
True if the client went through the identification process, False otherwise.
- frame_uuid: UUID | None
The UUID of the current frame we are working on.
- frame_prepared: bool
True if the DSP has prepared the frame to send.
- frame_sent: bool
True if the frame was sent.
- frame_ended: bool
True if QIE has ended.
- pe_ended: bool
True if the parameter estimation step has ended.
- ec_initialized: bool
True if the error correction has started.
- ec_ended: bool
True if the error correction has ended.
- pa_ended: bool
True if the privacy amplification has ended.
- quantum_sequence: ndarray | None
An array with the quantum sequence, of the current frame.
- symbols: ndarray | None
An array with the symbols, of the current frame.
- photon_number: float
The mean photon number of the current frame.
- config_path: str
The configuration path.
- config: Configuration | None
The configuration object.
- _init_hardware() None
Init the hardware (DAC, powermeter, VOA, laser, bias controller).
- _load_config() None
Load (or reload) the configuration file.
- _init_socket() None
Initialize the QOSST server socket.
- _reset() None
Completly reset the state of the server.
- _interruption_handler(_signum, _frame) None
The interruption handler of the script.
When CTRL-C is pressed, 4 options are proposed: P: Print current config R: Reload the configuration file (after a change) T: Manually reset the state of the server. S: Stop the server. C: Cancel and start back from where we left.
- _wait_for_client() None
Wait for a client to connect.
- _check_code(code: QOSSTCodes) bool
Check if code is expected depending on the state of the sever.
- Parameters:
code (QOSSTCodes) – the code of the received message.
- Returns:
True if the code is a vlaid command with respect to the current state of the server, False, otherwise.
- Return type:
bool
- get_state() str
Return the current state of the server as an str.
- Returns:
the current state of the server.
- Return type:
str
- serve()
Start the server.
- _do_dsp() bool
Apply the DSP using the configuration and load the sequence in the DAC.
- Returns:
True if the DSP and loading were successful, False otherwise.
- Return type:
bool
- _start_transmission() None
Start the transmission.
- _stop_transmission() None
Stop the transmission.
- _estimate_photon_number() float
Estimate the photon number by reemitting the quantum data and reading the photodiode.
- Returns:
the mean photon number at Alice’s output.
- Return type:
float
- _start_polarisation_recovery()
Start the polarisation recovery by sending a classical signal (sine).
- _end_polarisation_recovery()
End the polarisation recovery by stopping the classical signal (sine).
- start()
Start the server.
- stop(error=False)
Gracefuly stop the server.
- qosst_alice.alice._create_main_parser() ArgumentParser
Create the parser for the command line tool.
- Returns:
the created parser.
- Return type:
argparse.ArgumentParser
- qosst_alice.alice.main()
Create the parser, parse the arguments, start the logs and start alice’s server.