Skip to content

QUA tools repository

In the QUA tools repository, you can find various tools useful while writing your QUA programs, making it much easier and simpler to perform your experiments.

Do you have any additional tool to share with the QUA community? We would love to have your contribution! Just click here and add it.

Config Tools

Config Tools package includes tools related to the QOP configuration file. Using this package, you can, for example, create useful waveforms for your experiment via the Waveform Tools package. Moreover, creating and manipulating integration weights is very comfortable with the Integration Weights Tools package.

Unit Tools

The Unit Tools library includes simple tools for using units (MHz, us, mV...) and converting data to other units such as converting demodulated data to volts.

To show the simplicity of this tool, look at the snippet of code below that plots the converted demodulated data in millivolts.

u = unit()

plt.figure()
plt.plot(u.raw2volts(raw_data) * u.mV)
plt.ylabel("Raw trace [mV]")

QUA Loops Tools

The QUA Loops Tools library includes tools for parametrizing QUA for loops using the NumPy (linspace, arrange, logspace) syntax or by directly inputting a NumPy array as an iterable. Moreover, it validates the input so you don't have to worry about exceeding the range of the variables, for example. These tools make writing the loops inside your QUA program much simpler!

For example:

pulse_amplitude = np.arange(-0.3, 0.3 , 0.01)

with program() as prog:
    a = declare(fixed)
    with for_(*from_array(a, pulse_amplitude)):
        # The variable 'a' will be looped over the values from pulse_amplitude
        ...

Result Tools

The Result Tools library includes tools for easy fetching and handling of results from your QUA program. For example, you can add a progress bar to your job execution or live plot the data from the stream processing! This can be seen below:

my_results = fetching_tool(job, data_list=["I", "Q", "Ie", "Qe", "Ig", "Qg"], mode="live")

fig = plt.figure(figsize=(15, 15))

while job.result_handles.is_processing():
    # Live plotting
    I, Q, Ie, Qe, Ig, Qg = my_results.fetch_all()
    ...

Analysis Tools

The Analysis Tools library includes tools for analyzing data from experiments.

Currently, it contains one important tool: the Discriminator. This tool allows you to discriminate between two states in the IQ plane and be (almost) sure that your qubit is, in fact, in the right state.

Bakery

The Bakery library introduces a framework for creating arbitrary waveforms and storing them in the configuration file. It allows defining waveforms in a QUA-like manner while working with 1ns resolution (or higher).

Using this tool provides an advantage by embedding into one single waveform a series of instructions that allows program memory preservation. This way, you can generate the desired samples, for example, based on two previous ones. While baking the waveform, one of the instructions can even be waiting a negative amount of time!

All this is easily done by creating the baked waveform and using the run command inside your QUA program. See an example of the framework below:

with baking(config, "left"):
#Create your baked waveform

#Open QUA program:
with program() as QUA_prog:
    b.run()

Control Panel

The Control Panel package includes tools for directly controlling the OPX. This may help you control the OPX's outputs. For example, you can turn on and off digital channels and change the amplitude and frequency of the analog channels. This is very convenient if you want to output signals from the OPX without writing a QUA program.

Note

This is a stand-alone module.

Addons

Note

This is a beta package. Some of these tools are not fully supported and tested, but we believe have a true product value.

The Addons package includes more generic tools; InteractivePlotLib and Calibration. The former extends the capabilities of matplotlib and makes it much easier to analyze the data via, for example, fitting, editing, and saving the raw data. The latter allows you to easily perform most of the standard single qubit calibrations such as time_of_flight, resonator spectroscopy, Rabi and more!