Photon Number Resolution

Photon Number Resolution (PNR) refers to the ability to distinguish how many photons are contained in a light pulse detected by a photon detector. It is typically relevant at low-light levels, where the number of photons varies from pulse to pulse.

Depending on the method, the photon number is extracted either from the shape of the output pulse of a single detector, which varies with the photon number in a way that depends on the detector technology, or from combining several single-photon detectors in parallel and counting simultaneous clicks.

This tutorial shows how to configure the Time Tagger for a PNR experiment and how to set up each of the available methods:

  1. Time Tagger configuration: connecting to the Time Tagger, configuring the inputs and recording the calibration data.

  2. Pseudo PNR: counting how many of several single-photon detectors click at the same time, with one detector per channel.

  3. PNR with a single detector: reading the photon number from the shape of the pulse of one detector, with four methods:

    1. PNR by arrival time: using the time between a reference signal, such as the sync of a pulsed laser, and the front edge of the detector pulse.

    2. Two-edge PNR by arrival time: adding the rear edge to the previous method, which separates the photon numbers better.

    3. Time over threshold PNR: measuring how long the detector’s pulse stays above the trigger level from the time between the front and the rear edge, which is an indirect measure of its amplitude, without a reference signal.

    4. Slope PNR: measuring the steepness of the front edge from the time difference between the tags it generates at two trigger levels, without a reference signal.

../_images/PNR_setup.svg

Example setup. The laser output is attenuated with a variable optical attenuator (VOA), and its polarization is adjusted with a polarization controller (Pol.C.) before the detector. The laser trigger and the detector pulses are recorded on two inputs of the Time Tagger.

Time Tagger configuration

First of all, we connect to the Time Tagger.

tagger = createTimeTagger()

The Time Tagger detects both the rising and the falling edge of every input, which are identified by the sign of the channel number, see Input channels. In this tutorial, we consider all pulses to have a positive amplitude, so the front edge is the rising edge and the rear edge is the falling edge. For a detector with negative pulses, the front edge is the falling edge, so the signs of the two channel numbers are swapped and the trigger level is negative. The tutorial uses the following example channels, where LASER_CHANNEL is needed only for the PNR methods with a reference.

# Change the channel numbers based on your specific setup
LASER_CHANNEL = 1   # sync signal of the laser
FRONT_EDGE = 2      # rising edge of input 2
REAR_EDGE = -2      # falling edge of input 2

The Time Tagger hardware allows you to specify a trigger level voltage for each input channel. For the laser, it is convenient to set it to half of the signal amplitude. For the detector, the optimal trigger level depends on the PNR method:

  • PNR by arrival time and Two-edge PNR by arrival time: half of the detector signal amplitude.

  • Time over threshold PNR: about 80% of the one-photon amplitude.

  • Slope PNR: two levels, at 20% and 80% of the signal amplitude.

For all methods, the trigger level determines when the edges are detected. Therefore, it has to be the same during the calibration and the measurement. The default trigger level is 0.5 V.

# Change the trigger levels based on your signals
tagger.setTriggerLevel(LASER_CHANNEL, 0.5)
tagger.setTriggerLevel(FRONT_EDGE, 0.5)

For the PNR methods with a laser reference, it is highly recommended to collect the data using the Conditional Filter, as shown below. The methods without a reference record only the detector channels, but otherwise follow the same steps.

The Conditional Filter discards the unnecessary reference events. After each tag on a trigger channel, only the next tag of the filtered channels passes, and all the other tags of the filtered channels are discarded. With the laser as filtered channel and the rear edge as trigger channel, only the laser tag that follows a detector pulse is recorded, and the tags arrive in the correct order required by the PhotonNumberArrivalTime virtual channel: front edge, rear edge, laser.

tagger.setConditionalFilter(trigger=[REAR_EDGE], filtered=[LASER_CHANNEL])

When the rear edge and the next laser tag are close in time, differences in the channel delays can still swap them, and the pulse is lost. To avoid this, set the delays with setDelayHardware() where available, since it acts before the Conditional Filter. See the in-depth guide Conditional Filter for more details.

We record the calibration data, saving the time tags of the three channels to a file with FileWriter.

FILENAME = "calibration_data.ttbin"
DURATION = 5e12  # ps, 5 s

file_writer = FileWriter(tagger=tagger,
                         filename=FILENAME,
                         channels=[FRONT_EDGE, REAR_EDGE, LASER_CHANNEL])

