Introduction

Quantum detection opens new frontiers in science and engineering, enabling applications in previously unexplored realms. At the heart of this advancement are photonic quantum detectors, which drive fields like quantum key distribution1, boson sampling2, quantum computing3, space-based communication4, bioimaging5, integrated photonics6, and as foundational studies of entanglement7 and quantum light sources8. The leading detector technologies are superconducting transition-edge sensors (TESs)9, valued for their inherent photon-energy and number resolution (up to 16 photons10), and superconducting nanowire single-photon detectors (SNSPDs)11, which offer unrivaled picosecond jitter12, gigahertz count rate13, and ultra-low noise (a few dark counts a week14).

For decades, these detectors have operated exclusively at temperatures below 4 K, relying on low-critical-temperature (TC) superconductors and primarily detected photons in the visible to near-infrared (IR) range. Recent groundbreaking experiments have demonstrated near-IR photon detection at 20 K using nanowires made from high-TC cuprates (BSCCO flakes15,16, LSCO-LCO bilayers15) and magnesium diboride (MgB2 thin films17), as well as mid-IR sensitivity extending to 29 μm wavelengths at millikelvin temperatures in low-TC WSi-based nanowires18. These advances lay the groundwork for next-generation detectors, enabling space-based applications and dark matter searches.

However, these advancements expose the limitations of microscopic models19,20, which fail to describe quantum detection in materials with complex electronic band structures21,22, larger superconducting gaps, detecting low-energy excitations (e.g., mid-IR photons18 and dark matter particles23), high thermal loads, and high light intensities24. Attempts to incorporate physical models into otherwise model-agnostic quantum detector tomography (QDT)25, have led to unphysical results26 or applicability limited to impractical, point-like detectors27. As a result, many experiments still rely on classical calibrations like measuring detection efficiency or count rate linearity with light intensity, which risk overlooking critical issues28 or cause misinterpretations29.

In this work, we develop a universal quantum detection model applicable across diverse materials and operating conditions. It incorporates two key factors: the spatial distribution of photon absorption sites across the detector area and fluctuations in the detection threshold energy. To validate our approach, we fabricated and characterized a high-TC MgB2 nanowire detector, where these factors are particularly pronounced. Our analysis reveals a blurred energy threshold for near-IR photons and provides the first insights into quantum detection mechanism in high-TC superconductors. Our model can be directly integrated into quantum detector tomography and, beyond superconducting nanowires, can be extended to study other detector classes, including semiconductors with two-photon absorption processes.

Results

Detection model: effects of blurred energy threshold and spatial photon distribution

A full description of a quantum detector assigns a positive-operator-valued measure (POVM) element to each possible detection outcome. Importantly, quantum detector tomography (QDT)25 establishes a procedure for reconstructing the POVM elements experimentally. For instance, for single-photon detectors with two possible outcomes, “click” and “no-click”, there are two corresponding POVM elements. These elements, in turn, are uniquely defined by a set of coefficients \(\{{Q}_{n}^{({\rm{click}})}\}\), where \({Q}_{n}^{({\rm{click}})}\) is the probability of obtaining a “click” outcome given an input of n photons. QDT may be realized by measuring the optical pulse detection probability (PDP) in response to controlled laser intensity (Fig. 1a),

$$\,{\text{PDP}}\,(\mu )=\mathop{\sum }\limits_{n=0}^{\infty }{F}_{n}(\mu )\,{Q}_{n}^{({\rm{click}})}.$$
(1)

Here \({F}_{n}(\mu )=\frac{{\mu }^{n}{e}^{-\mu }}{n!}\) describes the Poisson distribution of the number of photons n in the laser pulse with mean photon number μ (experimentally, the laser intensity is proportional to the product of μ and the pulse repetition rate). By fitting the experimentally measured PDP, eq. (1) can be inverted to recover \({Q}_{n}^{({\rm{click}})}\) and, accordingly, the POVM elements.

Fig. 1: Photon detection by click/no-click detectors with sharp energy thresholds.
figure 1

