Detector
A single-photon avalanche diode detector available on the Virtual Bench.
A single-photon detector with the modelling parameters that actually matter for photon counting: coupling efficiency, detection efficiency, dead time and timing jitter - plus a dark-count generator. This is the only component that produces observable output.
The SPAD Detector (Single-Photon Avalanche Diode) converts incoming photons into detection events. It accounts for realistic imperfections: not every photon that arrives is detected, detection events have timing uncertainty, the detector needs recovery time after firing, and it can occasionally register a count with no photon present at all (a dark count).
Note
Six separate settings model six distinct physical effects. It helps to
think of them in two groups: coupling_eff and det_eff affect
whether a photon is registered; dead_time, jitter, and
mean_response_time affect when it’s registered; dark_count_rate
adds spurious counts independent of any real photon.
from QNS.components import Detector
D1 = Detector("D1", tl.env, sm,
dead_time=1e-8, jitter=55e-12, mean_response_time=1e-9,
coupling_eff=1, dark_count_rate=0, det_eff=1)
References for the model:
R. H. Hadfield, “Single-photon detectors for optical quantum information applications,” Nature Photonics, vol. 3, pp. 696-705, 2009.
M. Lasota and P. Kolenderski, “Optimal photon pairs for quantum communication protocols,” Nature Scientific Reports, vol. 10, no. 20810, 2020.
Constructor
Detector(uID, env, stateManager,
dead_time=10e-9, jitter=55e-12, mean_response_time=1e-9,
coupling_eff=1, dark_count_rate=0, det_eff=1,
follow_up_function=None)
Parameter |
Default |
Valid range |
Meaning |
|---|---|---|---|
|
|
|
Recovery time after a click, during which nothing is registered. |
|
|
|
Standard deviation of the response-time spread. |
|
|
|
Mean delay between absorption and the output electrical signal. |
|
|
|
Probability the photon couples into the detector at all. |
|
|
|
Rate of spurious counts. |
|
|
|
Probability of registering a count once a photon has coupled in. |
|
|
Callback invoked on a successful photon click. See below. |
Out-of-range values raise ValueError. env and stateManager are
required.
Ports: 1 input (port 0), 0 outputs. set_receiver always raises
TypeError.
Properties panel
Field |
Range |
Description |
|---|---|---|
|
0 - 25000 s |
Minimum time the detector is unavailable after registering a detection. |
|
0 - \(10^{-9}\) s |
Timing uncertainty on the recorded detection time. |
|
0 - \(5 \times 10^{-9}\) s |
Mean delay between photon arrival and the detector’s response. |
|
0 - 1 |
Fraction of arriving photons successfully coupled into the detector. |
|
0 - 100000 counts/s |
Rate of spurious detection events with no incident photon. |
|
0 - 1 |
Probability that a coupled photon actually produces a detection event. |
How it works (conceptually)
- Dead time (\(\tau_d\))
Zero means an idealized detector with no recovery limit. A nonzero value caps the maximum count rate at roughly \(R_{\max} \approx 1/\tau_d\), so it matters most when the laser’s pulse rate approaches the detector’s recovery rate.
- Jitter
A value of 0 means the recorded detection time exactly matches the photon’s real arrival time; larger values add timing noise around that true arrival time.
- Mean response time
Distinct from dead time - this is the average delay before the detector reports a click, not how long it stays unavailable afterward. 0 means an instantaneous response.
- Coupling efficiency (\(\eta_c\))
Models loss before the detector’s active region - 0 means nothing gets coupled in, 1 means every arriving photon reaches the detector.
- Dark count rate
Adds detection events that don’t correspond to a real photon at all. These become significant relative to real counts when the optical signal is weak.
- Detection efficiency (\(\eta_d\))
The probability that a photon which did reach the detector is actually registered - 0 means never, 1 means always. This is distinct from coupling efficiency, which is about getting the photon there in the first place.
The detection chain
receive applies four operations in order. A photon must pass all of them:
1. coupling random() < coupling_eff else → failed_couple_eff
2. efficiency random() < det_eff else → failed_eff_dark_get
(bypassed for dark counts)
3. dead time env.now >= next_detection_time else → failed_current_time
4. quantum QuantumOperations.Detector(state, on_mode) > 0 photons
Only if all four succeed does the detector increment actual_clicked and
append to the click log. Steps 1-3 are classical and cheap; step 4 is the
actual measurement.
Dark counts
If dark_count_rate > 0, start() schedules the first dark count and each
dark count reschedules the next, with intervals drawn from
Exponential(1/dark_count_rate) - a Poisson process.
start() is called for you by Timeline.run for every detector in
detector_list. A detector left out of that list still registers photon
clicks but generates no dark counts.
Dark counts bypass the det_eff gate (they are not photons) and are logged
with photon_id = None:
That is what lets Timeline exclude them from pulse-mode coincidences while still counting them as accidentals in window mode.
Note
A dark count sets next_detection_time = 0 rather than starting a dead
time. Dark counts therefore do not blind the detector in this model.
Use stop_det() to halt the dark-count chain partway through a run.
Reading results
- get_counts()
Total registered counts - photon clicks plus dark counts. This is the number that lands in the
Timeline.runresult dictionary.
- get_clicks()
The raw log: a list of
(photon_id, time)tuples, one per count, in the order they were registered.photon_idisNonefor dark counts.
- get_id()
The
uID. Used as the result-dictionary key.
Diagnostic counters
Useful when a circuit registers fewer counts than you expect - they tell you which operation is causing the photons to be lost:
Attribute |
Meaning |
|---|---|
|
Every call to |
|
Rejected at the coupling-efficiency gate. |
|
Rejected at the detection-efficiency gate. |
|
Rejected because the detector was still dead. |
|
Registered counts (what |
|
|
A photon that passes all three classical gates but yields zero photons from the
quantum measurement - the usual case when a polarizer absorbed it upstream -
increments none of the failure counters. total_recived minus the three
failure counts minus actual_clicked gives that population.
Follow-up callbacks
follow_up_function is invoked on a successful photon click (never on a dark
count). Either form works:
Warning
The check is isinstance(f, types.FunctionType), which covers plain
def functions and lambdas but not bound methods or
functools.partial objects. Those fall through to the second branch and
are called as f.operation(...), which raises
AttributeError unless they happen to have such a method. Pass a
module-level function, a lambda, or an object exposing
operation(photon, detector, time).
Using it on the Virtual Bench
Drag Detector from the component tray onto the bench.
Wire an output port of the preceding component (e.g. a Beam Splitter) into the detector’s input.
Click the component to open its properties and set the six parameters above to match your scenario, or leave them at their idealized defaults (
dead_time = 0,jitter = 0,mean_response_time = 0,coupling_eff = 1,dark_count_rate = 0,det_eff = 1).Click Run; detection counts appear in the job output.