Stimulated emission of signal photons from dark matter waves

The manipulation of quantum states of light has resulted in significant advancements in both dark matter searches and gravitational wave detectors [1-4]. Current dark matter searches operating in the microwave frequency range use nearly quantum-limited amplifiers [3, 5, 6]. Future high frequency searches will use photon counting techniques [1] to evade the standard quantum limit. We present a signal enhancement technique that utilizes a superconducting qubit to prepare a superconducting microwave cavity in a non-classical Fock state and stimulate the emission of a photon from a dark matter wave. By initializing the cavity in an $|n=4\rangle$ Fock state, we demonstrate a quantum enhancement technique that increases the signal photon rate and hence also the dark matter scan rate each by a factor of 2.78. Using this technique, we conduct a dark photon search in a band around $\mathrm{5.965\, GHz \, (24.67\, \mu eV)}$, where the kinetic mixing angle $\epsilon \geq 4.35 \times 10^{-13}$ is excluded at the $90\%$ confidence level.


Introduction
The existence of dark matter (DM) is one of the greatest mysteries in physics, which has puzzled scientists for nearly a century.Despite the lack of direct detection, there is compelling evidence for its existence, including its estimated contribution of 27% to the universe's energy density and its gravitational effects on galaxy dynamics and structure formation [7][8][9].Axions and dark photons have emerged as leading candidates for dark matter due to their cosmological origins and low-energy properties, which allow them to exist as coherent waves with macroscopic occupation numbers [10][11][12][13][14]. Dark matter haloscope experiments in the microwave frequency range use a cavity to resonantly enhance the oscillating electric field generated by the DM field at a frequency corresponding to the mass of a hypothetical particle (ν = mc 2 /h) [14,15].Since the mass of DM is unknown a priori, experimental searches are typically conducted as radio scans in which the resonant cavity is tuned one step dν at a time to test different frequency hypotheses.A key figure of merit is therefore the frequency scan speed, which in a photon counting experiment scales as dν/dt ∝ dν R 2 s /R b where R s and R b are the signal and background count rates respectively.
Quantum techniques have proven useful in accelerating the scan rate of axion and wavelike dark matter searches.Superconducting parametric amplifiers, which are quantum-limited, have reached the standard quantum limit (SQL) and add only 1/2 photon of noise per mode, as required by the Heisenberg uncertainty principle for phase-preserving measurements [16][17][18][19][20].Alternatively, qubit-based single photon detection [1] does not consider the photon phase and can in principle measure without any added detection noise by achieving extremely low, sub-SQL background rates.
While both of these methods employ quantum technologies, their operation is in some sense recognizable as an ideal classical amplifier and microwave photomultiplier.Parametric amplifiers and cavity-qubit systems can also synthesize inherently quantum mechanical states of light such as squeezed states [21][22][23] in the former and Fock states [24,25] or Schrodinger cat states [26][27][28][29][30] for the latter.Recently, squeezed state injection paired with phase-sensitive amplification was used to improve the scan rate of the HAYSTAC experiment [2].In this work, we develop a new method in which we prepare an n-photon Fock state which enhances the signal rate by η (n + 1) times where η is the efficiency of detecting the state.By creating a Fock state with |n = 4 photons in the cavity, we observe a 2.78-fold enhancement in the signal rate.We show that this technique is compatible with the previously-demonstrated noise reduction from photon counting [1].
The power delivered to the cavity by a current density generated by dark matter J DM is given by and is proportional to the magnitude of oscillating electric field E(x) in the cavity.In the conventional scenario, the cavity is cooled to the vacuum state, and the signal electric field builds up monotonically over the coherence time of the cavity or of the dark matter wave in a process akin to spontaneous emission.Alternatively, we may ini-tialize the cavity with a non-zero E(x) field from a coherent state sine wave or from a Fock state to induce stimulated emission.The Fock state has some advantages.First, unlike the homodyne or heterodyne detection using a coherent state pump, the Fock state is free from any shot noise, making it possible to measure small signal amplitudes far below the SQL.Second, a Fock state is symmetric in phase, making it equally sensitive to any instantaneous phase of the incoming DM wave, which is unknown a priori.
We can model the action of the DM wave on a Fock state as a classical drive amplitude ξ which shifts this phase-symmetric state away from the origin in the Wigner phase space by α (see Supp Fig. S6).The resultant state comprises both in-phase components which extracted excess power from the DM wave and also outof-phase components which delivered their power to the DM wave.The stimulated emission process for DM converting into photons is enhanced by a factor of (n + 1) while the stimulated absorption process is enhanced by a factor of n.Mathematically, the stimulated emission into the cavity state from a dark matter wave can be described as shown below, where D(α) is the displacement operator.From Eqn.
(2), we can infer that the displacement (α 1) induced by the DM wave on a cavity prepared in |n Fock state results in population of |n + 1 state with probability proportional to (n + 1).Using number-resolving measurements, the signal can thus be observed with (n + 1)× higher probability if the cavity is prepared in a larger |n Fock state.
We note that just as in other cases of quantumenhanced metrology, the (n + 1) enhancement factor in the signal transition probability can be exactly canceled by the 1/(n + 1) reduction in the coherence time of the probe.As a result, there would be no net improvement in the actual signal rate R s .However, this consideration does not apply when the limiting coherence time is that of the dark matter wave rather than of the Fock photon state in the cavity.In such cases, the signal rate is not degraded by the reduction of the probe coherence time and retains the factor (n + 1).To our knowledge, this is one of the few cases where quantum metrology can provide a realizable improvement in a real-world application.Also, since the readout rate scales as the inverse of the probe coherence time, the background count rate may also scale linearly with (n+1), for example for backgrounds associated with readout errors.For experiments with fixed tuning step size dν given for example by the dark matter linewidth, the improvement in scan speed dν/dt ∝ dν R 2 s /R b is therefore a single factor of η (n + 1).