a Conceptual diagram: a laser pulse with mean photon number μ = 1 may contain higher photon numbers randomly distributed across M detector elements. b Pulse detection probability for single- and multi-element detectors (dashed and dotted curves, Eq. (3)). \(R=\,\text{ceil}\,(\frac{{U}_{0}}{h\nu })\) denotes the threshold energy U0 as an integer of photon energy hν and determines the slope PDP(μ 1) μR, δU is the effective width of the threshold. The inset depicts the idealized detection efficiency η = 1; a “click" occurs if the total energy of photons simultaneously impinging on the same element exceeds the threshold energy U0, otherwise “no-click". Regardless of M, the click probability maintains discrete slopes at small μ (see the main text).

However, for click/no-click detectors with a sharp, step-like detection threshold, e.g., avalanche photodiodes (APDs), QDT becomes redundant. Such detectors have a well-defined threshold at energy U0, determined by the semiconductor bandgap, with a sharp effective width δU U0. They produce a “click” with detection efficiency η only if the energy of an incident photon hν exceeds the threshold energy U0. In this case, \({Q}_{n}^{({\rm{click}})}=1-{Q}_{n}^{({\rm{no-click}})}=1-{(1-\eta )}^{n}\), i.e., the response is fully described by a single parameter η (note η may also include optical coupling and energy conversion losses). Since η can be conveniently calibrated by classical methods, QDT is rarely used for such detectors.

At low laser intensities (μ 1), for detectors with sharp thresholds, expanding the exponential function in eq. (1) shows that PDP(μ) is a polynomial whose largest term scales as μR, where \(R=\,\text{ceil}\,(\frac{{U}_{0}}{h\nu })\) denotes the threshold energy as an integer of photon energy. Hence, PDP(μ 1) μR obeys discrete power laws (solid curves in Fig. 1b). This discrete behavior has led to a common experimental approach of determining detection regimes (single-photon for R = 1, two-photon for R = 2, etc.) by measuring the slope of the detector count rate versus laser intensity11. However, this method is not valid at high laser intensities (μ≥1) and for detectors with blurred thresholds.

In superconductors, the energy barrier for detection is set by the condensation energy (proportional to the square of the superconducting energy gap) and is blurred by thermal30 or Fano31 (phonon loss) fluctuations, non-uniformities, and geometrical constraints. Upon photon absorption, only a fraction of the photon energy is effective in reducing this barrier due to significant losses during photon energy conversion into the electron system. While the exact residual barrier is not precisely known, it scales linearly with the incident photon energy because the loss mechanism (via Debye phonons) is photon-energy independent. We use this linearity and scale the threshold energy U0 and its blur (δU) to the energy of incident photons. In this way, the detection efficiency ηU is defined by the error function (see eq. (5) in Methods) of the photon energy, threshold energy and blur. Below we use the scaled values U0 and δU.

For characterization of quantum detectors made from materials with varied properties, we propose a detector model that incorporates two critical effects, neglected in previous studies25,26,27: (i) spatial distribution of photon absorption sites across the detector and (ii) arbitrary blurred energy thresholds. While it is tailored to superconducting detectors, it can be extended to other detector classes (see Discussion). Our model relies on general microscopic principles of photon detection in superconductors regardless of their (low- or high) TC, gap structure, geometry, or ambient conditions. Specifically, we assume that detection occurs locally in regions (photon-induced hotspots) confined to a volume \(V=4\pi {L}_{T}^{2}d\)32, where d is the film thickness, LT is the thermal length determined by electron diffusion within the superconductor and the electron cooling to the substrate. When multiple photons are absorbed simultaneously in the same region, their energies are summed, and a detection event may occur if their total energy exceeds U0, equivalent to detecting a single higher-energy photon. Detection events across regions are statistically independent.

The localized detection nature implies that a quantum detector can be represented as M independent, identical “sub-detectors" (M-elements detector, each with size LT) all sharing a common output. Although each detector element individually, and all elements collectively, functions as a click/no-click detector, the click probability correlates with the total energy E = s × hν of s photons simultaneously absorbed in the same element.

