A 100-pixel photon-number-resolving detector unveiling photon statistics

Single-photon detectors are ubiquitous in quantum information science and quantum sensing. They are key enabling technologies for numerous scientific discoveries and fundamental tests of quantum optics. Photon-number-revolving detectors are the ultimate measurement tool of light; however, few detectors so far can provide high-fidelity photon number resolution at few-photon levels. Here we demonstrate an on-chip detector that can resolve up to 100 photons by spatiotemporally multiplexing an array of superconducting nanowires along a single optical waveguide. The unparalleled photon number resolution paired with the high-speed response exclusively allows us to unveil the quantum photon statistics of a true thermal light source at an unprecedented level, which is realized by direct measurement of the higher-order correlation function g(N) (with values of N up to 15), observation of photon-subtraction-induced photon number enhancement and quantum-limited state discrimination against a coherent light source. Our detector provides a viable route towards various important applications, including photonic quantum computation and quantum metrology. Up to 100 photons are resolved by a waveguide-integrated and hybrid spatiotemporal-multiplexed superconducting nanowire single-photon detector array. Using this detector array, photon statistical behaviour for a true thermal and a coherent light source is verified.

Single-photon detectors are ubiquitous in quantum information science and quantum sensing. They are key enabling technologies for numerous scientific discoveries and fundamental tests of quantum optics. Photon-number-revolving detectors are the ultimate measurement tool of light; however, few detectors so far can provide high-fidelity photon number resolution at few-photon levels. Here we demonstrate an on-chip detector that can resolve up to 100 photons by spatiotemporally multiplexing an array of superconducting nanowires along a single optical waveguide. The unparalleled photon number resolution paired with the high-speed response exclusively allows us to unveil the quantum photon statistics of a true thermal light source at an unprecedented level, which is realized by direct measurement of the higher-order correlation function g (N) (with values of N up to 15), observation of photon-subtraction-induced photon number enhancement and quantum-limited state discrimination against a coherent light source. Our detector provides a viable route towards various important applications, including photonic quantum computation and quantum metrology.
The observation and application of intriguing quantum optical effects have long relied on high-performance photon-number-resolving (PNR) detectors 1 . An ideal PNR detector should have unity detection efficiency, high-speed, low-timing jitter, negligible dark counts, and the ability to resolve photon numbers with a large dynamic range and high fidelity. Although transition edge sensors 2-6 and microwave kinetic inductance detectors 7,8 have demonstrated their inherent photon number resolution as well as excellent low readout noise, their performances are mainly limited in terms of low count rate (typically below 1 MHz), large timing jitter (nanosecond level) and the need for ultra-low operation temperatures (~100 mK). On the other hand, superconducting nanowire single-photon detectors (SNSPDs) 9 are a cutting-edge technology, with high efficiency (>98%) 10,11 , gigahertz-level count rate 12 , picosecond-level timing jitter 13 , subhertz dark count noise 14 , and an elevated operation temperature (2-4 K); however, the main drawback of SNSPDs is their limited photon number resolution. Although some modified readout schemes have been proposed to extend the PNR ability by either integrating a tapered impedance transformer 15 or employing a wide-band cryogenic amplifier 16 , the maximum resolvable photon number still remains at 3-4. Alternative approaches to construct a PNR-SNSPD include temporal-and spatial-multiplexing [17][18][19][20][21][22][23][24][25] , which have been used in ensemble measurements with only a few detector pixels; however, when a single-shot determination of the photon number is required, a sufficiently large pixel number is critical to minimize the probability of more than one photon simultaneously firing the same detector pixel, and thus to achieve high PNR fidelity [25][26][27][28][29][30] . Multiplexed detectors are thus also referred to as quasi-PNR detectors. The general limitation in the temporal-multiplexing scheme is the bulky set-up consisting of multiple stages of long fibres to provide nanosecond-level delay, which is difficult to integrate on a single chip and thus has limited scalability. In comparison, the spatial-multiplexed array of SNSPDs have shown PNR capability with a high dynamic range up to 24 photons 20 , while maintaining a simple readout scheme by series-or parallel-connecting all of the detector pixels. Nevertheless, as the detected photon number increases, the resolution of the output voltage proportional Article https://doi.org/10.1038/s41566-022-01119-3 thermal light has been studied extensively [32][33][34][35] , most experiments use a pseudo-thermal light source that is artificially generated by passing a coherent laser light through a rotating ground glass 36,37 . This is because true thermal light sources typically have a broad bandwidth and thus a short coherence time, which places extreme demand on the timing resolution of the single-photon detectors [38][39][40][41] . With the unprecedented photon number resolution as well as the high-speed responses of our detector, we are able to observe the photon statistics transition from a Bose-Einstein distribution to a Poisson distribution by tuning the pulse width of a true thermal light source. Our detector also permits a convenient direct measurement of the higher-order correlation function g (N) (ref. 5 ), with N up to 15 in our experiment, which is only limited by the data acquisition rate of our test equipment, rather than the detector itself. We also implement the quantum-limited discrimination of a thermal and a coherent state to the photon number degrades considerably due to the limited signal-to-noise ratio, thus limiting further scalability. Furthermore, both of these multiplexing schemes are lacking in spatial resolution, which is highly desired in some quantum applications to resolve the spatial modes of the input photons.
Here we demonstrate the design and experimental implementation of a waveguide-integrated, hybrid spatiotemporal-multiplexed SNSPD array, which features simultaneous photon number-and position-resolving capability, high scalability and a simple readout scheme. Furthermore, the high timing resolution combined with the large-dynamic-range PNR capability of the detector allows us to analyse the photon number statistics of a true thermal light source. Thermal light played a critical role in the development of quantum optics as it triggered the invention of the intensity correlation measurement g (2) in the work by Hanbury Brown and Twiss 31   100-pixel quasi-PNR detector structure based on the spatiotemporalmultiplexed SNSPD array. The high-frequency detector signals are read out through the bus line consisting of the series-connected nanowire detectors and delay-line sections (blue colour), whereas the bias currents of the fired detector pixels are recovered via the low-frequency reset loop formed by the on-chip inductor and resistor (orange colour). b, Overview optical micrograph image of the device. The image is taken before finishing device fabrication for better visibility (see Methods). c, Expanded view of the grating coupler. d, Expanded view of the delay-line sections located at the lower left corner of the device. e, Expanded optical micrograph and false-colour scanning-electron micrograph view of the nanowire detectors with the leads passing through the waveguide bridges. f, Expanded view of the on-chip resistors, inductors and part of the impedance tapers. g, Persistence oscilloscope traces of electrical pulses generated from each pixel of the detector. The presence/absence of the pulses combined with the arrival time of the pulse peaks can be used to provide both the total detected photon number and the pixel number information of the fired pixels. The gradually reduced peak height of the pulses for the higher pixel numbers is due to the ohmic loss introduced by the top metal ground of the microwave transmission line (see Methods).
Article https://doi.org/10.1038/s41566-022-01119-3 approaching the Helstrom bound 42 to showcase the potential of our detector in quantum metrology applications. Figure 1a illustrates the basic operation principle of the spatiotemporal-multiplexed SNSPD array, whereas Fig. 1b-f shows device images. Further images and device yields are presented in Supplementary Note 1. The incident photons are guided by the waveguide and spatially distributed to the nanowire detector pixels of incremental length integrated atop the waveguide. All of the detector pixels are series connected with identical sections of nanosecond-level delay lines embedded between neighbouring pixels. Each pixel is shunted by an on-chip inductor and resistor for the local reset of the bias current after firing. The fired pixel generates a pair of positive/negative electrical pulses that propagate along the opposite direction of the high-frequency bus line, which consists of the detector pixels and the delay-line sections (blue colour). The signals are then read out in a time sequence using the temporal-multiplexing method (Fig. 1g).

