In-situ Superconducting Qubit Flux Line Characterization and Precompensation in a Few Lines of Code

March 24, 2025 by Oscar Bettermann

Motivation and Introduction

In this blog post, we present a guide to characterize and compensate flux-line distortions in superconducting qubit devices using the Zurich Instruments HDAWG with the Real-Time Precompensation Option. Through in-situ measurements on real qubits, we demonstrate how this is conveniently implemented and used within the LabOne Q quantum computing control software framework. Our approach is simple and efficient, as it enables the compensation for flux-line distortions in a few lines of code while LabOne Q ensures correct pulse timings in the background. This allows scientists and engineers to focus on their experiments while benefitting from optimal gate fidelities through precise shaping of flux pulses sent to the qubits.

Flux pulses can be generated with high precision using Arbitrary Waveform Generators (AWGs) such as the HDAWG or SHFSG from Zurich Instruments. However, various electronic components in the signal line can distort the control pulses on their path to the qubits, thereby compromising gate fidelities, see Figure 1(a). One common way to correct linear distortions is through pulse precompensation: instead of generating a pulse with the desired shape, the shape is modified to precisely counteract the distortions by the signal line. The final pulse at the qubit is then distortion-free, see Figure 1(b).

Pulse shape with and without signal precompensation

Figure 1: Electronic components in the signal line distort the waveform. Instead of (a) playing the desired pulse directly, we (b) precompensate the pulse shape to counteract these distortions.

A possible way to perform such precompensation is by calculating the pulse shape offline, prior to uploading the waveforms to the AWG. However, in situations where the waveforms need to be adapted depending on feedback (e.g. for quantum error correction), this requires uploading the waveforms corresponding to all possible branching cases. Similarly, subsequent repetitions of the same experimental sequence may call for different flux pulse precompensations if the time constant of the distortions is very long, even without feedback. These situations may require an amount of waveform memory exceeding the instrument constraints and making this approach unfeasible in practice. To address this challenge, Zurich Instruments introduced the Real-Time Precompensation Option for the HDAWG to provide a scalable solution with an economic use of the waveform memory: all generated pulses are precompensated in real-time by passing through digital filters within the instrument, see Figure 2.

HDAWG Precompensation module filters

Figure 2: The Zurich Instruments Precompensation module precompensates pulses in real-time by applying a digital filter within the instrument. The Precompensation module provides four filter types to compensate different signal distortions: High pass, Exponential, Bounce and FIR.

The Precompensation module provides four filter types to compensate different signal distortions:

High-pass compensation

Some circuit elements such as bias-tees let higher frequency components in the signal pass while rejecting lower frequency components. A rectangular pulse passing such an element would be distorted so that its DC component between the rising and falling edges is converted to an exponential decay. A high-pass compensation filter can correct this by integrating the original signal with proper scaling, i.e., each sample in the precompensated signal is a weighted summation of the previous samples of the original signal. A time constant controls the rate of integration, and should be set based on the exponential decay of the distorted signal.

Exponential over- and undershoot compensation

Circuits containing RLC components may cause over- or undershooting of the signal. In a rectangular pulse, the signal can for example over- or undershoot at the edges, depending on the circuit. The exponential overshoot/undershoot compensation filter is designed to correct this type of distortions by adding undershoot in case of overshoot, and vice versa. The over- or undershoot is modeled as a single exponential decay or increase with an initial amplitude. Thus the filter has two parameters: an amplitude and a time constant. The amplitude defines the initial amplitude of the exponential decay while the time constant defines the decay time. A total of 8 exponential filters is available to address complex scenarios.

Bounce compensation

A traveling electromagnetic wave is partially reflected when encountering a change in medium. The reflected signal interferes with the original signal, and can for example distort a rectangular pulse by introducing multiple steps after its rising edge. The bounce compensation filter precompensates the pulse by subtracting a scaled version of the original pulse with appropriate delay from the original pulse. The amplitude of the subtracted pulse and the delay with respect to the original pulse are the two relevant parameters here.

Finite Impulse Response (FIR) filter

Unlike the above three types of filters, a FIR Filter is a general-purpose filter designed to correct distortions that do not have a clearly defined type. For example distortions of rectangular flux pulses on a very short time scale after the rising edge usually have a complex form which require adjusting each individual sample of the pulse. The FIR filter offers great flexibility and performance at the cost of a more advanced optimization workflow compared to other filters.

Characterize Distortions: the Flux Scope Experiment