In this scenario, the probability of outcome “click" \({Q}_{n}^{({\rm{click}})}\) in Eq. (1) includes (i) the probability of distributing n photons across M independent sub-detectors, which reduces to the classical problem of partitioning an integer n, and (ii) the blurred energy threshold. Integer partitioning belongs to the class of hard problems33 whose solution requires exponential time and, therefore, is computationally expensive. For instance, there are 42 partitions of the integer 10, while 100 has over 108 partitions. We solved this problem by treating it as a classical combinatorial problem of distributing n labeled balls (order matters) in M boxes (see partition problem in Methods). The obtained probability for the i-th partition, pi(n, M), incorporates permutations and multinomial arrangements of integer n into ri,s repetitions of summands s (from 1,2,...,n), such that n = ∑ssrs. This is given by:

$${p}_{i}(n,M)=\frac{1}{{M}^{n}}\frac{M!}{(M-{Q}_{i})!}\frac{n!}{{\prod }_{s}{(s!)}^{{r}_{i,s}}{\prod }_{s}{r}_{i,s}!},$$
(2)

where Qi = ∑sri,s denotes the number of parts in the i-th partition. For instance, in the partition (1+1+2) of n = 4 photons distributed between M-detector elements, there are Q = 3 non-empty elements, the photon number s = 1 occurs (repeats) in two elements and s = 2 in one element.

Note, at low laser intensities (μ 1), the pulse detection probability for multi-element detectors with sharp thresholds (δU hν) also obeys discrete power laws (dashed and dotted curves in Fig. 1b), similar to single-element detectors.

Next, we incorporate a blurred threshold, evidence of which was observed even in conventional low-TC NbN-based nanowire detectors30. We model the blurred threshold in the energy-dependent detection efficiency ηU (Fig. 2a inset), represented by an error function with a mean value U0 (threshold energy) and a standard deviation δU (threshold width, see Eq. (5) in Methods). As incident photon energy increases above U0, ηU asymptotically saturates. The probability of detecting a laser pulse is then expressed as:

$$\,{\text{PDP}}\,(\mu )=\mathop{\sum }\limits_{n=0}^{\infty }{F}_{n}(\mu )\left[1-\mathop{\sum }\limits_{i=1}^{{\mathcal{NP}}(n)}{p}_{i}(n,M)\,\prod _{s}{\left[1-{\eta }_{{\rm{U}}}\right]}^{{r}_{i,s}}\right],$$
(3)

where \({\mathcal{NP}}(n)\) is the number of partitions of the integer n.

Fig. 2: Detectors with blurred energy thresholds.
figure 2

a Pulse detection probability (Eq. (3)) for detectors with a threshold width δU = hν and the number of elements M indicated in the legend. The inset depicts the detection efficiency ηU defined as an error function of total photon energy (see the main text). The arrow (and color scheme) indicates increasing threshold energy U0 from hν to 3 hν. b The diagonals of the click POVM, \({Q}_{n}^{({\rm{click}})}\), reflect the detection probabilities of different photon numbers computed for M = 100, U0 = 2hν, and two threshold width δU = hν (dashed curve) and δU = hν/4 (solid curve), where hν = 0.04 eV. The threshold is illustrated in the inset. Detection probability of small photon numbers is higher for larger blur (see text).

In our model, dark counts or background thermal photons can be incorporated by assigning a non-zero efficiency at zero photon energy, i.e., ηU=0 > 0, which introduces an offset in the count rate. For simplicity, we subtract the experimentally measured dark count rate before fitting to the model. Other noise sources, e.g., parasitic reflections, afterpulsing, or dead-time effects, may also influence the measured count rate34 and can be incorporated in our model, but are beyond the scope of this work.

When the threshold blur equals the photon energy (δU = hν), the model (Fig. 2a) reveals two key effects: (i) for any number of detector elements M, there exists a sufficiently small μ providing linearity of PDP(μ), (ii) non-linear and non-discrete slopes in PDP(μ) before it saturates emerge at higher μ (sooner for a smaller number of elements) and arise solely from the blurred energy threshold (compare to Fig. 1b with a sharp threshold). These effects are due to the statistical nature of photon detection. For a given number of photons, the chance of two photons hitting the same element diminishes rapidly with increasing M. As a result, even with low detection efficiency, detection occurs primarily via single-photon events, producing a linear slope in PDP(μ). This linearity should not be misinterpreted as a sign of single-photon operation—it simply indicates a nonzero ηU. Provided sufficient acquisition time, such low efficiency can always be experimentally measured.

