## 6 Measurement Protocol for a Low Dark-Count Photon Detector with Two Qubits  
It is notable that 3D resonators can reach extremely high quality factors and it has been demonstrated that they can store a microwave photon for a time of up to \(10^{-2}\) s at mK temperature [23]. Coupling a high performance 3D resonator with a qubit can enable applications like quantum memories and single photon detection. Several experimental schemes for a single photon detector based on qubit-resonator coupling have been proposed [6; 7; 8; 9; 10]. We propose here an extension of the method described in [6] that aims at reducing the dark counts. Our approach is based on a system where two qubits with different resonant frequencies are dispersively coupled to the same resonator. In this configuration, the two qubits can be addressed separately and the qubit-qubit crosstalk is suppressed as long as the qubits have resonant frequencies that are different on the order of about 100 MHz [56]. The Jaynes-Cummings Hamiltonian of two qubits dispersively coupled to the same resonator mode is [28; 57]:  
\[H_{JC}=[\omega_{r}+\chi(\sigma_{1}^{z}+\sigma_{2}^{z})]a^{\dagger}a+\sum_{i=1 }^{2}\frac{\omega_{i}}{2}\sigma_{i}^{z} \tag{24}\]  
where the indexes one and two are used to differentiate the qubits and we assumed that the two qubits have the same dispersive shift \(\chi\) but different frequency \(\omega_{1}\
eq\omega_{2}\). We also assume that \(\chi\gg k\) where \(k\) is the resonator width. In (24), we neglected the two qubits state-swap term since \(\omega_{1}\
eq\omega_{2}\)[28]. We prepare both of the qubits in the state \(\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)\) by rotating around the \(Y\) axis of the Bloch sphere of \(\pi/2\) from the \(|0\rangle\) state. For both qubits, we send control pulses of proper length and power at the frequencies \(\omega_{1}\) and \(\omega_{2}\). The state after initialization is  
\[|Q_{1}Q_{2}\rangle=\frac{1}{2}(|0\rangle+|1\rangle)\times(|0\rangle+|1\rangle) \tag{25}\]  
We assume that a photon of frequency \(\omega_{R}\) is emitted into a coaxial cable terminated on the resonator. At time \(T\ll\sqrt{(T_{1}^{2}+T_{2}^{2})}/2\) after the initialization, we send two additional \(-\pi/2\) rotation pulses along the \(Y\) axis to complete the Ramsey spectroscopy on the two qubits. Since the qubits and the cavity photons are entangled, the total wavefunction has to be written as the product of the photons and qubit wavefunctions. If no photon impinged on the cavity, then the final state is  
\[|Q_{1}Q_{2}\rangle_{\overline{\gamma}}=|0\rangle\times|0\rangle \tag{26}\]  
If otherwise, a photon indeed reflected on the resonator, and it will gain a different phase according to the reflection coefficient in Equation (A17) (see Appendix B for the full calculations). Since the resonance frequency of the resonator depends on the states of the two qubits, the photon will acquire a phase \(\phi=0\) if \(|Q_{1}Q_{2}\rangle=(|0\rangle\times|1\rangle+|1\rangle\times|0\rangle)/2\), \(\phi=\pi\) if \(|Q_{1}Q_{2}\rangle=|1\rangle\times|1\rangle\) and \(\phi=-\pi\) if \(|Q_{1}Q_{2}\rangle=|0\rangle\times|0\rangle\) as shown in Figure 10. We then have  
\[|Q_{1}Q_{2}\rangle_{\gamma} = \frac{1}{2}\Big{(}e^{-i\pi}|00\rangle+|10\rangle+|01\rangle+e^{ i\pi}|11\rangle\Big{)}\] \[= \frac{-1}{2}(|00\rangle-|10\rangle-|01\rangle+|11\rangle)\] \[= -\frac{1}{2}(|0\rangle-|1\rangle)\times(|0\rangle-|1\rangle)\] \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Parameter** & \(N_{\rm train}\) & \(N_{\rm params}\) & Optimizer & \(N_{\rm shots}\) & MSE\({}_{\rm final}\) & Inst. & \(T_{\rm exe}\) \\ \hline
**Value** & 30 & 14 & Adam & 250 & \(3.6\times 10^{-3}\) & ZCU111 & \(78^{\prime}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Summary of hyper-parameters and results of the performed QML algorithm.