Operation principle of the detector
The impedance tapers are attached at both ends of the bus line to match the impedance between the delay lines and the reading electronics, which is critical for minimizing reflections of the readout signals, and thus preserving clear and fast-rising/falling edges 43,44 . Furthermore, the presence of the resistively shunted inductors prevents the high-frequency signals entering the low-frequency reset loop (orange colour), rendering the readout and reset of the individual detector pixels separated.
One advantage of this device design is that the nanowire detectors, on-chip inductors, microwave delay lines and impedance tapers could all be implemented in a single ultra-thin niobium nitride (NbN) superconducting layer 45 (Fig. 1b-f), thus greatly simplifying the fabrication process. Moreover, a compact design of an ultra-slow microwave transmission line based on high-kinetic-inductance NbN nanowires and a high-k dielectric layer (see Methods) is employed here instead of bulky optical delay lines for the temporal-multiplexed readout, and thus a high scalability of the detector pixel number is expected. More importantly, this hybrid spatiotemporal-multiplexing scheme enables position-resolving capability; that is, in addition to the information of

Photon statistics and correlation measurement
We first demonstrate the potential of our detector in quantum optics applications by measuring the photon statistics of thermal and coherent states of light. A high-speed oscilloscope is used to acquire electrical pulse signals generated by the detector and amplified by low-noise amplifiers (see Supplementary Note 2 for more details on the measurement set-up). One instance of the oscilloscope trace produced by detecting a thermal light source from erbium-doped fibre amplifiers (EDFAs) is shown in Fig. 2a, and the result for a coherent state is shown in Fig. 2b. The presence/absence of the pulses in each time slot-which correspond to the individual pixels of the detector-can be used to provide the total detected photon number as well as the position information of the fired pixels. The lower panels in Fig. 2a,b show ten measurement sequences and the corresponding photon number count in each measurement is presented at the end of each sequence. By collecting a sufficient number of measurements, the histogram of the detected photon numbers can be constructed to obtain the photon number probability distribution; panels c and d in Fig. 2 show the photon number probability distributions of a thermal light with experimentally measured mean photon numbers of n exp = 5.97 ± 0.30 and 18.10 ± 0.33, respectively, where n exp is represented by the mean value ± 1 standard error of the mean (SEM). It can be seen that the experimental data agree well with the Bose-Einstein fitting. The statistics measurement of a coherent laser source with n exp = 6.18 ± 0.01 is shown in Fig. 2e, and a much higher photon number (n exp = 53.63 ± 0.02 ) is demonstrated in Fig. 2f to showcase the large-dynamic-range PNR capability of our detector. Both traces from the coherent source follow the Poisson distribution, and the counts of photon number fluctuate much less strongly than that of the thermal state due to the lack of photon bunching (see Supplementary Videos 1 and 2). It is also worth noting that as the total detected photon number increases, the peak-to-background ratio deteriorates, particularly for the signals from the second half of the pixels. This is due to the reduced peak height of the pulses (Fig. 1g) along with the accumulated low-frequency background ripples from the preceding fired pixel signals, which is also captured in our simulation (Supplementary Note 3).
To mitigate this problem, we can use both output channels of our detector and separately collect the signals for 1-50 and 51-100 pixels. In a future upgrade, a higher-permittivity dielectric layer such as SrTiO 3 (ref. 46 ) can be employed to greatly reduce the propagation speed of the microwave signals and thus increase the delay time between neighbouring pulse signals to help better differentiate them. The use of a high-permittivity material also makes it possible to further boost the pixel number by one or more orders of magnitude on a compact-sized chip. Moreover, waveform processing schemes more advanced than simple pulse peaks counting 47 could be developed in the future to better extract the detection information. It is also worth noting that the measured statistics of a coherent state with a high mean photon number n exp = 53.63 ± 0.02 starts to deviate from the Poisson distribution. This is caused by the fact that one detector pixel is likely to be fired by more than one photon when the photon number is high 27 , and thus some photons are missing and not registered. We model this effect by Monte Carlo simulation (see Methods and Extended Data Fig. 2), and the simulation result agrees with the experiment (see green diamond markers in Fig. 2f). We next use our detector to investigate the effect of pulse width on the quantum statistics of a true thermal light source and compare it with that of a coherent counterpart. A simplified schematic of the experimental set-up is shown in Fig. 3a (see Supplementary Note 2 for a complete schematic). The spectrally filtered amplified spontaneous . In our implementation, we split the 100-pixel detector into N groups and use the separate sum of photon counts in the N groups for coincidence measurement.
This method is equivalent to the conventional method in which the input light beam is split by a beam-splitter tree into N paths, each of which is detected by a PNR detector. f, Measured mean values of g (N) with N up to 15 (dots) in comparison with the theoretical calculation (solid curves). Error bars indicate 1 SEM, and the asymmetric error bars are due to the log scale representation. The type and parameters used for the light source are labelled beside each corresponding curves. In particular, we experimentally measure g (2) = 1.962 ± 0.007 for πBτ = 0.05. The sample size used in f is 10 4 .
Article https://doi.org/10.1038/s41566-022-01119-3 emission from EDFAs and the narrow-bandwidth coherent-state light from a continuous-wave laser are used separately as light sources, with the variable optical attenuators (VOAs) tuning the light intensity and thus the mean photon number n . Both of the sources are followed by the temporal gating through the electro-optic modulator (EOM) to make them pulsed sources. The photon number probability distribution of a thermal light measured by a PNR detector can be described by a negative binomial distribution as [48][49][50] where n is the mean photon number, B is the full-width at half-maximum (FWHM) bandwidth of the Lorentzian optical spectral filter 51 , and τ the pulse width. When the time-bandwidth product πBτ ≪ 1, equation (1) reduces to the Bose-Einstein distribution P BE (n;n ) =  Fig. 3b-d. It can be clearly seen that the photon statistics gradually transits from the Bose-Einstein distribution to the Poisson distribution, which agrees well with the theoretical calculation by equation (1).
Our detector's position-resolving capability also aids convenient and direct measurement of g (N) = 〈n 1 n 2 … n N 〉/〈n 1 〉〈n 2 〉 ⋯ 〈n N 〉, where 〈⋅〉 indicates the ensemble average. Conventional measurement of g (N) is typically realized by splitting an optical beam into N parts and subsequently using N single-photon detectors for coincidence counting 5 . By contrast, we can flexibly split 100 pixels of our detector into N groups without modifying the experiment set-up and count the sum photon number in each group for coincidence measurement, as illustrated in Fig. 3e. The theoretical value of g (N) for the EDFA thermal light source can be calculated as 52 where Γ(⋅) is the gamma function. In the limit of πBτ ≪ 1, we have g (N) → N!, which agrees with the result of the Bose-Einstein distribution 53 . At the other extreme of πBτ ≫ 1, it follows that g (N) → 1, which is a well-known result of the Poisson distribution. The experimental results for g (N) with N up to 15 are shown in Fig. 3f, which agree well with the theoretical prediction. When πBτ decreases, we can see that the value of g (N) increases considerably. By contrast, the value of g (N) remains unity when a coherent laser is used as the light source. It should be noted that the measurement of g (N) with N > 15 is limited by the slow data acquisition rate of the oscilloscope (~30 Hz) used in our experiment, rather than the detector itself, as an exponentially larger sample number is needed to minimize the variance of g (N) as N increases. A dedicated gigahertz-level fast pulse counter could be employed in a future experiment to further unlock the performance of our detector.

