We introduce Cryoscope, a method for sampling on-chip baseband pulses used to dynamically control qubit frequency in a quantum processor. We specifically use Cryoscope to measure the step response of the dedicated flux control lines of two-junction transmon qubits in circuit QED processors with the temporal resolution of the room-temperature arbitrary waveform generator producing the control pulses. As a first application, we iteratively improve this step response using optimized real-time digital filters to counter the linear-dynamical distortion in the control line, as needed for high-fidelity repeatable one- and two-qubit gates based on dynamical control of qubit frequency.

In many solid-state quantum information platforms, accurate dynamical control of qubit frequency is key to realizing single- and two-qubit gates. Common on-chip control variables include, but are not limited to, voltage on a local gate and magnetic flux through a SQUID loop. For example, voltage control is typically used for spin qubits^{1–4} and gatemons,^{5,6} while flux control is ubiquitous for transmon, flux, and fluxonium superconducting qubits.^{7} In most cases, the input control signal originates in an arbitrary waveform generator (AWG) operating at room temperature. The signal suffers linear dynamical distortions as it traverses various electrical components on the control line connecting to the quantum device, most often lying at the coldest stage of a dilution refrigerator.

If uncompensated for, such distortions can have detrimental effects on gate performance, affecting fidelity and even repeatability. A salient example is the controlled-phase (CZ) gate between two transmon qubits implemented by a baseband flux pulse^{8} that brings the computational state $|11\u27e9$ temporarily near resonance with the non-computational state $|02\u27e9$. Short-time scale distortions of the meticulously shaped flux pulse^{9} can produce leakage away from the two-qubit computational subspace, leaving a remnant population in $|02\u27e9$. Meanwhile, long-time scale distortions make the unitary action of a flux pulse depend on the history of flux pulses applied.^{10,11} As leakage and history dependence severely limit the depth of quantum circuits that can be realized, a practical scheme for characterization and correction of pulse distortion on chip is of paramount importance.

Distortions introduced by components at room temperature (e.g., AWG bandwidth, high-pass filtering of a bias tee, and skin effect in instrumentation cable) are easily characterized using a fast oscilloscope. However, distortions introduced by components inside the refrigerator (e.g., low-pass filters, impedance mismatch, skin effect in semi-rigid coaxial cable, and chip packaging^{12}) are generally temperature-dependent and are thus best characterized in the cold. Additionally, the on-chip response varies across devices and even between different qubits on the very same device. Evidently, the ideal strategy for characterizing pulse distortion is to use the controlled qubit itself.

A traditional method to visualize the dynamical distortion of ideally square pulses is to observe the oscillations in the excited-state population (as a function of pulse amplitude and duration) when pulsing the qubit into near resonance with another exchange-coupled qubit or a continuous drive tone. While the distortions can be gleaned from the deviation from the ideal chevron pattern,^{10} the inversion is challenging. More direct methods use spectroscopy^{13} and Ramsey experiments^{14} to measure the qubit frequency dynamics, but only during the turn-off transients following a square pulse. Most recently, a method combining continuous microwave and flux drives was developed to convert a transmon into a vector network analyzer^{15} giving the frequency response of the flux control line, from which it is possible to calculate the qubit frequency dynamics for a given pulse.

In this Letter, we present Cryoscope (short for cryogenic oscilloscope), an *in situ* technique using the qubit to sample control pulses of arbitrary shape at the temporal resolution of the AWG. We specifically demonstrate Cryoscope for two-junction transmon qubits, whose frequency depends quadratically (to a good approximation) on the flux through the constituent SQUID loop. However, Cryoscope is generally applicable to any system with a quadratic or higher power dependence of qubit frequency on the control variable and a sweetspot where qubit frequency is at least first-order insensitive to this variable. As a first application, we use Cryoscope to iteratively measure the voltage-to-flux step response and apply predistortion corrections to the control waveforms. We predistort the waveforms digitally using finite- and infinite impulse response filters applied in real-time, i.e., without precompilation of the waveform, in a manner compatible with codeword-based microarchitectures^{16,17} and feedback control. We consistently find the reconstructed step response to be within $\u223c0.1%$ of the ideal response in several setups and devices.

