On-demand generation and characterization of a microwave time-bin qubit

Superconducting circuits offer a scalable platform for the construction of large-scale quantum networks, where information can be encoded in multiple temporal modes of propagating microwaves. Characterization of such microwave signals with a method extendable to an arbitrary number of temporal modes with a single detector and demonstration of their phase-robust nature are of great interest. Here, we show the on-demand generation and Wigner tomography of a microwave time-bin qubit with superconducting circuit quantum electrodynamics architecture. We perform the tomography with a single heterodyne detector by dynamically switching the measurement quadrature independently for two temporal modes through the pump phase of a phasesensitive amplifier. We demonstrate that the time-bin encoding scheme relies on the relative phase between the two modes and does not need a shared phase reference between sender and receiver.


INTRODUCTION
In the past few decades, quantum bits implemented as superconducting circuits have become promising candidates for building blocks of large-scale quantum computers [1][2][3][4] . To increase the scalability of these architectures, robust methods of generating single photons for quantum computation in the propagating modes and for transferring information between multiple superconducting qubits over relatively long distances are of recent interest. In the optical domain, different photonic qubit encodings have been demonstrated before for such purposes 5 . However, optical single-photon generation protocols are often probabilistic rather than deterministic, limiting success probability 6 . Moreover, conversion of quantum information stored in superconducting qubits operated in the microwave regime to optical photons suffers from low efficiency and limited bandwidth 7,8 . Schemes focused on generating photons at microwave frequencies and their characterization are therefore of great interest.
Photonic qubit encoding can be realized by constructing a set of computational basis states with one or more orthogonal modes of light. In the microwave regime, single-rail (single-mode) encoding has been demonstrated by using the photon number states of a propagating microwave qubit to transfer information between two superconducting qubits over a transmission line with fidelity close to 0.8 [9][10][11][12] . However, photon loss reduces the transfer fidelity greatly, as decayed photon states cannot be distinguished readily. In addition, the phase information in a single-rail photonic qubit state is stored as the relative phase between the propagating qubit mode and a separate phase reference. Thus, the reference must be shared between any hardware operating the nodes of a quantum network that the photonic qubit will interact with, reducing the practicality of single-rail encoding in large networks.
As an alternative to the single-rail encoding, dual-rail (dualmode) encoding has been demonstrated in the optical regime in the form of polarization [13][14][15] and time-bin qubits 16,17 . Occupation of a single photon in one of two orthogonal temporal modes functions as the basis of the time-bin qubit. Time-bin encoding allows one to readily determine loss of information during transfer with a photon number parity measurement 5,18 , and the qubit state is more robust against dephasing, as the phase information is stored in the relative phase between the two temporal modes. Thus, time-bin qubits do not require sharing of a phase reference 19 . Owing to these favorable properties, a linear optical scheme for quantum computation with time-bin qubits has been proposed 5 . However, only the loss-robustness of the microwave time-bin qubit has been demonstrated. The demonstration was based on discrete-variable measurements of superconducting qubits as a part of a transfer protocol, thus being limited to a single qubit of information 20 . A different approach is necessary for full state tomography of a general two temporal mode state or cluster states with multiple modes and qubits of information. Ideally, for a scalable characterization method, only a single detector should be necessary regardless of the number of modes.
In this work, we experimentally demonstrate on-demand generation of microwave time-bin qubits with a superconducting transmon qubit 21 and show how the time-bin qubit retains phase information and can be loss-corrected. Our scheme allows us to generate and shape the single-photon wave packet as well as to generate any superposition state of the time-bin qubit with variable spacing between the temporal modes. We perform Wigner tomography of microwave signal in two temporal modes by measuring the quadrature distributions with a flux-driven Josephson parametric amplifier 22 and a single heterodyne detector 23 . With the Josephson parametric amplifier (JPA), we can rapidly change the measurement quadrature for each temporal mode independently in a single shot. We reconstruct the quantum state of the signal with a maximum-likelihood method 23,24 . We compare the state preparation fidelity of the dual-rail time-bin qubit with a single-rail number-basis qubit and a transmon qubit. We demonstrate that correcting photon loss of the time-bin qubit state improves the fidelity significantly. By removing the phase-locking between the single-photon source 1 Research Center for Advanced Science and Technology (RCAST), The University of Tokyo, Meguro-ku, Tokyo 153-8904, Japan. 2 College of Liberal Arts and Sciences, Tokyo Medical and Dental University, Ichikawa, Chiba 272-0827, Japan. 3 Center for Emergent Matter Science (CEMS), RIKEN, Wako, Saitama 351-0198, Japan. ✉ email: jesper.ilves@qc. rcast.u-tokyo.ac.jp and the detector, we observe that the single-rail photonic qubit state dephases completely owing to the lack of a stable phase reference, whereas the time-bin qubit state is unaffected. This demonstrates that the phase information of the dual-rail qubit is contained in the relative phase between the two modes and that using the time-bin qubit in a quantum network does not require a shared phase reference.