Photon subtraction experiment
We then further investigate the capability of our detector by performing photon subtraction experiment. Conventional photon subtraction entails using a beam-splitter to probabilistically subtract a certain number of photons at the reflection port, as shown in Fig. 4a. In our experiment, we split the 100-pixel detector into two groups (that is, groups R and T), and a splitting ratio R:T = 20:80% is achieved by adjusting the number of pixels in each group. Due to the bunching effect of thermal light, higher mean photon numbers will be detected at the transmission port as the number of photons subtracted at the reflection port increases 54,55 . This effect can be potentially useful for applications such as quantum-enhanced interferometry 34 and quantum-state engineering 35 . Assuming that the input photon number probability distribution can be described by a negative binomial distribution P in NB (n; πBτ,n in ) with a mean photon number of n in , the photon number probability distribution at the transmission port can be described by another negative binomial distribution P T NB (n; πBτ + n R ,n T ) , whose mean photon number n T becomes 50 where n R is the subtracted photon number at the reflection port. When R → 0, πBτ ≪ 1, and n R = 1, we have n T = 2n in , which is the well-known  result that the mean photon number of a thermal state at the transmission port will be doubled when a single photon is annihilated at the reflection port of a low-reflection beam-splitter 33 . It is also worth noting that the time-bandwidth product of the negative binomial distribution at the transmission port increases from πBτ to πBτ + n R ; thus, if the input beam follows the Bose-Einstein statistics with πBτ ≪ 1, the photon number distribution at the transmission port will transit to Poisson-like statistics when the annihilated photon number n R is large. These theoretical predictions agree well with our experimental data as shown in Fig. 4b-d, where n R = 0, 2, 4 respectively. For these measurements, the spectrally filtered EDFA is used as the light source with πBτ = 0.05. We next investigate the photon number enhancement effect of photon subtraction, and we usē as the metric to quantify the photon number enhancement, where M is the subtracted photon number at the reflection port. The experimental results of photon number enhancement are shown in Fig. 4e, which illustrates that the photon number enhancement increases linearly as M increases. By contrast, there is no enhancement for the coherent light source from the laser, indicating the photon states at the two output ports of the beam-splitter are uncorrelated for a coherent state input 33 .