file_writer.startFor(DURATION)
file_writer.waitUntilFinished()

We analyze the recorded data with a virtual Time Tagger, see The TimeTaggerVirtual class. The measurements are created before the replay is started with run(), and appendFile() replays the file again, for example for the virtual channels of the following sections.

virtual_tagger = createTimeTaggerVirtual(filename=FILENAME)

Pseudo PNR

The setup is similar to the one in the example setup, but the light is split with fiber splitters into several detectors, each connected to its own input of the Time Tagger. Each detector that receives at least one photon clicks, and the photon number is inferred from the number of detectors that click at the same time. Two photons on the same detector give a single click, so the number of clicks is a lower bound for the photon number. The method suits room-temperature detectors, such as single-photon avalanche diodes (SPADs), and superconducting nanowire single-photon detectors (SNSPDs).

First, the signals must arrive aligned to each other. Delays between the channels arise from different optical paths, cable lengths and detector latencies, and are compensated with an input delay on each channel, using setInputDelay(). The delays are determined from correlation measurements, as described in the section Delay adjustment for coincidence detection of the tutorial Measuring Coincidences.

Then, the virtual channel Combinations emits a tag for every group of detectors that click together within the coincidence window window_size, provided that no other click occurs in a guard window before or after. The window has to be shorter than the period of the laser, otherwise the clicks of the next laser pulse fall into the guard window.

DETECTOR_CHANNELS = [1, 2, 3, 4]  # one input per detector
combinations = Combinations(tagger, DETECTOR_CHANNELS, window_size=1000)

The method getSumChannel(n) returns a channel that monitors all combinations of n simultaneous clicks, regardless of which detectors they come from. Counting the tags on these channels, for example with a Countrate measurement, gives the number of events with exactly n clicks.

sum_channels = [combinations.getSumChannel(n) for n in range(1, len(DETECTOR_CHANNELS) + 1)]
countrate = Countrate(tagger, sum_channels)

countrate.startFor(int(10e12))  # 10 s
countrate.waitUntilFinished()
counts = countrate.getCountsTotal()

To obtain the photon number distribution from the clicks, the efficiency of the system, including optical losses and detector efficiency, has to be taken into account, and the number of detectors limits the photon number that can be resolved. Calibrating a Pseudo PNR setup is most reliable with an attenuated pulsed laser, at an average photon number of roughly one to two photons per pulse.

PNR with a single detector

The other methods use a single detector and read the photon number from the shape of its pulse, which changes with the number of photons that were absorbed. They differ in the time difference they take from the pulse, but they follow the same workflow.

They use the example setup. The methods without a reference do not need the laser trigger, and Slope PNR splits the detector signal into two inputs with a power splitter.

  1. Record calibration data while the detector is illuminated by a source, such as an attenuated pulsed laser with an average of one to two photons per pulse. We save the time tags of the channels used by the method with FileWriter and replay them through a TimeTaggerVirtual, which allows us to repeat the analysis with different settings, such as the bin width or the windows.

  2. Histogram the time difference. The output pulse of the detector changes with the number of photons. In single-wire SNSPDs the front edge becomes steeper, and in parallel SNSPDs (where several nanowires are connected on the same chip) and in SiPMs the pulse amplitude increases. Both effects shift the times at which the signal crosses a trigger level. Each method takes a time difference that reflects this shift, and a histogram of it over many events shows one peak per photon number, ordered by photon number along the time axis. In Two-edge PNR by arrival time, each event gives two time differences, and a 2D histogram shows one cluster per photon number.

  3. Define the boundaries between the peaks. The valleys separate the photon numbers and define one window per photon number, whose limits are the intercepts. The last window collects all the higher photon numbers. In the 2D histogram, lines between the clusters take the place of the windows.

  4. Create one virtual channel per photon number. A virtual channel emits a tag for every event whose time difference falls into the window of a photon number. This is done by the WeightedAverage virtual channel in PNR by arrival time, Time over threshold PNR and Slope PNR, and by the PhotonNumberArrivalTime virtual channel in Two-edge PNR by arrival time. The channels can then be used like any other virtual channel, for example with Counter, Coincidences or Combinations.

