Download

Download this file as Jupyter notebook: t1.ipynb.

T1#

Relaxation Experiment#

Another example of decoherence is thermal relaxation which happens at a time scale commonly referred to as T1. This section shows how to perform a Relaxation experiment to learn that decay time T1 using the class T1Experiment.

A \(\pi\) gate is first applied to a qubit in the ground state to bring it to the excited state followed by a varying delay. The sequence is then followed by a readout pulse.

../_images/relaxation.png

This experiment follows the following steps:

  1. Initialize the qubit to the excited state by applying a \(\pi\)

  2. Apply a delay.

  3. Measure the population of the qubit in the excited state.

  4. Repeat the above steps with varying delay time.

We start again by initializing a qubit and loading a channel mapper to create a new instance of the T1Experiment class. Next, we generate a calibration set for the qubit using make_calibration_set(). This file includes the quantum operations and variables we will need to run the experiment.

[2]:
import keysight.qcs as qcs
import numpy as np
from keysight.qcs.experiments import T1Experiment
from keysight.qcs.experiments import make_calibration_set

# set the following to True when connected to hardware
run_on_hw = False

n_qubits = 1
qubits = qcs.Qudits(range(n_qubits))
calibration_set = make_calibration_set(n_qubits)

# generate an empty channel mapper
mapper = qcs.ChannelMapper("ip_addr")
[3]:
# create a T1 experiment
t1_experiment = T1Experiment(mapper, calibration_set=calibration_set, qubits=qubits)

t1_experiment.draw()

# The program consists of one `X` gate with a variable delay followed by a measurement.
Program
keysight-logo-svg
Program Body
Program
Duration undefined
Layers 1
Targets 1
Layer #0
Layer #0
Duration undefined
qudits 0
X
Gate X on ('qudits', 0)

Matrix:
0 1
1 0
Delay on ('qudits', 0)

Parameters
Duration Array(name=pulse_delay, shape=(1,), dtype=float, unit=s)
Measure on ('qudits', 0)

Parameters
Dim 2
[4]:
# configure the repetitions for this experiment
start_delay = 40e-9
end_delay = 80e-9
steps = 3
scan_values = np.linspace([start_delay] * n_qubits, [end_delay] * n_qubits, steps)
t1_experiment.configure_repetitions(delays=scan_values, n_shots=1)

Note

We can set different delay values for different qubits, as long as every qubit gets the same number of values i.e. delays should have shape (steps, n_qubits).

Compiling this program to the waveform level using the ParameterizedLinkers in the calibration set results in the following program:

[5]:
t1_experiment.compiled_program.draw()
Program
Sweep Details:
Repetitions Repeat with 1 repetitions
(HW)Repeat(1)
Sweep Details:
Repetitions Sweep with 3 repetitions
Associations
pulse_delay Array(name=_implicit, shape=(3, 1), dtype=float, unit=none, value=[[40 ns], [60 ns], [80 ns]])
(HW)Sweep_pulse_delay
keysight-logo-svg
Program Body
Program
Duration undefined
Layers 1
Targets 3
Layer #0
Layer #0
Duration undefined
xy_pulse 0
RFWaveform on ('xy_pulse', 0)

Parameters
Duration ScalarRef(name=xy_pulse_durations, value=30 ns, dtype=float, unit=s)
Amplitude ScalarRef(name=x180_pulse_amplitudes, value=0.5, dtype=float, unit=none)
Frequency ScalarRef(name=xy_pulse_frequencies, value=5.1 GHz, dtype=float, unit=Hz)
Envelope GaussianEnvelope(2.0)
Instantaneous Phase ScalarRef(name=x_phase, value=0 rad, dtype=float, unit=rad)
Post-phase ScalarRef(name=x_post_phase, value=0 rad, dtype=float, unit=rad)
Delay on ('xy_pulse', 0)

Parameters
Duration Max(Scalar(name=_implicit, value=105 ns, dtype=float, unit=s), Scalar(name=_implicit, value=105 ns, dtype=float, unit=s))
readout_pulse 0
Delay on ('readout_pulse', 0)

Parameters
Duration Array(name=_implicit, shape=(1,), dtype=float, unit=s)
Delay on ('readout_pulse', 0)

Parameters
Duration ScalarRef(name=readout_pulse_delay, value=0 s, dtype=float, unit=s)
RFWaveform on ('readout_pulse', 0)