Quantum-limited discrimination of photon states
As another application of our detector, we perform quantum-limited discrimination between a thermal state and a coherent state of light 42 .
Here the mean photon number n of the light source is assumed to be known, but its quantum state, either a thermal state or a coherent state, remains to be discriminated. The minimum possible discrimination error is known as the Helstrom bound 56 , which can be computed as P H err (n ) = 0.5 − 0.25||ρ th (n ) − ρ coh (n )|| 1 , where ρ th (n ) is the density matrix of a thermal state, ρ coh (n ) = | | α = √n ⟩ ⟨α| is the density matrix of a coherent state, and ||⋅|| 1 is the trace distance. The most straightforward method for discrimination is the direct detection, which entails using a PNR detector to measure the photon number emitted by the source. When n photons are measured, its quantum state is discriminated to be a thermal state if P BE (n;n ) > P P (n;n ) . On the other hand, if P BE (n;n ) ≤ P P (n;n ) , the quantum state is discriminated to be a coherent state. The error probability of discrimination can thus be calculated as P err direct (n ) = ∑ n min(P BE (n;n ), P P (n;n ))/2 ; however, this method cannot approach the Helstrom bound. The Kennedy receiver can outperform the direct detection by using homodyne detection. A high-transmission beam-splitter (T ≈ 1) is used to reduce the loss for the signal to be discriminated. The Kennedy detection entails using a local oscillator with a mean photon number of n T/(1 − T) and a relative π phase shift with respect to the coherent state light source, whose density matrix can be expressed as ρ LO = |−α LO ⟩ ⟨−α LO | with α LO = √n . If the source is a coherent state, the transmission port will present a vacuum state due to the destructive interference. If the source is a thermal state, the state at the transmission port possesses a Laguerre statistics 42,48 is the Laguerre polynomial of order n. The discrimination error probability is thus P err K (n ) = P L (0)/2 . The Kennedy detection, however, can be further generalized to approach the Helstrom bound by changing α LO to α LO = √n + Δn, where the value of Δn depends on n and can be computed by numerical optimization 42 . In this case, if the source is a coherent state, the detected statistics becomes a Poisson distribution P P (n; Δn) with a mean photon number of Δn. If the source is a thermal state, the detected statistics becomes a Laguerre distribution ), and thus the discrimination error probability is P err GK (n ) = ∑ n min(P P (n; Δn), P L (n, Δn))/2 . The experimental results measured by the different methods are shown in Fig. 5, which demonstrate that the generalized Kennedy detection closely approaches the Helstrom bound and is the best discrimination method that has been reported 42 .