The WeightedAverage virtual channel takes a start and a stop channel and a list of windows, and it has one output channel per window. For every pair of start and stop tags, it emits a tag on the channel of the window that contains the time difference dt between them. The tag is placed at t_\mathrm{start} + (1 + \mathrm{weight})\,dt/2. A weight of -1 places it on the start tag, 0 in the middle and +1 on the stop tag, while other values extrapolate beyond the two tags. Since the crossing times shift with the photon number, a suitable weight makes the tags of all photon numbers appear at the same time relative to, for example, the laser. The weight for each method is given in the following sections, and a single weight for all windows is usually sufficient. The windows are valid only for the conditions of the calibration, such as the detector, the trigger levels and the signal path. If one of them changes, the calibration has to be recorded again.

PNR by arrival time

This method evaluates the time between a reference signal, typically the sync of a pulsed laser, and the front edge of the pulse. In an SNSPD the slope of the front edge grows with the square root of the photon number (K. Nicolich et al., Phys. Rev. Applied 12, 034020 (2019)), so the front edge crosses the trigger level earlier as photons are added. It is the most direct approach with a single detector, and the number of photons that can be resolved depends on the jitter of the setup and on the detector. The method suits single-wire SNSPDs, and it assumes that the photons arrive synchronized with the reference signal, as is the case for a pulsed laser.

We measure the time from the front edge to the laser tag that follows it, which is the tag kept by the Conditional Filter, with a StartStop measurement. It needs neither a delay nor a histogram range, and its peaks correspond to the photon numbers.

start_stop = StartStop(tagger=virtual_tagger,
                       click_channel=LASER_CHANNEL,
                       start_channel=FRONT_EDGE,
                       binwidth=1)
virtual_tagger.run()
virtual_tagger.waitUntilFinished()

# One row per filled bin (empty bins are skipped): time difference in ps and counts
data = start_stop.getData()

In the sketch, a pulse with more photons has a steeper front edge, so it crosses the trigger level earlier and the time to the laser tag is longer. In the histogram, each photon number gives a peak, and the one-photon peak lies at the shortest time.

../_images/PNR-1.svg

The valleys between the peaks give the intercepts, which define the windows of the WeightedAverage virtual channel, one for each photon number. The first and the last intercept enclose the whole distribution, and the last window also collects the higher photon numbers that are not resolved. With the front edge as start and the laser as stop, a weight of +1 places every output tag on the laser tag. The same classification can be obtained with PhotonNumberArrivalTime and a slope of zero, see the next section.

# Intercepts read from the histogram, in ps
intercepts = [2263, 2358, 2408, 2437, 2456]
search_windows = [[low, high] for low, high in zip(intercepts[:-1], intercepts[1:])]

pnr = WeightedAverage(tagger=virtual_tagger,
                      start_channel=FRONT_EDGE,
                      stop_channel=LASER_CHANNEL,
                      search_windows=search_windows,
                      weights=[1])

# Count the events with 1, 2, 3, and 4 or more photons
countrate = Countrate(tagger=virtual_tagger, channels=pnr.getChannels())
virtual_tagger.appendFile(filename=FILENAME)
virtual_tagger.waitUntilFinished()
counts = countrate.getCountsTotal()

Note

The method also works without the Conditional Filter, only with a higher data rate. StartStop and WeightedAverage pair each front edge with the first laser tag that follows it, so the histogram and the intercepts are the same. Without the filter, the laser can also be used as start, as in usual time-correlated single-photon counting. The histogram is then mirrored, and the intercepts cannot be used with PhotonNumberArrivalTime, which always takes the laser tag after the pulse.

Two-edge PNR by arrival time

This method extends PNR by arrival time by also considering the rear edge of the pulse. As in PNR by arrival time, the slope of the front edge grows with the photon number, which shifts the time at which the front edge crosses the trigger level. Classifying the events also by the timing of the rear edge separates the photon numbers better than the front edge alone (G. Sauer et al., arXiv:2310.12472 (2023)).

Each event gives two time differences, from the front edge to the laser and from the front edge to the rear edge, which is the width of the pulse. A Histogram2D of them shows clusters for the different photon numbers, similar to the one on the PNR application page, where both edges are measured from the laser. The method works best with single-wire SNSPDs. With one detector, up to five photons have been resolved, compared with about two from the front edge alone. As in PNR by arrival time, a synchronized reference is required.

In the example, the clusters are tilted, so the front edge arrival times of the higher photon numbers overlap. Lines parallel to the clusters separate them better.

../_images/PNR-2.svg

The lines are described by \Delta t = \mathrm{threshold} + \mathrm{slope} \cdot w, where \Delta t is the time from the front edge to the laser, w is the width of the pulse, and each threshold is the intercept of a line with the \Delta t axis, at w = 0. The PhotonNumberArrivalTime virtual channel assigns the photon number of every event from these lines.

