Detector
Models for photon detection devices.
This module models a single photon detector (SPD) for measurement of individual photons. It also defines a QSDetector class, which combines models of different hardware devices to measure photon states in different bases. QSDetector is defined as an abstract template and as implementations for polarization and time bin qubits.
- class sequence.components.detector.Detector(name: str, timeline: Timeline, efficiency: float = 0.9, dark_count: float = 0, count_rate: float = 25000000.0, time_resolution: int = 150)
Single photon detector device.
This class models a single photon detector, for detecting photons. Can be attached to many different devices to enable different measurement options.
- name
label for detector instance.
- Type:
str
- efficiency
probability to successfully measure an incoming photon.
- Type:
float
- dark_count
average number of false positive detections per second.
- Type:
float
- count_rate
maximum detection rate; defines detector cooldown time.
- Type:
float
- time_resolution
minimum resolving power of photon arrival time (in ps).
- Type:
int
- next_detection_time
time of next possible detection event.
- Type:
int
- photon_counter
counts number of detection events.
- Type:
int
- add_dark_count() None
Method to schedule false positive detection events.
Events are scheduled as a Poisson process.
- Side Effects:
May schedule future get method calls. May schedule future calls to self.
- get(photon=None, **kwargs) None
Method to receive a photon for measurement.
- Parameters:
photon (Photon) – photon to detect (currently unused)
- Side Effects:
May notify upper entities of a detection event.
- init()
Implementation of Entity interface (see base class).
- notify(info: dict[str, Any])
Custom notify function (calls trigger method).
- record_detection()
Method to record a detection event.
Will calculate if detection succeeds (by checking if we have passed next_detection_time) and will notify observers with the detection time (rounded to the nearest multiple of detection frequency).
- class sequence.components.detector.FockDetector(name: str, timeline: Timeline, efficiency: float, wavelength: int = 0)
Class modeling a Fock detector.
A Fock detector can detect the number of photons in a given mode.
See https://arxiv.org/abs/2411.11377
- name
name of the detector
- Type:
str
- efficiency
the efficiency of the detector
- Type:
float
- wavelength
wave length in nm
- Type:
int
- photon_counter
counting photon for the non-ideal detector
- Type:
int
- photon_counter2
counting photon for the ideal detector
- Type:
int
- get(photon: Photon = None, **kwargs) None
Not ideal detector, there is a chance for photon loss.
- Parameters:
photon (Photon) – photon
- get_2(photon: Photon = None, **kwargs) None
Ideal detector, no photon loss
- Parameters:
photon (Photon) – photon
- init()
Implementation of Entity interface (see base class).
- class sequence.components.detector.QSDetector(name: str, timeline: Timeline)
Abstract QSDetector parent class.
Provides a template for objects measuring qubits in different encoding schemes.
- name
label for QSDetector instance.
- Type:
str
- components
list of all aggregated hardware components.
- Type:
list[entity]
- trigger_times
tracks simulation time of detection events for each detector.
- Type:
list[list[int]]
- abstractmethod get(photon: Photon, **kwargs) None
Abstract method for receiving photons for measurement.
- init()
Method to initialize entity (abstract).
Entity init methods are invoked for all timeline entities when the timeline is initialized. This method can be used to perform any necessary functions before simulation.
- set_detector(idx: int, efficiency=0.9, dark_count=0, count_rate=25000000, time_resolution=150)
Method to set the properties of an attached detector.
- Parameters:
idx (int) – the index of attached detector whose properties are going to be set.
class. (For other parameters see the Detector class. Default values are same as in Detector)
- class sequence.components.detector.QSDetectorFockDirect(name: str, timeline: Timeline, src_list: list[str])
QSDetector to directly measure photons in Fock state.
Usage: to measure diagonal elements of effective density matrix.
- name
label for QSDetector instance.
- Type:
str
- src_list
list of two sources which send photons to this detector (length 2).
- Type:
list[str]
- trigger_times
tracks simulation time of detection events for each detector.
- Type:
list[list[int]]
- arrival_times
tracks simulation time of Photon arrival at each input port
- Type:
list[list[int]]
- init()
Method to initialize entity (abstract).
Entity init methods are invoked for all timeline entities when the timeline is initialized. This method can be used to perform any necessary functions before simulation.
- class sequence.components.detector.QSDetectorFockInterference(name: str, timeline: Timeline, src_list: list[str], phase: float = 0)
QSDetector with two input ports and two photon detectors behind beamsplitter.
The detectors will physically measure the two beamsplitter output photonic modes’ Fock states, respectively. POVM operators which apply to pre-beamsplitter photonic state are used. NOTE: in the current implementation, to realize interference, we require that Photons arrive at both input ports simultaneously, and at most 1 Photon instance can be input at an input port at a time.
Usage: to realize Bell state measurement (BSM) and to measure off-diagonal elements of the effective density matrix.
- name
label for QSDetector instance.
- Type:
str
- src_list
list of two sources which send photons to this detector (length 2).
- Type:
list[str]
- phase
relative phase between two input optical paths.
- Type:
float
- trigger_times
tracks simulation time of detection events for each detector.
- Type:
list[list[int]]
- detect_info
tracks detection information, including simulation time of detection events and detection outcome for each detector.
- Type:
list[list[dict]]
- arrival_times
tracks simulation time of arrival of photons at each input mode.
- Type:
list[list[int]]
- temporary_photon_info
temporary list of information of Photon arriving at each input port. Specific to current implementation. At most 1 Photon’s information will be recorded in a dictionary. When there are 2 non-empty dictionaries, e.g. [{“photon”:Photon1, “time”:arrival_time1}, {“photon”:Photon2, “time”:arrival_time2}], the entangling measurement will be carried out. After measurement, the temporary list will be reset.
- Type:
list[dict]
- get(photon, **kwargs)
Abstract method for receiving photons for measurement.
- get_photon_times() list[list[int]]
Method to get detector trigger times and detection information. Will clear trigger_times and detect_info.
- init()
Method to initialize entity (abstract).
Entity init methods are invoked for all timeline entities when the timeline is initialized. This method can be used to perform any necessary functions before simulation.
- class sequence.components.detector.QSDetectorPolarization(name: str, timeline: Timeline)
QSDetector to measure polarization encoded qubits.
There are two detectors. Detectors[0] and detectors[1] are directly connected to the beamsplitter.
- name
label for QSDetector instance.
- Type:
str
- trigger_times
tracks simulation time of detection events for each detector.
- Type:
list[list[int]]
- splitter
internal beamsplitter object.
- Type:
- get(photon: Photon, **kwargs) None
Method to receive a photon for measurement.
Forwards the photon to the internal polarization beamsplitter.
- Parameters:
photon (Photon) – photon to measure.
- Side Effects:
Will call get method of attached beamsplitter.
- init() None
Implementation of Entity interface (see base class).
- class sequence.components.detector.QSDetectorTimeBin(name: str, timeline: Timeline)
QSDetector to measure time bin encoded qubits.
There are three detectors. The switch is connected to detectors[0] and the interferometer. The interferometer is connected to detectors[1] and detectors[2].
- name
label for QSDetector instance.
- Type:
str
- trigger_times
tracks simulation time of detection events for each detector.
- Type:
list[list[int]]
- interferometer
internal interferometer component.
- Type:
- get(photon, **kwargs)
Method to receive a photon for measurement.
Forwards the photon to the internal fiber switch.
- Parameters:
photon (Photon) – photon to measure.
- Side Effects:
Will call get method of attached switch.
- init()
Implementation of Entity interface (see base class).