Discussion
In this Article we have demonstrated a waveguide-integrated and large-dynamic-range quasi-PNR detector that employs a hybrid spatiotemporal-multiplexing scheme to read out a 100-pixel SNSPD array. In addition to inheriting all aspects of the excellent performances of single-pixel SNSPDs, this scheme also enables readout of the position information on the fired detector pixels. This distinct functionality makes our detector a versatile platform to perform various quantum optics experiments on a chip at an unprecedented level, such as the photon statistics measurement, the direct measurement of g (N) with N up to 15, the photon subtraction experiment with the subtracted photon number up to 7, and the quantum-limited photon state discrimination. In particular, these measurements present a comprehensive characterization of the quantum statistical properties of a true thermal light source for the first time, which is exclusively enabled by the simultaneous availability of high photon number resolution and fast detector response. We envision that our novel detector technology can boost a variety of cutting-edge applications in the near future, such as large-scale Boson sampling 57 , photonic quantum computing 58 and quantum metrology 59 .

Online content
Any methods, additional references, Nature Portfolio reporting summaries, source data, extended data, supplementary information, acknowledgements, peer review information; details of author contributions and competing interests; and statements of data and code availability are available at https://doi.org/10.1038/s41566-022-01119-3.

Device fabrication
The fabrication of the device involves six high-resolution (100 kV) e-beam lithography (EBL) steps, and a subsequent etching or deposition/lift-off process. First, alignment markers are pre-fabricated on top of a 100-mm-diameter, 330-nm-thick LPCVD-Si 3 N 4 /3.3-μm-thick thermal oxide/silicon wafer by the standard double-layer polymethyl methacrylate (PMMA) patterning process, e-beam evaporation of 10/100 nm Cr/Au layers, and subsequent lift-off in acetone. Second, a high-uniformity, 8-nm-thick NbN superconducting thin film is deposited by atomic layer deposition 45 , followed by e-beam patterning of the negative-tone 6% hydrogen silsesquioxane (HSQ) resist. It is worth noting that the spinning and patterning of the HSQ resist immediately after the fresh NbN film deposition is critical to maintaining excellent adhesion of the resist on the film. In the third EBL step, the electrode and contact pads for the on-chip resistors are defined by another double-layer PMMA patterning, e-beam evaporation of 5/25 nm Cr/ Au, and the subsequent lift-off process. The HSQ pattern is later transferred to the NbN layer in a timed reactive-ion etching step employing tetrafluoromethane chemistry, which defines the nanowire detector pixels, delay lines, on-chip inductors and impedance tapers. In the fourth EBL step, we pattern the positive-tone AR-P 6200 (CSAR 62) resist for the photonic microstructures, including gratings couplers, Y-splitters and waveguides. The patterns are then transferred to the Si 3 N 4 film via carefully timed reactive-ion etching in fluoroform (CHF 3 ). The remaining resist is removed with gentle oxygen plasma and hot N-methylpyrrolidone. In the fifth EBL step, we define the on-chip resistors by patterning double-layer PMMA and e-beam evaporation of 80/5 nm Cr/Au with lift-off process. Finally, the 80-nm-thick alumina (AlO x ) dielectric spacing layer and 100-nm-thick aluminium top ground layer are fabricated by double-layer PMMA patterning, e-beam evaporation and lift-off for making the low-speed microwave transmission line. The remaining HSQ mask on top of NbN in the delay-line area is removed by 1:100 diluted hydrofluoric acid after opening the PMMA window (lighter area in Fig. 1b) and before the deposition of AlO x /Al layers. The resulting device is shown in Fig. 1b-f, and additional device images as well as the fabrication yield are presented in Supplementary Note 1.

