{ "cells": [ { "cell_type": "markdown", "id": "f51bc51f", "metadata": {}, "source": [ "# NV Center Qubit\n", "\n", "## Setup\n", "### Imports" ] }, { "cell_type": "code", "execution_count": null, "id": "683a49a2", "metadata": {}, "outputs": [], "source": [ "from __future__ import annotations\n", "\n", "from typing import TYPE_CHECKING, Callable\n", "\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "from qcodes.instrument.parameter import ManualParameter\n", "\n", "if TYPE_CHECKING:\n", " from qblox_instruments.qcodes_drivers.module import QcmQrm\n", "\n", "from qcodes.instrument import find_or_create_instrument\n", "\n", "import quantify_core.visualization.pyqt_plotmon as pqm\n", "from qblox_instruments import Cluster, ClusterType\n", "from quantify_core.data import handling as dh\n", "from quantify_core.measurement.control import MeasurementControl\n", "from quantify_core.visualization.instrument_monitor import InstrumentMonitor\n", "from quantify_scheduler.backends import SerialCompiler\n", "from quantify_scheduler.device_under_test.quantum_device import QuantumDevice\n", "from quantify_scheduler.gettables import ScheduleGettable\n", "from quantify_scheduler.instrument_coordinator import InstrumentCoordinator\n", "from quantify_scheduler.instrument_coordinator.components.generic import (\n", " GenericInstrumentCoordinatorComponent,\n", ")\n", "from quantify_scheduler.instrument_coordinator.components.qblox import ClusterComponent\n", "from quantify_scheduler.schedules.schedule import Schedule" ] }, { "cell_type": "markdown", "id": "f6322be2", "metadata": {}, "source": [ "### Scan For Clusters\n", "\n", "We scan for the available devices connected via ethernet using the Plug & Play functionality of the Qblox Instruments package (see [Plug & Play](https://qblox-qblox-instruments.readthedocs-hosted.com/en/main/api_reference/tools.html#api-pnp) for more info)." ] }, { "cell_type": "code", "execution_count": null, "id": "dc64172f", "metadata": {}, "outputs": [], "source": [ "!qblox-pnp list" ] }, { "cell_type": "code", "execution_count": null, "id": "61b6c51f", "metadata": {}, "outputs": [], "source": [ "cluster_ip = None\n", "cluster_name = \"cluster0\"" ] }, { "cell_type": "markdown", "id": "fe89f63b", "metadata": {}, "source": [ "### Connect to Cluster\n", "\n", "We now make a connection with the Cluster." ] }, { "cell_type": "code", "execution_count": null, "id": "96a05686", "metadata": { "lines_to_next_cell": 2 }, "outputs": [], "source": [ "cluster = find_or_create_instrument(\n", " Cluster,\n", " recreate=True,\n", " name=cluster_name,\n", " identifier=cluster_ip,\n", " dummy_cfg=(\n", " {\n", " 2: ClusterType.CLUSTER_QCM,\n", " 4: ClusterType.CLUSTER_QRM,\n", " 6: ClusterType.CLUSTER_QCM_RF,\n", " 8: ClusterType.CLUSTER_QRM_RF,\n", " }\n", " if cluster_ip is None\n", " else None\n", " ),\n", ")" ] }, { "cell_type": "markdown", "id": "dc659b7f", "metadata": { "lines_to_next_cell": 2 }, "source": [ "#### Get connected modules" ] }, { "cell_type": "code", "execution_count": null, "id": "4d30e310", "metadata": {}, "outputs": [], "source": [ "def get_connected_modules(cluster: Cluster, filter_fn: Callable | None = None) -> dict[int, QcmQrm]:\n", " def checked_filter_fn(mod: ClusterType) -> bool:\n", " if filter_fn is not None:\n", " return filter_fn(mod)\n", " return True\n", "\n", " return {\n", " mod.slot_idx: mod for mod in cluster.modules if mod.present() and checked_filter_fn(mod)\n", " }" ] }, { "cell_type": "code", "execution_count": null, "id": "43909291", "metadata": {}, "outputs": [], "source": [ "# QRM baseband modules\n", "readout_modules = get_connected_modules(cluster, lambda mod: mod.is_qrm_type and not mod.is_rf_type)\n", "readout_modules" ] }, { "cell_type": "code", "execution_count": null, "id": "69c94ef9", "metadata": {}, "outputs": [], "source": [ "readout_module = readout_modules[4]" ] }, { "cell_type": "code", "execution_count": null, "id": "f4970348", "metadata": {}, "outputs": [], "source": [ "# QCM baseband modules\n", "control_modules = get_connected_modules(\n", " cluster, lambda mod: not mod.is_qrm_type and not mod.is_rf_type\n", ")\n", "control_modules" ] }, { "cell_type": "code", "execution_count": null, "id": "4a7aa1de", "metadata": {}, "outputs": [], "source": [ "control_module = control_modules[2]" ] }, { "cell_type": "code", "execution_count": null, "id": "d8b9bb74", "metadata": {}, "outputs": [], "source": [ "# QCM RF modules\n", "rf_control_modules = get_connected_modules(\n", " cluster, lambda mod: not mod.is_qrm_type and mod.is_rf_type\n", ")\n", "rf_control_modules" ] }, { "cell_type": "code", "execution_count": null, "id": "640540c2", "metadata": {}, "outputs": [], "source": [ "rf_control_module = rf_control_modules[6]" ] }, { "cell_type": "code", "execution_count": null, "id": "6a8b5de7", "metadata": {}, "outputs": [], "source": [ "\n", "from quantify_scheduler.helpers.mock_instruments import MockLocalOscillator\n", "\n", "lo_readout_laser = find_or_create_instrument(\n", " MockLocalOscillator, recreate=True, name=\"lo_readout_laser\"\n", ")" ] }, { "cell_type": "markdown", "id": "758e1c5f", "metadata": {}, "source": [ "### Connect to the Cluster in Quantify\n" ] }, { "cell_type": "code", "execution_count": null, "id": "5f7b4283", "metadata": {}, "outputs": [], "source": [ "dh.set_datadir(dh.default_datadir())\n", "\n", "meas_ctrl = find_or_create_instrument(MeasurementControl, recreate=True, name=\"meas_ctrl\")\n", "# Create the live plotting isntrument which handles the graphical interface\n", "# Two windows will be created, the main will feature 1D plots and any 2D plots will go\n", "# to the secondary\n", "\n", "plotmon = find_or_create_instrument(pqm.PlotMonitor_pyqt, recreate=True, name=\"plotmon\")\n", "# Connect the live plotting monitor to the measurement control\n", "meas_ctrl.instr_plotmon(plotmon.name)\n", "\n", "# # The instrument monitor will give an overview of all parameters of all instruments\n", "insmon = find_or_create_instrument(InstrumentMonitor, recreate=True, name=\"Instrument_Monitor\")\n", "\n", "ic = find_or_create_instrument(InstrumentCoordinator, recreate=True, name=\"ic\")\n", "ic.add_component(ClusterComponent(cluster))\n", "ic.add_component(GenericInstrumentCoordinatorComponent(lo_readout_laser))" ] }, { "cell_type": "markdown", "id": "21a3907e", "metadata": {}, "source": [ "### Quantum Device Configuration" ] }, { "cell_type": "markdown", "id": "75bfd792", "metadata": {}, "source": [ "To generate the device configuration on the fly, `quantify_scheduler` provides the `QuantumDevice` and `BasicElectronicNVElement` classes, with the latter being specifically for NV-Center experiments. `QuantumDevice` can contain multiple `BasicElectronicNVElement`, but in this case we will add a single element to it, `qe0`." ] }, { "cell_type": "code", "execution_count": null, "id": "8b431113", "metadata": { "lines_to_next_cell": 2 }, "outputs": [], "source": [ "from quantify_scheduler.device_under_test.nv_element import BasicElectronicNVElement\n", "\n", "nv_center = find_or_create_instrument(QuantumDevice, recreate=True, name=\"nv_center\")\n", "\n", "nv_center.instr_measurement_control(meas_ctrl.name)\n", "nv_center.instr_instrument_coordinator(ic.name)\n", "nv_center.cfg_sched_repetitions(1)\n", "\n", "qe0 = find_or_create_instrument(BasicElectronicNVElement, recreate=True, name=\"qe0\")\n", "nv_center.add_element(qe0)\n", "\n", "qe0.clock_freqs.ge0.set(470.4e12) # 637 nm" ] }, { "cell_type": "markdown", "id": "3a8ffce4", "metadata": {}, "source": [ "### Hardware Configuration" ] }, { "cell_type": "markdown", "id": "61991ca9", "metadata": {}, "source": [ "We define the hardware configuration for the experiment. Three different Cluster modules are used:\n", "- A readout module which receives triggers from the single photon detector as input. The triggers are counted if their amplitude passes a certain threshold `ttl_acq_threshold` defined in the hardware configuration below. This module is also used to drive the AOM connected to the readout laser through Output 1, at 200 MHz;\n", "- A control module which drives the AOMs for the spinpump and green lasers, at 200 MHz;\n", "- An RF control module which is used for spectroscopy operations - the RF current is injected into the stripline which generates an alternating field at the NV center." ] }, { "cell_type": "markdown", "id": "334ed5a5", "metadata": { "lines_to_next_cell": 2 }, "source": [ "![NVCenterSetup.svg](NVCenterSetup.svg)" ] }, { "cell_type": "code", "execution_count": null, "id": "12ae395a", "metadata": {}, "outputs": [], "source": [ "def set_hardware_config(ttl_acq_threshold: float) -> dict:\n", " hardware_cfg = {\n", " \"backend\": \"quantify_scheduler.backends.qblox_backend.hardware_compile\",\n", " f\"{cluster.name}\": {\n", " \"ref\": \"internal\",\n", " \"sequence_to_file\": \"true\",\n", " \"instrument_type\": \"Cluster\",\n", " f\"{readout_module.name}\": {\n", " \"instrument_type\": \"QRM\",\n", " \"real_input_0\": {\n", " \"portclock_configs\": [\n", " {\n", " \"port\": \"qe0:optical_readout\",\n", " \"clock\": \"qe0.ge0\",\n", " \"interm_freq\": 0,\n", " \"ttl_acq_threshold\": ttl_acq_threshold,\n", " },\n", " ],\n", " },\n", " \"real_output_0\": {\n", " \"lo_name\": \"lo_readout_laser\",\n", " \"mix_lo\": False,\n", " \"portclock_configs\": [\n", " {\"port\": \"qe0:optical_control\", \"clock\": \"qe0.ge0\", \"interm_freq\": 200e6},\n", " ],\n", " },\n", " },\n", " f\"{control_module.name}\": {\n", " \"instrument_type\": \"QCM\",\n", " \"real_output_0\": {\n", " \"lo_name\": \"lo_spinpump_laser\",\n", " \"mix_lo\": False,\n", " \"portclock_configs\": [\n", " {\"port\": \"qe0:optical_control\", \"clock\": \"qe0.ge1\", \"interm_freq\": 200e6}\n", " ],\n", " },\n", " \"real_output_1\": {\n", " \"lo_name\": \"lo_green_laser\",\n", " \"mix_lo\": False,\n", " \"portclock_configs\": [\n", " {\n", " \"port\": \"qe0:optical_control\",\n", " \"clock\": \"qe0.ionization\",\n", " \"interm_freq\": 200e6,\n", " }\n", " ],\n", " },\n", " },\n", " f\"{rf_control_module.name}\": {\n", " \"instrument_type\": \"QCM_RF\",\n", " \"complex_output_0\": {\n", " \"lo_freq\": None,\n", " \"dc_mixer_offset_I\": 0.0,\n", " \"dc_mixer_offset_Q\": 0.0,\n", " \"portclock_configs\": [\n", " {\n", " \"port\": \"qe0:mw\",\n", " \"clock\": \"qe0.spec\",\n", " \"interm_freq\": 200e6,\n", " \"mixer_amp_ratio\": 0.9999,\n", " \"mixer_phase_error_deg\": -4.2,\n", " }\n", " ],\n", " },\n", " },\n", " },\n", " \"lo_readout_laser\": {\"instrument_type\": \"LocalOscillator\", \"frequency\": None, \"power\": 1},\n", " \"lo_spinpump_laser\": {\"instrument_type\": \"LocalOscillator\", \"frequency\": None, \"power\": 1},\n", " \"lo_green_laser\": {\"instrument_type\": \"LocalOscillator\", \"frequency\": None, \"power\": 1},\n", " }\n", " return hardware_cfg" ] }, { "cell_type": "code", "execution_count": null, "id": "3ea24fa8", "metadata": {}, "outputs": [], "source": [ "hardware_cfg = set_hardware_config(ttl_acq_threshold=0.2)\n", "nv_center.hardware_config.set(hardware_cfg)\n", "\n", "readout_module.scope_acq_sequencer_select(0)" ] }, { "cell_type": "markdown", "id": "ab468b17", "metadata": {}, "source": [ "## Trace Acquisition\n", "\n", "We start by running a trace acquisition to establish the threshold voltage at which we count a photon detection." ] }, { "cell_type": "code", "execution_count": null, "id": "5f22081c", "metadata": {}, "outputs": [], "source": [ "from quantify_scheduler.enums import BinMode\n", "from quantify_scheduler.operations.gate_library import Measure\n", "\n", "qe0.measure.pulse_amplitude(0.5)\n", "qe0.measure.pulse_duration(16e-6)\n", "qe0.measure.acq_duration(16e-6)\n", "qe0.measure.acq_delay(0)\n", "\n", "\n", "def trace_acquisition_sched(qubit: str, repetitions: int = 1) -> Schedule:\n", " schedule = Schedule(\"Trace Acquisition\")\n", " schedule.add(Measure(\"qe0\", acq_protocol=\"Trace\"))\n", " return schedule\n", "\n", "\n", "trace_schedule = trace_acquisition_sched(\"qe0\")\n", "compiler = SerialCompiler(\"compiler\")\n", "compiled_trace_sched = compiler.compile(trace_schedule, nv_center.generate_compilation_config())\n", "\n", "compiled_trace_sched.plot_pulse_diagram(plot_backend=\"plotly\")" ] }, { "cell_type": "code", "execution_count": null, "id": "feb32073", "metadata": {}, "outputs": [], "source": [ "ic.prepare(compiled_trace_sched)\n", "ic.start()\n", "data = ic.retrieve_acquisition()\n", "ic.stop()\n", "trace = data[0].real[0]\n", "time = np.arange(0, 16000, 1)" ] }, { "cell_type": "code", "execution_count": null, "id": "b49631e6", "metadata": {}, "outputs": [], "source": [ "fig, ax = plt.subplots(1, 1, sharex=True, figsize=(15, 5))\n", "ax.plot(time / 1000, trace, color=\"#00839F\")\n", "ax.set_xlabel(r\"Time ($\\mu$s)\")\n", "ax.set_ylabel(\"Relative amplitude\")\n", "plt.rcParams[\"axes.labelsize\"] = 18\n", "plt.rcParams[\"xtick.labelsize\"] = 16\n", "plt.rcParams[\"ytick.labelsize\"] = 16\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "20e72c12", "metadata": {}, "source": [ "![Trace_Acquisition.png](Trace_Acquisition.png)" ] }, { "cell_type": "markdown", "id": "4171030a", "metadata": {}, "source": [ "## TTL Acquisition" ] }, { "cell_type": "markdown", "id": "3a212c19", "metadata": {}, "source": [ "We can now set a correct threshold for the Trigger Count acquisition to ensure all the photon arrivals are counted a single time." ] }, { "cell_type": "code", "execution_count": null, "id": "8ee3e7ea", "metadata": {}, "outputs": [], "source": [ "hardware_cfg = set_hardware_config(ttl_acq_threshold=0.3)\n", "nv_center.hardware_config.set(hardware_cfg)\n", "\n", "qe0.measure.pulse_duration(20e-6)\n", "qe0.measure.acq_duration(20e-6)\n", "\n", "\n", "def ttl_acquisition_sched(qubit: str, repetitions: int = 1):\n", " schedule = Schedule(\"TTL Acquisition\")\n", " schedule.add(Measure(\"qe0\", acq_protocol=\"TriggerCount\"))\n", " schedule.repetitions = repetitions\n", " return schedule\n", "\n", "\n", "schedule = ttl_acquisition_sched(\"qe0\")\n", "compiled_sched = compiler.compile(schedule, nv_center.generate_compilation_config())\n", "\n", "compiled_sched.plot_pulse_diagram(plot_backend=\"plotly\")" ] }, { "cell_type": "code", "execution_count": null, "id": "870162ac", "metadata": {}, "outputs": [], "source": [ "sched_kwargs = {\n", " \"qubit\": \"qe0\",\n", "}\n", "\n", "ttl_acquisition_gettable = ScheduleGettable(\n", " quantum_device=nv_center,\n", " schedule_function=ttl_acquisition_sched,\n", " schedule_kwargs=sched_kwargs,\n", " batched=True,\n", " data_labels=[\"Trigger Count\"],\n", ")\n", "ttl_acquisition_gettable.unit = [\"\"]" ] }, { "cell_type": "code", "execution_count": null, "id": "04225ab3", "metadata": {}, "outputs": [], "source": [ "result = ttl_acquisition_gettable.get()\n", "print(\"Photons counted: \" + str(result[0][0]))" ] }, { "cell_type": "code", "execution_count": null, "id": "156ba998", "metadata": {}, "outputs": [], "source": [ "rep_par = ManualParameter(\n", " name=\"repetitions\",\n", " unit=\"\",\n", " label=\"Repetitions\",\n", ")\n", "rep_par.batched = True\n", "repetitions = 200\n", "meas_ctrl.settables(rep_par)\n", "meas_ctrl.setpoints(np.asarray(range(repetitions)))\n", "meas_ctrl.gettables(ttl_acquisition_gettable)\n", "dataset = meas_ctrl.run()" ] }, { "cell_type": "code", "execution_count": null, "id": "191e1570", "metadata": {}, "outputs": [], "source": [ "photon_count = dataset.y0\n", "\n", "plt.hist(photon_count, bins=range(1, 10), align=\"left\", rwidth=0.9, color=\"#00839F\")\n", "plt.title(r\"Photon counts for 200 acquisitions of 20 $\\mu$s\")\n", "plt.xlabel(\"Trigger Count\")\n", "plt.ylabel(\"# of Occurences\")\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "d9448000", "metadata": {}, "source": [ "![TTLAcquisitionBins.png](TTLAcquisitionBins.png)" ] }, { "cell_type": "markdown", "id": "288a874e", "metadata": {}, "source": [ "## Quantify - NV Center Native Library\n", "\n", "We define a schedule consisting of a Charge Reset operation which sets the NV to its negative charge state NV$^-$, followed by a Charge and Resonance Count operation which runs the ionization and the spin pump lasers with a photon count, on the element `qe0`. These operations are defined in `quantify_scheduler.operations.nv_native_library`." ] }, { "cell_type": "code", "execution_count": null, "id": "7b55702c", "metadata": {}, "outputs": [], "source": [ "from quantify_scheduler.operations.nv_native_library import ChargeReset, CRCount\n", "\n", "qe0.clock_freqs.ionization.set(564e12) # 532 nm\n", "qe0.clock_freqs.ge1.set(470.4e12 - 5e9) # slightly detuned\n", "qe0.clock_freqs.f01.set(3.592e9)\n", "qe0.clock_freqs.spec.set(2.895e9)" ] }, { "cell_type": "code", "execution_count": null, "id": "4235e217", "metadata": {}, "outputs": [], "source": [ "# Define ChargeReset parameters\n", "green_voltage = 0.697 # 30 uW\n", "\n", "qe0.charge_reset.amplitude(green_voltage)\n", "qe0.charge_reset.duration(40e-6)" ] }, { "cell_type": "code", "execution_count": null, "id": "655f1549", "metadata": {}, "outputs": [], "source": [ "# Define CRCount parameters\n", "readout_voltage = 0.5\n", "spinpump_voltage = 0.15\n", "\n", "qe0.cr_count.readout_pulse_amplitude(readout_voltage)\n", "qe0.cr_count.spinpump_pulse_amplitude(spinpump_voltage)\n", "qe0.cr_count.acq_delay(5e-6)\n", "qe0.cr_count.acq_duration(40e-6)\n", "qe0.cr_count.readout_pulse_duration(45e-6)\n", "qe0.cr_count.spinpump_pulse_duration(45e-6)" ] }, { "cell_type": "markdown", "id": "cb8d43ff", "metadata": {}, "source": [ "For this schedule, three lasers are used, as well as the other modules in the cluster. Since these are not present in the hardware configuration defined above, a new hardware configuration listing all the hardware is necessary. We load an example json hardware configuration file present in `quantify_scheduler`, which contains all the instruments required. Additionally, these are added to the instrument coordinator." ] }, { "cell_type": "code", "execution_count": null, "id": "6f9fce28", "metadata": {}, "outputs": [], "source": [ "lo_spinpump_laser = find_or_create_instrument(\n", " MockLocalOscillator, recreate=True, name=\"lo_spinpump_laser\"\n", ")\n", "lo_green_laser = find_or_create_instrument(\n", " MockLocalOscillator, recreate=True, name=\"lo_green_laser\"\n", ")\n", "\n", "ic.add_component(GenericInstrumentCoordinatorComponent(lo_spinpump_laser))\n", "ic.add_component(GenericInstrumentCoordinatorComponent(lo_green_laser))" ] }, { "cell_type": "code", "execution_count": null, "id": "9c4735aa", "metadata": {}, "outputs": [], "source": [ "# Define Schedule\n", "def nv_schedule(qubit: str, repetitions: int = 1):\n", " sched = Schedule(\"NV Center Schedule\")\n", " sched.add(ChargeReset(qubit))\n", " sched.add(CRCount(qubit, acq_index=0, acq_protocol=\"TriggerCount\", bin_mode=BinMode.APPEND))\n", " return sched\n", "\n", "\n", "compiled_nv_sched = compiler.compile(nv_schedule(\"qe0\"), nv_center.generate_compilation_config())\n", "compiled_nv_sched.plot_pulse_diagram(plot_backend=\"plotly\")\n", "compiled_nv_sched.plot_circuit_diagram()" ] }, { "cell_type": "code", "execution_count": null, "id": "4b422069", "metadata": {}, "outputs": [], "source": [ "sched_kwargs = {\n", " \"qubit\": \"qe0\",\n", "}\n", "\n", "nv_gettable = ScheduleGettable(\n", " quantum_device=nv_center,\n", " schedule_function=nv_schedule,\n", " schedule_kwargs=sched_kwargs,\n", " batched=True,\n", " data_labels=[\"Trigger Count\"],\n", ")\n", "nv_gettable.unit = [\"\"]" ] }, { "cell_type": "code", "execution_count": null, "id": "16694ba7", "metadata": {}, "outputs": [], "source": [ "result = nv_gettable.get()\n", "print(\"Photons counted: \" + str(result[0][0]))" ] }, { "cell_type": "markdown", "id": "d772835a", "metadata": {}, "source": [ "## Dark ESR Schedule\n", "\n", "We turn now to the dark electron spin resonance (ESR) experiment.\n", "A predefined schedule has been defined in the Quantify Scheduler library, which uses the numerically controled oscillator frequency sweeping capabilities (see NCO Control tutorial for more information) to perform the spectroscopy operation in a defined frequency range. To ensure the NV center is in the correct state, after the Reset operation, a Charge Resonance check is performed before and after each Measure operation." ] }, { "cell_type": "code", "execution_count": null, "id": "4b0c4ace", "metadata": {}, "outputs": [], "source": [ "# Reset Operation\n", "spinpump_reset_voltage = 0.502 # 0.5 uW\n", "qe0.reset.amplitude(spinpump_reset_voltage)\n", "qe0.reset.duration(3e-6)" ] }, { "cell_type": "code", "execution_count": null, "id": "492a9016", "metadata": {}, "outputs": [], "source": [ "# Spectroscopy Operation\n", "qe0.spectroscopy_operation.amplitude(0.25)\n", "qe0.spectroscopy_operation.duration(3e-6)" ] }, { "cell_type": "code", "execution_count": null, "id": "faeb4fab", "metadata": {}, "outputs": [], "source": [ "from quantify_scheduler.schedules.spectroscopy_schedules import nv_dark_esr_sched_nco\n", "\n", "spec_frequencies = np.asarray(np.linspace(2.898e9, 3.098e9, 20))\n", "\n", "compiler = SerialCompiler(\"compiler\")\n", "compiled_nv_sched = compiler.compile(\n", " schedule=nv_dark_esr_sched_nco(\"qe0\", spec_clock=\"qe0.spec\", spec_frequencies=spec_frequencies),\n", " config=nv_center.generate_compilation_config(),\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "21dde330", "metadata": {}, "outputs": [], "source": [ "schedule_kwargs = {\n", " \"qubit\": \"qe0\",\n", " \"spec_clock\": \"qe0.spec\",\n", " \"spec_frequencies\": spec_frequencies,\n", "}\n", "\n", "dark_esr_gettable = ScheduleGettable(\n", " quantum_device=nv_center,\n", " schedule_function=nv_dark_esr_sched_nco,\n", " schedule_kwargs=schedule_kwargs,\n", " batched=True,\n", " data_labels=[\"Trigger Count\"],\n", ")\n", "dark_esr_gettable.unit = [\"\"]" ] }, { "cell_type": "code", "execution_count": null, "id": "24ce65cf", "metadata": {}, "outputs": [], "source": [ "acq_par = ManualParameter(\n", " name=\"acq_index\",\n", " unit=\"\",\n", " label=\"Acquisition Index\",\n", ")\n", "acq_par.batched = True" ] }, { "cell_type": "code", "execution_count": null, "id": "e002bed4", "metadata": {}, "outputs": [], "source": [ "meas_ctrl.settables([acq_par, qe0.clock_freqs.spec])\n", "meas_ctrl.setpoints_grid([np.asarray([0, 1, 2]), spec_frequencies])\n", "meas_ctrl.gettables(dark_esr_gettable)\n", "dataset = meas_ctrl.run()" ] }, { "cell_type": "code", "execution_count": null, "id": "f6b799dd", "metadata": {}, "outputs": [], "source": [ "rep_par = ManualParameter(\n", " name=\"repetitions\",\n", " unit=\"\",\n", " label=\"Repetitions\",\n", ")\n", "rep_par.batched = True" ] }, { "cell_type": "code", "execution_count": null, "id": "0316e955", "metadata": {}, "outputs": [], "source": [ "repetitions = 10\n", "\n", "meas_ctrl.settables([acq_par, rep_par, qe0.clock_freqs.spec])\n", "meas_ctrl.setpoints_grid([np.asarray([0, 1, 2]), np.asarray(range(repetitions)), spec_frequencies])\n", "meas_ctrl.gettables(dark_esr_gettable)\n", "dataset = meas_ctrl.run()" ] } ], "metadata": { "jupytext": { "formats": "ipynb,py:percent", "notebook_metadata_filter": "nbsphinx" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "nbsphinx": { "execute": "never" } }, "nbformat": 4, "nbformat_minor": 5 }