The transition frequency $fQ$ of a two-junction transmon depends on the magnetic flux $\Phi Q(t)$ through its SQUID loop, and for symmetric junctions, it is given by^{18}

where $EC$ is the charging energy, $EJ$ is the sum of the Josephson energies of the individual junctions, $\Phi 0$ is the flux quantum, and *h* is Planck's constant. In our system, the static and dynamic components of $\Phi Q$ are produced by a DC source and an AWG, respectively, and combined at a bias tee, all at room temperature. Here, we use the DC source to null flux offsets, biasing the transmon at its maximal frequency, $fmax\u22481h8EJEC\u2212EC$, which functions as a sweetspot with first-order insensitivity to $\Phi Q$. As in typical applications,^{10,11,19,20} we use the AWG to flux pulse the transmon to detunings $\Delta fQ(t)=fmax\u2212fQ(\Phi Q(t))$ up to $\u223c1\u2009\u2009GHz$, corresponding to $\u223c0.25\Phi 0$.

At its core, Cryoscope is a technique using Ramsey-style experiments to obtain an estimate $\Phi R(t)$ of the actual $\Phi Q(t)$ produced by an AWG pulse $Vin(t)$. We embed the flux pulse (with varying truncation of the input) between the two $\pi /2$ pulses, which are always separated by a fixed interval $Tsep$. The first $\pi /2$ pulse (around the *y* axis of the Bloch sphere) prepares the qubit in the superposition state $(|0\u27e9+|1\u27e9)/2$. An AWG pulse $Vin,\tau (t)$ truncated at time *τ* produces a flux $\Phi Q,\tau (t)$ that transforms the state to $(|0\u27e9+ei\phi \tau |1\u27e9)/2$, with a relative quantum phase

where we explicitly separate the contributions from the flux response up to the truncation point and the subsequent turn-off transient. We complete the Ramsey experiment with two variants, one with the final $\pi /2$ rotation around *y* and the other with it around *x* before measuring in order to determine the Bloch vector components $\u27e8X\u27e9$ and $\u27e8Y\u27e9$ from which we extract $\phi \tau $.

We estimate $\Phi Q(t)$ in the small time interval $[\tau ,\tau +\Delta \tau ]$ using the following procedure. First, we measure $\phi \tau $ and $\phi \tau +\Delta \tau $ to compute

which gives the average detuning $\Delta f\xafQ$ during the interval, with inaccuracy

given by the difference in the phase contributions of the turn-off transients.

The phase contribution from the turn-off transients is suppressed because of the steep return to the first-order flux-insensitive sweetspot of the nearly quadratic $\Delta fQ(\Phi Q)$. Numerical simulations indicate that $|\epsilon |/\Delta f\xafR\u227210\u22122$–$10\u22123$ for dynamical distortions of typically used components.^{10,19,21} This suppression of $|\epsilon |/\Delta f\xafR$ would improve for higher order of nonlinearity in $\Delta fQ(\Phi Q)$.

Finally, we obtain the reconstructed $\Phi R(t)$ by inversion of 1. The ability of Cryoscope to reconstruct pulses of arbitrary shape is shown in the supplementary material for the case of a pulse shaped as a traditional Dutch canal skyline.

We briefly discuss some technical aspects of the implementation. We set $\Delta \tau =1/2.4\u2009\u2009ns$, the minimum allowed by the sampling rate of the AWG (Zurich Instruments HDAWG). The separation time $Tsep$ is set as $100\u2009\u2009ns$ longer than the largest chosen *τ* to negate the need for fine timing calibrations and to be less sensitive to residual detuning during the final rotation. The phase $\phi \tau $ is determined by combining the $\u27e8X\u27e9$ and $\u27e8Y\u27e9$ data. Before unwrapping the phase, it is demodulated using the highest frequency component of a Fourier transform of the $\u27e8X\u27e9$ and $\u27e8Y\u27e9$ data. A second-order Savitzky–Golay filter is then used to determine the derivative by fitting a polynomial in a small window around each data point. The estimated detuning $\Delta f\xafR$ is a sum of the frequency extracted using the Savitzky–Golay filter, the demodulation frequency, and, when using large flux pulse amplitudes, appropriate multiples of the $1.2\u2009\u2009GHz$ Nyquist frequency. The Nyquist order can be determined by acquiring Cryoscope traces for square pulses with different amplitudes and observing when the mean frequency wraps as the pulse amplitude is increased. Because distortions can cause the instantaneous detuning to be slightly lower or higher than the mean detuning, amplitudes close to the Nyquist wrapping should be avoided.