System
To generate a single photon, we consider a coherently driven circuit quantum electrodynamical setup where a superconducting transmon qubit is dispersively coupled to a 3D microwave cavity with a resonance frequency ω c ∕2π = 10.619 GHz. The dynamics of the system are described in the rotating frame of the drive by the Hamiltonian The qubit is coupled to the cavity with coupling strength g∕2π = 156.1 MHz and it is driven by coherent microwaves at frequency ω d with time-dependent complex amplitude Ω(t) through the cavity. In Eq. (1), a and b are defined as the cavity and transmon annihilation operators, and ω ge ∕2π = 7.813 GHz is the qubit g j i− e j i transition frequency separated from the e j i− f j i transition frequency ω ef = ω ge + α by the transmon anharmonicity α∕2π = −340 MHz. The cavity and qubit are dispersively coupled, i.e., ω ge À ω c ) g, which allows us to readout the qubit state based on the qubit state-dependent dispersive shift of the cavity resonance frequency. The cavity is coupled to an external transmission line with an external coupling rate κ ex ∕2π = 2.91 MHz. The relaxation and coherence times between the g j ie j i and e j if j i states are T ge 1 ¼ 26 μs, T ef 1 ¼ 15 μs, and T ge 2 ¼ 15 μs, T ef 2 ¼ 16 μs, respectively.