Device design
As shown in Fig. 1b, the photons are launched into the Si 3 N 4 waveguide from a fibre through the input grating coupler. The waveguide is then split into two branches, one of which is attached to the output grating coupler for power calibration and alignment, whereas the other one is adiabatically tapered from 1.2 μm to 8 μm width, and then connected to a series of 100 NbN nanowire detector pixels placed above the waveguide. All of the active detector pixels are made up of hairpin-shaped 80-nm-wide NbN nanowires that guarantee saturated internal efficiency at the 1,550 nm telecommunication wavelength. Each nanowire is shunted by a 5-μm-wide and 50-μm-long Cr/Au on-chip resistor (60 Ω resistance at 1.7 K), along with an on-chip inductor made of a 400-nm-wide NbN meander wire (200 nH inductance). All of the nanowires are series-connected with long-meandered 800-nm-wide NbN delay lines embedded in between, as visualized in Fig. 1b. Both ends of the nanowire-detector-delay-line chain are connected to the impedance tapers consisting of meandered NbN wires with a gradually varying width from 800 nm to 9.2 μm, which follow the Klopfenstein design to match the impedance between the delay lines (hundreds of ohms) and the external reading electronics (50 Ω). The total length of each impedance taper is 24 mm, which allows for a <50 MHz lower cut-off frequency. The long impedance tapers here play an important role in preserving the fast-rising edges and clear shapes of the photon-excited detector pulses by suppressing multiple reflections between the device and external readout electronics. At the ends of the impedance tapers, the microstrip lines are converted to coplanar waveguides to match the modes of ground-signal-ground radiofrequency probes.
By engineering the nanowire length and the distance of the nanowire from the edge of the waveguide, we could tune the photon absorption efficiency of each nanowire and thus ensure the input photons are evenly distributed over the detector pixels. In the etched clearance area for the waveguide, a 1.2-μm-wide bridges are designed for the connection of each nanowire detector to the delay-line sections that are positioned outside the waveguide area (Fig. 1e). The 3D finite-difference time-domain simulation study shows that the total scattering loss introduced by 100 of such bridges is lower than 0.2 dB. We further confirm the results by investigating the quality factors of Si 3 N 4 racetrack resonators with varying number of bridges embedded in the straight waveguide sections.
The parts of NbN delay lines and the impedance tapers are capped by a high-dielectric-constant (high-k) AlO x layer and a top metal ground made of an aluminium layer (lighter green area in Fig. 1b), which helps substantially slow down the propagation speed of the photon-excited microwave signals, thereby enabling a very compact device design and also reducing the cross-talk between the transmission lines. Due to the high kinetic inductance of the superconducting wires made of NbN thin film and the high capacitance introduced by the thin high-k layer, the propagation speed could be achieved as low as 1.07% of c (vacuum speed of light), despite the very wide delay lines compared with the nanowire detector. Each delay-line section is designed to be 3.4 mm long and introduces a 1.09 ns propagation time delay between neighbouring detector pixels (Fig. 1g).