As a first demonstration of Cryoscope, we measure the voltage-to-flux step response *s*(*t*) of the control line. The result shown in Fig. 1(f) reveals clear deviations from the ideal, with dynamics on time scales comparable to typical pulse durations ($\u223c40\u2009ns$) and much longer. These dynamics are the result of compounded linear dynamical distortions and thus can be described by convolution of the input $Vin(t)=V0\xb7u(t)$ (where *u*(*t*) is the Heaviside step function) with the system impulse response *h*, $\Phi Q(t)=h\u22c6Vin(t)$. We furthermore assert that the system is causal so that $s(t)=0$ for *t *<* *0.

As an application of Cryoscope, we make iterative use of real-time digital filtering (available in the AWG) and Cryoscope to improve the step response. The goal of this procedure is to determine the filter $hfilt=h\u0303inv.$ that best inverts *h* such that the corrected step response $scorr(t)=hfilt\u22c6s(t)$ approximates *u*(*t*) as close as possible.

First, several first-order infinite impulse response (IIR) filters are applied to eliminate dynamics on time scales longer than $30\u2009\u2009ns$. The IIR filters are designed to each correct a step response of the form $s(t)=g(1+Ae\u2212t/\tau IIR)\xb7u(t)$, where *A* is the amplitude coefficient, $\tau IIR$ is the time constant of the filter, and *g* is a gain constant. The coefficients of the filters are determined by performing a least squares optimization of a prediction of $scorr(t)$ based on a model of the IIR filters and the measured *s*(*t*). Because the IIR filters are applied in real-time on the hardware, there are small differences between the ideal filter and the implementation, which are taken into account in the model. We typically require 3–5 such IIR filters in order to correct *s*(*t*) between $30\u2009and\u2009200\u2009\u2009ns$. Cryoscope is used to evaluate the corrections of the IIR filters [2(a)] and shows a reconstruction in which the slow dynamics are corrected to within $\u223c0.1%$.

Next, a finite impulse response (FIR) filter is used to correct for the remaining short ($<30\u2009\u2009ns$) time scale dynamics. The FIR filter is described by 40 parameters that in turn describe the 72 coefficients ($30\u2009\u2009ns$) of the filter. The values are found by minimizing the distance between the predicted signal and the ideal step response using the CMA-ES algorithm.^{22} A third Cryoscope measurement is performed to test the accuracy of the corrections. This final step can be used to iteratively fine-tune the FIR coefficients if required. No such iterations were required to achieve a reconstructed step response accurate to $\u223c0.1%$ shown in Fig. 2(a).

To independently characterize the corrections, we perform a chevron experiment without and with the predistortions applied [Figs. 2(b) and 2(c)]. In this experiment, two qubits (*q*_{1} and *q*_{0}) are prepared in the $|11\u27e9$ state using *π* pulses, and a square flux pulse of varying duration and amplitude is applied to the higher frequency qubit (*q*_{0}) to tune $|11\u27e9$ into (near) resonance with $|02\u27e9$, the same interaction that is exploited to realize a CZ gate. With no predistortions applied [Fig. 2(b)], the pattern of *q*_{1} population as a function of pulse amplitude (horizontal axis) and duration (vertical axis) is visibly asymmetric—fringes on the right-hand side are more visible, and the pattern bends toward large pulse amplitudes for short pulse durations. These two features are signatures of the finite rise time of the applied pulse. In contrast, when predistortions are applied [Fig. 2(c)], the pattern is almost perfectly left-right symmetric, both in terms of visibility and shape, indicating a near-perfect rectangular pulse. Using Cryoscope, we can predict the pulse amplitude that results in exact $|11\u27e9$–$|02\u27e9$ degeneracy at every point in time. The prediction [white curve in Figs. 2(b) and 2(c)] overlaps with the path along which the oscillations are slowest, providing an independent verification (although less quantitative) of our method.

