{ "cells": [ { "cell_type": "markdown", "id": "d63e38d4", "metadata": {}, "source": [ "# Coupled qubits characterization\n", "\n", ".. Note::\n", " This notebook uses some python helper functions and example data. You can find both in a zipfile accessible with this link: [gitlab](https://gitlab.com/qblox/packages/software/qblox_instruments_docs/-/blob/master/docs/applications/quantify/example_data_and_utils.zip).\n", "\n", "The experiments of this tutorial are meant to be executed with a Qblox Cluster controlling a flux-tunable transmon system.\n", "\n", "The experiments can also be executed using a dummy Qblox device that is created via an instance of the `Cluster` class, and is initialized with a dummy configuration. However, when using a dummy device, the analysis will not work because the experiments will return `np.nan` values. In this case, example data is loaded from the `\"./example_data/\"` directory." ] }, { "cell_type": "markdown", "id": "3e2f3b3a", "metadata": {}, "source": [ "## Hardware setup\n", "In this section we configure the hardware configuration which specifies the connectivity of our system." ] }, { "cell_type": "markdown", "id": "28d63c78", "metadata": {}, "source": [ "### Configuration file\n", "\n", "This is a template hardware configuration file for a 2-qubit system (we name the qubits `q0` and `q1`), with dedicated flux-control lines.\n", "\n", "The hardware setup is as follows, by cluster slot:\n", "1. **QCM-RF**\n", " - Drive line for `q0` using fixed 80 MHz IF.\n", " - Drive line for `q1` using fixed 80 MHz IF.\n", "2. **QCM**\n", " - Flux line for `q0`.\n", " - Flux line for `q1`.\n", "6. **QRM-RF**\n", " - Shared readout line for `q0`/`q1` using a fixed LO set at 7.5 GHz.\n", "\n", "Note that in the hardware configuration below the mixers are uncorrected, but for high fidelity experiments this should also be done for all the modules." ] }, { "cell_type": "code", "execution_count": 1, "id": "ddfa3103", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:35.349475Z", "iopub.status.busy": "2023-12-06T16:53:35.347968Z", "iopub.status.idle": "2023-12-06T16:53:35.374550Z", "shell.execute_reply": "2023-12-06T16:53:35.372975Z" } }, "outputs": [], "source": [ "hardware_cfg = {\n", " \"backend\": \"quantify_scheduler.backends.qblox_backend.hardware_compile\",\n", " \"cluster0\": {\n", " \"sequence_to_file\": False, # Boolean flag which dumps waveforms and program dict to JSON file\n", " \"ref\": \"internal\", # Use shared clock reference of the cluster\n", " \"instrument_type\": \"Cluster\",\n", " # ============ DRIVE ============#\n", " \"cluster0_module1\": {\n", " \"instrument_type\": \"QCM_RF\",\n", " \"complex_output_0\": {\n", " \"output_att\": 0,\n", " \"dc_mixer_offset_I\": 0.0,\n", " \"dc_mixer_offset_Q\": 0.0,\n", " \"portclock_configs\": [\n", " {\n", " \"port\": \"q0:mw\",\n", " \"clock\": \"q0.01\",\n", " \"interm_freq\": 80e6,\n", " \"mixer_amp_ratio\": 1.0,\n", " \"mixer_phase_error_deg\": 0.0,\n", " }\n", " ],\n", " },\n", " \"complex_output_1\": {\n", " \"output_att\": 0,\n", " \"dc_mixer_offset_I\": 0.0,\n", " \"dc_mixer_offset_Q\": 0.0,\n", " \"portclock_configs\": [\n", " {\n", " \"port\": \"q1:mw\",\n", " \"clock\": \"q1.01\",\n", " \"interm_freq\": 80e6,\n", " \"mixer_amp_ratio\": 1.0,\n", " \"mixer_phase_error_deg\": 0.0,\n", " }\n", " ],\n", " },\n", " },\n", " # ============ FLUX ============#\n", " \"cluster0_module2\": {\n", " \"instrument_type\": \"QCM\",\n", " \"real_output_0\": {\"portclock_configs\": [{\"port\": \"q0:fl\", \"clock\": \"cl0.baseband\"}]},\n", " \"real_output_1\": {\"portclock_configs\": [{\"port\": \"q1:fl\", \"clock\": \"cl0.baseband\"}]},\n", " },\n", " # ============ READOUT ============#\n", " \"cluster0_module3\": {\n", " \"instrument_type\": \"QRM_RF\",\n", " \"complex_output_0\": {\n", " \"output_att\": 0,\n", " \"input_att\": 0,\n", " \"dc_mixer_offset_I\": 0.0,\n", " \"dc_mixer_offset_Q\": 0.0,\n", " \"lo_freq\": 7.5e9,\n", " \"portclock_configs\": [\n", " {\n", " \"port\": \"q0:res\",\n", " \"clock\": \"q0.ro\",\n", " \"mixer_amp_ratio\": 1.0,\n", " \"mixer_phase_error_deg\": 0.0,\n", " },\n", " {\n", " \"port\": \"q1:res\",\n", " \"clock\": \"q1.ro\",\n", " \"mixer_amp_ratio\": 1.0,\n", " \"mixer_phase_error_deg\": 0.0,\n", " },\n", " ],\n", " },\n", " },\n", " },\n", "}" ] }, { "cell_type": "markdown", "id": "d70cb0d0", "metadata": {}, "source": [ "### Scan For Clusters\n", "\n", "We scan for the available clusters on our network using the Plug & Play functionality of the Qblox Instruments package (see [Plug & Play](https://qblox-qblox-instruments.readthedocs-hosted.com/en/master/api_reference/tools.html#plug-play) for more info)." ] }, { "cell_type": "code", "execution_count": 2, "id": "90fe6cf3", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:35.380262Z", "iopub.status.busy": "2023-12-06T16:53:35.380262Z", "iopub.status.idle": "2023-12-06T16:53:36.980403Z", "shell.execute_reply": "2023-12-06T16:53:36.979405Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "8ae1420ca9374a9e87c78bc7f2701f39", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Dropdown(description='Select Device', options=(['Dummy-Cluster', 'dummy_cluster'], ('dd0 @10.10.200.50', '0001…" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import warnings\n", "\n", "import ipywidgets as widgets\n", "from IPython.display import display\n", "\n", "from qblox_instruments import PlugAndPlay\n", "\n", "warnings.simplefilter(\"ignore\")\n", "\n", "# Scan for available devices and display\n", "with PlugAndPlay() as p:\n", " # Get info of all devices\n", " device_list = p.list_devices()\n", "\n", "names = {dev_id: dev_info[\"description\"][\"name\"] for dev_id, dev_info in device_list.items()}\n", "names[\"dummy_cluster\"] = \"dummy_cluster\"\n", "ip_addresses = {dev_id: dev_info[\"identity\"][\"ip\"] for dev_id, dev_info in device_list.items()}\n", "\n", "\n", "# Create widget for names and ip addresses\n", "connect = widgets.Dropdown(\n", " options=[[\"Dummy-Cluster\", \"dummy_cluster\"]]\n", " + [(f\"{names[dev_id]} @{ip_addresses[dev_id]}\", dev_id) for dev_id in device_list],\n", " description=\"Select Device\",\n", ")\n", "display(connect)" ] }, { "cell_type": "markdown", "id": "306219eb", "metadata": {}, "source": [ "### Connect to Cluster\n", "\n", "We now make a connection with the Cluster selected in the dropdown widget. We also define a function to find the modules we're interested in. We select the readout and control module we want to use." ] }, { "cell_type": "code", "execution_count": 3, "id": "bcaed73b", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:36.985937Z", "iopub.status.busy": "2023-12-06T16:53:36.984918Z", "iopub.status.idle": "2023-12-06T16:53:37.276918Z", "shell.execute_reply": "2023-12-06T16:53:37.275831Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Dummy-Cluster connected\n" ] } ], "source": [ "from pathlib import Path\n", "\n", "from qcodes import Instrument\n", "\n", "from qblox_instruments import Cluster, ClusterType\n", "\n", "# Close all existing QCoDeS Instrument instances\n", "Instrument.close_all()\n", "\n", "# Select the device\n", "dev_id = connect.value\n", "\n", "# Here we have the option to use a dummy device so that you can run your tests without a physical cluster\n", "dummy_cfg = (\n", " {\n", " 1: ClusterType.CLUSTER_QCM_RF,\n", " 2: ClusterType.CLUSTER_QCM,\n", " 3: ClusterType.CLUSTER_QRM_RF,\n", " }\n", " if dev_id == \"dummy_cluster\"\n", " else None\n", ")\n", "\n", "cluster = Cluster(name=\"cluster0\", identifier=ip_addresses.get(dev_id), dummy_cfg=dummy_cfg)\n", "\n", "print(f\"{connect.label} connected\")" ] }, { "cell_type": "markdown", "id": "5a9e6e5a", "metadata": {}, "source": [ "### Reset the Cluster\n", "\n", "We reset the Cluster to enter a well-defined state. Note that resetting will clear all stored parameters and repeats startup calibration, so resetting between experiments is usually not desirable." ] }, { "cell_type": "code", "execution_count": 4, "id": "e06dd44b", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:37.280460Z", "iopub.status.busy": "2023-12-06T16:53:37.280460Z", "iopub.status.idle": "2023-12-06T16:53:37.292258Z", "shell.execute_reply": "2023-12-06T16:53:37.291245Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Status: CRITICAL, Flags: TEMPERATURE_OUT_OF_RANGE, Slot flags: SLOT1_TEMPERATURE_OUT_OF_RANGE, SLOT2_TEMPERATURE_OUT_OF_RANGE, SLOT3_TEMPERATURE_OUT_OF_RANGE\n" ] } ], "source": [ "cluster.reset()\n", "print(cluster.get_system_state())" ] }, { "cell_type": "markdown", "id": "137d329b", "metadata": {}, "source": [ "Note that a dummy cluster will raise error flags, this is expected behavior and can be ignored." ] }, { "cell_type": "markdown", "id": "26f14ca4", "metadata": {}, "source": [ "## Experiment setup" ] }, { "cell_type": "markdown", "id": "c5fb6c7a", "metadata": {}, "source": [ "### Quantum device settings\n", "Here we initialize our `QuantumDevice` and our qubit parameters, checkout this [tutorial](https://quantify-os.org/docs/quantify-scheduler/dev/tutorials/Operations%20and%20Qubits.html) for further details.\n", "\n", "In short, a `QuantumDevice` contains device elements where we save our found parameters." ] }, { "cell_type": "code", "execution_count": 5, "id": "72396c1a", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:37.297335Z", "iopub.status.busy": "2023-12-06T16:53:37.296325Z", "iopub.status.idle": "2023-12-06T16:53:39.559468Z", "shell.execute_reply": "2023-12-06T16:53:39.558111Z" } }, "outputs": [], "source": [ "import contextlib\n", "\n", "from quantify_scheduler.device_under_test.quantum_device import QuantumDevice\n", "from quantify_scheduler.device_under_test.transmon_element import BasicTransmonElement\n", "\n", "# Close QCoDeS instruments with conflicting names\n", "for name in [\"device_2q\", \"q0\", \"q1\"]:\n", " with contextlib.suppress(KeyError):\n", " Instrument.find_instrument(name).close()\n", "\n", "\n", "q0 = BasicTransmonElement(\"q0\")\n", "q0.measure.acq_channel(0)\n", "\n", "q1 = BasicTransmonElement(\"q1\")\n", "q1.measure.acq_channel(1)\n", "\n", "quantum_device = QuantumDevice(\"device_2q\")\n", "quantum_device.hardware_config(hardware_cfg)\n", "\n", "quantum_device.add_element(q0)\n", "quantum_device.add_element(q1)" ] }, { "cell_type": "markdown", "id": "2f7d5387", "metadata": {}, "source": [ "### Set calibrations\n", "\n", "This tutorial explicitly only deals with 2-qubit experiments. As such, we assume that both the qubits and their resonators have already been characterized.\n", "For information on how to do this, please see the single transmon qubit tutorial.\n", "In order to use this tutorial on your own system, you must first change the calibrated values to match your own system.\n", "\n", "For the sake of this tutorial, we will use some template values for both qubits.\n" ] }, { "cell_type": "code", "execution_count": 6, "id": "fc57981c", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:39.564162Z", "iopub.status.busy": "2023-12-06T16:53:39.563094Z", "iopub.status.idle": "2023-12-06T16:53:39.590214Z", "shell.execute_reply": "2023-12-06T16:53:39.589057Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Type Unit q0 q1\n", "Parameter \n", "pulse_type measure SquarePulse SquarePulse\n", "pulse_amp measure 0.05 0.05\n", "pulse_duration measure (s) 0.000002 0.000002\n", "acq_channel measure (#) 0 1\n", "acq_delay measure (s) 0.0000001 0.0000001\n", "integration_time measure (s) 0.0000019 0.0000019\n", "reset_clock_phase measure True True\n", "acq_weights_a measure None None\n", "acq_weights_b measure None None\n", "acq_weights_sampling_rate measure None None\n", "acq_weight_type measure SSB SSB\n", "acq_rotation measure 0 0\n", "acq_threshold measure 0 0\n", "duration reset (s) 0.0001 0.0001\n", "f01 clock_freqs (Hz) 5100000000.0 5200000000.0\n", "f12 clock_freqs (Hz) NaN NaN\n", "readout clock_freqs (Hz) 7600000000.0 7700000000.0\n", "amp180 rxy 0.1 0.1\n", "motzoi rxy 0.05 0.05\n", "duration rxy (s) 0.00000004 0.00000004\n", "microwave ports q0:mw q1:mw\n", "flux ports q0:fl q1:fl\n", "readout ports q0:res q1:res\n" ] } ], "source": [ "from utils.tutorial_utils import show_parameters\n", "\n", "# ============ READOUT ============ #\n", "q0.reset.duration(100e-6)\n", "q0.measure.acq_delay(100e-9)\n", "q0.measure.pulse_amp(0.05)\n", "q0.measure.pulse_duration(2e-6)\n", "q0.measure.integration_time(1.9e-6)\n", "\n", "q1.reset.duration(100e-6)\n", "q1.measure.acq_delay(100e-9)\n", "q1.measure.pulse_amp(0.05)\n", "q1.measure.pulse_duration(2e-6)\n", "q1.measure.integration_time(1.9e-6)\n", "\n", "q0.clock_freqs.readout(7.6e9)\n", "q1.clock_freqs.readout(7.7e9)\n", "\n", "# ============ DRIVE ============ #\n", "q0.rxy.amp180(0.1)\n", "q0.rxy.motzoi(0.05)\n", "q0.rxy.duration(40e-9)\n", "\n", "q1.rxy.amp180(0.1)\n", "q1.rxy.motzoi(0.05)\n", "q1.rxy.duration(40e-9)\n", "\n", "q0.clock_freqs.f01(5.1e9)\n", "q1.clock_freqs.f01(5.2e9)\n", "\n", "show_parameters(q0, q1)" ] }, { "cell_type": "markdown", "id": "9c4bae08", "metadata": {}, "source": [ "### Configure measurement control loop\n", "We will use a `MeasurementControl` object for data acquisition as well as an `InstrumentCoordinator` for controlling the instruments in our setup.\n", "\n", "The `PlotMonitor` is used for live plotting.\n", "\n", "All of these are then associated with the `QuantumDevice`." ] }, { "cell_type": "code", "execution_count": 7, "id": "a3f20f28", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:39.594671Z", "iopub.status.busy": "2023-12-06T16:53:39.594671Z", "iopub.status.idle": "2023-12-06T16:53:40.454174Z", "shell.execute_reply": "2023-12-06T16:53:40.453662Z" } }, "outputs": [], "source": [ "from quantify_core.measurement.control import MeasurementControl\n", "from quantify_core.visualization.pyqt_plotmon import PlotMonitor_pyqt as PlotMonitor\n", "from quantify_scheduler.instrument_coordinator import InstrumentCoordinator\n", "from quantify_scheduler.instrument_coordinator.components.qblox import ClusterComponent\n", "\n", "\n", "def configure_measurement_control_loop(\n", " device: QuantumDevice, cluster: Cluster, live_plotting: bool = False\n", ") -> None:\n", " # Close QCoDeS instruments with conflicting names\n", " for name in [\n", " \"PlotMonitor\",\n", " \"meas_ctrl\",\n", " \"ic\",\n", " \"ic_generic\",\n", " f\"ic_{cluster.name}\",\n", " ] + [f\"ic_{module.name}\" for module in cluster.modules]:\n", " with contextlib.suppress(KeyError):\n", " Instrument.find_instrument(name).close()\n", "\n", " meas_ctrl = MeasurementControl(\"meas_ctrl\")\n", " ic = InstrumentCoordinator(\"ic\")\n", "\n", " # Add cluster to instrument coordinator\n", " ic_cluster = ClusterComponent(cluster)\n", " ic.add_component(ic_cluster)\n", "\n", " if live_plotting:\n", " # Associate plot monitor with measurement controller\n", " plotmon = PlotMonitor(\"PlotMonitor\")\n", " meas_ctrl.instr_plotmon(plotmon.name)\n", "\n", " # Associate measurement controller and instrument coordinator with the quantum device\n", " device.instr_measurement_control(meas_ctrl.name)\n", " device.instr_instrument_coordinator(ic.name)\n", "\n", " return (meas_ctrl, ic)\n", "\n", "\n", "meas_ctrl, instrument_coordinator = configure_measurement_control_loop(quantum_device, cluster)" ] }, { "cell_type": "markdown", "id": "9e5952ab", "metadata": {}, "source": [ "### Set data directory\n", "This directory is where all of the experimental data as well as all of the post processing will go." ] }, { "cell_type": "code", "execution_count": 8, "id": "f79e9139", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:40.458710Z", "iopub.status.busy": "2023-12-06T16:53:40.458710Z", "iopub.status.idle": "2023-12-06T16:53:40.471145Z", "shell.execute_reply": "2023-12-06T16:53:40.469753Z" } }, "outputs": [], "source": [ "import quantify_core.data.handling as dh\n", "\n", "# Enter your own dataset directory here!\n", "dh.set_datadir(Path(\"example_data\").resolve())" ] }, { "cell_type": "markdown", "id": "cbe9d14b", "metadata": {}, "source": [ "### Configure external flux control\n", "We need to have some way of controlling the external flux.\n", "\n", "This can be done by setting an output bias on a module of the cluster which is then connected to the flux-control line.\n", "\n", "```python\n", " # e.g. nullify external flux by setting current to 0 A\n", " cluster.module2.out0_current(0.0)\n", "```\n", "\n", "Here we are nullifying the external flux on both qubits." ] }, { "cell_type": "code", "execution_count": 9, "id": "3ade7761", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:40.475507Z", "iopub.status.busy": "2023-12-06T16:53:40.474233Z", "iopub.status.idle": "2023-12-06T16:53:40.486772Z", "shell.execute_reply": "2023-12-06T16:53:40.485199Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "q0 = cluster0_module2_out0_offset\n", "q1 = cluster0_module2_out1_offset\n" ] } ], "source": [ "from utils.tutorial_utils import show_args\n", "\n", "from quantify_scheduler.helpers.collections import find_port_clock_path\n", "\n", "\n", "def find_flux_settable(qubit: BasicTransmonElement) -> callable:\n", " \"\"\"Return flux port voltage offset for qubit.\"\"\"\n", " path = find_port_clock_path(\n", " quantum_device.hardware_config(), qubit.ports.flux(), \"cl0.baseband\"\n", " )\n", " module = getattr(cluster, path[1].split(\"_\")[1])\n", " settable = getattr(module, f\"out{path[2].split('_')[-1]}_offset\")\n", " return settable\n", "\n", "\n", "flux_settables = {q.name: find_flux_settable(q) for q in (q0, q1)}\n", "\n", "for flux_settable in flux_settables.values():\n", " flux_settable(0.0)\n", "\n", "show_args(flux_settables)" ] }, { "cell_type": "code", "execution_count": 10, "id": "89da3a74", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:40.490836Z", "iopub.status.busy": "2023-12-06T16:53:40.489214Z", "iopub.status.idle": "2023-12-06T16:53:40.501688Z", "shell.execute_reply": "2023-12-06T16:53:40.500706Z" } }, "outputs": [], "source": [ "flux_settables[q0.name](0.0) # enter your own value here for qubit 0\n", "flux_settables[q1.name](0.0) # enter your own value here for qubit 1" ] }, { "cell_type": "markdown", "id": "947a8fed", "metadata": {}, "source": [ "### Activate NCO delay compensation\n", "Compensate for the digital propagation delay for each qubit (i.e each sequencer)\n", "\n", "For more info, please see: https://qblox-qblox-instruments.readthedocs-hosted.com/en/master/api_reference/sequencer.html#Sequencer.nco_prop_delay_comp\n", "\n", "To avoid mismatches between modulation and demodulation, the delay between any readout frequency or phase changes and the next acquisition should be equal or greater than the total propagation delay (146ns + user defined value)." ] }, { "cell_type": "code", "execution_count": 11, "id": "963a80a7", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:40.506220Z", "iopub.status.busy": "2023-12-06T16:53:40.505215Z", "iopub.status.idle": "2023-12-06T16:53:40.516653Z", "shell.execute_reply": "2023-12-06T16:53:40.515650Z" } }, "outputs": [], "source": [ "for i in range(6):\n", " getattr(cluster.module3, f\"sequencer{i}\").nco_prop_delay_comp_en(True)\n", " getattr(cluster.module3, f\"sequencer{i}\").nco_prop_delay_comp(10)" ] }, { "cell_type": "markdown", "id": "4951d4a6", "metadata": {}, "source": [ "### Set attenuation\n", "We ought to make sure that our excitation and readout pulses have the appropriate power. Since we are assuming that the qubits and resonators have already been individually characterised, we use the same attenuation that we used in the single transmon qubit tutorial." ] }, { "cell_type": "code", "execution_count": 12, "id": "6f6e2eb9", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:40.521501Z", "iopub.status.busy": "2023-12-06T16:53:40.521501Z", "iopub.status.idle": "2023-12-06T16:53:40.532341Z", "shell.execute_reply": "2023-12-06T16:53:40.531320Z" } }, "outputs": [], "source": [ "from utils.tutorial_utils import set_drive_attenuation, set_readout_attenuation\n", "\n", "set_readout_attenuation(quantum_device, q0, out_att=50, in_att=0)\n", "set_readout_attenuation(quantum_device, q1, out_att=50, in_att=0)\n", "\n", "set_drive_attenuation(quantum_device, q0, out_att=18)\n", "set_drive_attenuation(quantum_device, q1, out_att=18)" ] }, { "cell_type": "markdown", "id": "3aa46059", "metadata": {}, "source": [ "## Experiments\n", "\n", "As in the single qubit tuneup tutorial, the sweep setpoints for all experiments in this section are only examples. The sweep setpoints should be changed to match your own system.\n", "In this section we assume that each individual qubit has already been characterized, and that they have been biased to their sweetspots.\n", "\n", "We will examine the flux response of the 2-qubit system. By \"flux response\" we mean the measured response of the system when the parameterization of a flux pulse is varied.\n", "\n", "We consider two separate experiments which have their own separate parameterizations, they are:\n", "\n", "1. Controlled phase calibration (a.k.a. two-qubit Chevron experiment)\n", " - Used to measure coupling strength between the two qubits.\n", " - Used to find the location of the $|11\\rangle \\leftrightarrow |02\\rangle$ avoided crossing.\n", "2. Conditional oscillations\n", " - Used to measure the conditional phase of the controlled phase gate.\n", " - Used to estimate leakage to $|02\\rangle$.\n", " - Can also be used to measure single-qubit phases on the individual qubits.\n", "\n", "In both of these experiments, we apply the flux pulse on the flux-control line of `q1` (on top of the sweetspot bias) which we take to be the qubit with the *higher* frequency, i.e. $\\omega_1$ > $\\omega_0$." ] }, { "cell_type": "markdown", "id": "1c0d614b", "metadata": {}, "source": [ "### Controlled phase calibration" ] }, { "cell_type": "code", "execution_count": 13, "id": "9b74ccb9", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:40.536311Z", "iopub.status.busy": "2023-12-06T16:53:40.536311Z", "iopub.status.idle": "2023-12-06T16:53:40.547589Z", "shell.execute_reply": "2023-12-06T16:53:40.546481Z" } }, "outputs": [], "source": [ "import numpy as np\n", "\n", "from quantify_scheduler.operations.gate_library import Measure, Reset, X\n", "from quantify_scheduler.operations.pulse_library import SquarePulse\n", "from quantify_scheduler.schedules.schedule import Schedule\n", "\n", "\n", "def chevron_cz_sched(\n", " lf_qubit: str,\n", " hf_qubit: str,\n", " amplitudes: np.ndarray,\n", " duration: float,\n", " flux_port: str = None,\n", " repetitions: int = 1,\n", ") -> Schedule:\n", " \"\"\"https://quantify-quantify-scheduler.readthedocs-hosted.com/en/latest/autoapi/quantify_scheduler/schedules/two_qubit_transmon_schedules.\"\"\"\n", " sched = Schedule(\"Two-qubit Chevron CZ schedule\", repetitions)\n", "\n", " # Ensure amplitudes is an iterable when passing a float\n", " amplitudes = np.asarray(amplitudes)\n", " amplitudes = amplitudes.reshape(amplitudes.shape or (1,))\n", "\n", " # Set flux port\n", " flux_port = flux_port if flux_port is not None else f\"{hf_qubit}:fl\"\n", "\n", " for acq_index, amp in enumerate(amplitudes):\n", " # Reset to |00>\n", " sched.add(Reset(lf_qubit, hf_qubit), label=f\"Reset {acq_index}\")\n", "\n", " # Prepare |11>\n", " excite_lf = sched.add(X(lf_qubit), label=f\"X({lf_qubit}) {acq_index}\")\n", " sched.add(\n", " X(hf_qubit),\n", " ref_op=excite_lf,\n", " ref_pt=\"start\",\n", " label=f\"X({hf_qubit}) {acq_index}\",\n", " )\n", "\n", " # Go to |11> <=> |02> avoided crossing and come back\n", " sched.add(\n", " SquarePulse(\n", " amp=amp,\n", " duration=duration,\n", " port=flux_port,\n", " clock=\"cl0.baseband\",\n", " ),\n", " label=f\"SquarePulse({flux_port}) {acq_index}\",\n", " )\n", "\n", " # Measure system\n", " sched.add(\n", " Measure(lf_qubit, hf_qubit, acq_index=acq_index),\n", " label=f\"Measure({lf_qubit},{hf_qubit}) {acq_index}\",\n", " )\n", "\n", " return sched" ] }, { "cell_type": "code", "execution_count": 14, "id": "ac74b64e", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:40.551281Z", "iopub.status.busy": "2023-12-06T16:53:40.551281Z", "iopub.status.idle": "2023-12-06T16:53:40.579090Z", "shell.execute_reply": "2023-12-06T16:53:40.577948Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "chevron_cz_sched_kwargs\n", "=============\n", "lf_qubit = q0\n", "hf_qubit = q1\n", "amplitudes = amp\n", "duration = dur\n" ] } ], "source": [ "from qcodes.parameters import ManualParameter\n", "\n", "from quantify_scheduler.gettables import ScheduleGettable\n", "\n", "duration = ManualParameter(name=\"dur\", unit=\"Hz\", label=\"Duration of flux pulse\")\n", "amplitude = ManualParameter(name=\"amp\", unit=\"\", label=\"Amplitude of flux pulse\")\n", "\n", "amplitude.batched = True\n", "duration.batched = False\n", "\n", "chevron_cz_sched_kwargs = dict(\n", " lf_qubit=q0.name, hf_qubit=q1.name, amplitudes=amplitude, duration=duration\n", ")\n", "\n", "gettable = ScheduleGettable(\n", " quantum_device,\n", " schedule_function=chevron_cz_sched,\n", " schedule_kwargs=chevron_cz_sched_kwargs,\n", " real_imag=False,\n", " data_labels=[\n", " \"Magnitude lf qubit\",\n", " \"Phase lf qubit\",\n", " \"Magnitude hf qubit\",\n", " \"Phase hf qubit\",\n", " ],\n", " batched=True,\n", " num_channels=2,\n", ")\n", "\n", "meas_ctrl.gettables(gettable)\n", "show_args(chevron_cz_sched_kwargs, \"chevron_cz_sched_kwargs\")" ] }, { "cell_type": "code", "execution_count": 15, "id": "357ba6e5", "metadata": { "execution": { "iopub.execute_input": "2023-12-06T16:53:40.583259Z", "iopub.status.busy": "2023-12-06T16:53:40.582256Z", "iopub.status.idle": "2023-12-06T16:53:55.251832Z", "shell.execute_reply": "2023-12-06T16:53:55.251832Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Starting batched measurement...\n", "Iterative settable(s) [outer loop(s)]:\n", "\t dur \n", "Batched settable(s):\n", "\t amp \n", "Batch size limit: 1024\n", "\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ff4a340696bd42a6b54db7654555ff99", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Completed: 0%| [ elapsed time: 00:00 | time left: ? ] it" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
<xarray.Dataset>\n", "Dimensions: (dim_0: 2400)\n", "Coordinates:\n", " x0 (dim_0) float64 4e-09 4e-09 4e-09 4e-09 ... 9.6e-08 9.6e-08 9.6e-08\n", " x1 (dim_0) float64 0.05 0.05152 0.05303 0.05455 ... 0.197 0.1985 0.2\n", "Dimensions without coordinates: dim_0\n", "Data variables:\n", " y0 (dim_0) float64 nan nan nan nan nan nan ... nan nan nan nan nan nan\n", " y1 (dim_0) float64 nan nan nan nan nan nan ... nan nan nan nan nan nan\n", " y2 (dim_0) float64 nan nan nan nan nan nan ... nan nan nan nan nan nan\n", " y3 (dim_0) float64 nan nan nan nan nan nan ... nan nan nan nan nan nan\n", "Attributes:\n", " tuid: 20231206-175340-589-c5e22a\n", " name: chevron\n", " grid_2d: True\n", " grid_2d_uniformly_spaced: True\n", " 1d_2_settables_uniformly_spaced: False\n", " xlen: 24\n", " ylen: 100