Before we can apply compensation filters, we need to characterize the distortions in the signal line. To achieve this, we implement here a so-called "flux scope" experiment, which is schematically depicted in Figure 3 [1, 2]. This method can be used to characterize the flux line step response function spectroscopically at time scales exceeding the typical duration of a qubit excitation pulse. The experiment works as follows: we start by playing a rectangular pulse on the qubit flux line at a flux-sensitive point where the qubit frequency changes rapidly as a function of the magnetic flux bias. After a delay time \(t\), a \(\pi\)-rotation pulse is played on the qubit drive (or charge) line. By scanning the frequency of this pulse, we can determine the qubit frequency for each value of \(t\). Through a careful theoretical description of the chip under test, the corresponding flux pulse amplitude – and thus the step response function of the signal line – can finally be extracted as a function of \(t\).

Flux scope pulse sequence

Figure 3: Schematic description of a flux scope experiment. A \(\pi\)-rotation pulse is played on the qubit drive line with a delay \(t\) relative to the start of a rectangular pulse on its flux bias line. The flux pulse is then ramped down to perform qubit readout at constant readout resonator frequency. The measurement pulse is played after a delay from the falling edge of the flux pulse to avoid transients.

In LabOne Q, the sequence for a flux scope experiment can be programmed in just a few lines of code. To keep this guide concise, we assume the reader has a basic understanding of the software's functionalities. For those who are not very familiar with LabOne Q yet, we recommend going through our user manual, including the tutorials.

The real-time acquisition loop of the experiment contains a 2D sweep, where we scan the delay \(t\) in the outer loop while scanning the qubit drive frequency in the inner loop. The pulse sequence inside the acquisition loop is defined using four main sections. First, a rectangular pulse is ramped up on the flux experimental signal line. The length of this pulse is determined by the sum of the delay \(t\) (delay_sweep in the code) and of the length drive_pulse_length of the drive pulse:

with exp_flux_scope.section(uid="flux_pulse"):
    exp_flux_scope.play(signal="flux", pulse=flux_pulse,
    			length=delay_sweep+drive_pulse_length)

In a second section, a qubit excitation pulse is played on the drive line following a delay \(t\) after ramping up the flux pulse in the previous section:

with exp_flux_scope.section(uid="drive_pulse"):
	exp_flux_scope.delay(signal="drive", time=delay_sweep)
	exp_flux_scope.play(signal="drive", pulse=drive_pulse)

In the following section, a qubit readout pulse is played on the measure line and acquired on the acquire line, with a delay delay_readout after playing the drive pulse and ramping down the flux pulse.

with exp_flux_scope.section(uid="qubit_readout", play_after="drive_pulse"):
    exp_flux_scope.delay(signal="measure", time=delay_readout)
    exp_flux_scope.delay(signal="acquire", time=delay_readout)
    exp_flux_scope.play(signal="measure", pulse=readout_pulse)
    exp_flux_scope.acquire(signal="acquire", handle="flux_scope",
    			kernel=readout_pulse)

Finally, a last section allows for the qubit to relax back to its ground state before the above sequence is repeated.

Let us demonstrate the flux scope experiment defined above by running it on real quantum hardware. Here, we use a single flux-tunable transmon qubit coupled to a readout resonator, with both charge and flux line addressability. The qubit drive and readout are managed by a Zurich Instruments SHFQC+ while the flux pulses are generated by a Zurich Instruments HDAWG. When examining the qubit response as a function of the drive pulse frequency and of the delay \(t\), we typically obtain results such as those shown in Figure 4(a). We see that after reaching its target value after the flux pulse ramp-up, the qubit frequency quickly shifts back to its initial value. This indicates a high-pass behavior – caused by the bias tees in the setup – with time constant \(\sim 20\,\mu\mathrm{s}\) which dominates the flux line response function for times \(\gtrsim 100\,\mathrm{ns}\). In a last step, we convert the qubit frequency into a normalized flux pulse amplitude. This requires us to carefully model the system, which is different for each chip design. In our case, the qubit frequency roughly depends quadratically on the flux bias pulse amplitude, leading to the result depicted in Figure 4(b).

Flux pulse distortions without precompensation

Figure 4. (a) Qubit readout signal without flux pulse precompensation. The frequency axis is inverted and its origin set to the qubit frequency in the absence of a flux bias pulse. For each delay, the fitted qubit frequency is shown (blue dots). The dashed gray line denotes the target qubit frequency with flux pulse on. (b) Corresponding time-dependent flux pulse amplitude, normalized to its maximal value.

Compensate Distortions on the Zurich Instruments HDAWG

Determine filter parameters