Dynamics of time-bin qubit generation
The state of two time-bin modes can be represented in the photon number basis in two orthogonal temporal modes where nm j i :¼ n j i E m j i L represents the photon number states of the earlier (E) and later (L) modes, respectively, with P 1 n;m¼0 jC nm j 2 ¼ 1.
The protocol for quantum state transfer from a superconducting qubit to a time-bin qubit is shown in Fig. 1a. We prepare the superconducting qubit in a superposition state α q g j i þ β q e j i and transfer the state to α q e j i þ β q f j i with a sequence of π ef and π ge pulses at frequencies ω ef and ω ge , respectively.
We induce the transition between the f0 j i and g1 j i states of the combined qubit-cavity system with a drive pulse to generate a shaped single photon inside a transmission line 25 . The f0 j i-g1 j i transition frequency is defined as ω f0g1 = 2ω ge + α − ω c . When the drive frequency matches this transition, the microwave-induced effective coupling between f0 j i and g1 j i can be derived from the system Hamiltonian in Eq. (1) Here, the complex amplitude ΩðtÞ ¼ exp½iϕðtÞjΩðtÞj has a phase degree of freedom ϕ(t). By applying this coupling pulse to the sample we can generate a photon inside the cavity. The photon in the cavity will decay to the waveguide at the external coupling rate κ ex . Thus, the coefficient β q is transferred to the photon in the E mode of the time-bin qubit. The second coefficient, α q , is transferred to the propagating microwave mode by driving the qubit with a π ef pulse and the coupling pulse once afterwards. If the generation protocol has ideal efficiency, the coefficients α q and β q are transferred to the modes 01 j i and 10 j i as C 01 = α q and C 10 = β q . As the original qubit state is normalized, C 01 j j 2 þ C 10 j j 2 ¼ 1, and all of the other coefficients in Eq. (2) Fig. 1 Dynamics of time-bin qubit generation and measurement setup. a Driven interaction between a superconducting qubit and 3D cavity for the generation of a microwave time-bin qubit propagating along a transmission line. The two energy diagrams for the qubit-cavity system describe the generation protocol. b Simplified configuration for generating and measuring a time-bin qubit at frequency ω g c with Josephson parametric amplifier (JPA) realized heterodyne measurement. Three different microwave sources are used in the experiment to generate signal at the qubit control frequencies ω ge and ω ef , f0 j i− g1 j i transition frequency ω f0g1 , dispersive cavity readout frequency ω RO , JPA pump frequency ω p , and demodulation local oscillator frequency ω LO c . c Measured marginal distribution of a single-rail single-photon qubit state (red histogram) as a function of a given quadrature of the generated signal. The dark blue dashed line represents a theoretical fit to the data with 95% confidence intervals (light blue zone). d Reconstructed Wigner function of the signal with quadratures q and p defined corresponding to [q, p] = i. The data in the figures has not been corrected for detection inefficiency.
become zero. Thus, the transfer process of the qubit state to propagating microwave mode in the temporal mode basis represents the mapping α q g j i þ β q e j i7 !α q 01 j i þ β q 10 j i. We can therefore define the temporal modes 01 j i L j i and 10 j i E j i as the basis states of a dual-rail time-bin qubit. One should note that the time-bin qubit basis states have a single photon, meaning that a valid qubit state can be confirmed with a parity measurement of the total photon number in the two temporal modes.
Characterization of the experimental setup A schematic of the experimental configuration for generating and measuring the propagating time-bin qubit state is shown in Fig.  1b. We input the qubit control pulses, qubit state readout pulse, and coupling pulse, to the cavity cooled down to 30 mK inside a dilution refrigerator. We amplify the generated time-bin qubit signal with a flux-driven JPA operated in the degenerate mode by driving the JPA with two successive microwave pulses at frequency ω p ¼ 2ω g c where ω g c =2π ¼ 10.628 GHz is the dressed cavity frequency when the qubit is in the ground state. The measured signal is demodulated with a local oscillator at frequency ω LO c shifted from ω g c by the sideband frequency −2π × 50 MHz.
We estimate the measurement efficiency for our generation and characterization system by measuring the marginal distribution along a given quadrature in phase space and reconstructing the Wigner function of a single-rail single-photon state 1 j i in Fig. 1c, d. We only consider measurements where the qubit is in the ground state both before and after the measurement. In the marginal distribution of the measured signal, we extract from a theoretical fit 26 a single-photon probability of P 1 j i ¼ 0:591 ± 0:038 with 95% confidence intervals. We obtain a fidelity of 0.556 ± 0.009 for the reconstructed Wigner function and observe a negative region in the quasiprobability distribution near the origin of the phase space (Fig. 1d), demonstrating negativity of the measured state without loss correction for detection inefficiency. We define the error interval of the fidelity as three times the standard deviation obtained from bootstrapping 27 of the tomography data. We obtain from an analytical calculation (see Section 2 of Supplementary Methods) the possible maximum generation efficiency of η gen = 0.83 ± 0.02 with the parameters in our system, resulting in the minimum measurement efficiency of η meas = 0.67 ± 0.01, comparable to recent experiments in similar systems [28][29][30] and mostly explained by the insertion loss of the circulators and isolators.
Quadrature distribution of microwave time-bin qubit signal The pulse sequence used in the experiment for time-bin qubit generation is shown as a quantum circuit in Fig. 2a and as temporal waveforms with different angular frequencies in Fig. 2b. We perform a z-basis dispersive readout on the qubit state 28,31 with an assignment fidelity of 0.99 to initialize the qubit, and at the end of the generation sequence to measure whether the transfer sequence results in the qubit being in the ground state or not.
In Fig. 2c, we show the measured and simulated mean field amplitude squared |〈a out (t)〉| 2 of the state ð1= ffiffi ffi 2 p Þ 00 j i þ ð1=2Þ 10 j i þ ð1=2Þ 01 j i as a function of time. The magnitude is calculated according to the theory in Section 2 of the Supplementary Methods. The measured amplitude is normalized to match the simulated amplitude by defining that the integrals calculated over the time interval for the squared amplitudes must be equal. We only consider here measurement events where the transmon qubit was measured as being in the ground state both before and after the generation sequence. We utilize the shape of the measured temporal mode amplitudes to calculate the quadrature distributions of the time-bin qubit. The correlation between the measurements changes based on the selected quadratures, as shown in Fig. 2d.
Characterization of microwave photonic qubit states We experimentally prepare the transmon, single-rail number basis and time-bin qubits in the six cardinal states of the Bloch sphere, Þð L j i þ E j iÞ. Each of the three distributions correspond to 72637 post-selected samples measured for quadratures with phase difference Δφ EL = φ E − φ L conditioned on the transmon qubit being in the ground state both before and after the time-bin generation.
as shown in Fig. 3a. We define the number-basis qubit state basis as 0 j i 0 j i S and 1 j i 1 j i S , corresponding to no excitation or a single excitation in a single mode. The number-basis qubit states are generated with a sequence similar to the time-bin generation sequence in Fig. 2, but with only the first two qubit control pulses and the first coupling and JPA pump pulses. A series of qubit state readouts along the three Bloch sphere axes are performed to reconstruct the transmon qubit state. All of the measurements are performed in single-shot.
We calculate the fidelity of each prepared state as where the pure target state is defined as ψ t j i and ρ is the measured qubit state.
Transmon qubit tomography For the transmon qubit states, we only consider measurement events where the qubit is initially measured to be in the ground state. On average, 87.5% of our measurement events fulfill this condition. The relatively high initial excited state population may be explained by noise from the qubit control line 32 . The population can be reduced with cooling techniques 33,34 . Given the above condition, we measure a state preparation fidelity of F avg T ¼ 0:987 ± 0:001 averaged over the six cardinal states (Fig.  3b), limited mainly by the qubit control pulse fidelity and readout assignment fidelity.
Single-rail number-basis qubit tomography For the single-rail states, we post-select the measurement events where both of the readouts before and after the generation sequence result in the qubit state being assigned to the ground state. On average, we keep 82.6% of all data in the tomography process.
We prepare the single-rail number-basis qubit states with a fidelity of F avg SR ¼ 0:781 ± 0:003, noticeably lower than the transmon qubit states. The difference in fidelity is caused by relaxation and dephasing of the transmon qubit state during single-photon generation and photon loss during photon transfer from the qubit to the JPA and heterodyne detector. The effect of photon loss can be observed in the Bloch sphere as a bias towards the 0 j i state for all of the six cardinal states.

