{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "36940ed7", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:05.120413Z", "iopub.status.busy": "2025-10-02T01:28:05.120129Z", "iopub.status.idle": "2025-10-02T01:28:05.123936Z", "shell.execute_reply": "2025-10-02T01:28:05.123330Z" }, "nbsphinx": "hidden" }, "outputs": [], "source": [ "# Copyright 2025 Keysight Technologies Inc." ] }, { "cell_type": "raw", "id": "d4ba3d59", "metadata": { "lines_to_next_cell": 0, "raw_mimetype": "text/restructuredtext" }, "source": [ "Live Plotting\n", "=============\n", "\n", "The QCS is able to display live plots for the IQ data of programs while they are\n", "running. The QCS software stack supports one-dimensional and two-dimensional live\n", "plotting of both hardware-time and software-time sweeps.\n", "\n", "One limitation of live plotting is that the total number of sweep repetitions must\n", "be less than 38,000. Here, \"sweep repetitions\" refers to the product of the\n", "number of steps in each of the sweeps. This limitation cannot be reached for\n", "one-dimensional hardware-time sweeps, as the max size of a sweep dimension is\n", "24,576. However, for two-dimensional sweeps, this limit can easily be reached.\n", "For example, a program with sweep dimensions of 380 x 100 will be at the\n", "maximum supported size.\n", "\n", ":py:class:`~keysight.qcs.executor.HclBackend` must also be set with\n", "``fpga_postprocessing = True``.\n", "\n", "In order to enable live plotting, set the ``live_plotting_config`` parameter\n", "on :py:class:`~keysight.qcs.executor.HclBackend` with the channels to visualize.\n", "\n", "Live plotting on a program\n", "**************************" ] }, { "cell_type": "code", "execution_count": 2, "id": "05645fd4", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:05.126247Z", "iopub.status.busy": "2025-10-02T01:28:05.126006Z", "iopub.status.idle": "2025-10-02T01:28:08.151064Z", "shell.execute_reply": "2025-10-02T01:28:08.149906Z" } }, "outputs": [], "source": [ "import keysight.qcs as qcs\n", "import numpy as np" ] }, { "cell_type": "code", "execution_count": 3, "id": "4fe4e482", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.154140Z", "iopub.status.busy": "2025-10-02T01:28:08.153655Z", "iopub.status.idle": "2025-10-02T01:28:08.160864Z", "shell.execute_reply": "2025-10-02T01:28:08.160227Z" }, "lines_to_next_cell": 2 }, "outputs": [], "source": [ "\n", "# Define a channel mapper or load one from file.\n", "channel_mapper_exists = False\n", "\n", "if channel_mapper_exists:\n", " mapper = qcs.load(\"\")\n", "else:\n", " # generate an empty channel mapper with the correct address\n", " mapper = qcs.ChannelMapper(\"127.0.0.1\")\n", "\n", "readout_pulse_channels = qcs.Channels([0, 1], \"readout_pulse\", absolute_phase=True)\n", "readout_acquisition_channels = qcs.Channels(\n", " [0, 1], \"readout_acquisition\", absolute_phase=True\n", ")" ] }, { "cell_type": "code", "execution_count": 4, "id": "40e425b2", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.162729Z", "iopub.status.busy": "2025-10-02T01:28:08.162537Z", "iopub.status.idle": "2025-10-02T01:28:08.345568Z", "shell.execute_reply": "2025-10-02T01:28:08.344879Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", "
\n", "
\n", " Program\n", "
\n", "
\n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " \n", "\n", "\n", "\n", "
\n", " Sweep Details:\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Repetitions\n", " Sweep with 50 repetitions\n", "
\n", " Associations\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
frequencyArray(name=frequencies, shape=(50,), dtype=float, unit=none, value=[5 GHz, 5.0051 GHz, 5.0102 GHz, 5.01531 GHz, 5.02041 GHz, 5.02551 GHz, 5.03061 GHz, 5.03571 GHz, 5.04082 GHz, 5.04592 GHz, ... ])
\n", "\n", "
\n", "
\n", "\n", "
\n", "\n", " \n", " (SW)Sweep_frequency\n", " \n", "
\n", "\n", "
\n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
\n", "
\n", " \n", " \n", "\n", "\n", "\n", "
\n", " Sweep Details:\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Repetitions\n", " Repeat with 50 repetitions\n", "
\n", "\n", "
\n", "
\n", "\n", "
\n", "\n", " \n", " (HW)Repeat(50)\n", " \n", "
\n", "\n", "
\n", " \n", "\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", " \n", "\tkeysight-logo-svg\n", "\t\n", "\t\n", "\t\t\n", "\t\n", "\n", "\n", " \n", "
\n", " Program Body\n", "
\n", " \n", "\n", "\n", "\n", "
\n", " Program\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Duration80 ns
Layers1
Targets4
\n", "
\n", "\n", "
\n", "
\n", "
\n", "
\n", " Layer #0\n", "
\n", " \n", "\n", "\n", "\n", "
\n", " Layer #0 \n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Duration80 ns
\n", "
\n", "\n", "
\n", "
\n", "
\n", " readout_pulse\n", " \n", " 0\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " RFWaveform on ('readout_pulse', 0)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationScalar(name=_implicit, value=80 ns, dtype=float, unit=s)
Amplitude1
FrequencyScalar(name=frequency, value=None, dtype=float, unit=Hz)
EnvelopeGaussianEnvelope(2.0)
Instantaneous Phase0 rad
Post-phase0 rad
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " 1\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " RFWaveform on ('readout_pulse', 1)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationScalar(name=_implicit, value=80 ns, dtype=float, unit=s)
Amplitude1
FrequencyScalar(name=frequency, value=None, dtype=float, unit=Hz)
EnvelopeGaussianEnvelope(2.0)
Instantaneous Phase0 rad
Post-phase0 rad
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " readout_acquisition\n", " \n", " 0\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Acquisition on ('readout_acquisition', 0)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationScalar(name=_implicit, value=80 ns, dtype=float, unit=s)
Integration Filter\n", " \n", " \n", "\n", "\n", "\n", "
\n", " RFWaveform \n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationScalar(name=_implicit, value=80 ns, dtype=float, unit=s)
Amplitude1
Frequency[5.1 GHz, 5.15 GHz]
EnvelopeGaussianEnvelope(2.0)
Instantaneous Phase0 rad
Post-phase0 rad
\n", "
\n", "\n", "
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " 1\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Acquisition on ('readout_acquisition', 1)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationScalar(name=_implicit, value=80 ns, dtype=float, unit=s)
Integration Filter\n", " \n", " \n", "\n", "\n", "\n", "
\n", " RFWaveform \n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationScalar(name=_implicit, value=80 ns, dtype=float, unit=s)
Amplitude1
Frequency[5.1 GHz, 5.15 GHz]
EnvelopeGaussianEnvelope(2.0)
Instantaneous Phase0 rad
Post-phase0 rad
\n", "
\n", "\n", "
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", "
\n", "\n", "\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": { "text/html": { "isolated": true } }, "output_type": "display_data" } ], "source": [ "# Define a program to run\n", "program = qcs.Program()\n", "frequency = qcs.Scalar(\"frequency\", dtype=float)\n", "waveform = qcs.RFWaveform(80e-9, qcs.GaussianEnvelope(), 1, frequency)\n", "int_filter = qcs.RFWaveform(80e-9, qcs.GaussianEnvelope(), 1, [5.1e9, 5.15e9])\n", "program.add_waveform(waveform, readout_pulse_channels)\n", "program.add_acquisition(int_filter, readout_acquisition_channels)\n", "program.n_shots(50)\n", "frequencies = qcs.Array(\"frequencies\", value=np.linspace(5e9, 5.25e9, 50))\n", "program.sweep(frequencies, frequency)\n", "program.draw()" ] }, { "cell_type": "code", "execution_count": 5, "id": "56946b52", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.347646Z", "iopub.status.busy": "2025-10-02T01:28:08.347426Z", "iopub.status.idle": "2025-10-02T01:28:08.385531Z", "shell.execute_reply": "2025-10-02T01:28:08.384861Z" }, "lines_to_next_cell": 2 }, "outputs": [], "source": [ "# Setup live plotting to display the two digitizer channels\n", "backend = qcs.HclBackend(\n", " channel_mapper=mapper,\n", " fpga_postprocessing=True,\n", " live_plotting_config=readout_acquisition_channels,\n", ")" ] }, { "cell_type": "code", "execution_count": 6, "id": "dab7850b", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.388892Z", "iopub.status.busy": "2025-10-02T01:28:08.388677Z", "iopub.status.idle": "2025-10-02T01:28:08.392214Z", "shell.execute_reply": "2025-10-02T01:28:08.391547Z" }, "lines_to_next_cell": 2 }, "outputs": [], "source": [ "# Set this to True if connected to hardware\n", "run_on_hw = False\n", "\n", "if run_on_hw:\n", " # Execute the program.\n", " # While running, live IQ data for the frequency sweep will be shown.\n", " program_result = qcs.Executor(backend).execute(program)\n", "\n", " # Plot the \"static\" version of the plot to compare the results\n", " program_result.plot_iq(channel_subplots=False, plot_type=\"linear\")" ] }, { "cell_type": "raw", "id": "8321bdbd", "metadata": { "lines_to_next_cell": 0, "raw_mimetype": "text/restructuredtext" }, "source": [ "\n", "Live plotting on an experiment\n", "******************************\n", "Live plotting can also be setup to run on experiments.\n", "Here we show an example of setting up live plotting to run with a 2D spectroscopy\n", "experiment. See :doc:`../../applications/res_spec` for more details on setting up\n", "this experiment." ] }, { "cell_type": "code", "execution_count": 7, "id": "3c4e8132", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.394775Z", "iopub.status.busy": "2025-10-02T01:28:08.394542Z", "iopub.status.idle": "2025-10-02T01:28:08.482581Z", "shell.execute_reply": "2025-10-02T01:28:08.481877Z" } }, "outputs": [], "source": [ "qubits = qcs.Qudits([0, 1])\n", "calibration_set = qcs.experiments.make_calibration_set(qubits=len(qubits))" ] }, { "cell_type": "code", "execution_count": 8, "id": "3311401b", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.485071Z", "iopub.status.busy": "2025-10-02T01:28:08.484838Z", "iopub.status.idle": "2025-10-02T01:28:08.775520Z", "shell.execute_reply": "2025-10-02T01:28:08.774605Z" }, "lines_to_next_cell": 0 }, "outputs": [], "source": [ "# Create a resonator spectroscopy experiment with live plotting\n", "# Note that the channels for live plotting match the channels from the calibration set.\n", "backend = qcs.HclBackend(\n", " channel_mapper=mapper,\n", " fpga_postprocessing=True,\n", " live_plotting_config=readout_acquisition_channels,\n", ")\n", "\n", "res_spectroscopy2D = qcs.experiments.ResonatorSpectroscopy2D(\n", " backend=backend,\n", " calibration_set=calibration_set,\n", " qubits=qubits,\n", " operation=\"measurement\",\n", ")" ] }, { "cell_type": "code", "execution_count": 9, "id": "c1062626", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.778548Z", "iopub.status.busy": "2025-10-02T01:28:08.778302Z", "iopub.status.idle": "2025-10-02T01:28:08.829246Z", "shell.execute_reply": "2025-10-02T01:28:08.828350Z" }, "lines_to_next_cell": 0 }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", "
\n", "
\n", " Program\n", "
\n", "
\n", " \n", " \n", "\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", " \n", "\tkeysight-logo-svg\n", "\t\n", "\t\n", "\t\t\n", "\t\n", "\n", "\n", " \n", "
\n", " Program Body\n", "
\n", " \n", "\n", "\n", "\n", "
\n", " Program\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Duration105 ns
Layers1
Targets4
\n", "
\n", "\n", "
\n", "
\n", "
\n", "
\n", " Layer #0\n", "
\n", " \n", "\n", "\n", "\n", "
\n", " Layer #0 \n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Duration105 ns
\n", "
\n", "\n", "
\n", "
\n", "
\n", " readout_pulse\n", " \n", " 0\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Delay on ('readout_pulse', 0)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationArraySlice(name=readout_pulse_delay, shape=(2,), dtype=float, unit=s, value=[0 s, 0 s])
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " RFWaveform on ('readout_pulse', 0)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationArraySlice(name=readout_pulse_duration, shape=(2,), dtype=float, unit=s, value=[100 ns, 100 ns])
AmplitudeArraySlice(name=readout_pulse_amplitudes, shape=(2,), dtype=float, unit=none, value=[0.1, 0.1])
FrequencyArraySlice(name=readout_frequencies, shape=(2,), dtype=float, unit=Hz, value=[5.15 GHz, 5.15 GHz])
EnvelopeSineEnvelope()
Instantaneous PhaseArraySlice(name=readout_pulse_phases, shape=(2,), dtype=float, unit=rad, value=[0 rad, 0 rad])
Post-phaseArraySlice(name=measurement_post_phase, shape=(2,), dtype=float, unit=rad, value=[0 rad, 0 rad])
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Delay on ('readout_pulse', 0)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationScalar(name=_implicit, value=5 ns, dtype=float, unit=s)
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " 1\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Delay on ('readout_pulse', 1)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationArraySlice(name=readout_pulse_delay, shape=(2,), dtype=float, unit=s, value=[0 s, 0 s])
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " RFWaveform on ('readout_pulse', 1)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationArraySlice(name=readout_pulse_duration, shape=(2,), dtype=float, unit=s, value=[100 ns, 100 ns])
AmplitudeArraySlice(name=readout_pulse_amplitudes, shape=(2,), dtype=float, unit=none, value=[0.1, 0.1])
FrequencyArraySlice(name=readout_frequencies, shape=(2,), dtype=float, unit=Hz, value=[5.15 GHz, 5.15 GHz])
EnvelopeSineEnvelope()
Instantaneous PhaseArraySlice(name=readout_pulse_phases, shape=(2,), dtype=float, unit=rad, value=[0 rad, 0 rad])
Post-phaseArraySlice(name=measurement_post_phase, shape=(2,), dtype=float, unit=rad, value=[0 rad, 0 rad])
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Delay on ('readout_pulse', 1)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationScalar(name=_implicit, value=5 ns, dtype=float, unit=s)
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " readout_acquisition\n", " \n", " 0\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Delay on ('readout_acquisition', 0)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationArraySlice(name=acquisition_delay, shape=(2,), dtype=float, unit=s, value=[5 ns, 5 ns])
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Acquisition on ('readout_acquisition', 0)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationArray(name=_implicit, shape=(2,), dtype=float, unit=s, value=[100 ns, 100 ns])
Integration Filter\n", " \n", " \n", "\n", "\n", "\n", "
\n", " RFWaveform \n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationArraySlice(name=acquisition_duration, shape=(2,), dtype=float, unit=s, value=[100 ns, 100 ns])
AmplitudeArraySlice(name=measurement_integrator_amplitude, shape=(2,), dtype=float, unit=none, value=[1, 1])
FrequencyArraySlice(name=readout_frequencies, shape=(2,), dtype=float, unit=Hz, value=[5.15 GHz, 5.15 GHz])
EnvelopeConstantEnvelope()
Instantaneous PhaseArraySlice(name=measurement_integrator_phase, shape=(2,), dtype=float, unit=rad, value=[0 rad, 0 rad])
Post-phaseArraySlice(name=measurement_integrator_post_phase, shape=(2,), dtype=float, unit=rad, value=[0 rad, 0 rad])
\n", "
\n", "\n", "
ClassifierClassifier(ArraySlice(name=references, shape=(2, 2), dtype=complex, unit=none))
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Delay on ('readout_acquisition', 0)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationScalar(name=_implicit, value=4.96308e-24 s, dtype=float, unit=s)
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " 1\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Delay on ('readout_acquisition', 1)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationArraySlice(name=acquisition_delay, shape=(2,), dtype=float, unit=s, value=[5 ns, 5 ns])
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Acquisition on ('readout_acquisition', 1)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationArray(name=_implicit, shape=(2,), dtype=float, unit=s, value=[100 ns, 100 ns])
Integration Filter\n", " \n", " \n", "\n", "\n", "\n", "
\n", " RFWaveform \n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationArraySlice(name=acquisition_duration, shape=(2,), dtype=float, unit=s, value=[100 ns, 100 ns])
AmplitudeArraySlice(name=measurement_integrator_amplitude, shape=(2,), dtype=float, unit=none, value=[1, 1])
FrequencyArraySlice(name=readout_frequencies, shape=(2,), dtype=float, unit=Hz, value=[5.15 GHz, 5.15 GHz])
EnvelopeConstantEnvelope()
Instantaneous PhaseArraySlice(name=measurement_integrator_phase, shape=(2,), dtype=float, unit=rad, value=[0 rad, 0 rad])
Post-phaseArraySlice(name=measurement_integrator_post_phase, shape=(2,), dtype=float, unit=rad, value=[0 rad, 0 rad])
\n", "
\n", "\n", "
ClassifierClassifier(ArraySlice(name=references, shape=(2, 2), dtype=complex, unit=none))
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " Delay on ('readout_acquisition', 1)\n", "
\n", "
\n", " Parameters\n", "
\n", " \n", " \n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
DurationScalar(name=_implicit, value=4.96308e-24 s, dtype=float, unit=s)
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": { "text/html": { "isolated": true } }, "output_type": "display_data" } ], "source": [ "# Draw the program to view the operations to be performed on hardware\n", "res_spectroscopy2D.draw()" ] }, { "cell_type": "raw", "id": "864f3fb8", "metadata": { "lines_to_next_cell": 0, "raw_mimetype": "text/restructuredtext" }, "source": [ "Next, we define the sweep values for both the\n", "amplitude and frequency of the readout pulse.\n" ] }, { "cell_type": "code", "execution_count": 10, "id": "d76b1c1f", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.831944Z", "iopub.status.busy": "2025-10-02T01:28:08.831650Z", "iopub.status.idle": "2025-10-02T01:28:08.840197Z", "shell.execute_reply": "2025-10-02T01:28:08.839342Z" } }, "outputs": [], "source": [ "# Retrieve the readout frequencies stored in the calibration set for the target qubits\n", "current_freq = res_spectroscopy2D.calibration_set.variables.readout_frequencies[\n", " [0, 1]\n", "].value\n", "\n", "# Set the range for sweeping the readout pulse frequency\n", "start_frequency = current_freq - 200e6\n", "end_frequency = current_freq + 200e6\n", "freq_steps = 9\n", "freq_scan_values = np.linspace(start_frequency, end_frequency, freq_steps)" ] }, { "cell_type": "code", "execution_count": 11, "id": "fb47314f", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.843005Z", "iopub.status.busy": "2025-10-02T01:28:08.842754Z", "iopub.status.idle": "2025-10-02T01:28:08.847125Z", "shell.execute_reply": "2025-10-02T01:28:08.846372Z" }, "lines_to_next_cell": 2 }, "outputs": [], "source": [ "# Set the range for sweeping the readout pulse amplitude (units = V)\n", "start_amplitude = 0.1 if len(qubits) == 1 else [0.1] * len(qubits)\n", "end_amplitude = 1 if len(qubits) == 1 else [1] * len(qubits)\n", "ampl_steps = 10\n", "ampl_scan_values = np.linspace(start_amplitude, end_amplitude, ampl_steps)" ] }, { "cell_type": "code", "execution_count": 12, "id": "c9fe2abf", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.849589Z", "iopub.status.busy": "2025-10-02T01:28:08.849326Z", "iopub.status.idle": "2025-10-02T01:28:08.884296Z", "shell.execute_reply": "2025-10-02T01:28:08.883437Z" }, "lines_to_next_cell": 2 }, "outputs": [], "source": [ "# Configure the repetitions for this experiment\n", "res_spectroscopy2D.configure_repetitions(\n", " frequencies=freq_scan_values,\n", " frequency_name=\"readout_frequencies\",\n", " amplitudes=ampl_scan_values,\n", " amplitude_name=\"readout_pulse_amplitudes\",\n", " n_shots=10,\n", ")" ] }, { "cell_type": "raw", "id": "20b5e066", "metadata": { "lines_to_next_cell": 0, "raw_mimetype": "text/restructuredtext" }, "source": [ "We can now execute the experiment and see the live 2D heatmaps." ] }, { "cell_type": "code", "execution_count": 13, "id": "7a6206c3", "metadata": { "execution": { "iopub.execute_input": "2025-10-02T01:28:08.887609Z", "iopub.status.busy": "2025-10-02T01:28:08.887282Z", "iopub.status.idle": "2025-10-02T01:28:08.890674Z", "shell.execute_reply": "2025-10-02T01:28:08.889875Z" } }, "outputs": [], "source": [ "if run_on_hw:\n", " res_spectroscopy2D.execute()" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "raw_mimetype,nbsphinx,-all", "main_language": "python", "notebook_metadata_filter": "-all", "text_representation": { "extension": ".py", "format_name": "percent" } }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" } }, "nbformat": 4, "nbformat_minor": 5 }