Having established the ability to measure and correct distortions, we investigate the sensitivity of Cryoscope. Figure 3(a) presents the unprocessed measurement of $\u27e8X\u27e9$ for three values of qubit detuning during the rectangular pulse. In all cases, we observe decaying oscillations. The faster the decay, the larger the pulse amplitude due to reduced coherence of the qubit further away from the sweetspot. The reconstructed instantaneous flux in a $100\u2212200\u2009\u2009ns$ window [Figs. 3(b) and 3(c)] fluctuates around the mean value, in a range decreasing with the amplitude of the rectangular pulse. We interpret that for larger detuning, the qubit precession is faster, resulting in a larger phase acquired between subsequent time steps and consequently yielding a more accurate measurement of the instantaneous detuning relative to nearly the same sampling noise.

We define a signal-to-noise ratio to quantify the influence of dephasing and the precession rate on Cryoscope sensitivity,

We define as signal the mean amplitude of the optimally corrected, reconstructed flux $\Phi R\xaf$, and as noise the standard deviation $s\Phi R$ The SNR is experimentally determined for several time windows and amplitudes of the rectangular flux pulse [Fig. 3(d)]. We perform 10 Cryoscope experiments for every data point to extract $\Phi R\xaf$ and $s\Phi R$ in the relevant time interval. In the $100\u2212200\u2009\u2009ns$ window, SNR increases quadratically with pulse amplitude, indicating that detuning increases, while the qubit coherence is not affected on this short time scale. In contrast, the increase in SNR is slower for the other time windows. In particular, for the $1200\u22121300\u2009\u2009ns$ window, the SNR reaches a maximum for pulse amplitude $\Phi Q\u22480.17\u2009\Phi 0$. The maximum indicates the configuration in which the benefit of the increased precession rate balances out the drawback of the reduced qubit coherence (due to increased sensitivity to flux noise).

The SNR is also affected by acquisition and processing parameters. The former is the precision with which the qubit state can be determined, which depends on the number of averages and the readout fidelity. The latter is a matter of applied data filtering and can be adjusted depending on the temporal resolution demanded.

All these factors can be combined in a model yielding

where *t* is the time of reconstruction, *c* accounts for the sampling noise and filtering effects in data processing, $\Gamma 0$ is a sweetspot dephasing rate, $\Gamma 1$ quantifies the power of flux noise, and the qubit detuning from the sweetspot is $\Delta fQ(\Phi Q)=a\Phi Q2$. The interplay between quadratic and exponential terms in $\Phi Q$ represents the trade-off between improved sensitivity to the shape of the flux pulse vs reduced signal visibility due to dephasing. The prefactor *c* can be increased by averaging more or alternatively improving the readout fidelity. We fix values of *a* and $\Gamma 0$ based on independent measurements and perform a fit of the two-parameter model (*c* and $\Gamma 1$), finding a good agreement with the data [Fig. 3(d)].

In conclusion, we have demonstrated a method capable of sampling on-chip flux pulses by exploiting the nonlinear flux dependence of transmon frequency. This characterization method is straightforward to use and generalizable to any qubit system with baseband control of the qubit frequency and a sweetspot with respect to the control variable. Furthermore, we have demonstrated the capability to correct distortions as demonstrated by a reconstructed step response accurate to $\u223c0.1%$. The identified corrections were applied in real-time, making the correction method compatible with an instruction-based control architecture.^{16,17} Cryoscope has already been used to tune-up fast, high-fidelity, and low-leakage CZ gates for a QEC experiment^{11,20} and parametrized iSWAP interactions in a variational quantum eigensolver.^{19,23}

See the supplementary material for the experimental details and derivations supporting claims made in the main text. First, we describe the experimental setup. We next discuss technical details of Cryoscope. The third section details a simple model for the signal-to-noise ratio of Cryoscope. Next, we provide the details on the hardware implementations of the FIR and IIR filters used to correct distortions in real-time. Finally, we provide experimental data demonstrating the ability to use Cryoscope to reconstruct an arbitrary signal.

This research was supported by the Office of the Director of National Intelligence (ODNI), Intelligence Advanced Research Projects Activity (IARPA), via the U.S. Army Research Office Grant No. W911NF-16-1-0071, by Intel Corporation, and by the ERC Synergy Grant QC-lab. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of the ODNI, IARPA, or the U.S. Government.

## References

*)*(IEEE,