Time-bin qubit tomography
We post-select the time-bin measurement events where both of the readouts result in the transmon qubit being in the ground state corresponding to 80.4% of all measurements. We discuss the other measurement events in more detail in Section 7 of the Supplementary Methods. Without loss correction, we measure an average state preparation fidelity of F avg TB ¼ 0:434 ± 0:001. As the generation sequence is longer than that of the single-rail qubit, the effect of qubit control pulse infidelity and qubit dephasing and relaxation on the state preparation fidelity also becomes stronger. Furthermore, we emulate an effective photon number parity measurement on the time-bin qubit density matrices by projecting the full two-mode density matrix to the time-bin qubit subspace spanned by E j i and L j i, as detailed in Section 6 of the Supplementary Methods. After the effective parity measurement, we obtain a loss-corrected timebin qubit average state fidelity of F avg TB;LC ¼ 0:910 ± 0:002.
Phase robustness of the time-bin qubit We measure and reconstruct the density matrices of the single-rail qubit and time-bin qubits for the coherent superposition states ð1= Þð L j i þ E j iÞ when the photon source does and does not share the same relative phase reference with the detector, as shown in Fig. 4a, b, respectively. To experimentally realize this condition, we use a separate reference clock for the microwave source, which generates the coupling pulse carrier signal than for the other two microwave sources used for qubit control, JPA operation, and demodulation of singlephoton signal. We also perform photon loss correction on the time-bin qubit density matrices.
When all of the microwave sources share the same external rubidium clock (Fig. 4a), phase coherence is maintained between the generated photons, and the tomography results in a single-rail qubit state fidelity of F shared SR;X ¼ 0:811 ± 0:007 and time-bin qubit state fidelity of F shared TB;X ¼ 0:901 ± 0:006. The time-bin qubit is slightly more coherent than the single-rail qubit, because of a slow phase reference drift, which occurs even with a shared external clock and perhaps also in-part owing to the photon loss correction. In Fig. 4b, we disconnect the microwave source for the coupling pulse from the shared clock. Owing to the phase drift between the two clocks, the single-photon signal generated by the coupling pulse has a different phase reference each time. Thus, as we observe in the measured off-diagonal matrix elements, the measured single-rail qubit is dephased completely, resulting in a single-rail preparation fidelity of F sep SR;X ¼ 0:500 ± 0:008. In contrast, for the time-bin qubit, the phase information is not lost since the relative phase between the two temporal modes determines the phase information of the qubit, resulting in a time-bin qubit state fidelity of F sep TB;X ¼ 0:899 ± 0:006.

DISCUSSION
We successfully performed on-demand generation of microwave time-bin qubits by driving a 3D circuit-QED system in dispersive regime and characterized the resulting quantum states with maximum-likelihood estimation of two-mode signal amplified by a JPA in heterodyne measurement. Our tomography method allowed us to perform Wigner tomography of a general two temporal mode microwave state with a single detector by switching the measurement quadrature in time between the temporal modes. We measured an average time-bin qubit state preparation fidelity of 0.910 after loss correction. We also demonstrated that the phase information of the time-bin qubit is stored in the relative phase of the temporal modes and that the lack of a shared phase reference does not cause the time-bin qubit to dephase. By performing a quantum non-demolition measurement of the photon number parity in the time-bin qubit with the method in refs 23,29,35 , it is possible to perform loss-detection on the time-bin qubits to increase the fidelity of information transfer and distributed computation in a superconducting qubit network by an amount corresponding to the photon loss. Our tomography method can also be extended to microwave cluster states with an arbitrary number of temporal modes without any additional detector hardware by adding a new JPA pump pulse for each additional temporal mode. The quadrature detection can be used to realize remote state preparation schemes 36,37 . It is also possible to combine our method with an entanglement witness 38 or select the measurement quadratures adaptively to characterize the entanglement and state with minimal number of measurements.