Parameters
Duration ScalarRef(name=readout_pulse_duration, value=100 ns, dtype=float, unit=s)
Amplitude ScalarRef(name=readout_pulse_amplitudes, value=0.1, dtype=float, unit=none)
Frequency ScalarRef(name=readout_frequencies, value=5.15 GHz, dtype=float, unit=Hz)
Envelope SineEnvelope()
Instantaneous Phase ScalarRef(name=readout_pulse_phases, value=0 rad, dtype=float, unit=rad)
Post-phase ScalarRef(name=measurement_post_phase, value=0 rad, dtype=float, unit=rad)
Delay on ('readout_pulse', 0)

Parameters
Duration Scalar(name=_implicit, value=5 ns, dtype=float, unit=s)
readout_acquisition 0
Delay on ('readout_acquisition', 0)

Parameters
Duration Array(name=_implicit, shape=(1,), dtype=float, unit=s)
Delay on ('readout_acquisition', 0)

Parameters
Duration ScalarRef(name=acquisition_delay, value=5 ns, dtype=float, unit=s)
Acquisition on ('readout_acquisition', 0)

Parameters
Duration ScalarRef(name=acquisition_duration, value=100 ns, dtype=float, unit=s)
Integration Filter
RFWaveform

Parameters
Duration ScalarRef(name=acquisition_duration, value=100 ns, dtype=float, unit=s)
Amplitude ScalarRef(name=measurement_integrator_amplitude, value=1, dtype=float, unit=none)
Frequency ScalarRef(name=readout_frequencies, value=5.15 GHz, dtype=float, unit=Hz)
Envelope ConstantEnvelope()
Instantaneous Phase ScalarRef(name=measurement_integrator_phase, value=0 rad, dtype=float, unit=rad)
Post-phase ScalarRef(name=measurement_integrator_post_phase, value=0 rad, dtype=float, unit=rad)
Classifier Classifier(Array(name=references, shape=(1, 2), dtype=complex, unit=none))
Delay on ('readout_acquisition', 0)

Parameters
Duration Scalar(name=_implicit, value=4.96308e-24 s, dtype=float, unit=s)

We again use the render method to visualize this with the ChannelMapper.

[6]:
t1_experiment.compiled_program.render(
    channel_subplots=False,
    lo_frequency=5e9,
    sweep_index=2,
    sample_rate=5e9,
)

The sweep index allows you to visualize the change of delay value between the control and readout pulses.

[7]:
t1_experiment.compiled_program.render(
    channel_subplots=False,
    lo_frequency=5e9,
    sweep_index=0,
    sample_rate=5e9,
)

To execute this experiment, we can simply run

[8]:
if run_on_hw:
    t1_experiment.execute()
else:
    # load in a previously executed version of this experiment
    t1_experiment = qcs.load("T1Experiment.qcs")

For the purposes of this demonstration, we added a second “ancilla” qubit to the program and connected the physical output channels for our qubit to the digizer associated with the ancilla to allow us to capture the full pulse sequence.

[9]:
t1_experiment.draw()
T1Experiment
Sweep Details:
Repetitions Sweep with 3 repetitions
Associations
pulse_delay Array(name=_implicit, shape=(3, 1), dtype=float, unit=none, value=[[40 ns], [60 ns], [80 ns]])
(SW)Sweep_pulse_delay
Sweep Details:
Repetitions Repeat with 1 repetitions
(HW)Repeat(1)
keysight-logo-svg
Program Body
T1Experiment
Duration undefined
Layers 1
Targets 2
Layer #0
Layer #0
Duration undefined
qudits 0
X
Gate X on ('qudits', 0)

Matrix:
0 1
1 0
Delay on ('qudits', 0)

Parameters
Duration Array(name=pulse_delay, shape=(1,), dtype=float, unit=s)
Measure on ('qudits', 0)

Parameters
Dim 2
ancilla 1
Measure on ('ancilla', 1)

Parameters
Dim 2

We can see the program compiled to the waveform level with the following command:

[10]:
t1_experiment.compiled_program.draw()
T1Experiment
Sweep Details:
Repetitions Sweep with 3 repetitions
Associations
pulse_delay Array(name=_implicit, shape=(3, 1), dtype=float, unit=none, value=[[40 ns], [60 ns], [80 ns]])
(SW)Sweep_pulse_delay
Sweep Details:
Repetitions Repeat with 1 repetitions
(HW)Repeat(1)
keysight-logo-svg
Program Body
T1Experiment
Duration undefined
Layers 1
Targets 4
Layer #0
Layer #0
Duration undefined
xy_pulse 0
RFWaveform on ('xy_pulse', 0)