The key information lies in the width δU and the mean U0 of the detection threshold. This highlights the need for a model-enhanced QDT approach to reliably extract these parameters.

Implications for existing SNSPDs

In our detection model, photon energy serves as a scaling parameter for the detection threshold and its blur. Let’s consider a recent practical example of low-TC WSi-based SNSPD designed for detecting mid-IR photons with a wavelength of 29 μm (hν = 0.04 eV) reported in ref. 18. This detector features a threshold at energy U0 ≈ 0.08 eV (or 2 hν) and with blur δU ≈ 0.01 eV (or hν/4), shown in the inset in Fig. 2b. As we illustrate in Fig. 2b (diagonals of the click POVM computed via eq. (6), see Methods), broadening the threshold increases the detection probability for lower photon numbers. This implies that, beyond the straightforward strategy of enhancing mid-IR sensitivity by lowering the threshold energy below the photon energy (e.g., through reducing the superconducting gap via material engineering or film thinning), an alternative approach is to intentionally increase the threshold blur (i.e., through defect engineering). However, this approach has limitations and provides only moderate improvements.

Among low-TC materials, the silicide-based (WSi35, MoSi36) and nitride-based (disorder-optimized NbN37, NbTiN38) SNSPDs exhibit a clear saturation of photon counts with increasing bias current or photon energy up to the near-infrared range. Our model attributes this behavior to a relatively sharp detection threshold with a width much smaller than the near-infrared photon energy. This interpretation aligns with findings from experiments using single-photon sources39, confirming the sharp threshold. However, non-discrete (smooth) dependencies of count rate versus light intensity have been observed for SNSPDs made of other low-TC superconductors, for example, Nb40, Al41, NbC42, and even NbN27,43 when operated outside its optimal conditions. Our model explains these non-discrete dependencies as a consequence of relatively blurred thresholds with the width comparable to the photon energy in the visible range. This is consistent with spectral measurements30,43, which show an exponential decrease in detection efficiency with decreasing visible photon energy.

Experimental validation with MgB2 detectors

To test our model, we fabricated and characterized a superconducting nanowire detector made of modern MgB2 thin film, as shown in Fig. 3a (see Methods for details). The device consists of a nanowire with the thickness 8 nm, width w = 100 nm, and length l = 100 μm. It exhibited a superconducting transition at 35 K and hysteresis current, as shown in Supplementary Fig. 1a and b, respectively. The device was mounted into a cryostat with the base temperate 3.1 K and optical windows and electrically biased using standard circuiting (with shunts, see Methods). The MgB2 device outputs fast voltage pulses, as shown in Supplementary Fig. 2, with a dead time of 11 ns, defined as the time at which the voltage decays below the amplifier noise level (see Supplementary Note 1 for circuit details). A free-space optical setup (Fig. 3b) was used to deliver laser pulses with the duration 30 fs (FWHM), significantly shorter than the characteristic relaxation times in MgB244, ensuring simultaneous photon absorption within the pulse duration. Free-space coupling avoids the pulse broadening that otherwise occurs in optical fibers due to dispersion. The laser central wavelength (785 nm, photon energy ≈ 1.6 eV) is well above both MgB2’s superconducting gaps (Δπ = 1.6 meV and Δσ = 6.0 meV for current films45). The laser pulse repetition rate was 80 MHz (12.5 ns period). Given the low detection efficiency of our device and fast electron cooling time of MgB2 (2 ps, see Supplementary Note 3), potential effects of the 12.5 ns laser pulse period approaching the 11 ns device dead time can be neglected.

Fig. 3: Characterization of MgB2 nanowire detector
figure 3

a Image of the MgB2 nanowire on a SiC substrate (note, the negative e-beam resist remains on the top). b Free-space optical setup including a femtosecond 785 nm laser, beamsplitter (BS), mirror (M), calibrated attenuators (A), lens (L), and a cryostat with an optical window. c Pulse detection probability of the MgB2 nanowire in response to mean photon number μ at the detector area for different bias currents Ibias indicated (the error bars are based on Poisson errors of measured count rates). Markers: measured data; curves: model fits using eq. (3) with the number of detector elements M = 773 fixed, the best-fit threshold width δU = 1.6 eV, and the best-fit current-dependent threshold energy U0(Ibias), shown in the inset.