Pulse calibration
We define the qubit control pulses as Gaussian-shaped pulses while the shape of the coupling pulse is defined as a cosine pulse ½1 À cosð2πt=wÞ=2 with width w for t ∈ [0, w]. We optimize the width, separation, amplitude, phase, and frequency of all pulses in parameter sweep experiments by maximizing the assignment and state preparation fidelities for each parameter separately. The experimental setup used for pulse generation is detailed in Section 1 of the Supplementary Methods. In addition, we apply DRAG 39 to the qubit control pulses and chirp the coupling pulses to limit the effect of the f j i-state Stark shift affecting the phase of the generated photon wave packet 9 . We also add a constant phase shift to the second coupling pulse relative to the first to reduce the effect of e j i-state Stark shift. The optimization of the coefficients for DRAG and chirping is detailed in Sections 3, 4, and 6 of the Supplementary Methods.

Wigner tomography of two temporal modes
We use JPA phase-sensitive amplification together with heterodyne measurement to reconstruct the full quantum state of the single-rail number basis and time-bin qubits with iterative maximum-likelihood estimation performed on measured quadrature distributions of the temporal modes based on refs 24,40 .
To change the quadrature of amplification independently for two temporal modes, we select pairs of JPA pump pulse phases (φ E , φ L ) ∈ [0, 2π] × [0, 2π] corresponding to amplification of each temporal mode. For a single phase pair, we obtain measured quadrature values (q E , q L ). A measured two-mode state ρ EL matches a given set of the four values above with a probability amplitude Tr½ρ EL Πðφ E ; q E ; φ L ; q L Þ. Here, we have defined the projection operator In order to find the optimal density matrix ρ opt that matches the measured probabilities of all outcomes φ E;j ; q E;j ; φ L;j ; q L;j À Á in our experiment, we iteratively search for the density matrix that maximizes the logarithm of the likelihood function ln ½LðρÞ ¼ X j ln Tr ρΠ φ E;j ; q E;j ; φ L;j ; q L;j À Á Â Ã È É ; where we have assumed that the set φ E;j ; q E;j ; φ L;j ; q L;j À Á forms a dense parameter space. We perform the maximization by defining an iterative operator which has a property R(ρ opt )ρ opt R(ρ opt ) ∝ ρ opt . This property allows us to iteratively calculate ρ opt by ρ kþ1 ¼ Rðρ k Þρ k Rðρ k Þ=Tr½Rðρ k Þρ k Rðρ k Þ. We start the iteration from an initial state ρ 0 ¼ I=TrðIÞ and calculate the logarithm of the likelihood for each density matrix in the iteration until convergence. We perform the above iteration numerically and solve the reconstructed density matrix in the Fock basis of two temporal modes by calculating the two-mode matrix elements n E ; n L h jRðρÞ m E ; m L j i of the iterative operator for photon numbers n E , n L , m E , and m L in the two modes.
We measured a JPA gain of 26.8 dB for the single-photon signal (See Section 5 of the Supplementary Methods). To reduce the amount of measurements, we perform the tomography for 12 × 12 different quadratures in the two modes. For each quadrature pair, we measure 10 4 samples. We truncate the two-mode density matrix in the tomography by limiting the maximum amount of photons in a single temporal mode to two. Fig. 4 Effect of the lack of a shared phase reference on photonic qubit generation. Measured real parts of density matrix elements for a single-rail number-basis qubit (basis: 0 j i S and 1 j i S ) and a losscorrected time-bin qubit (basis: L j i and E j i). a All of the microwave sources used share the same reference clock (phase reference). b There is no shared reference clock. The Bloch spheres refer to the stability of the phase between each measured state. In the bar plots, the rectangles indicate the ideal values and the error bars describe three times the standard deviation obtained from bootstrapping.

Bootstrapping of the reconstructed density matrices
We estimate the error of the reconstructed density matrices and state preparation fidelity of the qubit states by bootstrapping the tomography measurement events 27 . We resample the data measured for each qubit state and perform maximum-likelihood estimation on the resampled data set to obtain a bootstrapped density matrix. By performing this procedure for a number of bootstrapping samples, we can calculate the distribution and standard deviation of the reconstructed density matrix elements. We use 250 bootstrapping samples for each tomography measurement.

DATA AVAILABILITY
The data that support the findings of this study are available from the corresponding authors upon reasonable request.
Received: 5 December 2019; Accepted: 9 March 2020; Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons. org/licenses/by/4.0/.

