Experiment Setup#

Getting Started#

To demonstrate how to use the QCS, we will start with a high-level overview of a simple calibration experiment. This section is intended to demonstrate the basic principles of the QCS workflow before we explore the different components in more detail in later sections.

The basic workflow of the QCS is to use the following components to make it easy to program an experiment:

  • Channel Mapper: Define the hardware configuration of the system using a ChannelMapper. The Channel Mapper defines the relationship between physical channel addresses and “virtual channels” that are useful for programming experiments. For example, we can map (AWG channel 1 in slot 2 of chassis 1) to (readout_channel 0). This allows users to program experiments in terms of readout_channel instead of physical addresses.

  • Calibration Variables: Create a list of calibration parameters using a CalibrationSet that defines the operations (waveforms/gates/acquisitions). The experiment variables are the list of parameters that need to be stored to build the pulses and acquisitions that are used in an experiment. For example, we can define control_frequencies to track the frequencies of pulses used to rotate each qubit. These values may need to be updated as users calibrate their quantum system.

  • Operation Definitions: Operation definitions define how the Calibration Variables are used to construct different basic operations that can be used in an experiment. or example, we can define an X-gate as a pulse with a gaussian envelope with width defined by single_qubit_durations, an amplitude defined by single_qubit_amplitude, and a frequency defined by control_frequencies.

The role of a simple experiment then is to:

  1. Define a program with a series of pulses and acquisitions

  2. Configure a scan where the program is repeated many times while adjusting one of the Experiment Variables

For a simple example of this we consider the below example. In this section we will go over each step required to use the QCS to run simple experiments, highlighting select sections of the relevant files. For a more detailed line-by-line breakdown please use the Experiment Library section.

To use this example we must first set up the channel mapper. We do this by opening the file channel_mapper.py. Here we map the virtual channels to physical channels, and the physical channels must match your actual hardware configuration.

import keysight.qcs as qcs

readout_awg_address = qcs.Address(chassis=1, slot=2, channel=1)
xy_awg_address = [
    qcs.Address(chassis=1, slot=2, channel=2),
    qcs.Address(chassis=1, slot=2, channel=3),
]
dig_address = qcs.Address(1, 18, 1)
dnc_address = qcs.Address(1, 17, 1)

Each physical channel has a slot number, a chassis number, and a channel number. Ensure that these physical addresses match the hardware of your system and then run the python script to generate a channel mapper and save it to the new file called channel_mapper.qcs.

we will next look at the file calibration.py. This file generates default calibration variables and default gate definitions in calibration.qcs.

Next open the file hello_qcs.ipynb. In this file we construct our pulse program.

# Define the program for the experiment
program = qcs.Program()
program.add_measurement(qubits)

Note that this simple program contains only a measurement. This consists of a readout pulse played from readout_channels, and an acquisition on acquire_channels.

Finally we construct the scan. Here we are sweeping over the readout_amplitudes calibration variable, which defines the amplitude of our readout pulse.

# Add the scan to the experiment
hello_qcs_experiment.configure_repetitions(
    n_shots, False, **{cal_variable_name: amplitudes}
)

This experiment is designed to be run in “loopback mode” where the AWG output at readout_awg_address is connected to the input of the downconverter at dnc_address. Additionally, verify that the output from dnc_address is connected to the digitizer input at dig_address.

Once the cable connections have been made, the experiment can be executed and acquired data plotted:

hello_qcs_experiment.execute()

hello_qcs_experiment.plot_iq()

We see that the acquired amplitude scales linearly as we sweep the readout amplitude.