Download

Download this file as Jupyter notebook: hahn_echo.ipynb.

Hahn Echo Experiment#

This section shows how to perform a Hahn Echo experiment. This experiment can be easily generated with EchoExperiment.

With the previous Ramsey experiment we showed a way to characterize the decay rate of the coherence between the ground and excited states of the qubit. We now show how to perform a T_2 Hahn Echo experiment to obtain a more precise estimate of the qubit’s decay time. Indeed, unlike the T_2^* previously measured, the T_2 obtained using a Hahn Echo experiement allows to get a measure of the decoherence while eliminating low frequency fluctuations. Here we are following the same process as the Ramsey experiment above with the addition of an additional Z rotation also called a refocusing pulse in between the two \(\frac{\pi}{2}\) pulses. This Z rotation will counteract the natural precession of the qubit’s state and is refocusing any slow noise by doing so.

../_images/hahn_echo.png

The experiment therefore follows the following steps:

  1. Initialize the qubit to an equal superposition state between the ground and excited state (in the \(XY\) plane of the Bloch sphere) by applying a \(\frac{\pi}{2}\) gate.

  2. Apply a delay.

  3. Apply a \(Z\) rotation to offset the natural precession.

  4. Apply a second \(\frac{\pi}{2}\) gate to drive the qubit toward either the ground or excited state.

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

  6. 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 EchoExperiment 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 EchoExperiment
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")

# create Ramsey experiment
echo_experiment = EchoExperiment(mapper, calibration_set=calibration_set, qubits=qubits)

echo_experiment.draw()

# The program consists of two `X90` gates, with a `X` gate placed between them.
# There are two delays of `d/2` where `d` is variable, one in between the first
# `X90` gates and the `X` gate and one in between the `X` gates and the second
# `X90` gate. The sequence is then 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
X90
Gate X90 on ('qudits', 0)

Matrix:
0.71 -0.71j
-0.71j 0.71
Delay on ('qudits', 0)

Parameters
Duration Array(name=pulse_delay, shape=(1,), dtype=float, unit=s)
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)
X90
Gate X90 on ('qudits', 0)

Matrix:
0.71 -0.71j
-0.71j 0.71
Measure on ('qudits', 0)

Parameters
Dim 2
[3]:
# 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)
echo_experiment.configure_repetitions(delays=scan_values, n_shots=1)

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

[4]:
echo_experiment.compiled_program.render(channel_subplots=False, sample_rate=5e9)

To execute this experiment, we can simply run

[5]:
if run_on_hw:
    echo_experiment.execute()
else:
    # load in a previously executed version of this experiment
    echo_experiment = qcs.load("EchoExperiment_data.hdf5")

The draw and plot methods can then be used just like for the Ramsey experiment.

[6]:
echo_experiment.draw()
EchoExperiment
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
EchoExperiment
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=_implicit, value=0.25, 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=sx_phase, value=0 rad, dtype=float, unit=rad)
Post-phase ScalarRef(name=sx_post_phase, value=0 rad, dtype=float, unit=rad)
Delay on ('xy_pulse', 0)

Parameters
Duration Array(name=pulse_delay, shape=(1,), dtype=float, unit=s)
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 Array(name=pulse_delay, shape=(1,), dtype=float, unit=s)
RFWaveform on ('xy_pulse', 0)

Parameters
Duration ScalarRef(name=xy_pulse_durations, value=30 ns, dtype=float, unit=s)
Amplitude ScalarRef(name=_implicit, value=0.25, 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=sx_phase, value=0 rad, dtype=float, unit=rad)
Post-phase ScalarRef(name=sx_post_phase, value=0 rad, dtype=float, unit=rad)
Delay on ('xy_pulse', 0)

Parameters
Duration Max(Scalar(name=_implicit, value=265 ns, dtype=float, unit=s), Scalar(name=_implicit, value=265 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=165 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=260 ns, dtype=float, unit=s)
Integration Filter
RFWaveform

Parameters
Duration ScalarRef(name=acquisition_duration, value=260 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=260 ns, dtype=float, unit=s)
Integration Filter
DCWaveform

Parameters
Duration Scalar(name=_implicit, value=260 ns, dtype=float, unit=s)
Amplitude 1
Frequency 0 Hz
Envelope ConstantEnvelope()
Instantaneous Phase 0
Post-phase 0
[7]:
echo_experiment.plot_trace(channels=qcs.Qudits(1, "ancilla"))

Download

Download this file as Jupyter notebook: hahn_echo.ipynb.