© The Author(s) 2020
frame. The Hamiltonian of the transmission line can be written as where b k is the annihilation operator of the propagating mode in the transmission line with wave number k, a is the cavity photon annihilation operator, and κ is the total cavity coupling strength. We model the relaxation channel as  where we define the dissipation operator D as with relaxation times T ge 1 = 1/γ ge and T ef 1 = 1/γ ef from |e to |g , and from |f to |e , respectively. In addition, c k is the annihilation operator for a bosonic mode with energy v m k in the relaxation channel, and s vw is the transition operator of the transmon, s vw = |v w|.
The dephasing of the qubit is described by two additional channels in which we define d j,k as the annihilation operators of the relaxation channels for three different pure dephasing coefficients γ p,j . By defining the Fourier transform of b k as b r = (2π) −1/2 dk exp(ikr)b k , we can write the state of the system at a given time as where the dots represent the terms with excitations in the relaxation channel, C qc are defined as complex coefficients related to the probability |C qc | 2 for the qubit-cavity system to be in a given state, the third state |0 in the tensor product is the vacuum state of the transmission line, and f (r, t) is the time-bin wave packet complex amplitude at position r from the qubit at time t, as shown in the schematic in Supplementary Figure 2b. Given the input-output relation and initial state of the system we can calculate the wave packet shape as f (r, t) = ψ(t)|b r |ψ(t) .
We introduce a unitary time-evolution operator where T is the time-ordering operator. We define the notation S(t) 0 = ψ(0)|S(t)|ψ(0) for any operator S. By writing f (r, t) = U † (t)b r (0)U (t) 0 , we have that (S12) since b r (0)|ψ(0) = 0. Hereafter, we evaluate the amplitude of the generated time-bin qubit at r = +0, corresponding to the qubit's position. From Eq. (S12), we obtain where we have omitted the terms σ e0,e1 (t) 0 and σ f0,f1 (t) 0 since they are zero. The time evolution for any system operator S can be solved from the Heisenberg equation (S14) From here on we denote C vj,wl = σ vj,wl (t) 0 . After substitution of relevant system operators to (S14), we notice that many of the expectation values are zero. The time-evolution of C g0,g1 can be solved from the following system of equations where T ge 2 = (γ ge /2 + γ p,1 ) −1 (T ef 2 = (γ ef /2 + γ p,2 ) −1 ) is the dephasing time of the qubit between |g and |e (|e and |f ).
To simulate the time-bin qubit generation process, we solve the equations numerically for two separate time periods. In the first period, we simulate the generation of the first time-bin. After the transfer, we simulate the X ef π pulse by swapping the |e0 terms with |f0 in the equations and performing a second calculation simulating the generation of the second time-bin with the initial condition matching the state of the system after the X ef π pulse. To simulate generation of coherent time-bin qubit state signal amplitude, we initialize the system state as C 0 = 1/ √ 2 , C 1 = C 2 = 1/2. We show the g eff (t) defined in the simulations together with the change in the qubit population as a function of time in Supplementary Figure 2c and d calculated with the parameters for the sample given in Table Supplementary Table 1.
In order to calculate the generation efficiency of the system in the simulation, we prepare the system in the initial state C 0 = C 2 = 1/ √ 2, C 1 = 0. We perform the photon generation process for the first temporal mode only. We evaluate the photon generation efficiency as where we have defined P sc e0 as the leftover population in the |e0 state at 0.95 µs. The leftover population is used to match the conditions in the simulation with the experiments. The scaling imposes the condition that the qubit must be in the ground state both before and after the generation protocol. We do not take the leftover population in the |f0 state into account in the scaling since it is smaller than P sc e0 by over one order. For a calculated value of P sc e0 = 0.02, we thus obtain a generation efficiency of η gen = 0.83 ± 0.02.