To compensate for the observed long-time behavior using the HDAWG with Real-Time Precompensation Option, we use two of the filters introduced above. First, the high-pass compensation filter assuming a model step response \(y(t) = e^{-t/\tau_{\mathrm{hp}}}\), with time constant \(\tau_{\mathrm{hp}}\). Second, the exponential compensation filter assuming a model step response \(y(t) = 1+A_\mathrm{exp}\,e^{-t/\tau_{\mathrm{exp}}}\) with time constant and amplitude \(\tau_{\mathrm{exp}}\) and \(A_{\mathrm{exp}}\), respectively.

Before we can use these filters, the relevant parameters \(\tau_{\mathrm{hp}}\)\(\tau_{\mathrm{exp}}\) and \(A_{\mathrm{exp}}\) need to be determined from the reconstructed flux pulse profile obtained in the flux scope experiment above (Figure 4). A very handy tool to do this is the Precompensation Advisor Module available in LabOne, and which we use here through the Zurich Instruments Toolkit library. We follow very closely the precompensation curve fit example available online, the only difference being that we account for the high-pass compensation filter in addition to the exponential filter. This leads to a slight modification in enabling the filters:

module = session.modules.precompensation_advisor
module.highpass[0].enable(True)
module.exponentials[0].enable(True)

as well as in the Precompensation Advisor:

def labone_exponential_filter(module_handle, input_signal,
				tau_hp, amp_exp, tau_exp):
    module_handle.highpass[0].timeconstant(tau_hp)
    module_handle.exponentials[0].amplitude(amp_exp)
    module_handle.exponentials[0].timeconstant(tau_exp)
    module_handle.wave.input.inputvector(input_signal)
    return np.array(module_handle.wave.output.forwardwave()["x"])

Here, we explicitly define one high-pass filter with time constant tau_hp as well as an exponential filter with amplitude amp_exp and time constant tau_exp in the Precompensation Advisor Module. Using the data from the flux scope experiment as input_signal, we can fit the coefficients of the filters of the module to precisely describe the step response function of the flux line.

Apply precompensation

Finally, the high-pass as well as the exponential filters are set in LabOne Q through the calibration of the corresponding qubit’s flux signal line:

cal["flux"] = SignalCalibration(
  precompensation=Precompensation(
    high_pass=HighPassCompensation(timeconstant=tau_hp),
    exponential=[ExponentialCompensation(timeconstant=tau_exp, amplitude=amp_exp)]
    ))

To demonstrate the effect of the precompensation, we repeat the flux scope experiment using the above filters. The result is shown in Figure 5, which is in striking contrast with the situation without precompensation. We see that the flux pulse amplitude remains stable at its target value for times ranging from \(\sim100\,\mathrm{ns}\) to \(\sim100\,\mu\mathrm{s}\). Note that while in theory the flux pulse can be corrected for arbitrary long times, in practice the available output amplitude on the HDAWG limits the compensation to times \(\lesssim 100\,\mathrm{\mu s}\).

Flux pulse distortions with precompensation

Figure 5. (a) Qubit readout signal with flux pulse precompensation. The frequency axis is inverted and its origin set to the qubit frequency in the absence of a flux bias pulse. For each delay, the fitted qubit frequency is shown (orange dots). The dashed gray line denotes the target qubit frequency with flux pulse on. (b) Corresponding time-dependent flux pulse amplitude, normalized to its maximal value (orange dots). For reference, we also show the flux pulse amplitude without precompensation (light blue dots).

An Alternative Method to Characterize Distortions: the Cryoscope Experiment

Besides the flux scope measurement, an alternative method to characterize flux line distortions is the so-called Cryoscope experiment [3]. It is particularly well-suited for the characterization of distortions over short time scales up to the qubit coherence time. It is defined as follows: a flux pulse of varying length \(t\) is embedded within two \(\pi/2\)-pulses separated by a fixed time interval \(T>t\), see Figure 6. Here, the qubit is effectively used as a quantum sensor for flux pulses via Ramsey interferometry. This method measures pulse distortions directly at the qubit level by estimating the magnetic flux \(\phi(t)\) from the qubit phase. In contrast to the flux scope, the Cryoscope is applicable to systems with quadratic or higher power dependence of qubit frequency on the control variable (i.e. flux). Hence the Cryoscope can be operated at a sweetspot, where qubit frequency is at least first-order insensitive to the flux.

Cryoscope pulse sequence

Figure 6: Schematic description of a Cryoscope experiment sequence. A \(\pi/2\) rotation pulse is played on the qubit drive line, after which a square pulse of variable length \(t\) is played on the qubit flux line. Following a delay \(T>t\), a second \(\pi/2\) rotation pulse is played on the qubit drive line.