Fock state preparation and photon number resolving detector
We couple the cavity to a non-linear element, in this case a superconducting transmon qubit to prepare and measure the Fock states, which are otherwise impossible to create in a linear system such as a cavity.The device used in this work is composed of three components -a high quality factor (Q s = 4.06 × 10 7 ) 3D multimode cavity [31] to accumulate and store the signal induced by the dark matter (storage, ω s /2π = 5.965 GHz), a superconducting transmon qubit (ω q /2π = 4.95 GHz), and a 3D cavity strongly coupled to a transmission line (Q r = 9×10 3 ) used to quickly read out the state of qubit (readout, ω r /2π = 7.789 GHz) (Fig. 1 (a)).We mount the device to the base stage of a dilution refrigerator operating at 10 mK.
The interaction between a superconducting transmon qubit [33,34] and the field in a microwave cavity is described by the Jaynes-Cummings Hamiltonian [35] in the dispersive limit (qubit-cavity coupling qubit-cavity detuning) as, where a and a † are the annihilation and creation operators of the cavity mode and σ z is the Pauli Z operator of the transmon.Eqn. 3 elucidates a key feature of this interaction -a photon number dependent shift (χ) of the qubit transition frequency (see Fig. 1(b)) [36].Another important feature of this Hamiltonian is the quantum non-demolition (QND) nature of the interaction between the qubit and cavity which preserves the cavity state upon the measurement of the qubit state and vice-versa [36][37][38].By driving the qubit at the Stark shifted frequency (ω q + n χ), one would selectively excite the qubit if and only if there are exactly n-photons in the cavity.
Recent works have shown that a single transmon has the capability to prepare any quantum state in a cavity and perform universal control on it [23,27,[39][40][41][42].In this study, we used a GRadient Ascent Pulse Engineering (GRAPE) based method to generate optimal control pulses (OCT) [27,43] that consider the full model of the time-dependent Hamiltonian and allow us to prepare non-classical states in a cavity.As shown in Fig. 1 (b), our approach successfully prepared cavity Fock states with pulse duration as short as O(1/χ), which did not increase for higher Fock states.

Stimulated emission protocol
The stimulated emission protocol is divided into two parts: the first part involves the preparation of cavity in a desired Fock state, |n and the second part involves the detection of the cavity in the |n + 1 Fock state as depicted in Fig. 2 FIG. 1. Fock state preparation in a cavity dispersively coupled to a transmon qubit.(a) A schematic of the multimode flute cavity showing the location of the storage cavity (red), readout cavity (green), and transmon chip with a SEM image of the Josephson junction (blue) [31].(b) Creation of Fock states in a particular mode of the cavity using GRAPE method.Characterization of the cavity state using qubit spectroscopy (left) and Wigner tomography (right).Qubit spectroscopy is performed immediately after the optimal control (OCT) pulses, a single peak in each qubit excitation probability (Pe) distribution confirms the creation of the correct |n Fock state.Resultant probability distribution is fitted to a Gaussian to estimate the state preparation fidelity.Grey dashed lines correspond to the expected shift in frequency, accounted for quadratic dispersive shift.(Right) Wigner tomography [32] is performed by coherently displacing the resultant cavity state in 2D phase space to map the average parity and thus, reconstruct the cavity state density matrix.
positive events such as the cavity accidentally starting in |n + 1 state, we conditionally excite the qubit with a resolved π-pulse at the (n + 1)-shifted peak three times.If and only if the qubit fails to excite in all three attempts do we proceed ahead with rest of the protocol.By doing this, we can suppress the false positive rate ≤ 3%.
At the end of this sequence, we measure the efficiency of the state preparation for each n by measuring the qubit excitation probability P n with a number resolved π-pulse centered at the |n peak.The measured fidelities are P 0 = 95.2 ± 0.3%, P 1 = 91.2± 0.4%, P 2 = 87.3 ± 0.5%, P 3 = 81.6 ± 0.6%, P 4 = 63.6 ± 0.7%.After the state preparation, we apply a coherent drive to the cavity mimicking a push from the DM wave to characterize the detector.A series of repeated QND measurements are recorded by performing conditional πpulses centered at the (n + 1)-shifted peak.The time between two successive QND measurements is 5 µs, which is relatively short compared to the lifetime of Fock states given by T s 1 = 1320 µs/n (see Table S2).This projective measurement resets the clock on the decay of the |n + 1 state [44].We then apply a hidden Markov model (HMM) analysis to reconstruct the cavity state and compute the probability that the cavity state had changed from |n → |n + 1 and assign a likelihood ratio λ associated with such events (see Supplementary section for implementation of HMM analysis).
In principle, it is possible to prepare Fock states |n > 4 in the device.However, due to the presence of multiple cavity modes, simulating the complete Hamiltonian to generate the OCT pulses becomes computationally challenging and in practice, higher (n + 1) Fock states are prepared with lower fidelity.Furthermore, to prevent excessive signal photon loss, the Fock state decay rate which is also enhanced by a factor of (n + 1) must remain small compared to the sum of Stark shift and readout rate, which determines the maximum rate of number resolved measurements.For this study, we chose |n = 4 , such that the decay probability stays below 1% between successive measurements.

Signature of Fock enhancement
To assess the performance of the detector after preparing the cavity in a particular Fock state |n , we carry out a series of experiments.We apply a small variable displacement (α 1) to the cavity and measure the relationship between the number of injected (n inj = |α| 2 ) and detected photons.We perform 30 repetitions of the qubit measurement and apply a likelihood threshold of λ thresh = 10 3 to distinguish positive and negative events.This threshold is determined based on the background cavity occupation n c b = 6 × 10 −3 , which is assumed to be caused by photon shot-noise from a hot cavity, as measured using the photon counting method described in [1] (refer to Fig. S15).Errors below this value are considered to be sub-dominant.For a cavity initialized in |n , the probability of finding the cavity in the Fock state |l for a complex displacement α is described by the analytical expression [45]: , where Ln l−n is an associated Laguerre polynomial.The data obtained from the characterization of the detector is fitted to an expression, represented by Eqn.(4).
This equation takes into account the detection efficiency, η, and false positive probability, δ.In cases where the cavity displacement α 1, the relationship between the injected photons (n inj = |α| 2 ) and measured photons can be approximated such that P nl (|α 2 |) ≈ (n + 1)|α 2 |, as shown in Eqn.(2) Fig. 3 displays the unique characteristic of stimulated emission enhancement, where a higher number of detected photons is observed for the cavity that was initialized in a higher Fock state.This result aligns with expectations and highlights the effectiveness of stimulated emission as a method for amplifying weak signals.The Mean number of measured photons (positive events) as a function of the mean number of injected photons in the cavity.After initializing the cavity in a Fock state |n and applying a variable cavity displacement (mock DM drive), 30 repeated qubit measurements of the cavity photon state are performed and a threshold λ thresh is applied to determine the cavity population at |n + 1 .Background events with α = 0 are subtracted to compare between different Fock states which may have systematic errors in the state preparation step.λ thresh = 10 3 is chosen based on the observed background cavity occupation of n c b = 6 × 10 −3 such that the detector based errors are still sub-dominant.The background cavity occupation is measured using the photon counting technique described in Ref. [1] with repeated qubit parity measurements.Detector efficiency (η) for each Fock state is determined from the fit as reported in the legend.The monotonic decrease in the efficiency is attributed to -higher decay probability to reach the same false positive probability and demolition probability (see Supp Fig. S13).Anomalous behavior in |3 is attributed to the state decaying to nearby modes in the band structure formed by multiple modes of the cavity, qubit and readout, which are close in the energy level |q, s, r .
figure also showcases a clear, monotonic increase in the slope as the Fock states increase, further emphasizing the success of this technique.The resultant enhancement between |n = 4 and |n = 0 is 2.78 (0.45×5/0.81×1).The reduced efficiency η = 0.45 to see the full (n+1) enhancement can be explained by the enhanced decay rate of higher Fock states making it more difficult to achieve the fixed likelihood ratio threshold used for the comparison.For example, consider the |n = 5 Fock state.During the course of 30 repeated measurements, it is 1.6 times more likely to decay than the |n = 1 Fock state.In addition, the higher demolition probability 0.074 for |n = 4 makes it more difficult to achieve high likelihood ratio since this photon state only persists for the first 14 quasi-QND measurements.The false positive probabilities δ are smaller than 10 −4 for all Fock states, comparable to the measured residual photon occupation in the cavity.Further advancements could be achieved by utilizing a system with a higher Q value and reduced demolition probability.By combining weakly coupled qubits with the Echoed Conditional Displacement (ECD) technique [23], Fock states can be prepared with high fidelity while also keeping the demolition probability low.Additionally, a detector with reduced errors from factors such as thermal population and readout fidelity would also improve the results.
We observe anomalous behavior for the |n = 3 data which shows no signal enhancement.There is no direct way to investigate the cause but we suspect leakage to a nearby mode as the 3D cavity contains multiple modes which are closely spaced [31].We tried this experiment on a different cavity mode and observed similar behavior but for |n = 1.We have identified a couple of transitions with different modes which are closer in energy level with |g, 3 and which could be facilitated by the always-on interaction of the transmon with all the modes.This frequency collision issue can be easily resolved in future designs such that the cavity modes are spaced further apart and the transmon has negligible overlap with the spectator modes.

Dark photon search
In order to conduct a dark photon search, we collect independent datasets for a cavity prepared in different Fock states and count the number of positive events in the absence of the mock DM drive.Additionally, we vary the dwell time (τ ) between the state preparation and the beginning of the measurement sequence in order to allow the coherent buildup of cavity field due to the dark matter.Once the measurement sequence begins, the quantum Zeno effect prevents further build-up of the signal field.Ideally, one would like to choose the dwell time as close to the lifetime of Fock state as possible to maximize the accumulation of signal and thus, the scan rate.In this work, the dwell time was varied to compare on equal footing the dependence on n and not optimized for DM sensitivity.For this study, we chose a maximum dwell time of 20 µs to collect reasonable statistics with λ thresh = 10 3 for all Fock states.Longer integration times comparable to or larger than the dark matter coherence time (75 µs) which are needed to realize the full benefit of Fock enhancement will be implemented in future dedicated experiments.The number of measured counts shown in Fig. 4 is fit to a functional form given by Eqn.(5) (see Supplementary material), which has contributions coming from a coherent source (hence the (n + 1) Fock enhancement factor), an incoherent source, and a state preparation dependent error where a 0 and b and c n 's are the fit parameters we extract from fitting the measured counts.The first term has two factors of τ : one from the coherent buildup of signal energy in the storage cavity for τ < T s 1 which is included in the average signal rate dN/dt, and a second factor of τ for the total integration time t tot = N trials τ .
By performing an ordinary least square (OLS) fit to the measured counts, we extract the fit parameters with their uncertainties tabulated in Table I.The values of fit parameters obtained from performing a Maximum Likelihood Estimate (MLE) were comparable.
The large statistical uncertainties on a 0 are due to the fact that the other two terms dominate the measured counts and fluctuations causing a 0 to swing up and down by a large amount.With the extracted value of a 0 , we can compute the kinetic mixing angle of dark photon given by = a0 ρDMmDMGV (see Supplemen- FIG. 5. Exclusion of dark photon parameter space with stimulated emission.Shaded regions in the dark photon parameter space [13,46] of coupling ( ) and mass (mγ) are excluded.In the orange band, dark photon is naturally produced in models of high scale cosmic inflation [14].The exclusion set with stimulated emission based dark photon search is shown in the blue and red curves.On resonance with the storage cavity (m γ c 2 = ωs), the dark photon kinetic mixing angle is constrained to ≤ 4.24 × 10 −13 with 90% confidence.(Inset) The horizontal extent of the excluded region is set by the bandwidth of the number resolved qubit π-pulse which is insensitive to any drive outside the band.The vertical limit is set by the maximum which would result in dark photon rate greater than the value which would degrade the fidelity of Fock state preparation significantly.The region between the blue and red curve represents the exclusion with the stimulated emission experiment, whereas the excluded region above the red curve is mainly due to the failure of Fock state preparation which is easily detectable in the experiment (See Supp Fig. S16).
tal material for derivation).With the measured uncertainties on all the parameters and using error propagation, we compute the 90% confidence limit on to be f it + 1.28 σ .Thus, a dark photon candidate on resonance with the storage cavity (m γ c 2 = ω s ), with mixing angle ≥ 4.35 × 10 −13 is excluded at the 90% confidence level.Fig. 5 shows the regions of dark photon parameter space excluded by the stimulated emission based search, assuming the dark photon comprises all the dark matter density (ρ DM = 0.4 GeV/cm 3 ).The detector is maximally sensitive to dark matter candidates with masses within a narrow window around the resonance frequency of the cavity.This window is set by the lineshape of the dark matter [47] (Q DM ∼ 10 6 ).For DM wave at ∼ 6 GHz, the FWHM linewidth is 6 kHz, so the -3 dB point is 3 kHz away from the cavity resonance and the efficiency of a finite bandwidth number resolved qubit πpulse is non-zero.While the stimulated emission protocol is valid for small induced signal, the cavity state preparation using OCT pulses excludes DM wave corresponding to |α| > 0.05 (see Fig. S16) as it would result in larger preparation error than experimentally observed.

Conclusions and outlook
The preparation of a cavity in quantum states of light, such as a Fock state, has the potential to significantly enhance the DM signal rate and hence also the DM frequency scan rate compared to previous methods.In the current work, we have demonstrated a signal enhancement of 2.78× by initializing the cavity in |n = 4 versus |n = 0 Fock state.The corresponding improvement in attainable scan speed is reduced because of the finite amounts of time required to prepare the initial Fock state and to read out the final state after integrating the signal, though in an optimized experiment the duty cycle should be comparable to that of other photon counting experiments.Despite these imperfections, even in this initial demonstration, the dark photon search sets an unprecedented sensitivity in an unexplored parameter space with 90% confidence level.This method holds great promise for continued improvement as advancements in cavity coherence times [48] and state preparation methods [23] progress, and we expect the same improvement factor or better in future dedicated dark matter search experiments.
While this study focuses on the detection of dark matter, the quantum-enhanced technique presented here can be applied more widely to sense ultra-weak forces in various settings, in cases where the signal accumulation is limited by the coherence time of the signal rather than by that of the probe.The Fock state stimulated emission can increase the rate of processes that involve the delivery of small amounts of energy, and the resulting signal quanta can be detected through number-resolved counting techniques that surpass the SQL.

Stimulated emission of signal photons from dark matter waves Supplemental Material
Ankur Agrawal, Akash V. Dixit, Tanay Roy, Srivatsan Chakram, Kevin He, Ravi K. Naik, David I. Schuster, Aaron Chou

Conceptual overview
We use QuTip [49,50] simulation tool to study the evolution of a cavity initialized in different Fock states under the action of a small displacement drive.As seen in Fig. S6, the probability of observing a dark matter induced signal is significantly enhanced for a cavity prepared in large |n Fock state. 1 results in a small probability P0,1 ∝ |M0,1| 2 for creating a |1 component by spontaneous emission of a photon from the DM wave.The direction of displacement is determined by the instantaneous phase of the DM wave which is randomized every DM coherence time, but since the initial cavity state is azimuthally symmetric, a displacement in any direction gives the same probability P01.The red dashed line is shows as a guide to locate the origin w.r.t to the center of the blob.(Right plots) The cavity is initialized in a |n = 10 Fock state which also has an azimuthally symmetric Wigner distribution.Displacing this distribution in an arbitrary direction shifts some part of the distribution to larger radius and other parts to smaller radius.For example, the lower plots shows a displacement of β coh = 0.1 in the positive X = Re(β) direction.The shift to larger radius corresponds to stimulated emission to states with larger photon number, for example |11 while the shift to smaller radius corresponds to stimulated absorption to states with smaller photon number, for example |9 .As shown in the histograms, the stimulated enhancement factors (N F ock + 1) and N F ock give probabilities which satisfy P10,11 = 11 × P0,1 and P10,9 = 10 × P0,1.

Dark matter conversion and scan rate
The expected signal rate (R s ) from DM is proportional to the volume and the quality factor of the cavity.In DM experiments operating below 1 GHz (hν k B T ), the background rate (R b ) is limited by the thermal occupation of the cavity such that the noise added by an amplifier in the readout process is sub-dominant.However, at frequencies in 5 − 30 GHz range, the DM search faces major challenges as the signal-to-noise ratio (SNR) rapidly plummets down.
The expected DM signal decreases at higher frequencies due to following reasons: (1) the cavity volume diminishes as the cavity dimensions shrink to maintain the resonance condition (V ∝ ν −3 ) for a TM 0n0 type mode, (2) the quality factor of a normal metal cavity degrades due to the anomalous skin effect [51,52].Moreover, the noise from quantum-limited readout process increases at higher frequencies because the power scales as hν ( ν QDM ), where Q DM is the quality factor of a DM wave given by the escape velocity of DM from the galaxy.The first term in the expression represents the energy of one photon, which is determined by the standard quantum limit.This limit specifies that the minimum amount of noise added by an amplifier is equivalent to a mean photon number of nSQL ≥ 1 [16][17][18][19][20].The signal frequency scan rate R (in Hz/s), a key merit of haloscope type experiment, is proportional to ∝ R 2 s /R b as shown in Eqn.(S6).Quantum-enhanced techniques to improve signal rate and reduce noise are required to improve SNR and hence accelerate the search for the extremely weak dark matter signal.
The integration time (∆t) required for a background limited dark matter search is given by the time required to achieve 1σ sensitivity determined by Poisson counting statistics: R s ∆t > √ R b ∆t, where R s = nHP /∆t and background rate R b = nb c /∆t.The signal accumulation time for each Fock state preparation is given by τ .For an optimal dark matter scanning experiment, we would want to start with a high-Q cavity (Q cav > Q DM ) in the largest possible Fock state |n such that τ (which must be smaller than the Fock state coherence time Q cav /(ν * n)) can be matched with the signal coherence time Q DM /ν.Hence, the integration time at each frequency point scales as R b /R 2 s and, the scan rate is given by, such that ∆t is the sum of many iterations of duration τ and N is the total number of iterations for each Fock state preparation.While the stimulated emission technique will generally enhance R s by a factor (n + 1), the coherence time of the prepared quantum state is also reduced by a factor (n + 1), thus also restricting the accumulation time τ .The smaller coherence time then necessitates a faster readout rate which then generally causes the background rate R b to also increase by a factor (n + 1) for backgrounds which are associated with the readout procedure or due to a residual non-zero mode occupation number in the cavity.The overall improvement in dν/dt due to Fock enhancement is then a single factor η (n + 1), where η is the detection efficiency in the experiment.Each measurement sequence consists of state preparation and validation (2 µs + 3 × t m = 17 µs), signal integration (20 µs) and 30 repeated measurements (30×t m = 150 µs).There is an additional dead time in the experiment due to imperfect state preparation which constitutes 35% × 17 µs ≈ 6 µs for |n = 4 Fock state.The total search time at each Fock state is roughly 20, 000 × 193 µs = 36.6s with a duty cycle of 20  193 = 10% (3.6 s of integration).For the present apparatus, the duty cycle could be increased to ∼ 30% if longer signal integration times are chosen at the expense of greater systematics due to Fock state decoherence.Higher Q cavities would enable even larger integration times and duty cycles.

Experimental setup
The cavities and qubit are mounted to the base plate of a dilution fridge (Bluefors LD400) operating at 10 mK.The device is housed in two layers of µ-metal to shield from magnetic fields.Signals sent to the device are attenuated and thermalized at each temperature stage of the cryostat as shown in Fig. S7.The field probing the readout resonator is injected via the weakly coupled port (shorter dipole stub antenna).Control pulse for the qubit are inserted through the strongly coupled readout port (longer dipole stub antenna).The storage cavity is driven through a direct port which is weakly coupled to the external microwave chain.Both control lines also contain an inline copper coated XMA attenuator that is threaded to the base plate.The signal from the readout resonator reflects off a Josephson parametric amplifier before being amplified by a cryogenic HEMT amplifier at the 4 K stage.The output is mixed down to 100 MHz IF signal before being digitized.Cavity and transmon fabrication details can be found in Supplemental materials of Ref. [1,42].

Fock state characterization
We know that a Fock state has a definite photon number but no definite phase associated with it.Therefore, a simple qubit spectroscopy reveals as much as information as a Wigner tomogram would do.However, we use both these methods to compute and confirm the presence of Fock states in the cavity.Fig. 1 shows the qubit spectroscopy on the left and Wigner tomography Keysight MXG SignalCore MXC Plate 8 mK 100 mK Quantum Machines (QM) OPX controller was used to generate the arbitrary wave forms (DACs) and digitize the incoming readout signal (ADCs).All the tones are up-converted using IQ modulation, with local oscillator (LO) and AWG synced to an SRS F2575 RB source.Storage cavity is controlled via a direct port and qubit is controlled by injecting a drive into the strongly coupled port of the readout.Readout signal is injected into the weakly coupled port, and the signal is routed to the JPA using non reciprocal circulator elements.The amplified signal is routed to the HEMT for further amplification and the signal is then mixed down to 100 MHz IF, further amplified, and finally digitized.All the RF lines are heavily filtered with homemade eccosorb filters and attenuated to minimize stray radiation from entering the device.
of the resultant Fock states on the right.By fitting a Gaussian curve to the spectrum we estimate the fidelities to be P 0 = 95.2 ± 0.3%, P 1 = 91.2± 0.4%, P 2 = 87.3 ± 0.5%, P 3 = 81.6 ± 0.6%, P 4 = 63.6 ± 0.7%.Moreover, we study the evolution of the cavity under the action of OCT pulses by tracking the cavity state as shown in Fig. S8 (b).We perform a number resolved qubit spectroscopy at different points in time to map out the occupation probability of different Fock levels, in agreement with the simulated trajectory.In several recent works, it has been demonstrated that a single transmon is capable of preparing any quantum state in the cavity and perform universal control on it.The methods developed include -resonant swap of a qubit excitation to the cavity [40], SNAP gates [39], Blockade [42], and GRadient Ascent Pulse Engineering (GRAPE) based optimal control (OCT) pulses [27,41] and Echoed Conditional Displacement (ECD) control pulses [23] to solve the inversion problem of finding control fields to transfer a quantum system from state A to B. We use a GRAPE based method to generate a set of optimal control pulses [27,41] to prepare non-classical states in an cavity.In the optimal control, we consider the full model of the time dependent Hamiltonian and generate the control pulses which maximizes the target state fidelity as has been previously demonstrated in nuclear magnetic resonance experiments [43] as well as superconducting circuits [27].The main advantage of this approach is that the duration of state preparation pulses can be as short as 1/χ and does not necessarily increase for higher Fock states [23,27].We use OCT pulses to successfully prepare cavity Fock states as shown in Fig. 1 (b).
We briefly investigated the SNAP protocol [39] to prepare Fock states but did not pursue further as it suffers from two issues limiting the maximum achievable fidelity.First, the number of constructed sequences scales as (2n+1), requiring large number of gates, limiting operations which are feasible in the presence of decoherence.Second, the constructed model fails to account for the higher order Kerr non-linearity (H Kerr / = K(a † ) 2 (a) 2 ) in the Hamiltonian, which is non-negligible at higher photon occupation.This results in finite occupation probability at the other Fock states as well.

Calibration of number resolved π ulse
In order to successfully probe the presence of Fock states in the cavity, we need a very well calibrated narrow bandwidth π-pulse -amplitude as well as frequency.We perform an amplitude Rabi experiment with a 3µs (4σ) long Gaussian pulse such that its spectral spread is smaller than the χ-shift.After a coarse amplitude sweep, we perform a finer sweep centered at the initial guess and apply a set of 12 Gaussian pulses in succession to amplify any gate errors such as under/over rotation, frequency drift to get a better estimate of the π-pulse amplitude.For qubit transition frequency, we initialize the cavity in a particular Fock state |n and perform a qubit Ramsey interferometry experiment.It consists of two π/2 pulses separated by a variable delay time.A Fast Fourier Transform (FFT) of the resultant time oscillations gives the shift in the qubit transition frequency which accounts for any higher order corrections as well.The computed transition frequencies and amplitude are used in the actual experiment to minimize the errors.

Device calibration
By applying a weak coherent tone at the storage cavity frequency, we induce a variable displacement α of the cavity state.We calibrate the number of photons injected into the storage cavity by varying the drive amplitude and performing qubit spectroscopy.By fitting the qubit spectrum as shown in Fig. S9 to a Poisson distribution, we extract the cavity occupation, n = |α| 2 .Similarly, the qubit drive strength is calibrated by performing qubit Rabi experiments with varying AWG amplitude and pulse length.The measured drive strength and the AWG amplitude mapping is used to send the correct OCT pulses to the device.See Supp.section in [1] and [31] for more details on device parameter calibrations.The cavity is displaced using a variable weak coherent drive for a finite period of time.The resulting population of the cavity is determined by performing qubit spectroscopy with a resolved π-pulse.The cavity photon number dependent shift of the qubit transition frequency reveals the cavity population.By fitting the spectrum to a Poisson distribution we extract the weights of the cavity number states in the prepared coherent state and thus, the mean photon occupation.

Hidden Markov model analysis
We adopt the Hidden Markov Model (HMM) approach presented in [1] to consider all the possible errors that may occur during the measurement process and alter the state of the cavity, qubit, and readout.The cavity and qubit states are treated as hidden variables that emit readout signals.The Markov chain is modeled by the transition matrix (T ) (Eqn.(S8)) which describes the evolution of the joint cavity-qubit hidden state s ∈ [|n g , |n e , |ng , |ne ] and the emission matrix (E) (Eqn.(S9)) that calculates the probability of a readout signal R ∈ [G, E] given a certain hidden state.It's important to note that with a number-resolved πpulse centered at the n-shifted peak, we can only determine whether the cavity is in the |n Fock state or not (|n = n ).
The transition and emission matrix were first introduced in [53] and implemented in [1].The change in qubit state probability is not affected by the cavity state.However, the repeated measurement of the cavity state with a number selective π-pulse introduces an additional channel through which the cavity loses its excitation.It is called demolition probability (p d ), which signifies the non-QNDness of the projective measurement of the cavity state with the qubit.In simple terms, a single qubit measurement is (1 − p D )% QND.We followed the protocol described in Ref. [54] for repeated parity measurement and replaced it with number selective π-pulse.Table S2 and Fig. S13 show the measured values for different Fock states.The elements of the emission matrix represent the readout fidelities for the ground and excited states of the qubit, which are influenced by noise from the first stage JPA.More information on the experimental protocols used can be found in the supplemental material.We used the backward algorithm (Eqn.(S7)) [53,55] to calculate the probability (P (n 0 )) that the cavity state was in the |n + 1 Fock state after the injection of a synthetic DM signal.The algorithm takes a set of N +1 measured readout signals (R 0 , R 1 , ..., R N ) as input, where n 0 = n + 1 represents the target Fock state and n 0 can take on values in the range [0, n, n + 2, ...].
In the reconstruction process, all possible scenarios are taken into account.For instance, a readout measurement of G followed by E could happen due to the successful detection of the cavity in the |n + 1 state with a probability of P n0n0 P gg F eE /2.On the other hand, it could also be caused by either a qubit heating event (P n 0 n 0 P ge F eE /2) or a readout error (P n 0 n 0 P gg F gE /2).The data in Fig. 2(b) illustrates the results of the measurement of the readout signals and the reconstructed initial probabilities of the cavity state.The panels on the left show instances when there was no emission event, while the panels on the right depict cases where a positive emission event took place.The cavity state shifted from |1 to |2 as a result of a variable displacement drive D(α), and the change was accurately reflected in the reconstructed probability.
The reconstructed cavity state probabilities undergo a likelihood ratio test (λ = P (n0=n+1) P (n0 =n+1) ) to determine if the cavity state changed or not.A positive detection of a photon signal |n → |n + 1 is declared when the threshold λ > λ thresh .The false positive rate is limited to less than 1 λ thresh +1 as a result of this procedure.A higher detection threshold can be achieved by increasing the number of repeated measurements, but at the cost of decreased efficiency which is linear in the number of measurements.Hence, λ thresh is chosen to strike a balance between the detection efficiency and the false positive rate, keeping it below the observed physical photon background.This will be discussed further in the next section.

Elements of hidden Markov model
The hidden Markov model relies on independent measurements of the probabilities contained in the transition and emission matrices.The elements of these matrices depend on the parameters of the experiment and the device, including the lifetimes of the qubit and cavity, qubit spurious population, and readout fidelities.

Transmission matrix elements
The transition matrix captures the possible qubit (cavity) state changes.Qubit relaxation |e → |g occurs with a probability P ↓ eg = 1 − e −tm/T q 1 .The probability of spontaneous heating |g → |e of the qubit towards its steady state population is given by P ↑ ge = nq [1−e −tm/T q 1 ].Unlike a two-level system such as a qubit, the cavity state may change from |n → |n via either decay (|n → |n − 1 ) or excitation (|n → |n + 1 ) with probabilities P n,n−1 = 1−e −tm/T n 1 or P n,n+1 = nc [1−e −tm/T n 1 ] respectively.The lifetime of the Fock state is modified due to the enhanced decay [40] (T n 1 = T s 1 /n) as compared to the bare lifetime of a coherent state (see Supp Fig. S12).Yet another possible source of change in the cavity state is the repeated qubit measurement itself.In most cases, we assume the interaction between the qubit and cavity to be QND, i.e., the measurement of cavity state by qubit does not perturb the state.However, we measured the QNDness of repeated qubit measurement for |n = 1 Fock state to be 97.4% which corresponds to a demolition probability p d of 2.6% per measurement (see Fig. S13).Hence, we add this term in the transition matrix.All these probabilities are computed using independently measured qubit, cavity and readout parameters described below.The lifetime of the qubit is determined by applying a π pulse and waiting for a variable time before measuring the population as shown in Fig. S10.We map out the qubit population as a function of the delay time, fit it with an exponential characterizing the Poissonian nature of the decay process, and obtain T q 1 = 115 ± 10 µs.The dephasing time of the qubit is measured by a Ramsey interferometry experiment with a π/2 pulse, variable delay, and a final π/2 with its phase advanced by ω r t where ω r is the Ramsey frequency.The phase advancement is implemented in the software.During the variable delay period, a series of π pulses are applied to perform spin echos and reduce sensitivity to low frequency noise.
We observe a dephasing time of T q 2 = 160 ± 10 µs which extends to T e 2 = 236 ± 6 µs with a single echo sequence.(Top) T1 measurement by sending a π-pulse to excite the transmon to |e state and monitor its decay as a function of variable delay time.By fitting an exponential function to the qubit excitation probability Pe, we extract the T q 1 = 115 ± 10 µs.(Bottom) T2 measurement with a Ramsey experiment.The sequence consists of two π/2-pulse separated by a variable delay time.The envelope of the measured oscillations informs the T e 2 = 236 ± 6 µs and its frequency provides us the detuning between the drive and the transmon resonance frequency.In this case, we intentionally introduced a 60 kHz synthetic detuning.
The storage cavity lifetime is calibrated by performing a cavity T 1 experiment.We use the OCT pulse to prepare the cavity in a |n = 1 Fock state, wait for a variable delay time and probe the cavity state at the end by Rabi driving the qubit with a resolved π-pulse.The resultant cavity population is fitted to an exponential to obtain T s 1 = 1.36 ± 0.02 ms as shown in Fig. S11.To measure the cavity dephasing time, the cavity is initialized in a superposition state (a |0 + b |1 ) by applying a weak coherent drive (α) such that approximately only the first two photon states |n are populated.The contrast in the signal will be determined by the relative amplitude ( a 2 a 2 +b 2 ) without any loss of information.After a variable delay time, an identical displacement drive with its phase advanced by ω r t is applied before probing the |n = 0 with a resolved π-pulse on the qubit.The oscillations are fitted to obtain a dephasing time of T s 2 = 2.39 ± 0.02 ms.The qubit spurious population is determined by measuring the relative populations of its ground and excited states [56].This is done by utilizing the f -level of the transmon.Two Rabi experiments are conducted swapping population between the |e and |f levels.First, we apply a π ge pulse to invert the qubit population followed by the |e − |f Rabi experiment.Second, no π ge pulse is applied before the ef Rabi oscillation.The ratio of the amplitudes of the oscillations gives us the ratio of the populations of the excited and ground state.Assuming that P (g) + P (e) = 1 and measuring P (e) P (g) = 0.02, corresponds to an effective qubit temperature of 54 mK.In a dispersive interaction, we assume that the measurement of cavity state via a parity or number resolved π-pulse does not perturbed the state i.e. it is a quantum non-demolition (QND) measurement or in other words, does not induce additional relaxation in the cavity mode.However, a recent study has shown that parity measurements, while highly QND, can induce a small amount of additional relaxation [54].Hence, in order to estimate the same, but, in the context of number resolved qubit measurement, we follow the method described in [54], where we perform a cavity T 1 experiment interleaved with varying number of repeated number resolved qubit measurements during the delay time.In that experiment, the total relaxation rate was modeled as a combination of the bare storage lifetime τ s and a demolition probability p d associated with each qubit measurement.In Fig. S13, we show the extracted total decay time (τ tot ) and demolition probability p d = 2 ± 0.02% when the cavity is prepared in |n = 1 Fock state.In other words, a single number resolved qubit measurement is 98% QND.Unfortunately, for |n = 2, p d = 4 ± 0.04% gets worse, which is not a good sign but probably explains why the detection efficiency in Fig. 3 falls off at higher Fock states.This acts like an additional source of loss to the cavity mode but only when the resolved π-pulse is on resonance with the shifted qubit frequency.

Emission matrix elements
In order to characterize the emission matrix it is necessary to measure the readout infidelity of a particular transmon state.We consider only two possible transmon states (|g , |e ) in this case as the number resolved π-pulses have very narrow spectral width (σ ν α q ).Each state is prepared 20,000 times and the resultant quadrature values are digitized to assign a voltage in the (I − Q) space.The phase of the readout pulse is precalibrated to align the signal along the I axis.The histogram corresponding to each state is fitted with a sum of two Gaussian functions to estimate the overlap region and calculate the readout fidelity, F = 97% (Fig. S14).A discriminator value (red dashed line) is used to assign each readout signal either G or E in real-time.Readout errors are due to voltage excursions from amplifier noise or spurious qubit transitions.The emission matrix should only contain readout errors that occur due to voltage fluctuations.Errors due to qubit transitions during the readout window are accounted for in the transition matrix.To disentangle the two contributions, we subtract the readout errors caused by the spontaneous heating and decay of the qubit to obtain F gG = 97.5 ± 1% and F eE = 96.8± 1%.

Detector characterization
To characterize the detector, the cavity population is varied by applying a weak drive and the cavity photon number is counted using the technique described in the main text.In order to extract the efficiency (η) and false positive probability (δ) of the detector, the relationship  between injected photon population (n inj ) and measured photon population (n meas ) is fit to nmeas = η × ninj + δ.

Detector efficiency
The detector efficiency and false positive probability is determined at varying thresholds for detection λ thresh .As the detection threshold is increased, more repeated number resolved qubit measurements are required to determine the presence of a photon.This suppresses false positives due to qubit errors but also leads to a decrease in the detector efficiency as events with low likelihood ratio are now rejected.Also, the maximum achievable likelihood ratio decreases with the Fock state prepared in the cavity.Hence, we decided to keep the false positive probability same for comparing different Fock states at the expense of detection efficiency.We performed a single photon counting experiment [1] to determine the occupation number of the background photons in the cavity (Fig. S15) and chose the threshold such that 1 λ thresh +1 < nc b ⇒ λ thresh = 10 3 .This measured background translates into a metrological gain of 11.0 dB below the SQL.

Cavity backgrounds
The number of events which cross λ thresh for cavity prepared in different Fock states are not same, and are subtracted from the α = 0 events to demonstrate the enhancement effect.The number of such events are listed in the table below and are similar to the false positive probability from the fits in Fig. 3.The number of counts are corrected for the detection efficiency to reflect the actual counts.There is no reason to expect the number of counts would increase with n and we include them in the systematic uncertainties while conducting a dark photon search.In an independent dataset, we observe a similar number of counts as reported in Fig. 4. |n

Converting background counts to dark photon exclusion
As described in the main text, for a coherent source we expect the signal rate to be proportional to the term a 0 .We will derive the expression and compute the kinetic mixing angle which corresponds to a 0 .See Supp.Section in Ref. [1] for discussion about dark matter induced signal.

Kinetic mixing angle exclusion
For a dark matter candidate on resonance with the cavity frequency (m DM c 2 = ω c ), the rate of photons deposited in the cavity prepared in a Fock state |n by the coherent build up of electric field in time τ (τ < T s 1 , Q DM /ν) is given by: The stimulated emission factor appears via the enhancement of magnitude of the electric field generated inside the cavity.The volume of the cavity is 34.5 × 0.5 × 2.5 cm 3 = 43.13cm 3 .G encompasses the total geometric factor of the particular cavity used in the experiment.This includes a factor of 1/3 due to the dark matter field polarization being randomly oriented every coherence time.For the lowest order mode of the rectangular cavity coupled to the qubit with E = ( πx l )( πy w )z the geometric form factor is given by: The dark photon generated current is set by the density of dark matter in the galaxy ρ DM = 0.4 GeV/cm 3 = 2π × 9.67 × 10 19 GHz/cm 3 : where is the kinetic mixing angle between the dark photon and the visible matter.Substituting Eqn.S12 into Eqn.S10 yields the signal rate of photons deposited in the cavity by a dark photon dark matter candidate: dN HP dt = (n + 1) 2 ρ DM m DM GV τ (S13) The total number of photons we expect to be deposited is determined by the photon rate and the integration time (N trials τ ) for each Fock state: Comparing the first term in Eq. 5, we can rewrite the terms to obtain 2 = a0 ρDMmDMGV .

Calculating 90% confidence limit
By estimating the strength of the coherent drive in the absence of an external drive and the measured background counts for different Fock states, we perform a dark photon search.We determine the dark photon mixing angle that can be excluded at the 90% confidence level by using standard error propagation formula.We determine the standard deviation on given, we have the error estimates for all the parameters tabulated above.S5.Stimulated emission experimental parameters.Systematic uncertainties of physical parameters in the experiment must be incorporated in determining the excluded dark photon mixing angle .The uncertainty in the dark photon (HP) conversion is determined in the previous section.The storage cavity frequency uncertainty is obtained by Ramsey interferometry.The quality factor of the cavity is given by Qs = ωsT s 1 so the uncertainty is calculated as σ 2 Qs = (ωsσ T s 1 ) 2 + (T s 1 σω s ) 2 .The volume uncertainty is estimated by assuming machining tolerances of 0.005 inches in each dimension.The form a factor uncertainty is estimated from assuming 1% error in the simulated structure.Of the experimental quantities, the DP conversion has the largest systematic uncertainty.

Dark photon parameter space exclusion
A dark photon candidate that could result in more detector counts than background counts is constrained by the cavity occupation number which degrades the fidelity of Fock state preparation in the cavity by a significant amount.In order to estimate the same, the cavity is prepared with varied number of mean photons before applying the the OCT pulse.The resultant state is measured with the same procedure as the stimulated emission protocol to compute the fidelity.We observe that the fidelity changes significantly when the mean injected photon number goes above n > 0.05 shown by the red dashed line in Fig. S16.The maximum number of photons sourced from the dark photon which is tolerable before the state preparation is out of control.In principle, we can exclude any value of which is above the red curve as it will break the first step of the stimulated emission experiment.The above calculations assume an infinitely narrow dark matter line.To obtain the excluded region of the dark photon kinetic mixing angle, we must account for the lineshape of the dark matter [47].We convolve the dark matter lineshape, characterized by Q DM ∼ 10 6 , to obtain the region shown in Fig. S17.
The storage cavity contain an infinite set of discrete resonances each with a unique coupling to the dark matter.We focus only on the lowest order cavity mode that has a non-zero coupling to the dark matter as well as the qubit.In principle, the interactions between any modes and the dark matter could result in additional sensitivity to the dark photon.This would require the mode of interest to have a sufficiently large geometric form factor as well as a resolvable photon number dependent qubit shift.Future dark matter searches could employ structures with multiple resonances to enable multiple simultaneous searches [31].
(a).In order to actively suppress any false

FIG. 3 .
FIG.3.Stimulated emission enhancement.Mean number of measured photons (positive events) as a function of the mean number of injected photons in the cavity.After initializing the cavity in a Fock state |n and applying a variable cavity displacement (mock DM drive), 30 repeated qubit measurements of the cavity photon state are performed and a threshold λ thresh is applied to determine the cavity population at |n + 1 .Background events with α = 0 are subtracted to compare between different Fock states which may have systematic errors in the state preparation step.λ thresh = 10 3 is chosen based on the observed background cavity occupation of n c b = 6 × 10 −3 such that the detector based errors are still sub-dominant.The background cavity occupation is measured using the photon counting technique described in Ref.[1] with repeated qubit parity measurements.Detector efficiency (η) for each Fock state is determined from the fit as reported in the legend.The monotonic decrease in the efficiency is attributed to -higher decay probability to reach the same false positive probability and demolition probability (see Supp Fig.S13).Anomalous behavior in |3 is attributed to the state decaying to nearby modes in the band structure formed by multiple modes of the cavity, qubit and readout, which are close in the energy level |q, s, r .

FIG. 4 .
FIG. 4. Measured background counts for different Fock states in the cavity as a function of dwell time.There is no clear trend in the number of observed background counts indicating systematic effects which could be due to the state preparation steps.The error bars are plotted as √ Counts and the N trials ∼ 20, 000 for each point.

P
FIG. S6.Phase-space representation of the cavity state before and after the dark matter wave push.(Left plots) Displacing the cavity initialized in |0 in an arbitrary direction by a small coherent push β coh 1 results in a small probability P0,1 ∝ |M0,1| 2 for creating a |1 component by spontaneous emission of a photon from the DM wave.The direction of displacement is determined by the instantaneous phase of the DM wave which is randomized every DM coherence time, but since the initial cavity state is azimuthally symmetric, a displacement in any direction gives the same probability P01.The red dashed line is shows as a guide to locate the origin w.r.t to the center of the blob.(Right plots) The cavity is initialized in a |n = 10 Fock state which also has an azimuthally symmetric Wigner distribution.Displacing this distribution in an arbitrary direction shifts some part of the distribution to larger radius and other parts to smaller radius.For example, the lower plots shows a displacement of β coh = 0.1 in the positive X = Re(β) direction.The shift to larger radius corresponds to stimulated emission to states with larger photon number, for example |11 while the shift to smaller radius corresponds to stimulated absorption to states with smaller photon number, for example |9 .As shown in the histograms, the stimulated enhancement factors (N F ock + 1) and N F ock give probabilities which satisfy P10,11 = 11 × P0,1 and P10,9 = 10 × P0,1.
FIG. S7.Wiring diagram inside the dilution refrigerator and the room temperature measurement setup.Quantum Machines (QM) OPX controller was used to generate the arbitrary wave forms (DACs) and digitize the incoming readout signal (ADCs).All the tones are up-converted using IQ modulation, with local oscillator (LO) and AWG synced to an SRS F2575 RB source.Storage cavity is controlled via a direct port and qubit is controlled by injecting a drive into the strongly coupled port of the readout.Readout signal is injected into the weakly coupled port, and the signal is routed to the JPA using non reciprocal circulator elements.The amplified signal is routed to the HEMT for further amplification and the signal is then mixed down to 100 MHz IF, further amplified, and finally digitized.All the RF lines are heavily filtered with homemade eccosorb filters and attenuated to minimize stray radiation from entering the device.
FIG. S8.Fock state preparation in a cavity dispersively coupled to a transmon qubit.(a) Optimized control drives to the qubit (top) and cavity (bottom) to transfer the qubit-cavity state from |g, 0 − → |g, 3 .The drive strengths are in units of MHz.(b) Simulated trajectory of the cavity state using QuTip under the control drive.Measured cavity occupation probability showing all the levels explored during the evolution before converging to the desired state |g, 3 at the end.The experiment involves playing a fraction of the OCT pulses and performing qubit spectroscopy with a number resolved π-pulse.Each vertical slice corresponds to the cavity occupation probability in different number states as function of the duration of pulse.Note that the simulation does not include the presence of neighboring cavity modes as well as the measurement infidelity.Control fields for the qubit and cavity are generated by a room temperature fieldprogrammable gate array (FPGA) controller, which also provides a low-latency feedback signal to actively monitor the state of the cavity.
FIG. S9.Qubit spectroscopy reveals cavity displacement (a) Pulse sequence showing the calibration of cavity photon number by performing qubit spectroscopy.(b) The cavity is displaced using a variable weak coherent drive for a finite period of time.The resulting population of the cavity is determined by performing qubit spectroscopy with a resolved π-pulse.The cavity photon number dependent shift of the qubit transition frequency reveals the cavity population.By fitting the spectrum to a Poisson distribution we extract the weights of the cavity number states in the prepared coherent state and thus, the mean photon occupation.
FIG. S10.Qubit lifetime and dephasing time measurement.(Top) T1 measurement by sending a π-pulse to excite the transmon to |e state and monitor its decay as a function of variable delay time.By fitting an exponential function to the qubit excitation probability Pe, we extract the T q 1 = 115 ± 10 µs.(Bottom) T2 measurement with a Ramsey experiment.The sequence consists of two π/2-pulse separated by a variable delay time.The envelope of the measured oscillations informs the T e 2 = 236 ± 6 µs and its frequency provides us the detuning between the drive and the transmon resonance frequency.In this case, we intentionally introduced a 60 kHz synthetic detuning.

8 T 2
FIG.S11.Storage cavity lifetime and dephasing time from T1 and Ramsey measurements.The long lived storage cavity mode is ideal for holding a signal photon induced by the dark matter while a series of repeated photon counting measurements is performed.
FIG. S12.Decay rate of Fock states.Measured lifetime of the different Fock states prepared in the cavity using GRAPE pulses.The decay rate is inversely proportional to the lifetime (Γ = 1/T1).The curve shows enhancement in the decay rate as a function of the Fock state |n .The linear fit to the data fits well as predicted by[57], where T n 1 = T1/n.
FIG. S14.QND readout of the transmon state.(Top) shows the two quadrature values of the down-converted readout signal for qubit prepared in |g and |e state.Each state preparation contains 20,000 single shot points.(Bottom) By fitting a sum of two Gaussian we can estimate the overlap region and assign a single-shot readout fidelity as F = 97%.The red dashed line shows an optimal value of the threshold for tagging a qubit state based on a single shot readout.

3 SQL
FIG.S15.Photon counting to measure the cavity background.Repeated parity measurement technique followed from[1] to measure the real photon occupation in the cavity nc b = 6.23 • 10 −3 with detector based errors less than 10 −8 .

1 . 9 ×
10 3 (s −2 ) σ a = 9.807 × 10 5 (s −2 ) FIG. S16.Fock state preparation with non-zero occupation in the cavity.Measuring the Fock state preparation probability as a function of initializing the cavity with varying occupation before the OCT pulses.Red dashed line corresponds to the maximum tolerable injected number of photons where the fidelity changes significantly.
FIG.S17.Excluded with mγ .Shaded regions in the dark photon parameter space of coupling ( ) and mass (mγ) are excluded with 90% confidence.The horizontal extent is set by the bandwidth of the number resolved qubit π-pulse which is insensitive to any drive outside the band.The vertical limit is set by the minimum which would result in dark photon rate greater than the value which would degrade the fidelity of Fock state preparation significantly.

TABLE I .
Fitted parameters.Best fit and statistical uncertainties corresponding to each source of background counts.The Fock state with higher background counts have larger c value indicating that the source of counts is related to the state preparation step and thus, it is valid to perform a background subtraction to demonstrate the enhancement technique.For τ = 20 µs and N trials ∼ 20, 000, all three terms in Eqn. ( P gg P n n P ge P n n P ge P n n P gg |n g P n n P eg P n n P ee P n n P eg P n n P ee |n e P nn P gg P nn P ge P nn P ge P nn P gg |ng P nn P eg P nn P ee P nn P ee P nn P eg |ne

TABLE S2 .
Demolition probability.Measured lifetime of the different Fock states and their fitted demolition probability with error bars.p d can be approximated with a linear dependence on n.

TABLE S3 .
Device parameters.Measured qubit, storage, and readout cavity parameters.These independently measured values are necessary to determine for the transition and emission matrices.This enables the hidden Markov model to capture the behavior of the system during the measurement sequence.

TABLE S4 .
Background counts.Number of background counts N bkgd reported for cavity initialized in different Fock states out of N trials .