III. OPTIMIZATION OF QUBIT CONTROL AND READOUT PULSE PARAMETERS
To optimize the qubit readout and control parameters, we first perform a rough optimization of the parameters by using a readout with enough visibility to obtain reasonable resolution. We define the X ge π and X ef π qubit control pulses as Gaussian pulses with a fixed width of 15 ns. We define the amplitude and frequency of the pulses with Rabi oscillation and Ramsey measurements, respectively. We optimize the |f0 -|g1 coupling pulse parameters by measuring the Rabi oscillation between the states as a function of the drive frequency and pulse amplitude, finding the optimal point that maximizes state transfer and effective coupling strength.
For further optimization of the qubit readout pulse, we perform two consecutive readouts of the qubit state and maximize the measured assignment fidelity (1/2) [P (g|g) + P (e|e)] by sweeping over different readout pulse parameter values. The readout frequency is set constant at the frequency of the dressed cavity when the qubit is in the ground state. We vary the rectangular shape readout pulse width, amplitude, and separation between the two pulses in the assignment fidelity measurement sequence. In addition, since the measurements are performed in single shot, we also sweep over different JPA pump pulse amplitudes, widths, and phases to maximize the assignment fidelity. Since we operate the JPA in the degenerate mode, we use the JPA to perform a measurement of the qubit being either in state 's' or 'not s' instead of being able to distinguish between the different qubit states at the same time. Here the state 's' refers to either |g , |e or |f . Depending on whether we want to measure the |g , |e or |f state, we change the direction of the phase to match the correct state. Since the readout is a result of IQ demodulated signal, we Supplementary Figure 3. Calibration of DRAG coefficient for qubit control pulses. a Measured normalized |g state population during DRAG optimization of a π pulse for the |g -|e transition as a function of the DRAG coefficient βge. The black curve is a cosine function fit to the measured data. b Same as a but for a sequence corresponding to optimizing the DRAG coefficient β ef of a π pulse for the |e -|f transition. also optimize the shape of the demodulation integration weight function to match the readout signal. With these optimizations, we measure an assignment fidelity of 0.99 for our readout with a pulse length of 400 ns.
To increase the fidelity of the gate operations for short pulses with relatively high power, we apply the Derivative Removal by Adiabatic Gate (DRAG) [S1] technique to the qubit control pulses. The DRAG technique reduces leakage to unwanted transitions due to the short high power drive pulses. We can write the amplitude of the generated control pulse shape with drive frequency ω d as where φ g is the drive phase that controls around what axis in the equatorial plane the qubit state rotates in the Bloch sphere and β is the DRAG coefficient. The amplitude without DRAG correction is applied as X(t).
We optimize the DRAG coefficient separately for the |g -|e and |e -|f pulses experimentally by measuring the population in the |g state after a specific control pulse sequence. The sequence for optimizing the X ge π pulse with DRAG can be written as X ge π/2 (X ge −π/2 X ge π/2 ) N X ge −π/2 , as shown in Supplementary Figure 3a, where N corresponds to an integer number describing the number of repetitions of the sequence. In the figure we show measured population in the |g state normalized to unity as a function of the control pulse amplitude and DRAG coefficient β ge for N = 20. The sequence amplifies the phase error caused by virtual excitation through undesired states. By tuning the DRAG coefficient β ge to β opt ge = 0.92, we find the optimal point where the population is maximized, corresponding to minimal phase error. A similar sequence can be defined for the X ef π pulse by exchanging the X ge −π/2 and X ge π/2 pulses with their X ef equivalents and by preceding the sequence with a X ge π pulse reversed after the sequence by a X ge −π pulse. We show the results of this optimization in a similar plot to Supplementary Figure 3a in Supplementary Figure 3b with N = 20 and an optimal point at β opt ef = 1.08 maximizing the population in the ground state. With the optimized parameters for the readout and qubit control pulses, we obtain a probability of 0.979 for the qubit to be measured in the first excited state after initialization by post-selection and performing the X ge π pulse.

IV. CANCELLATION OF THE EFFECT OF AC STARK SHIFT ON THE |f STATE
Due to the ac Stark shift caused by the qubit-cavity excitation swapping pulse, the shape of the generated photon will become distorted. To compensate the effect of the |f -state shift, we generate a chirped pulse a c (t) = a p (t) exp[iφ f0g1 (t)] by time-modulating the phase of the original control pulse a p (t) with a method based on Ref. [S2]. Here, both pulse amplitudes are defined in an arbitrary unit. We apply time-modulation to the phase φ f0g1 (t) of the drive pulse according to where ∆ f0g1 (t) is the Stark shift of the transition caused by the drive pulse at a given time. Since the ac Stark shift has a quadratic dependence on the pulse amplitude, the general form of the chirped pulse satisfying the above equation reduces to where C ch is the coefficient mapping the amplitude of the pulse to a corresponding ac Stark shift value. Here we have ignored the global phase coefficient.
In the experiment, the chirped form of the pulse is calculated by first measuring the ac Stark shift of the qubit as a function of the drive amplitude of an effective coupling pulse with a rectangular shape. We show the results of these measurements together with a quadratic fit in Supplementary Figure 4a with coefficient C ch = −2.15. The maximum drive-pulse amplitude corresponds to an effective coupling rate g max eff /2π = 2.2 MHz. We measure the qubit population transfer in the |f0 -|g1 transition as a function of coupling pulse drive frequency and find the optimal frequency where the transfer is maximal for each drive amplitude. The shift of this frequency relative to the optimal frequency at low drive amplitude corresponds to the ac Stark shift. We calculate the necessary phase shift at each amplitude in the pulse with Eq. (S28) with the coefficient obtained from the quadratic fit. Due to effect of filtering on different pulse shapes and non-linearity of the effective coupling at high pulse amplitudes, the fit values are not necessarily optimal and we need to sweep the coefficient to minimize the effect by the Stark shift.
We measure the |g state population P g after excitation transfer from |f0 to |g1 as a function of the chirping coefficient for a cosine coupling pulse in Supplementary Figure 4b. The optimal chirping parameter value C opt ch = −1.66 matches the region where the |g state population is the largest, indicating highest transfer between the two states. The difference between the optimal value and the fit value is due to leakage of the cosine coupling pulse power to the image sideband, which limits the effective coupling rate to g cos eff /2π = 1. We perform quantum state tomography on the quantum state of a propagating microwave mode with a Josephson parametric amplifier operated in the degenerate mode by driving it with a pulse of phase ϕ to measure a projected quadrature q ϕ of the single photon signal. The amplification anti-squeezes the single photon wave packet along a direction orthogonal to ϕ. For the quadrature amplification in tomography, we use a JPA gain of 26.8 dB [Supplementary Figure 5a)]. We optimize the amplitude of the JPA pump pulse so that there is no significant distortion in the amplified shape of the single-photon wave packet, as shown in Supplementary Figure 5b.