Device characterization set-up
The sample chip containing tens of detector devices is mounted on a 3-axis stack of stages (Attocube) inside a low-vibration closed-cycle refrigerator (Cryomech) and cooled down to a base temperature of 1.7 K. We drive the stages to move the sample chip and make the electrode contact with a multi-channel radiofrequency probe, which is used to direct current bias the detector device and read out the photon-excited electrical pulses. In the meantime, the grating couplers are aligned to the single-mode fibre array by optimizing the optical transmission through the device (see Fig. 1). The photons are coupled into the waveguide from one of the fibre through the input grating coupler, while parts of them are output from the other calibration grating coupler, collected with another optical fibre in the same fibre array, and finally detected with a calibrated room-temperature photodetector. This cryogenic optical set-up not only guarantees multiple optical and radiofrequency channels input/output, but also allows for the measurement of multiple devices in a single round of cool-down.
The pulsed coherent light source is generated by gating a tunable continuous-wave laser (New Focus 6427 Vidia-Discrete) with the cascaded EOMs and acoustic-optic modulator, which guarantees subnanosecond narrow pulse width combined with a >100 dB extinction ratio to efficiently suppress the background photons. The thermal light source is generated by employing the same gating method but with the EDFA/ narrow-bandwidth spectral filter chain to replace the continuous-wave laser part. A more detailed description on the measurement set-up can be found in Supplementary Note 2.

Timing jitter characterization
We use a femtosecond laser (Toptica FemtoFiber pro IR) to characterize the timing jitter of each detector pixel. A beam-splitter along with a high-speed photodetector are used to provide the synchronization signal of the laser, and a high-speed oscilloscope (Teledyne LeCroy HDO9404-MS) is employed to measure and build the histogram for the arrival time difference between the synchronization signal and the pulses generated by the detector pixels. The histogram is shown in Extended Data Fig. 1a, where each peak corresponds to the 100 individual pixels. The zoomed-in data for the 1st, 50th and 100th pixels are also shown in Extended Data Fig. 1b-d. It can be seen that the timing jitter, which is defined by the FWHM of the histogram peak, is Nature Photonics Article https://doi.org/10.1038/s41566-022-01119-3 relatively small (~50 ps) for low pixel numbers and large (~90 ps) for high pixel numbers. This is because the signals from the detector of high pixel numbers have relatively lower peak voltage, which is caused by the larger ohmic loss from the top metal ground of the microwave transmission line after longer propagation (see Fig. 1g of the main text). The lower peak voltage in turn leads to lower signal-to-noise ratio and thus increases the noise-induced jitter. In a future work, the current aluminium ground of the transmission line could be replaced by other superconducting materials at the operation temperature of the device (such as niobium or NbN) to minimize the propagation loss of the detector signals.

