{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "ad41ead1", "metadata": { "execution": { "iopub.execute_input": "2024-10-11T06:16:57.347130Z", "iopub.status.busy": "2024-10-11T06:16:57.346816Z", "iopub.status.idle": "2024-10-11T06:16:57.352281Z", "shell.execute_reply": "2024-10-11T06:16:57.351529Z" }, "nbsphinx": "hidden" }, "outputs": [], "source": [ "# Copyright 2024 Keysight Technologies Inc." ] }, { "cell_type": "raw", "id": "6f24c5b8", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "Compiling multi-qubit native gates to waveforms\n", "===============================================\n", "\n", "In this guide, we build on on :doc:`parameterized_linker_native_gates_sq` to\n", "demonstrate how to create a linker for a typical multi-qubit gate. We define two\n", "linkers for a cross-resonance gate, a common entangling gate in superconducting\n", "systems. The first is a basic implementation, while the second adds an extra pulse for\n", "crosstalk suppression.\n", "\n", "Here, we only consider one of two commuting subsets of multi-qubit gates assuming\n", "linear connectivity." ] }, { "cell_type": "raw", "id": "1a300fe5", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "Creating the Linkers\n", "--------------------\n", "We define the cross-resonance gate and a corresponding instruction. We work with all\n", "phases in the gate being ``0`` for simplicity, resulting in a gate proportional to\n", ":math:`ZX` with angle :math:`\\beta`." ] }, { "cell_type": "code", "execution_count": 2, "id": "1ba06e8c", "metadata": { "execution": { "iopub.execute_input": "2024-10-11T06:16:57.355452Z", "iopub.status.busy": "2024-10-11T06:16:57.355158Z", "iopub.status.idle": "2024-10-11T06:17:00.549479Z", "shell.execute_reply": "2024-10-11T06:17:00.548520Z" } }, "outputs": [], "source": [ "import keysight.qcs as qcs\n", "import numpy as np\n", "import math\n", "\n", "n_targets = 4\n", "qubits = qcs.Qudits(range(n_targets))\n", "\n", "# the number of commuting multi-qubit gates\n", "n_mq = math.floor(n_targets / 2)\n", "\n", "# create the multi-qudit targets\n", "mq_targets = qcs.MultiQudits.from_qudits((qubits[: 2 * n_mq : 2], qubits[1::2]))\n", "\n", "zx = qcs.PAULIS.sigma_z & qcs.PAULIS.sigma_x\n", "cr_gate = qcs.ParametricGate([zx], [\"beta\"])\n", "\n", "angles = qcs.Array(name=\"beta\", shape=(n_mq,), dtype=float)\n", "cr_param_gate = qcs.ParameterizedGate(cr_gate, angles)" ] }, { "cell_type": "raw", "id": "19b2a1ea", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "The first linker corresponds to the basic implementation. Here, we apply a pulse to\n", "to the control qubit with the resonant frequency of the target qubit, resulting in a\n", "rotation around :math:`Z` for the control and around :math:`X` for the target.\n", "Note that we use the same frequencies as those in\n", ":doc:`parameterized_linker_native_gates_sq`." ] }, { "cell_type": "code", "execution_count": 3, "id": "3e4bb64d", "metadata": { "execution": { "iopub.execute_input": "2024-10-11T06:17:00.553618Z", "iopub.status.busy": "2024-10-11T06:17:00.553098Z", "iopub.status.idle": "2024-10-11T06:17:00.744058Z", "shell.execute_reply": "2024-10-11T06:17:00.742983Z" } }, "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", " \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\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", "
Duration30 ns
Layers1
Targets2
Repetitions\n", "
\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", "
Duration30 ns
\n", "
\n", "\n", "
\n", "
\n", "
\n", " xy_channels\n", " \n", " 0\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " RFWaveform on ('xy_channels', 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=multi_qubit_duration, value=30 ns, dtype=float, unit=s)
AmplitudeArray(name=_implicit, shape=(2,), dtype=float, unit=none)
FrequencyArraySlice(name=single_qubit_frequencies, shape=(2,), dtype=float, unit=Hz, value=[5.1 GHz, 5.3 GHz])
EnvelopeGaussianEnvelope(2.0)
Instantaneous Phase0 rad
Post-phase0 rad
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " 2\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " RFWaveform on ('xy_channels', 2)\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=multi_qubit_duration, value=30 ns, dtype=float, unit=s)
AmplitudeArray(name=_implicit, shape=(2,), dtype=float, unit=none)
FrequencyArraySlice(name=single_qubit_frequencies, shape=(2,), dtype=float, unit=Hz, value=[5.1 GHz, 5.3 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" ], "text/plain": [ "" ] }, "metadata": { "text/html": { "isolated": true } }, "output_type": "display_data" } ], "source": [ "channels = qcs.Channels(range(n_targets), name=\"xy_channels\")\n", "\n", "sq_freqs = [5e9 + 100e6 * n for n in range(n_targets)]\n", "freqs = qcs.Array(\"single_qubit_frequencies\", value=sq_freqs, dtype=float)\n", "amps = qcs.Array(\"multi_qubit_amplitudes\", value=[0.5] * n_mq, dtype=float)\n", "dur = qcs.Scalar(\"multi_qubit_duration\", value=30e-9, dtype=float)\n", "\n", "pulse = qcs.RFWaveform(dur, qcs.GaussianEnvelope(), angles * amps, freqs[1::2])\n", "\n", "cr_prog = qcs.Program()\n", "cr_prog.add_waveform(pulse, channels[: 2 * n_mq : 2])\n", "\n", "# create the linker\n", "cr_linker = qcs.ParameterizedLinker(cr_param_gate, mq_targets, cr_prog)\n", "\n", "cr_prog.draw()" ] }, { "cell_type": "raw", "id": "a3734af4", "metadata": { "lines_to_next_cell": 0, "raw_mimetype": "text/restructuredtext" }, "source": [ "We now extend the above linker to suppress crosstalk by playing a simultaneous pulse\n", "on the target qubit at the same frequency with a fraction of the amplitude\n", ":math:`\\alpha`." ] }, { "cell_type": "code", "execution_count": 4, "id": "e8767173", "metadata": { "execution": { "iopub.execute_input": "2024-10-11T06:17:00.749184Z", "iopub.status.busy": "2024-10-11T06:17:00.748530Z", "iopub.status.idle": "2024-10-11T06:17:00.779070Z", "shell.execute_reply": "2024-10-11T06:17:00.778311Z" } }, "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", " \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\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", "
Duration30 ns
Layers1
Targets4
Repetitions\n", "
\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", "
Duration30 ns
\n", "
\n", "\n", "
\n", "
\n", "
\n", " xy_channels\n", " \n", " 0\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " RFWaveform on ('xy_channels', 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=multi_qubit_duration, value=30 ns, dtype=float, unit=s)
AmplitudeArray(name=_implicit, shape=(2,), dtype=float, unit=none)
FrequencyArraySlice(name=single_qubit_frequencies, shape=(2,), dtype=float, unit=Hz, value=[5.1 GHz, 5.3 GHz])
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 ('xy_channels', 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=multi_qubit_duration, value=30 ns, dtype=float, unit=s)
AmplitudeArray(name=_implicit, shape=(2,), dtype=float, unit=none)
FrequencyArraySlice(name=single_qubit_frequencies, shape=(2,), dtype=float, unit=Hz, value=[5.1 GHz, 5.3 GHz])
EnvelopeGaussianEnvelope(2.0)
Instantaneous Phase0 rad
Post-phase0 rad
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " 2\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " RFWaveform on ('xy_channels', 2)\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=multi_qubit_duration, value=30 ns, dtype=float, unit=s)
AmplitudeArray(name=_implicit, shape=(2,), dtype=float, unit=none)
FrequencyArraySlice(name=single_qubit_frequencies, shape=(2,), dtype=float, unit=Hz, value=[5.1 GHz, 5.3 GHz])
EnvelopeGaussianEnvelope(2.0)
Instantaneous Phase0 rad
Post-phase0 rad
\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", " 3\n", " \n", " \n", "
\n", " \n", "\n", "\n", "
\n", " \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " RFWaveform on ('xy_channels', 3)\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=multi_qubit_duration, value=30 ns, dtype=float, unit=s)
AmplitudeArray(name=_implicit, shape=(2,), dtype=float, unit=none)
FrequencyArraySlice(name=single_qubit_frequencies, shape=(2,), dtype=float, unit=Hz, value=[5.1 GHz, 5.3 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" ], "text/plain": [ "" ] }, "metadata": { "text/html": { "isolated": true } }, "output_type": "display_data" } ], "source": [ "alpha = qcs.Scalar(\"alpha\", value=0.3, dtype=float)\n", "pulse_supp = qcs.RFWaveform(\n", " dur, qcs.GaussianEnvelope(), alpha * angles * amps, freqs[1::2]\n", ")\n", "\n", "cr_prog_supp = qcs.Program()\n", "cr_prog_supp.add_waveform(pulse, channels[: 2 * n_mq : 2])\n", "cr_prog_supp.add_waveform(pulse_supp, channels[1::2])\n", "\n", "# create the linker\n", "cr_linker_supp = qcs.ParameterizedLinker(cr_param_gate, mq_targets, cr_prog_supp)\n", "\n", "cr_prog_supp.draw()" ] }, { "cell_type": "raw", "id": "8869eb55", "metadata": { "lines_to_next_cell": 0, "raw_mimetype": "text/restructuredtext" }, "source": [ "Using the Linkers\n", "-----------------\n", "We can use either of the linkers defined above to replace cross-resonance gates. The\n", "first linker gives a single waveform." ] }, { "cell_type": "code", "execution_count": 5, "id": "cdb3d62b", "metadata": { "execution": { "iopub.execute_input": "2024-10-11T06:17:00.782606Z", "iopub.status.busy": "2024-10-11T06:17:00.782271Z", "iopub.status.idle": "2024-10-11T06:17:01.511586Z", "shell.execute_reply": "2024-10-11T06:17:01.510867Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "dx": 4.166666666666667e-10, "legendgroup": "xy_channels, labels: (0,)", "legendgrouptitle": { "text": "xy_channels, labels: (0,)" }, "name": "Drive pulse for xy_channels, labels: (0,)", "type": "scatter", "x0": 0, "xaxis": "x", "y": [ 0.006912860965365565, 0.02013227908827532, 0.029991219753040962, 0.0335042042605014, 0.0281313594519586, 0.012169536895085474, -0.014906801957172821, -0.0522015719937786, -0.09729111284222483, -0.1462863995648704, -0.19407738779840858, -0.23475363015242628, -0.26217373654183274, -0.27063541117607814, -0.2555803481245921, -0.2142567570931774, -0.1462588085904262, -0.05386812749302004, 0.05786213028101613, 0.18131606179311774, 0.3068216070984352, 0.42342607532010335, 0.519878464989719, 0.585727822975701, 0.6124267821460316, 0.5943208892791569, 0.5294092054276431, 0.41978019178269355, 0.2716576510696519, 0.09503143606908135, -0.0971075789338035, -0.28986428709661655, -0.46776506783172417, -0.6161812035288292, -0.7227045056162636, -0.7783316035281371, -0.7783316035281374, -0.7227045056162642, -0.6161812035288299, -0.46776506783172495, -0.28986428709661755, -0.0971075789338046, 0.0950314360690803, 0.2716576510696511, 0.4197801917826929, 0.5294092054276427, 0.5943208892791566, 0.6124267821460317, 0.5857278229757014, 0.5198784649897195, 0.42342607532010407, 0.306821607098436, 0.18131606179311863, 0.05786213028101686, -0.053868127493019426, -0.14625880859042573, -0.21425675709317707, -0.25558034812459185, -0.27063541117607814, -0.26217373654183296, -0.23475363015242648, -0.19407738779840886, -0.14628639956487072, -0.0972911128422251, -0.05220157199377877, -0.014906801957172986, 0.012169536895085365, 0.02813135945195855, 0.03350420426050144, 0.02999121975304097, 0.020132279088275397, 0.006912860965365572 ], "yaxis": "y" } ], "layout": { "annotations": [ { "font": { "size": 16 }, "showarrow": false, "text": "Waveforms", "x": 0.5, "xanchor": "center", "xref": "paper", "y": 1.0, "yanchor": "bottom", "yref": "paper" } ], "height": 500, "template": { "data": { "bar": [ { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" } ], "scatter": [ { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" } ], "violin": [ { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" } ] }, "layout": { "annotationdefaults": { "font": { "size": 12 } }, "autotypenumbers": "strict", "hoverlabel": { "bgcolor": "white", "font": { "family": "Rockwell", "size": 14 } }, "hovermode": "x unified", "legend": { "bgcolor": "white", "bordercolor": "Black", "borderwidth": 1, "font": { "family": "Rockwell" } }, "xaxis": { "linecolor": "black", "linewidth": 1, "mirror": true, "showline": true }, "yaxis": { "linecolor": "black", "linewidth": 1, "mirror": true, "showline": true } } }, "width": 900, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ], "showticklabels": true, "title": { "text": "Time (s)" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "title": { "text": "Fractional Voltage" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "program = qcs.Program()\n", "some_beta = qcs.Array(\"beta\", value=[np.pi / 2])\n", "program.add_parametric_gate(cr_gate, [some_beta], (qubits[0], qubits[1]))\n", "\n", "linker_pass = qcs.LinkerPass(cr_linker)\n", "program_compiled = linker_pass.apply(program)\n", "\n", "program_compiled.render(\n", " channel_subplots=False,\n", " lo_frequency=5e9,\n", " sample_rate=qcs.SAMPLE_RATES[qcs.InstrumentEnum.M5300AWG],\n", ")" ] }, { "cell_type": "raw", "id": "8524897d", "metadata": { "raw_mimetype": "text/restructuredtext" }, "source": [ "Reusing the same program to compile, the second linker renders two waveforms on\n", "different channels." ] }, { "cell_type": "code", "execution_count": 6, "id": "36f83aef", "metadata": { "execution": { "iopub.execute_input": "2024-10-11T06:17:01.547228Z", "iopub.status.busy": "2024-10-11T06:17:01.546723Z", "iopub.status.idle": "2024-10-11T06:17:01.652120Z", "shell.execute_reply": "2024-10-11T06:17:01.651374Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "dx": 4.166666666666667e-10, "legendgroup": "xy_channels, labels: (0,)", "legendgrouptitle": { "text": "xy_channels, labels: (0,)" }, "name": "Drive pulse for xy_channels, labels: (0,)", "type": "scatter", "x0": 0, "xaxis": "x", "y": [ 0.006912860965365565, 0.02013227908827532, 0.029991219753040962, 0.0335042042605014, 0.0281313594519586, 0.012169536895085474, -0.014906801957172821, -0.0522015719937786, -0.09729111284222483, -0.1462863995648704, -0.19407738779840858, -0.23475363015242628, -0.26217373654183274, -0.27063541117607814, -0.2555803481245921, -0.2142567570931774, -0.1462588085904262, -0.05386812749302004, 0.05786213028101613, 0.18131606179311774, 0.3068216070984352, 0.42342607532010335, 0.519878464989719, 0.585727822975701, 0.6124267821460316, 0.5943208892791569, 0.5294092054276431, 0.41978019178269355, 0.2716576510696519, 0.09503143606908135, -0.0971075789338035, -0.28986428709661655, -0.46776506783172417, -0.6161812035288292, -0.7227045056162636, -0.7783316035281371, -0.7783316035281374, -0.7227045056162642, -0.6161812035288299, -0.46776506783172495, -0.28986428709661755, -0.0971075789338046, 0.0950314360690803, 0.2716576510696511, 0.4197801917826929, 0.5294092054276427, 0.5943208892791566, 0.6124267821460317, 0.5857278229757014, 0.5198784649897195, 0.42342607532010407, 0.306821607098436, 0.18131606179311863, 0.05786213028101686, -0.053868127493019426, -0.14625880859042573, -0.21425675709317707, -0.25558034812459185, -0.27063541117607814, -0.26217373654183296, -0.23475363015242648, -0.19407738779840886, -0.14628639956487072, -0.0972911128422251, -0.05220157199377877, -0.014906801957172986, 0.012169536895085365, 0.02813135945195855, 0.03350420426050144, 0.02999121975304097, 0.020132279088275397, 0.006912860965365572 ], "yaxis": "y" }, { "dx": 4.166666666666667e-10, "legendgroup": "xy_channels, labels: (1,)", "legendgrouptitle": { "text": "xy_channels, labels: (1,)" }, "name": "Drive pulse for xy_channels, labels: (1,)", "type": "scatter", "x0": 0, "xaxis": "x", "y": [ 0.0020738582896096696, 0.006039683726482597, 0.00899736592591229, 0.01005126127815042, 0.00843940783558758, 0.003650861068525642, -0.004472040587151846, -0.015660471598133583, -0.02918733385266745, -0.04388591986946113, -0.058223216339522564, -0.07042608904572788, -0.07865212096254981, -0.08119062335282344, -0.07667410443737764, -0.06427702712795322, -0.04387764257712786, -0.016160438247906014, 0.01735863908430484, 0.05439481853793533, 0.09204648212953057, 0.12702782259603101, 0.1559635394969157, 0.17571834689271032, 0.1837280346438095, 0.17829626678374708, 0.15882276162829295, 0.12593405753480805, 0.08149729532089559, 0.028509430820724404, -0.02913227368014105, -0.08695928612898497, -0.14032952034951726, -0.18485436105864875, -0.21681135168487908, -0.23349948105844112, -0.23349948105844118, -0.21681135168487925, -0.18485436105864897, -0.14032952034951748, -0.08695928612898528, -0.02913227368014138, 0.028509430820724088, 0.08149729532089534, 0.12593405753480785, 0.1588227616282928, 0.178296266783747, 0.18372803464380955, 0.17571834689271038, 0.15596353949691585, 0.1270278225960312, 0.0920464821295308, 0.054394818537935596, 0.017358639084305058, -0.016160438247905827, -0.043877642577127715, -0.06427702712795313, -0.07667410443737756, -0.08119062335282345, -0.07865212096254988, -0.07042608904572795, -0.05822321633952265, -0.043885919869461214, -0.02918733385266753, -0.01566047159813363, -0.004472040587151896, 0.0036508610685256093, 0.008439407835587564, 0.010051261278150432, 0.008997365925912292, 0.006039683726482619, 0.002073858289609672 ], "yaxis": "y" } ], "layout": { "annotations": [ { "font": { "size": 16 }, "showarrow": false, "text": "Waveforms", "x": 0.5, "xanchor": "center", "xref": "paper", "y": 1.0, "yanchor": "bottom", "yref": "paper" } ], "height": 500, "template": { "data": { "bar": [ { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "/" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "\\" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "x" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "-" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "|" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "+" } }, "type": "bar" }, { "marker": { "color": "#00b287", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" }, { "marker": { "color": "#ff9000", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" }, { "marker": { "color": "#00d539", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" }, { "marker": { "color": "#ff005c", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" }, { "marker": { "color": "#ad6aff", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" }, { "marker": { "color": "#c97a88", "line": { "color": "black", "width": 1.5 }, "opacity": 0.8, "pattern": { "shape": "." } }, "type": "bar" } ], "scatter": [ { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "type": "scatter" }, { "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "circle" }, "type": "scatter" }, { "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "square" }, "type": "scatter" }, { "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "type": "scatter" }, { "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "type": "scatter" }, { "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "cross" }, "type": "scatter" } ], "violin": [ { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff005c" }, "marker": { "color": "#ff005c", "opacity": 0.5, "size": 8, "symbol": "hexagram" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00d539" }, "marker": { "color": "#00d539", "opacity": 0.5, "size": 8, "symbol": "circle" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ad6aff" }, "marker": { "color": "#ad6aff", "opacity": 0.5, "size": 8, "symbol": "square" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#ff9000" }, "marker": { "color": "#ff9000", "opacity": 0.5, "size": 8, "symbol": "diamond" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#00b287" }, "marker": { "color": "#00b287", "opacity": 0.5, "size": 8, "symbol": "triangle-down" }, "meanline": { "visible": true }, "type": "violin" }, { "box": { "visible": true }, "line": { "color": "#c97a88" }, "marker": { "color": "#c97a88", "opacity": 0.5, "size": 8, "symbol": "cross" }, "meanline": { "visible": true }, "type": "violin" } ] }, "layout": { "annotationdefaults": { "font": { "size": 12 } }, "autotypenumbers": "strict", "hoverlabel": { "bgcolor": "white", "font": { "family": "Rockwell", "size": 14 } }, "hovermode": "x unified", "legend": { "bgcolor": "white", "bordercolor": "Black", "borderwidth": 1, "font": { "family": "Rockwell" } }, "xaxis": { "linecolor": "black", "linewidth": 1, "mirror": true, "showline": true }, "yaxis": { "linecolor": "black", "linewidth": 1, "mirror": true, "showline": true } } }, "width": 900, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ], "showticklabels": true, "title": { "text": "Time (s)" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "title": { "text": "Fractional Voltage" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "linker_pass_supp = qcs.LinkerPass(cr_linker_supp)\n", "program_compiled = linker_pass_supp.apply(program)\n", "\n", "program_compiled.render(\n", " channel_subplots=False,\n", " lo_frequency=5e9,\n", " sample_rate=qcs.SAMPLE_RATES[qcs.InstrumentEnum.M5300AWG],\n", ")" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "nbsphinx,raw_mimetype,-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.9.6" } }, "nbformat": 4, "nbformat_minor": 5 }