VI. OPTIMIZATION OF THE COUPLING PULSE FOR TIME-BIN QUBIT GENERATION AND LOSS-CORRECTION OF THE TIME-BIN QUBIT DENSITY MATRIX
The chirping of the coupling pulse accounts for the ac Stark shift affecting the qubit |f state, however shift of the |e state is not corrected by the chirping. During the generation of any coherent superposition state of the time-bin qubit, there is population in the |e state during the emission of the first bin. The first coupling pulse therefore causes a shift of the |e state that results in a constant shift of the time-bin qubit phase. To correct this offset and generate the target state, we apply a phase offset to the second coupling pulse relative to the first pulse. To calibrate this phase offset, we measure the difference in amplitude between the signal in the two bins for a coherent time-bin qubit state as a function of the JPA pump phase ϕ JPA and coupling pulse phase offset φ L in Supplementary Figure 5c. At φ opt L = 0.74π the difference between the signal amplitude in the two bins is the smallest, corresponding to correction of the phase shift due to ac Stark shift.
For the tomography of the time-bin qubit state, we apply a loss correction to the density matrix in post-processing by reducing the measured complete time-bin qubit density matrix shown in Supplementary Figure 5d to the singlephoton subspace, which corresponds to the time-bin subspace. We pick the submatrix inside the raw data density Supplementary Figure 4. Chirping of the coupling pulse. a Measured Stark shift ∆ f0g1 for the |f0 -|g1 transition as a function of the drive-pulse amplitude (red points). A quadratic fit C ch |ap(t )| 2 with coefficient C ch = −2.15 is shown with the black curve. b Normalized population of qubit |g state measured after |f0 -|g1 transition as a function of the chirping coefficient C ch . The optimal parameter C opt ch for cancelling the Stark shift caused by the effective coupling pulse is marked by the white dashed line at C opt ch = −1.66. c,d Measured |g state population as a function of the maximum effective coupling pulse amplitude and detuning for a coupling pulse c without ac-Stark-shift cancellation and d with cancellation. matrix corresponding to the elements with a single photon in one of the temporal modes. The resulting density matrix is subsequently normalized. This operation can be realized in real-time if one has a single-photon detector or up to high degree with a parity measurement in quantum-non-demolition manner [S3, S4].

VII. ERRORS IN THE PHOTONIC QUBIT GENERATION
In the generation sequence of the photonic qubits, we measure the superconducting qubit state before and after the generation. Here, we discuss the measurement events corresponding to errors in the generation. In 12.2% of measurement events for the single-rail and in 14.4% of the time-bin qubit, we measure an initial excited state and a final state corresponding to the ground state. These events correspond to measurements where an initially (thermally) excited qubit has a state prepared and transferred to the photonic qubit. Events corresponding to an initial measurement in the ground state and a final measurement in the excited state, caused mostly by errors in the system transitions, correspond to 2.90% of the events in the single-rail measurement and to 4.25% of the events in the time-bin measurement. Some of these errors also occur due to the limited assignment fidelity of our readout. In the case of the single-rail qubit measurements, these events show a relatively large two-photon component in the reconstructed density matrices compared to the other measurement events, possibly due to JPA back-action [S5].
[S1] Motzoi, F., Gambetta c Absolute difference in measured time-bin qubit signal amplitude between the two bins as a function of JPA pump phase ϕJPA and second coupling pulse phase offset φL. By modifying the second coupling pulse phase to where the difference is the smallest, φ opt L = 0.74π, we can correct the offset in phase between the two bins caused by ac Stark shift. d Measured real part of density matrix elements for a time-bin qubit state (1/ √ 2)(|E + |L ). The basis represents the number of photons measured in each temporal mode.