Figure 3c shows the measured optical pulse detection probability (with dark counts subtracted) as a function of the mean photon number per pulse μ. We estimated μ from the measured laser power and repetition rate, accounting for the spatial overlap between the laser spot (20 μm diameter) and the nanowire, and assuming a film absorbance of approximately 30% (noting that the actual absorbance may differ). The data in Fig. 3c were obtained by sweeping the bias current from 525 uA up to the critical current IC = 540 uA at the fixed cryostat temperature 3.1 K and different fixed laser intensities. For clarity, Fig. 3c displays only a subset of data, while the full experimental dataset spans the entire plot area, with their slopes continuously changing from μ1 to μ2.5 as the bias current decreases. These non-discrete slopes, also observed previously45, are now explained by our model as a consequence of the blurred energy threshold.

We fit our model in Eq. (3) to the measured PDP(μ), shown in Fig. 3c, using the threshold energy U0 and width δU as the only two fitting parameters. To ensure consistency, we constrained δU to remain constant across all datasets, as the experimental current range spans only 1.3% of the critical current. Importantly, the number of independent elements M was fixed at 773, estimated by dividing the MgB2 nanowire area by the photon-induced hotspot area with radius LT = 29 nm (see Supplementary Note 3) and accounting for the 20% overlap with the 20 μm laser spot (\(M=0.2wl/[\pi {L}_{T}^{2}]\)).

Best model fits are shown in Fig. 3c with lines. Due to the high computational expense, the photon number n in Eq. (3) was truncated at 65 (as integer 65 has about two million partitions), and the mean photon number at μ = 45 (for μ = 45, the probability of finding 65 photons is 0.016 of the probability of finding 45 photons). The best-fit values were the threshold width δU = 1.6 eV and the threshold energy lenearly dependent on the bias current (Ibias) within the experimental range, U0(Ibias) = [4.5 + 140(1 − Ibias/IC)] × hν. Extrapolating it to the critical current results in U0(IC) = 7.1 eV (the black curve in the inset of Fig. 3c). The uncertainty in the fitting parameters is ≈ 0.1 eV.

An independent estimate of the threshold energy \({U}_{0}\approx 4\pi \,d\,{L}_{T}^{2}\,\,\text{eDOS}\,\,{({k}_{B}{T}_{{\rm{C}}})}^{2}\), yields ≈ 9.2 eV for zero current and temperature, which is close to the experimental value. Here, eDOS is the electron density of states per one spin and \((4\pi \,d\,{L}_{T}^{2})\) is the relevant volume (see Supplementary Note 4).

Alternatively, M can be estimated as the smallest size of an optimal fluctuation in the superconducting system that drives it out of equilibrium and produces a dark count30 (dark counts at different base temperatures are plotted in Supplementary Fig. 3). This size (lF = 6 nm) approximately corresponds to the coherence lengths in MgB2 (see Supplementary Note 4), yielding M = 5806. The corresponding best-fit values are δU = 0.9 eV and U0(Ibias) = [3.1 + 80(1 − Ibias/IC)] × hν, with U0(IC) = 4.9 eV. Despite uncertainty in M, the key conclusion remains, namely, the energy threshold is blurred and its mean value is larger than the photon energy.

We note that the exact correlation length and correlation time of the hotspot remain open research questions. While other methods have been reported such as two-photon pump-probe measurements for the hotspot lifetime46 and one- and two-photon detection regimes comparison for the hotspot size47, however, they are not applicable to detectors with strongly blurred thresholds, where distinguishing one- and two-photon events from multi-photon events is not possible.

Discussion

Incorporating a detection model that accounts for both a blurred energy threshold and spatial photon distribution into QDT is essential for correctly interpreting measurements from both conventional low-TC29 detectors and novel (and unconventional high-TC) detectors like MgB2 nanowires. At high photon fluxes, threshold widths of about the photon energy lead to significant contributions from multi-photon events, manifesting as non-discrete slopes in photon count rate versus light intensity.

Thermal fluctuations30 are the most likely cause of the threshold blur in MgB2, as their impact increases with TC following statistical thermodynamics48. Possible contribution to threshold blurring from Fano fluctuations31 should be excluded due to much faster electron scattering times in MgB2 (femtoseconds49) compared to NbN (picoseconds50), where the impact of these fluctuations was already shown to be negligible30.