Parameters
Duration ScalarRef(name=xy_pulse_durations, value=30 ns, dtype=float, unit=s)
Amplitude ScalarRef(name=x180_pulse_amplitudes, value=0.5, dtype=float, unit=none)
Frequency ScalarRef(name=xy_pulse_frequencies, value=5.1 GHz, dtype=float, unit=Hz)
Envelope GaussianEnvelope(2.0)
Instantaneous Phase ScalarRef(name=x_phase, value=0 rad, dtype=float, unit=rad)
Post-phase ScalarRef(name=x_post_phase, value=0 rad, dtype=float, unit=rad)
Delay on ('xy_pulse', 0)

Parameters
Duration Max(Scalar(name=_implicit, value=225 ns, dtype=float, unit=s), Scalar(name=_implicit, value=225 ns, dtype=float, unit=s))
readout_pulse 0
Delay on ('readout_pulse', 0)

Parameters
Duration Array(name=_implicit, shape=(1,), dtype=float, unit=s)
Delay on ('readout_pulse', 0)

Parameters
Duration ScalarRef(name=readout_pulse_delay, value=0 s, dtype=float, unit=s)
RFWaveform on ('readout_pulse', 0)

Parameters
Duration ScalarRef(name=readout_pulse_duration, value=100 ns, dtype=float, unit=s)
Amplitude ScalarRef(name=readout_pulse_amplitudes, value=0.1, dtype=float, unit=none)
Frequency ScalarRef(name=readout_frequencies, value=5.15 GHz, dtype=float, unit=Hz)
Envelope SineEnvelope()
Instantaneous Phase ScalarRef(name=readout_pulse_phases, value=0 rad, dtype=float, unit=rad)
Post-phase ScalarRef(name=measurement_post_phase, value=0 rad, dtype=float, unit=rad)
Delay on ('readout_pulse', 0)

Parameters
Duration Scalar(name=_implicit, value=125 ns, dtype=float, unit=s)
readout_acquisition 0
Delay on ('readout_acquisition', 0)

Parameters
Duration Array(name=_implicit, shape=(1,), dtype=float, unit=s)
Delay on ('readout_acquisition', 0)

Parameters
Duration ScalarRef(name=acquisition_delay, value=5 ns, dtype=float, unit=s)
Acquisition on ('readout_acquisition', 0)

Parameters
Duration ScalarRef(name=acquisition_duration, value=220 ns, dtype=float, unit=s)
Integration Filter
RFWaveform

Parameters
Duration ScalarRef(name=acquisition_duration, value=220 ns, dtype=float, unit=s)
Amplitude ScalarRef(name=measurement_integrator_amplitude, value=1, dtype=float, unit=none)
Frequency ScalarRef(name=readout_frequencies, value=5.15 GHz, dtype=float, unit=Hz)
Envelope ConstantEnvelope()
Instantaneous Phase ScalarRef(name=measurement_integrator_phase, value=0 rad, dtype=float, unit=rad)
Post-phase ScalarRef(name=measurement_integrator_post_phase, value=0 rad, dtype=float, unit=rad)
Classifier Classifier(Array(name=references, shape=(1, 2), dtype=complex, unit=none))
Delay on ('readout_acquisition', 0)

Parameters
Duration Scalar(name=_implicit, value=4.96308e-24 s, dtype=float, unit=s)
1
Acquisition on ('readout_acquisition', 1)

Parameters
Duration Scalar(name=_implicit, value=220 ns, dtype=float, unit=s)
Integration Filter
DCWaveform

Parameters
Duration Scalar(name=_implicit, value=220 ns, dtype=float, unit=s)
Amplitude 1
Frequency 0 Hz
Envelope ConstantEnvelope()
Instantaneous Phase 0
Post-phase 0

Here we can see the control pulse and the readout pulse separated by our varying delay.

[11]:
t1_experiment.render(channel_subplots=False, sweep_index=2)

The ancilla qubit is mapped to the digitizer channel 1 and has a single acquisition that spans the duration of both control pulses and the maximum delay between them.

[12]:
t1_experiment.plot_trace(channels=qcs.Qudits(1, "ancilla"))

Download

Download this file as Jupyter notebook: t1.ipynb.