Three example scripts in the installation folder perform the calibration, with the channels and file locations set in arrival_time_constants.py:

<installation path>/examples/python/11-PNR/1-arrival-time/
  • A_measure_arrival_time.py records the calibration data using the Conditional Filter.

  • B_evaluate_arrival_time.py analyzes the data and writes the calibration file.

  • C_check_arrival_time.py applies the calibration and shows how well the photon-number peaks separate.

The scripts need NumPy, SciPy and Matplotlib. They save their data in a .data folder next to them, so we copy the folder to a location with write access before running them. The evaluation script builds the 2D histogram and searches the slope for which the projection along the lines has the sharpest peaks. It writes a JSON file with the slope, the thresholds and the max_signal_delay, which is the largest accepted time from the front edge to the laser. The thresholds refer to the recorded data, so no delay has to be applied to the laser. The PhotonNumberArrivalTime virtual channel, which is used in the third script, reads these parameters. It expects the tags in the order front edge, rear edge, laser, and emits a tag at the position of the laser on the channel of the photon number of the event.

import json

PARAMETER_FILE = ".data/parameters_ch2.json"  # written by B_evaluate_arrival_time.py
with open(PARAMETER_FILE) as file:
    parameters = json.load(file)

pnr = PhotonNumberArrivalTime(tagger=tagger,
                              trigger_channel=LASER_CHANNEL,
                              front_edge_channel=FRONT_EDGE,
                              rear_edge_channel=REAR_EDGE,
                              slope=parameters["slope"],
                              thresholds=parameters["thresholds"],
                              max_signal_delay=parameters["max_signal_delay"])

# Element n is the channel of the events with n photons
photon_channels = pnr.getPhotonChannels()

The first element of getPhotonChannels() collects the laser tags without a complete detector pulse. With the Conditional Filter, it only reports anomalies, such as a lost edge, and the number of laser pulses without a detection is the number of laser pulses during the measurement minus the number of recorded laser tags. Without the filter, it also counts every laser pulse without a detection. The events outside the thresholds click on getBelowRangeChannel() and getAboveRangeChannel().

We run the calibration once per detector and check it with C_check_arrival_time.py. For several detectors, the resulting channels can be combined with Coincidences or Combinations.

Time over threshold PNR

The width of the pulse, from the front to the rear edge, is the time during which the signal stays over the trigger level. It is an indirect measure of the amplitude of the pulse, and a larger pulse crosses a fixed level earlier on the front edge and later on the rear edge. The method therefore depends entirely on how the shape of the pulse changes with the photon number, which is a property of the detector. In parallel or interleaved SNSPDs and in room-temperature detectors, such as SiPMs, the amplitude increases with the number of absorbed photons. In single-wire SNSPDs the amplitude is fixed, so the method is not well suited to them. It needs a single channel, since both edges come from the same input, and no reference signal.

The trigger level sets which photon numbers can be separated. A level near the one-photon amplitude separates the low photon numbers, and a higher level separates the higher ones. With a parallel SNSPD, by splitting the detector output into two channels with levels at the one- and four-photon amplitudes, we can resolve up to eight photons (PNR application note). To choose the level, we scan it and record the count rate with a Countrate measurement. The result is a staircase whose steps mark the amplitudes of the photon numbers. A good choice is a level on the plateau just below the step of the lowest photon number of interest, for example at 80% of the one-photon amplitude.

levels = np.arange(0.02, 1.0, 0.02)  # V
countrate = Countrate(tagger=tagger, channels=[FRONT_EDGE])

rates = []
for level in levels:
    tagger.setTriggerLevel(FRONT_EDGE, level)
    tagger.sync()  # wait until the new trigger level is active
    countrate.startFor(int(1e11))  # 0.1 s
    countrate.waitUntilFinished()
    rates.append(countrate.getData()[0])

With the trigger level set, we record the calibration data and histogram the time from the front to the rear edge with a StartStop measurement. The peaks lie at larger widths for higher photon numbers. The valleys between them give the intercepts, and the WeightedAverage virtual channel creates one channel per photon number. A weight of 0 places the tag at the center of the pulse. Since a larger pulse crosses the trigger level earlier on the front edge and later on the rear edge, the center of the pulse compensates most of this shift when both edges move by comparable amounts, as in parallel SNSPDs. For pulses that rise fast and decay slowly, such as those of SiPMs, the rear edge moves more, and a weight closer to -1 compensates better.

