qkd_key_rate.base.detector module

Base class for detector objects.

class qkd_key_rate.base.detector.Detector(name, jitter_source, jitter_detector, dead_time, detection_window, efficiency_system, polarization_drift=0.122782758757646, error_detector=0, dark_count_frequency=None, dark_count_rate=None, detection_frequency=None, interval=None, efficiency_detector=None, efficiency_party=None)[source]

Bases: ABC

Class for the detectors to be used in the key-rate estimates.

__init__(name, jitter_source, jitter_detector, dead_time, detection_window, efficiency_system, polarization_drift=0.122782758757646, error_detector=0, dark_count_frequency=None, dark_count_rate=None, detection_frequency=None, interval=None, efficiency_detector=None, efficiency_party=None)[source]

Initialise a Detector instance.

Parameters:
  • name (str) – Label of the detector party

  • jitter_source (float) – Time-delay introduced at the source

  • jitter_detector (float) – Time-delay introduced at the detector

  • dead_time (float) – The recovery time before a new event can be recorded

  • detection_window (float) – Time window used for event detection

  • efficiency_system (float) – Efficiency of the detecting side without the detector

  • polarization_drift (float) – Shift/drift in the encoding of the photons

  • error_detector (float) – Error-rate of detector

  • dark_count_frequency (Optional[float]) – Number of dark-counts per second

  • dark_count_rate (Optional[float]) – Number of dark-counts per detection window

  • detection_frequency (Optional[float]) – Number of detection windows per second

  • interval (Optional[float]) – Length of a single detection window in seconds

  • efficiency_detector (Optional[float]) – Efficiency of the detector on the detecting side

  • efficiency_party (Optional[float]) – Total efficiency of the detecting side

If related optional arguments are both given they must satisfy

  • \(\text{interval} = \frac{1}{\text{detection_frequency}}\)

  • \(\text{dark_count_frequency} = \text{dark_count_rate} \cdot \text{detection_frequency}\)

  • \(\text{efficiency_party} = \text{efficiency_system} \cdot \text{efficiency_detector}\)

If they are not given, they are calculated using the same formulas.

Returns:

Detector instance with specified parameters.

Raises:
  • ValueError – If a required field is missing.

  • ValueError – If a needed optional field is missing.

  • AssertionError – If inconsistent related optional fields are provided.

customise(name=None, jitter_source=None, jitter_detector=None, dead_time=None, detection_window=None, efficiency_system=None, polarization_drift=None, error_detector=None, dark_count_frequency=None, dark_count_rate=None, detection_frequency=None, interval=None, efficiency_detector=None, efficiency_party=None)[source]

Create a detector with customised parameter from current detector

See __init__() for parameter description.

Return type:

Detector

classmethod from_file(path)[source]

Construct Detectors from csv file.

Parameters:

path (str) – Path to csv file.

Return type:

List[Detector]

get_parameters()[source]

Get all parameters of the Detector

Return type:

dict[str, Any]

required_fields = ['name', 'jitter_source', 'jitter_detector', 'dead_time', 'detection_window', 'efficiency_system']