To enhance photon detection in MgB2 nanowires, lowering the threshold energy closer to infrared photon energies is essential. The most straightforward strategies are to reduce the superconducting gap or increase the current density, as our findings show that the threshold energy is strongly dependent on current (inset in Fig. 3c). Furthermore, our model also shows that moderate enhancements in mid-infrared sensitivity can be achieved by intentionally blurring the fixed energy threshold (see “Implications for existing SNSPDs" in Results). Recent experiments15,16,17 suggest that He-ion irradiation may enable such control. In MgB2, He-ion irradiation may merge its two gaps or introduce spatial non-uniformities, potentially blurring the threshold even further. Our detection model-enhanced QDT approach can resolve such effects.

Additionally, our approach has direct implications for photon-number-resolving (PNR) measurements, which are essential in photonic quantum computing and quantum cryptography. In SNSPDs, photon-number information is encoded in the rising time (or arrival time) of the voltage pulse. Our model links this time to the spatial distribution of absorbed photons and local energy threshold, showing that some degree of PNR is present even when multiple photons are absorbed within the same hotspot—via the energy-dependent intrinsic delay time (latency)51,52. The main limitation of PNR-SNSPDs lies in resistive domain and hotspot overlaps53; our model allows to incorporate these effects and refines the PNR model. Further PNR development is ongoing and will be reported separately.

Relying on the quantized nature of light, we reconstructed the energy threshold of the MgB2-nanowire detector without the need for spectral measurements, which pose additional challenges. Multi-photon detection requires both tight timing and spatial coincidence (within the electron cooling time and thermal length, respectively). These two conditions are rarely met under continuous-wave (CW) light illumination (see “Detection of CW light" in Methods) unless high CW photon fluxes are used. Furthermore, photons absorbed during the detector’s dead time are not counted, but still heat the detector, complicating interpretation and distorting results in such experiments.

Although we chose a superconducting detector as a showcase, our approach can be extended, mutatis mutandis, to other detector classes. For example, it can be applied to semiconducting photodetectors, where the blurred energy threshold might capture the probabilistic nature of two-photon absorption54, or to detectors with spatially (in depth) distributed absorption sites, such as Schottky photodiodes or photomultiplier tubes. For detectors with non-uniform material properties or defect-engineered energy gaps, our model with an arbitrary energy threshold enables the reliable interpretation of detection mechanisms across various photon energies. Thus, our approach could enhance the understanding of detection processes across diverse quantum sensing technologies.

In conclusion, we established a universal detection model that can augment quantum detector tomography by embedding physical constraints on POVMs, providing a comprehensive framework for understanding quantum light detection. Our work highlights the significant impact of blurred energy thresholds in high-critical-temperature superconductors, explaining the non-discrete slopes observed in MgB2 photon counts vs. light intensity. Further studies are needed to address how material engineering influences superconducting gaps and detection threshold and to identify the mechanisms responsible for the threshold blur in MgB2. Our model has broad implications for improving photon-number resolution, enhancing detection of low-energy (mid-infrared) photons, and engineering the detection threshold via post-fabrication techniques such as ion irradiation. Beyond superconducting nanowires, our approach can be extended to other detector classes.

Methods

Partition problem

We reduce the problem of distributing n photons over the detector area consisting of M independent, identical elements to a classical combinatorial problem of counting the permutations of n balls into M boxes (0 < n ≤ M) such that each box may contain any number of balls (including zero). We aim to find the probability that a given box contains s balls.

  • The total number of ways to distribute n balls into M boxes (order matters) is Mn.

  • Each from Mn permutation results in Qi non-empty boxes. The number of ways to choose these Qi boxes from M boxes (order matters, without repetitions) is \(\frac{M!}{(M-{Q}_{i})!}\).

  • The number of non-empty boxes Qi equals the number of non-zero parts in i-th partition of the integer n, which can be represented with a multi-set {mk} of positive integers that sum to n, so that ∑kmk = n. For example, the partition {2, 1, 1} of n = 4 has Q = 3 parts, while the partition {1, 1, 1, 1} has Q = 4 parts. Alternatively, the integer n can be represented with summands, each equals the number from 1, 2, . . , n. We denote ri,s as the repetition number that captures how often summand s occurs in i-th partition so that the integer being partitioned is ∑ssri,s = n, and the number of parts in the partition is ∑sri,s = Qi. Then, the number of ways to partition the integer n into ri,s repetitions of specified summands s is \(\frac{n!}{{\prod }_{s}{(s!)}^{{r}_{i,s}}{\prod }_{s}{r}_{i,s}!}\) (see e.g., Theorem 4.1.5 in ref. 55). We note that a recurrence relation yields the total number of ways to split the integer n into summands with order \({\sum }_{i}\frac{{Q}_{i}!}{{\prod }_{s}{r}_{i,s}!}={2}^{n-1}\). In our notation, it also follows that \({\prod }_{k}{m}_{k}!={\prod }_{s}{(s!)}^{{r}_{i,s}}\).

The total probability is a sum of probabilities pi(n, M) of specific distributions Eq. (2) over all partitions (\({\mathcal{NP}}(n)\)) of n:

$$P(n,M)=\mathop{\sum }\limits_{i=1}^{{\mathcal{NP}}(n)}{p}_{i}(n,M)=\mathop{\sum }\limits_{i=1}^{{\mathcal{NP}}(n)}\frac{1}{{M}^{n}}\frac{M!}{(M-{Q}_{i})!}\frac{n!}{{\prod }_{s}{(s!)}^{{r}_{i,s}}{\prod }_{s}{r}_{i,s}!}.$$
(4)

Here, i in the sum runs over each partition, and s in the products runs over each summand in i-th partition.

Blurred energy threshold

In superconductors, thermodynamic fluctuations of the electron free energy obey a normal distribution. In photon detection, these fluctuations translate into variations in the detection energy threshold, modeled by the error function30,

$${\eta }_{{\rm{U}}}=\frac{1}{2}\left[1+\,{\text{erf}}\,\left(\frac{E-{U}_{0}}{\sqrt{2}{\delta }_{{\rm{U}}}}\right)\right].$$
(5)

Here, U0 and δU are the mean energy and the width of the detection threshold, both are scaled to the energy of incident photons E. This function ηU describes the detection efficiency; as photon energy E increases, ηU asymptotically saturates.

Modified quantum detector tomography

Our universal detection model imposes physical constraints on POVM elements that account for (i) spatial photon distribution (Eq. (2)) across M independent detector elements, where s photons may impinge on the same element and deposit energy E = s × hν, and (ii) an arbitrarily blurred detection threshold described by ηU, (Eq. (5)). For click/no-click detectors, the two corresponding POVM elements can be uniquely defined as:

$${Q}_{n}^{({\rm{click}})}=1-\mathop{\sum }\limits_{i=1}^{{\mathcal{NP}}(n)}{p}_{i}(n,M)\prod _{s}{\left[1-{\eta }_{{\rm{U}}}\right]}^{{r}_{i,s}},$$
(6)
$${Q}_{n}^{({\rm{no-click}})}=\mathop{\sum }\limits_{i=1}^{{\mathcal{NP}}(n)}{p}_{i}(n,M)\prod _{s}{\left[1-{\eta }_{{\rm{U}}}\right]}^{{r}_{i,s}}.$$
(7)

These POVM elements are connected to the pulse detection probability (see Eq. (1)) via matrix multiplication PDP = FΠ. Here, PDPC×1 contains all the measured detection probabilities, FN contains the photon number distribution (truncated at N) of C coherent probe states, and ΠN×1 contains the diagonal elements of click POVM \({Q}_{n}^{({\rm{click}})}\), where subscripts denote the matrix dimensions. Reconstructing POVMs reduces to a matrix inversion problem, allowing direct determination of detection threshold.

Detection of CW light

In experiments with CW light and M-element detector, multi-photon detection requires all photons to arrive within a characteristic time window (τe) and be absorbed in the same detector element. We divide one second into K = t/τe time windows. Photons arriving within a single window are treated as arriving simultaneously. The number of photons n in each window is Poisson-distributed \({F}_{n}(\mu /K)=\frac{{(\mu /K)}^{n}{e}^{-\mu /K}}{n!}\), where μ/K is the mean photon number per time window. The probability of q windows containing n photons follows a Binomial distribution, \({P}_{n,q}(K)=\frac{K!}{q!(K-q)!}{F}_{n}^{q}{[1-{F}_{n}]}^{K-q}\). Then, the CW photon flux detection probability (CWDP) is:

$$\,{\text{CWDP}}\,(\mu )=\sum _{n}\mathop{\sum }\limits_{q}^{K}{P}_{n,q}(K)\left[1-\,\mathop{\sum }\limits_{i=1}^{{\mathcal{NP}}(n)}{p}_{i}(n,M)\,\prod _{s}{\left[1-{\eta }_{{\rm{U}}}\right]}^{{r}_{i,s}}\right].$$
(8)

This result must be corrected for the detector dead time, which would further reduce the probability of CWDP. Without this, the heating effect induced by photons absorbed during the dead time is overlooked, which corrupts the outcome in such experiments.

Device fabrication

Our ultra-thin MgB2 films56 were deposited with a custom-built Hybrid Physical-Chemical Vapor Deposition system57,58. Magnesium melts from solid bits placed in the vicinity of the 4H-SiC substrates (heated to 700 C) in an atmosphere of H2+B2H6 (H2 flow 400 sccm, 5% B2H6/H2 flow 2 sccm) reacting with boron. The film thickness is ≈ 7–8 nm, estimated based on the deposition time and TEM imaging of films with varied thicknesses. After deposition, the films were covered with a 1 nm amorphous Si layer.

Devices were patterned using electron beam lithography with a negative resist and Ar+ ion milling, leaving the resist layer on top of MgB2. Ti/Au contacts were made via a lift-off process to enable bonding. The device layout comprises a 100 μm-long, 100 nm-wide straight nanowire in series with a 5.1 mm-long, 1 μm-wide meandered inductor made of the same MgB2 film.

The critical temperature of the nanowire was ≈ 35 K with a transition width of ≈ 1 K. It is 1.6 K lower than that of the 1 μm-wide inductor, likely due to edge effects, as the feature size approaches the coherence length (ξπ ≈ 60 nm in the clean limit)59. At 40 K, the nanowire’s normal state resistance was ≈ 14 kΩ, as determined by the I-V curve and the R-T curve (see Supplementary Note 1). The device’s critical (switching) current was limited to that in the nanowire, being much smaller than that in the 1 μm-wide inductor.

The meandering 1 μm-wide inductor had a resistance of 66 kOhm at 40 K, corresponding to a sheet resistance of 13 Ω/sqr. Its estimated inductance in the superconducting state is ≈ 7.5 nH (the sheet kinetic inductance in MgB2 is ≈ 1.5 pH/sqr45). The device’s residual resistance ratio was R300K/R40K ≈ 2.

Device characterisation

The MgB2 devices were measured in a continuous-flow optical cryostat with a base temperature of 2.0 K (ST-100, Janis). A chip was mounted on a copper holder and wire bonded to PCB contact pads. The device was biased with a direct current source (battery-power home-made) through a room-temperature bias-T (ZFBT-4R2GW+, Mini-Circuits) with a nominal bandwidth of 0.1–4200 MHz. Response pulses were amplified with a low-noise room-temperature amplifier (ZFL-1000LN, Mini-Circuits, 0.1-1000 MHz bandwidth). The amplified pulses exhibited 11 ns dead times and were counted with a counter (SR400, Stanford Research Systems) and recorded with a real-time oscilloscope (LeCroy WaveMaster 8600 A, 6 GHz bandwidth, 20 GS/s). This dead time is jointly determined by the device inductance along with an additional parallel shunt resistor and a series inductor, both were located on the PCB near the chip, which were implemented to mitigate latching. The light was guided from the femtosecond-pulse 785 nm laser (Femtosource, synergy 20) to the device through the cryostat’s optical window in free space. The rough alignment was performed using a video image on the device plane positioning the laser spot with a diameter of 20 μm in the middle of the nanowire. The fine alignment was achieved by maximizing the photon counts from the nanowire. The laser power was measured with a Silicon sensor (S120UV, Thorlabs) and attenuated with (absorptive) neutral density filters.