start_stop = StartStop(tagger=virtual_tagger,
                       click_channel=REAR_EDGE,
                       start_channel=FRONT_EDGE,
                       binwidth=1)
virtual_tagger.run()
virtual_tagger.waitUntilFinished()

# Intercepts read from the histogram, in ps
intercepts = [465, 795, 935, 1012, 1073, 1120, 1180]
search_windows = [[low, high] for low, high in zip(intercepts[:-1], intercepts[1:])]

pnr = WeightedAverage(tagger=virtual_tagger,
                      start_channel=FRONT_EDGE,
                      stop_channel=REAR_EDGE,
                      search_windows=search_windows,
                      weights=[0])

# Count the events with 1 to 5, and 6 or more photons
countrate = Countrate(tagger=virtual_tagger, channels=pnr.getChannels())
virtual_tagger.appendFile(filename=FILENAME)
virtual_tagger.waitUntilFinished()
counts = countrate.getCountsTotal()

The histogram is shown on a logarithmic scale. The counts fall quickly for photon numbers above the mean photon number of the source, and the last peak has about a hundred times fewer counts than the strongest one.

../_images/PNR-3.svg

The example script pnr_time_over_threshold.py in <installation path>/examples/python/11-PNR/2-time-over-threshold/ performs these steps and finds the intercepts automatically, at the minima between the peaks.

Slope PNR

This method also uses the front edge and does not need a reference signal. Since the slope of the front edge grows with the photon number, the time that the signal needs to go from a low to a high level shortens.

We detect the crossing of two trigger levels, e.g., at 20% and 80% of the pulse amplitude, by splitting the signal with a power splitter into two Time Tagger channels (see Recommended Accessories). The method works best with detectors of fixed amplitude, such as single-wire SNSPDs, and it can also be used with room-temperature detectors at lower performance. Splitting reduces the amplitude and can degrade slew rate and noise, so the signal needs sufficient amplitude and a steep front edge.

LOW_LEVEL = 2    # rising edge of input 2, at 20% of the pulse amplitude
HIGH_LEVEL = 3   # rising edge of input 3, at 80% of the pulse amplitude
AMPLITUDE = 0.4  # V, pulse amplitude at the inputs, after the splitter

tagger.setTriggerLevel(LOW_LEVEL, 0.2 * AMPLITUDE)
tagger.setTriggerLevel(HIGH_LEVEL, 0.8 * AMPLITUDE)

The levels should give a good SNR while keeping enough distance between them to obtain time tags far enough apart to distinguish photon numbers. As for the Time over threshold PNR method, scanning the trigger level helps by giving an estimate of the pulse amplitude, from which the 20% and 80% levels follow. Alternatively, the signal amplitude can be measured with an oscilloscope. It is important to measure it after splitting the signal. Different cable lengths from the splitter to the two inputs shift the time between the two crossings, which can be compensated with an input delay. We then histogram the time between the two crossings with a StartStop measurement. The one-photon peak lies at the largest time difference, and the WeightedAverage virtual channel creates one channel per photon number.

A weight of -1 places the tag on the crossing of the low level, which happens earlier for the steeper front edges of the higher photon numbers. A weight below -1 extrapolates the front edge back towards its start and reduces this shift. For a straight front edge, the weight is -(H + L)/(H - L), where L and H are the two levels as fractions of the amplitude, which gives about -1.7 for 20% and 80%.

start_stop = StartStop(tagger=virtual_tagger,
                       click_channel=HIGH_LEVEL,
                       start_channel=LOW_LEVEL,
                       binwidth=1)
virtual_tagger.run()
virtual_tagger.waitUntilFinished()

# One window per photon number, from 1 to 3 or more photons, read from the histogram, in ps
search_windows = [[100, 166], [77, 100], [59, 77]]

pnr = WeightedAverage(tagger=virtual_tagger,
                      start_channel=LOW_LEVEL,
                      stop_channel=HIGH_LEVEL,
                      search_windows=search_windows,
                      weights=[-(0.8 + 0.2) / (0.8 - 0.2)])
countrate = Countrate(tagger=virtual_tagger, channels=pnr.getChannels())
virtual_tagger.appendFile(filename=FILENAME)
virtual_tagger.waitUntilFinished()
counts = countrate.getCountsTotal()

In the example, only the one-photon peak is well separated, and the peaks of two and three or more photons overlap.

../_images/PNR-4.svg