On-chip detection efficiency and dark count rate characterization
We use the EDFAs and a bandwidth-tunable filter (Oz Optics BTF-11) to generate a 3-nm-bandwidth thermal light to characterize the grating coupler efficiency as well as the on-chip detection efficiency of the detector. A relatively broadband light source is used here because of its short coherence length to mitigate the reflection-induced interference between two grating couplers. As shown in Extended Data Fig. 2a, we use a symmetric design to facilitate the efficiency measurement. Here we assume that both of the grating couplers and Y-splitters perform identically. The total optical transmission between the two grating couplers is measured to be T tot = 0.088%, including two Y-splitters, and thus the fibre-to-detector transmission efficiency through one Y-splitter is T det = √T tot = 2.97%. Based on this result, we can estimate the on-chip optical power carried by the waveguide and further infer the on-chip input mean photon number n in with the calibrated attenuation by the optical attenuators. The on-chip detection efficiency can then be calculated as (n det − n dark )/n in , where n det and n dark are the mean number of pulses detected by the PNR detector and the dark count rates, respectively. Extended Data Fig. 2b illustrates the measured on-chip detection efficiency and dark count rates versus the bias current I b applied to the detector. The efficiency is measured with a relatively low input photon number n in = 1.2 and recorded as 88.5% at the bias current of I b = 18 μA, where the dark count is still at few-hertz level. The maximum efficiency reaches 95.5% and saturates, when the bias current is applied very close to the switching current (I SW = 19.5 μA). By using thinner NbN film and narrower nanowire width, detectors can be made with wider saturation plateau in the efficiency curve 45 , and thus they can provide near-unity efficiency while operating in the regime of low dark count rate. The typical bias current used for the detector in the photon statistical measurement is 18 μA.
We measure the individual pixel detection efficiency by calculating the total counts C i , where i = 1, 2, … , 100 for each detector pixel via summing up the counts for each histogram peaks in Extended Data Fig. 1a. The individual pixel efficiency is thus calculated by E i = C i / ∑ 100 j=1 C j and plotted in Extended Data Fig. 2c. The efficiency drops substantially for the middle 49th to 52nd pixels, as the nanowire detectors of these pixels are located at the end of the optical waveguide, and thus the absorption is limited by the finite length of the nanowires (see Fig. 1b of the main text). The uniformity of the pixel efficiencies could be further improved by better engineering of the nanowire detector length and position in the future. It requires a series of dedicated experimental tests, such as detailed measurement of the nanowire absorption efficiency versus the width, length, thickness, and the position of the nanowire on the waveguide. The results could then be compared with the simulation to obtain a more exact nanowire absorption efficiency model that could be applied in the future device design.
The detected mean photon number as a function of the input mean photon number n in at the fixed bias current I b = 18 μA is shown in Extended Data Fig. 2d. The detected mean photon number saturates as n in increases, due to the increased probability of more than two photons hitting identical pixels increases 27 . Some of the photons are missing in this case, as each detector pixel can only output one electrical pulse for multi-photon excitation. We verify this hypothesis by performing Monte Carlo simulations, in which we model the detector with 101 pixels, and the 101st pixel is the loss channel. For a single input photon, the probability of each pixel for detecting this photon is P i , where i = 1, 2, … , 101. We thus have P 101 = 11.5% and P i = 0.885E i , where i = 1, 2, … , 100 and E i is the single-pixel efficiency as shown in Extended Data Fig. 2c. For a single input photon, we can generate a random number 1 ≤ k ≤ 101 following the probability distribution of P i to determine which pixel will detect this photon. When the input pulse contains N photons, we generate N random numbers k 1 , k 2 , … , k N and then count how many pixels (except the 101st pixel) are fired. As a specific example, when N = 4, the numerically generated random numbers are k 1 = 4, k 2 = 4, k 3 = 5 and k 4 = 101, which means that the fourth and fifth pixels are fired while one photon is annihilated due to loss. As two pixels are fired, the detected photon number is two. We repeat this process many times and thus we can get a probability distribution U i,j=N (i = 0, 1, 2, …). The value of U i,j=N represents the probability of detecting i photons when the input pulse contains j = N photons. Obviously, we have U i,j=N = 0 when i > N and ∑ N i=0 U i,j=N = 1. We next scan the value of j and finally arrive at a two-dimensional matrix U ij . When the input pulse follows a Poisson statistics as P j = P P (n = j;n in ), where n in is the input mean photon number, the detected photon number probability distribution can be computed as P det (n = i) = ∑ j U ij P j . The detected mean photon number is n det = ∑ n nP det (n). For an ideal detector with 100% efficiency and perfect PNR capability, we have U ij = I, where I is the identity matrix and the detected photon number distribution is shown as a function of the input mean photon number in Extended Data Fig. 2e. For our detector, we use Monte Carlo simulation to numerically compute U ij , and the simulated probability distribution is shown Extended Data Fig. 2f, which agrees well with our experimental data shown in Extended Data Fig. 2g. It can be seen that the detector saturation effect transforms a Poisson distribution to a sub-Poisson distribution, and the detected mean photon number is lower than the actual input mean photon number.