An example of how to implement the Cryoscope experiment can be found in the LabOne Q user manual. The experiment contains two different sequences: one sequence where the final \(\pi/2\) rotation pulse is in-phase with respect to the first \(\pi/2\) pulse (rotation around the \(x\) axis of the Bloch sphere, \(x_{90}\)) and another sequence where the final pulse is phase shifted by 90° (rotation around the \(y\) axis of the Bloch sphere, \(y_{90}\)). Depending on the final pulse (\(x_{90}\) or \(y_{90}\)), the Bloch vector components \(\langle X\rangle\) and \(\langle Y\rangle\) are obtained. From these, we can extract the phase \(\varphi(t)\) via 

\[\varphi(t) = \text{tan}^{-1}\frac{\langle Y(t)\rangle}{\langle X(t)\rangle} + n\cdot \pi,\]

where \(n\) denotes an arbitrary integer. Finally, the detuning from the qubit resonance frequency can then be calculated as the time derivative of the phase 

\[\Delta f(t) = \frac{d\varphi}{dt} .\]

As already mentioned in the above discussion about the flux scope measurement, the conversion of the frequency detuning \(\Delta f(t)\) into a flux \(\phi(t)\) depends on the specifics of the qubit chip being used. We show in Figure 7 an example of a Cryoscope measurement performed on a flux-tunable transmon qubit, which exhibits flux pulse distortions for times up to \(\lesssim 50\,\mathrm{ns}\). Once the distorted flux pulse is reconstructed, it can be pre-compensated following the same procedure as the one described above for flux scope measurements.

Cryoscope measurement

Figure 7. Qubit frequency detuning as a function of the flux pulse duration (orange dots). The reconstructed magnetic flux in units of the magnetic flux quantum is shown as blue dots. Data provided by the Walther-Meißner-Institute.

Conclusion and Acknowledgments

In this blog post, we have demonstrated how to characterize flux pulse distortions in superconducting qubits directly at the qubit location, as well as methods to compensate for them in real time on the Zurich Instruments HDAWG Arbitrary Waveform Generator. These methods have recently helped researchers achieve controlled-Z gates with 99.9% fidelity [4]. We have discussed in detail the implementation of a flux scope experiment in the quantum computing software framework LabOne Q and given a short description of the Cryoscope experiment in this context. We thank the ETHZ-PSI Quantum Computing Hub for providing the sample for the flux scope measurements in the frame of the Innosuisse project Sherloq, and the Walther-Meißner-Institute for providing the experimental data for the Cryoscope experiment in the frame of the BMBF project MUNIQC-SC. Finally, we would like to warmly thank Dr. Lukas Sigl and Dr. Tianmu Zhang for their tremendous help in writing this blog post.

Are you interested in characterizing and compensating flux pulse distortions in your experiment? Feel free to get in touch with us at oscar.bettermann@zhinst.com, we will be delighted to discuss your specific implementation in more detail and help you move forward!

References

  1. M. Hofheinz, H. Wang, M. Ansmann, R. C. Bialczak, E. Lucero, M. Neeley, A. D. O'Connell, D. Sank, J. Wenner, J. M. Martinis, and A. N. Cleland, "Synthesizing arbitrary quantum states in a superconducting resonator", Nature, 459, 546-549 (2009)
  2. C. Hellings, N. Lacroix, A. Remm, R. Boell, J. Herrmann, S. Lazar, S. Krinner, F. Swiadek, C. K. Andersen, C. Eichler, A. Wallraff, "Calibrating Magnetic Flux Control in Superconducting Circuits by Compensating Distortions on Time Scales from Nanoseconds up to Tens of Microseconds", arXiv:2503.04610
  3. M. A. Rol, L. Ciorciaro, F. K. Malinowski, B. M. Tarasinski, R. E. Sagastizabal, C. C. Bultink, Y. Salathe, N. Haandbaek, J. Sedivy, L. DiCarlo, "Time-domain characterization and correction of on-chip distortion of control pulses in a quantum processor", Appl. Phys. Lett. 116, 054001 (2020)
  4. N. J. Glaser, F. A. Roy, I. Tsitsilin, L. Koch, N. Bruckmoser, J. Schirk, J. H. Romeiro, G. B. P. Huber, F. Wallner, M. Singh, G. Krylov, A. Marx, L. Södergren, C. M. F. Schneider, M. Werninghaus, S. Filipp, "Sensitivity-Adapted Closed-Loop Optimization for High-Fidelity Controlled-Z Gates in Superconducting Qubits", arXiv:2412.17454