{ "cells": [ { "cell_type": "markdown", "id": "cc306b82", "metadata": {}, "source": [ "# Deprecated code suggestions\n", "\n", "```{seealso}\n", "Download the notebook: {nb-download}`deprecated.ipynb`\n", "```\n", "\n", "| **Target** | **Depr** | **Remv** | **Alternatives** |\n", "|---|---|---|---|\n", "| `latency_correction` in `Connectivity` | 0.20.1 | 0.22 | See {ref}`Qblox Hardware Configuration` |\n", "| `distortion_correction` in `Connectivity` | 0.20.1 | 0.22 | See {ref}`Qblox Hardware Configuration` |\n", "| `duration` parameter in `ShiftClockPhase` operation | 0.20.1 | 0.22 | See {ref}`removed_duration` |\n", "| `duration` parameter in `SetClockFrequency` operation | 0.20.1 | 0.22 | See {ref}`removed_duration` |\n", "| `duration` parameter in `VoltageOffset` operation | 0.20.1 | 0.22 | See {ref}`removed_duration` |\n", "| `quantify_scheduler.operations.stitched_pulse.StitchedPulse` | 0.20.1 | 0.22 | {class}`~quantify_scheduler.qblox.operations.StitchedPulse` |\n", "| `quantify_scheduler.operations.stitched_pulse.convert_to_numerical_pulse` | 0.20.1 | 0.22 | {class}`~quantify_scheduler.qblox.operations.convert_to_numerical_pulse` |\n", "| `quantify_scheduler.operations.stitched_pulse.StitchedPulseBuilder` | 0.20.1 | 0.22 | {class}`~quantify_scheduler.qblox.operations.StitchedPulseBuilder` |\n", "| `quantify_scheduler.compilation.determine_absolute_timing` | 0.20.1 | 0.22 | {ref}`Compiling to Hardware` and {ref}`Operations and Qubits` |\n", "| `control_flow` argument in `Schedule.add` | 0.20.1 | 0.22 | See {ref}`New control flow interface`|\n", "| `common.DistortionCorrection` | 0.20.1 | 0.22 | See {ref}`DistortionCorrection => SoftwareDistortionCorrection`|\n", "| `bounds_error` and `extrapolate` args in `waveforms.interpolated_complex_waveform` | 0.19.0 | 0.22 | See {ref}`removed_bounds_error` |\n", "| `quantify_scheduler.operations.stitched_pulse` | 0.18 | 0.21 | {mod}`quantify_scheduler.backends.qblox.operations.stitched_pulse` |\n", "| `quantify_scheduler.operations.pulse_factories.staircase_pulse` | 0.18 | 0.22 | {func}`quantify_scheduler.backends.qblox.operations.pulse_factories.staircase_pulse` |\n", "| `quantify_scheduler.operations.pulse_factories.long_square_pulse` | 0.18 | 0.22 | {func}`quantify_scheduler.backends.qblox.operations.pulse_factories.long_square_pulse` |\n", "| `quantify_scheduler.operations.pulse_factories.long_ramp_pulse` | 0.18 | 0.22 | {func}`quantify_scheduler.backends.qblox.operations.pulse_factories.long_ramp_pulse` |\n", "| `NumericalWeightedIntegrationComplex` | 0.18 | 0.23 | {class}`~quantify_scheduler.operations.acquisition_library.NumericalSeparatedWeightedIntegration` |\n", "| `offset_path_{0,1}` arguments in {class}`~quantify_scheduler.operations.pulse_library.VoltageOffset` | 0.18 | 0.21 | Replaced by `offset_path_{I,Q}` |\n", "| `ScheduleGettable.generate_diagnostics_report()` | 0.17 | 0.18 | See {ref}`ScheduleGettable.generate_diagnostics_report()` |\n", "| `plot_kwargs` parameter in `ScheduleBase.plot_pulse_diagram()` | 0.15 | - | See {ref}`plot_kwargs parameter in ScheduleBase.plot_pulse_diagram()` |\n", "| `repetitions` parameter in `ScheduleGettable.process_acquired_data()` | 0.15 | 0.18 | See {ref}`repetitions parameter in ScheduleGettable.process_acquired_data()` |\n", "| `t` parameter in `NumericalSeparatedWeightedIntegration` | 0.13 | 0.18 | See {ref}`t parameter in NumericalSeparatedWeightedIntegration` |\n", "| Qblox `convert_hw_config_to_portclock_configs_spec()` | 0.13 | 0.18 | See {ref}`Qblox Hardware Configuration` |\n", "| Qblox `instruction_generated_pulses_enabled` hardware config setting | 0.13 | 0.17 | See {ref}`Instruction-generated pulses (Qblox only)` |\n", "| `quantify_scheduler.visualization` | 0.12 | 0.15 | See {ref}`Circuit diagrams and pulse diagrams` |\n", "| `acq_channel` (in {class}`~quantify_scheduler.operations.gate_library.Measure` and {class}`~quantify_scheduler.operations.nv_native_library.CRCount`) | 0.10 | 0.13 | See {ref}`acq_channel` |\n", "| `quantify_scheduler.compilation.qcompile()`
`quantify_scheduler.compilation.device_compile()`
`quantify_scheduler.compilation.hardware_compile()` | 0.10 | 0.13 | See {ref}`qcompile() => SerialCompiler` |\n", "| The `data` parameter in `Operation` subclasses | 0.9 | 0.15 | - |\n", "| Old Qblox hardware configuration | 0.8 | 0.13 | See {ref}`Qblox Hardware Configuration` |\n", "| `TransmonElement` | 0.7 | 0.13 | See {ref}`TransmonElement => BasicTransmonElement` |\n", "| `add_pulse_information_transmon()` | 0.6 | 0.13 | See {ref}`add_pulse_information_transmon() => compile_circuit_to_device()` |\n", "| `plot_circuit_diagram_mpl()` | 0.6 | 0.9 | {meth}`~quantify_scheduler.schedules.schedule.ScheduleBase.plot_circuit_diagram` |\n", "| `plot_pulse_diagram_mpl()` | 0.6 | 0.9 | {meth}`~quantify_scheduler.schedules.schedule.ScheduleBase.plot_pulse_diagram` |\n", "\n", "As of `quantify-scheduler==0.10.0`, deprecation warnings are shown by default (as `FutureWarning`).\n", "\n", "## Changed in 0.22.0\n", "\n", "(removed_duration)=\n", "### Removed\n", "\n", "- :class:`~quantify_scheduler.operations.ShiftClockPhase`, :class:`~quantify_scheduler.operations.SetClockFrequency` and :class:`~quantify_scheduler.operations.VoltageOffset` no longer accept the `duration` parameter and are set internally to 0 seconds. \n", "- `determine_absolute_timing` was removed from the public interface. Please use :class:`~quantify_scheduler.SerialCompiler` or :class:`~quantify_scheduler.ScheduleGettable` instead.\n", "\n", "### Moved\n", "\n", "- In the hardware config, the settings `latency_correction` and `distortion_correction` should now be defined inside `HardwareOptions`.\n", "- `StitchedPulse`, `convert_to_numerical_pulse`, `StitchedPulseBuilder`, `staircase_pulse`, `long_square_pulse` and `long_ramp_pulse` have moved to the Qblox backend: \n", "\n", "| old location | new location |\n", "|----------|---------------------\n", "| `quantify_scheduler.operations.StitchedPulse` | `quantify_scheduler.qblox.operations.StitchedPulse` |\n", "| `quantify_scheduler.operations.convert_to_numerical_pulse` | `quantify_scheduler.qblox.operations.convert_to_numerical_pulse` |\n", "| `quantify_scheduler.operations.StitchedPulseBuilder` | `quantify_scheduler.qblox.StitchedPulseBuilder` |\n", "| `quantify_scheduler.operations.staircase_pulse` | `quantify_scheduler.qblox.staircase_pulse` |\n", "| `quantify_scheduler.operations.long_square_pulse` | `quantify_scheduler.qblox.long_square_pulse` |\n", "| `quantify_scheduler.operations.long_ramp_pulse` | `quantify_scheduler.qblox.long_ramp_pulse` |\n", "| \n", "\n", "\n", "### Renamed\n", "\n", "- `DistortionCorrection` and `NumericalWeightedIntegrationComplex` have a new name:\n", "\n", "| old name | new name |\n", "|----------|---------------------\n", "| `DistortionCorrection` | `SoftwareDistortionCorrection` |\n", "| `NumericalWeightedIntegrationComplex` | `NumericalSeparatedWeightedIntegration` |\n", "\n", "\n", "(removed_bounds_error)=\n", "### Other\n", "\n", "- When interpolating waveforms, a call to `interpolated_complex_waveform` is made, which accepts key word arguments that will be passed to `scipy.interpolate.interp1d`. The two arguments `bounds_error` and `fill_value` are now fixed to `False` and `\"extrapolate\"` and cannot be changed.\n", "\n", "## Changed in 0.21.0\n", "\n", "\n", "### New control flow interface\n", "\n", "This is an example for the loop control flow. For other control flow types, please use the respective operation classes in the same way.\n", "\n", "```{code-block} python\n", "# Old way:\n", "from quantify_scheduler.operations.control_flow_library import Loop\n", "\n", "schedule_with_loop = Schedule(\"Schedule with loop\")\n", "\n", "subschedule = Schedule(\"Subschedule\")\n", "subschedule.add(X(\"q0\"))\n", "\n", "schedule_with_loop.add(subschedule, control_flow=Loop(3))\n", "```\n", "\n", "```{code-block} python\n", "# New way:\n", "from quantify_scheduler.operations.control_flow_library import LoopOperation\n", "from quantify_scheduler.operations.gate_library import X\n", "\n", "schedule_with_loop = Schedule(\"Schedule with loop\")\n", "\n", "subschedule = Schedule(\"Subschedule\")\n", "subschedule.add(X(\"q0\"))\n", "\n", "loop_operation = LoopOperation(body=subschedule, repetitions=3)\n", "\n", "schedule_with_loop.add(loop_operation)\n", "```\n", "\n", "### DistortionCorrection => SoftwareDistortionCorrection\n", "\n", "To prepare for distortion corrections performed by hardware, distortion corrections will now come in two flavors: `SoftwareDistortionCorrection` and `HardwareDistortionCorrection`. \n", "\n", "In the hardware configuration, the following needs to be replaced:\n", "\n", "```{code-block} diff\n", "\n", "hardware_configuration = {\n", " ...\n", " hardware_options : {\n", " ...\n", " distortion_corrections = {\n", "- \"q0:fl-cl0.baseband\": DistortionCorrection(\n", "+ \"q0:fl-cl0.baseband\": SoftwareDistortionCorrection( \n", " filter_func=\"scipy.signal.lfilter\",\n", " input_var_name=\"x\",\n", " kwargs={\n", " \"b\": [0, 0.25, 0.5],\n", " \"a\": [1]\n", " },\n", " clipping_values=[-2.5, 2.5]\n", " )\n", " }\n", " }\n", "}\n", "```\n", "\n", "## Older\n", "\n", "### qcompile() => SerialCompiler\n", "\n", "The `qcompile()`, `device_compile()` and `hardware_compile()` compilation functions have been replaced by the {class}`~quantify_scheduler.backends.graph_compilation.SerialCompiler`. For step-by-step guides on how to perform compilation to the device level and hardware, please see {ref}`Compiling to Hardware` and {ref}`Operations and Qubits`. A brief example is shown below.\n", "\n", "\n", "```{code-block} python\n", "# Old way:\n", "from quantify_scheduler.compilation import qcompile\n", "\n", "compiled_schedule = qcompile(sched, device_cfg, hardware_cfg)\n", "```\n", "\n", "```{code-block} python\n", "from quantify_scheduler.backends.graph_compilation import SerialCompiler\n", "\n", "quantum_device.hardware_config(hardware_cfg)\n", "\n", "compiler = SerialCompiler(name=\"compiler\")\n", "compiled_schedule = compiler.compile(\n", " schedule=sched, config=quantum_device.generate_compilation_config()\n", ")\n", "```\n", "\n", "### ScheduleGettable.generate_diagnostics_report()\n", "\n", "In version 0.17, the `ScheduleGettable.generate_diagnostics_report` method received a major update. This method should no longer be called directly. Instead, the experiment should be run via the {meth}`.ScheduleGettable.initialize_and_get_with_report` method, which executes the experiment and generates a diagnostics report for debugging.\n", "\n", "### plot_kwargs parameter in ScheduleBase.plot_pulse_diagram()\n", "\n", "In version 0.15, the `plot_kwargs` parameter of the {meth}`.ScheduleBase.plot_pulse_diagram` method was replaced by variable keyword arguments (`**kwargs`). This means that the dictionary provided to `plot_kwargs` can be unpacked and passed to the method directly. For example,\n", "\n", "```python\n", "schedule.plot_pulse_diagram(plot_kwargs={\"x_range\": (201e-6, 201.5e-6)})\n", "```\n", "\n", "can now be written as\n", "\n", "```{code-block} python\n", "compiled_schedule.plot_pulse_diagram(x_range=(201e-6, 201.5e-6))\n", "```\n", "\n", "### repetitions parameter in ScheduleGettable.process_acquired_data()\n", "\n", "In version 0.15, the `repetitions` parameter of the `ScheduleGettable.process_acquired_data` method was deprecated. This parameter has no effect, and can simply be omitted. The {ref}`sec-tutorial-schedulegettable-repetitions` section of {ref}`sec-tutorial-schedulegettable` contains more information on how to set the number of repetitions in an experiment.\n", "\n", "### t parameter in NumericalSeparatedWeightedIntegration\n", "\n", "```{note}\n", "This class was renamed from `NumericalWeightedIntegrationComplex` in quantify-scheduler 0.18.1.\n", "```\n", "\n", "In version 0.13.0, the `t` parameter in the {class}`~quantify_scheduler.operations.acquisition_library.NumericalSeparatedWeightedIntegration` initializer was replaced by the `weights_sampling_rate` parameter, which takes a sampling rate in Hz.\n", "\n", "This means that creating a class instance as\n", "\n", "```python\n", "NumericalSeparatedWeightedIntegration(\n", " weights_a=[0.1, 0.2, 0.3],\n", " weight_b=[0.4, 0.5, 0.6],\n", " t=[0.0, 1e-9, 2e-9],\n", " port=\"some_port\",\n", " clock=\"some_clock\",\n", " # other args\n", ")\n", "```\n", "\n", "should now be done as" ] }, { "cell_type": "code", "execution_count": 1, "id": "0386ee6c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "NumericalSeparatedWeightedIntegration(weights_a=[0.1, 0.2, 0.3], weights_b=[0.4, 0.5, 0.6], weights_sampling_rate=999999999.9999999, port='some_port', clock='some_clock', interpolation='linear', acq_channel=0, acq_index=0, bin_mode='append', phase=0, t0=0)" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from quantify_scheduler.operations.acquisition_library import NumericalSeparatedWeightedIntegration\n", "\n", "NumericalSeparatedWeightedIntegration(\n", " weights_a=[0.1, 0.2, 0.3],\n", " weights_b=[0.4, 0.5, 0.6],\n", " weights_sampling_rate=1e9,\n", " port=\"some_port\",\n", " clock=\"some_clock\",\n", " # other args\n", ")" ] }, { "cell_type": "markdown", "id": "47810123", "metadata": {}, "source": [ "### Circuit diagrams and pulse diagrams\n", "\n", "The functions to plot circuit and pulse diagrams have moved to a private module in version 0.12.0.\n", "\n", "Instead, to plot circuit and pulse diagrams, call, directly on the schedule, {meth}`~quantify_scheduler.schedules.schedule.ScheduleBase.plot_circuit_diagram` and {meth}`~quantify_scheduler.schedules.schedule.ScheduleBase.plot_pulse_diagram`. \n", "\n", "For example, the line\n", "\n", "```python\n", "pulse_diagram_plotly(schedule)\n", "pulse_diagram_matplotlib(schedule)\n", "```\n", "\n", "should now be written as\n", "\n", "```{code-block} python\n", "compiled_schedule.plot_pulse_diagram(plot_backend=\"plotly\")\n", "compiled_schedule.plot_pulse_diagram(plot_backend=\"mpl\")\n", "```\n", "\n", "More examples can be found in the {ref}`Schedules and Pulses` and {ref}`Operations and Qubits` tutorials.\n", "\n", "### acq_channel\n", "\n", "In the {class}`~quantify_scheduler.operations.gate_library.Measure` and {class}`~quantify_scheduler.operations.nv_native_library.CRCount` classes, the `acq_channel` parameter has been removed from the initializers. For gate-level operations, the acquisition channel can be set in the {class}`~quantify_scheduler.device_under_test.device_element.DeviceElement` subclasses, such as {class}`~quantify_scheduler.device_under_test.transmon_element.BasicTransmonElement`, instead.\n", "\n", "\n", "\n", "### add_pulse_information_transmon() => compile_circuit_to_device()\n", "\n", "The compilation step `add_pulse_information_transmon` has been replaced by `compile_circuit_to_device`. For steps on how to add device configuration to your compilation steps, please see {ref}`Operations and Qubits`.\n", "\n", "### Qblox Hardware Configuration\n", "\n", "In quantify-scheduler 0.8.0, the schema for the Qblox hardware configuration was revised. From version 0.13.0, old hardware configurations will no longer be automatically converted. Below is a summary of the changes.\n", "\n", "1. `seqx` => `portclock_configs` \n", "1. `latency_correction` => standalone/top-level `latency_corrections`\n", "1. `line_gain_db` removed\n", "\n", "```{warning}\n", "The helper function `convert_hw_config_to_portclock_configs_spec` has been removed in version 0.18.0.\n", "```" ] }, { "cell_type": "code", "execution_count": 2, "id": "0064edb5", "metadata": {}, "outputs": [], "source": [ "depr_hardware_cfg = {\n", " \"backend\": \"quantify_scheduler.backends.qblox_backend.hardware_compile\",\n", " \"cluster\": {\n", " \"ref\": \"internal\",\n", " \"instrument_type\": \"Cluster\",\n", " \"cluster_module1\": {\n", " \"instrument_type\": \"QRM_RF\",\n", " \"complex_output_0\": {\n", " \"line_gain_db\": 0,\n", " \"seq0\": {\n", " \"port\": \"q6:res\",\n", " \"clock\": \"q6.ro\",\n", " \"latency_correction\": 4e-9,\n", " },\n", " \"seq1\": {\n", " \"port\": \"q1:res\",\n", " \"clock\": \"q1.ro\",\n", " },\n", " },\n", " },\n", " },\n", "}" ] }, { "cell_type": "code", "execution_count": 3, "id": "0bc7d15a", "metadata": {}, "outputs": [], "source": [ "correct_hardware_cfg = {\n", " \"backend\": \"quantify_scheduler.backends.qblox_backend.hardware_compile\",\n", " \"cluster\": {\n", " \"ref\": \"internal\",\n", " \"instrument_type\": \"Cluster\",\n", " \"cluster_module1\": {\n", " \"instrument_type\": \"QRM_RF\",\n", " \"complex_output_0\": {\n", " \"portclock_configs\": [\n", " {\n", " \"port\": \"q6:res\",\n", " \"clock\": \"q6.ro\"\n", " },\n", " {\n", " \"port\": \"q1:res\",\n", " \"clock\": \"q1.ro\"\n", " }\n", " ]\n", " }\n", " }\n", " },\n", " \"latency_corrections\": {\n", " \"q6:res-q6.ro\": 4e-09\n", " }\n", "}" ] }, { "cell_type": "markdown", "id": "6a20890d", "metadata": {}, "source": [ "### TransmonElement => BasicTransmonElement\n", "\n", "In quantify-scheduler 0.7.0, the {class}`~quantify_scheduler.device_under_test.transmon_element.BasicTransmonElement` class was added and replaced the `TransmonElement` class." ] }, { "cell_type": "code", "execution_count": 4, "id": "0eb55384", "metadata": { "tags": [ "hide-cell" ] }, "outputs": [], "source": [ "from qcodes import Instrument\n", "\n", "Instrument.close_all()" ] }, { "cell_type": "code", "execution_count": 5, "id": "e8436749", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "basic: ['IDN', 'reset', 'rxy', 'measure', 'pulse_compensation', 'ports', 'clock_freqs']\n", "basic.reset: ['duration']\n", "basic.rxy: ['amp180', 'motzoi', 'duration']\n", "basic.measure: ['pulse_type', 'pulse_amp', 'pulse_duration', 'acq_channel', 'acq_delay', 'integration_time', 'reset_clock_phase', 'acq_weights_a', 'acq_weights_b', 'acq_weights_sampling_rate', 'acq_weight_type', 'acq_rotation', 'acq_threshold', 'num_points']\n", "basic.pulse_compensation: ['max_compensation_amp', 'time_grid', 'sampling_rate']\n", "basic.ports: ['microwave', 'flux', 'readout']\n", "basic.clock_freqs: ['f01', 'f12', 'readout']\n" ] } ], "source": [ "# Before:\n", "# from quantify_scheduler.device_under_test.transmon_element import TransmonElement\n", "\n", "# transmon = TransmonElement(\"transmon\")\n", "# print(f\"{transmon.name}: {list(transmon.parameters.keys())}\")\n", "\n", "# After:\n", "from quantify_scheduler.device_under_test.transmon_element import BasicTransmonElement\n", "\n", "basic = BasicTransmonElement(\"basic\")\n", "print(f\"{basic.name}: {list(basic.parameters.keys()) + list(basic.submodules.keys())}\")\n", "for submodule_name, submodule in basic.submodules.items():\n", " print(f\"{basic.name}.{submodule_name}: {list(submodule.parameters.keys())}\")" ] }, { "cell_type": "markdown", "id": "3ba8d017", "metadata": {}, "source": [ "The block below shows how the attributes of the `TransmonElement` (`transmon`) are converted to attributes of the `BasicTransmonElement` (`basic`).\n", "\n", "```\n", "transmon.IDN => basic.IDN\n", "transmon.instrument_coordinator => None\n", "transmon.init_duration => basic.reset.duration\n", "transmon.mw_amp180 => basic.rxy.amp180\n", "transmon.mw_motzoi => basic.rxy.motzoi\n", "transmon.mw_pulse_duration => basic.rxy.duration\n", "transmon.mw_ef_amp180 => None\n", "transmon.mw_port => basic.ports.microwave\n", "transmon.fl_port => basic.ports.flux\n", "transmon.ro_port => basic.ports.readout\n", "transmon.mw_01_clock => no longer settable, always \"basic.01\"\n", "transmon.mw_12_clock => no longer settable, always \"basic.12\"\n", "transmon.ro_clock => no longer settable, always \"basic.ro\"\n", "transmon.freq_01 => basic.clock_freqs.f01\n", "transmon.freq_12 => basic.clock_freqs.f12\n", "transmon.ro_freq => basic.clock_freqs.readout\n", "transmon.ro_pulse_amp => basic.measure.pulse_amp\n", "transmon.ro_pulse_duration => basic.measure.pulse_duration\n", "transmon.ro_pulse_type => basic.measure.pulse_type\n", "transmon.ro_pulse_delay => via:\tschedule.add(..., rel_time=...)\n", "transmon.ro_acq_channel => basic.measure.acq_channel\n", "transmon.ro_acq_delay => basic.measure.acq_delay\n", "transmon.ro_acq_integration_time => basic.measure.integration_time\n", "transmon.spec_pulse_duration => via:\tschedule.add(SpectroscopyOperation(\"basic\")), not implemented for BasicTransmonElement, see BasicElectronicNVElement.spectroscopy_operation\n", "transmon.spec_pulse_frequency => via:\tschedule.add(SpectroscopyOperation(\"basic\")), not implemented for BasicTransmonElement, see BasicElectronicNVElement.spectroscopy_operation\n", "transmon.spec_pulse_amp => via:\tschedule.add(SpectroscopyOperation(\"basic\")), not implemented for BasicTransmonElement, see BasicElectronicNVElement.spectroscopy_operation\n", "transmon.spec_pulse_clock => via:\tschedule.add(SpectroscopyOperation(\"basic\")), not implemented for BasicTransmonElement, see BasicElectronicNVElement.spectroscopy_operation\n", "transmon.acquisition => via:\tschedule.add(Measure(\"basic\", acq_protocol=...))\n", "transmon.ro_acq_weight_type => basic.measure.acq_weight_type\n", "schedule.add(Measure(\"transmon\", acq_channel=...)) => basic.measure.acq_channel\n", "```\n", "\n", "Both classes will generate the same device configuration." ] }, { "cell_type": "code", "execution_count": 6, "id": "801d85f7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'clocks': {'basic.01': nan, 'basic.12': nan, 'basic.ro': nan},\n", " 'compilation_passes': [{'compilation_func': 'quantify_scheduler.backends.circuit_to_device.compile_circuit_to_device_with_config_validation',\n", " 'name': 'circuit_to_device'},\n", " {'compilation_func': 'quantify_scheduler.backends.circuit_to_device.set_pulse_and_acquisition_clock',\n", " 'name': 'set_pulse_and_acquisition_clock'},\n", " {'compilation_func': 'quantify_scheduler.pulse_compensation.process_compensation_pulses',\n", " 'name': 'process_compensation_pulses'},\n", " {'compilation_func': 'quantify_scheduler.compilation._determine_absolute_timing',\n", " 'name': 'determine_absolute_timing'}],\n", " 'edges': {},\n", " 'elements': {'basic': {'H': {'factory_func': 'quantify_scheduler.operations.composite_factories.hadamard_as_y90z',\n", " 'factory_kwargs': {'qubit': 'basic'},\n", " 'gate_info_factory_kwargs': None},\n", " 'Rxy': {'factory_func': 'quantify_scheduler.operations.pulse_factories.rxy_drag_pulse',\n", " 'factory_kwargs': {'amp180': nan,\n", " 'clock': 'basic.01',\n", " 'duration': 2e-08,\n", " 'motzoi': 0,\n", " 'port': 'basic:mw',\n", " 'reference_magnitude': None},\n", " 'gate_info_factory_kwargs': ['theta', 'phi']},\n", " 'Rz': {'factory_func': 'quantify_scheduler.operations.pulse_factories.phase_shift',\n", " 'factory_kwargs': {'clock': 'basic.01'},\n", " 'gate_info_factory_kwargs': ['theta']},\n", " 'measure': {'factory_func': 'quantify_scheduler.operations.measurement_factories.dispersive_measurement_transmon',\n", " 'factory_kwargs': {'acq_channel': 0,\n", " 'acq_delay': 0,\n", " 'acq_duration': 1e-06,\n", " 'acq_protocol_default': 'SSBIntegrationComplex',\n", " 'acq_rotation': 0,\n", " 'acq_threshold': 0,\n", " 'acq_weights_a': array([], dtype=float64),\n", " 'acq_weights_b': array([], dtype=float64),\n", " 'acq_weights_sampling_rate': None,\n", " 'clock': 'basic.ro',\n", " 'freq': None,\n", " 'num_points': None,\n", " 'port': 'basic:res',\n", " 'pulse_amp': 0.25,\n", " 'pulse_duration': 3e-07,\n", " 'pulse_type': 'SquarePulse',\n", " 'reference_magnitude': None,\n", " 'reset_clock_phase': True},\n", " 'gate_info_factory_kwargs': ['acq_channel_override',\n", " 'acq_index',\n", " 'bin_mode',\n", " 'acq_protocol',\n", " 'feedback_trigger_label']},\n", " 'pulse_compensation': {'factory_func': None,\n", " 'factory_kwargs': {'clock': 'basic.01',\n", " 'max_compensation_amp': nan,\n", " 'port': 'basic:mw',\n", " 'sampling_rate': nan,\n", " 'time_grid': nan},\n", " 'gate_info_factory_kwargs': None},\n", " 'reset': {'factory_func': 'quantify_scheduler.operations.pulse_library.IdlePulse',\n", " 'factory_kwargs': {'duration': 0.0002},\n", " 'gate_info_factory_kwargs': None}}},\n", " 'scheduling_strategy': 'asap'}\n" ] } ], "source": [ "import pprint\n", "\n", "# device_config_transmon = transmon.generate_device_config().model_dump()\n", "# pprint.pprint(device_config_transmon)\n", "\n", "device_config_basic_transmon = basic.generate_device_config().model_dump()\n", "pprint.pprint(device_config_basic_transmon)" ] }, { "cell_type": "markdown", "id": "2e464a05", "metadata": {}, "source": [ "### Instruction-generated pulses (Qblox only)\n", "\n", "Instead of using the ``instruction_generated_pulses_enabled: True`` field in the port-clock configuration for generating long square and staircase pulses, you can now create long square, staircase and ramp waveforms (that would otherwise not fit in memory), by creating these operations with the following helper functions." ] }, { "cell_type": "code", "execution_count": 7, "id": "0d044c73", "metadata": {}, "outputs": [], "source": [ "from quantify_scheduler.backends.qblox.operations import (\n", " long_ramp_pulse,\n", " long_square_pulse,\n", " staircase_pulse,\n", ")\n", "\n", "ramp_pulse = long_ramp_pulse(amp=0.5, duration=1e-3, port=\"q0:mw\")\n", "square_pulse = long_square_pulse(amp=0.5, duration=1e-3, port=\"q0:mw\")\n", "staircase_pulse = staircase_pulse(\n", " start_amp=0.0, final_amp=1.0, num_steps=20, duration=1e-4, port=\"q0:mw\"\n", ")" ] }, { "cell_type": "markdown", "id": "0369692a", "metadata": {}, "source": [ "More complex long waveforms can now also be created, see section {ref}`Long waveform support `." ] } ], "metadata": { "file_format": "mystnb", "kernelspec": { "display_name": "python3", "name": "python3" }, "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.20" }, "source_map": [ 6, 223, 234, 281, 306, 332, 338, 349, 363, 402, 410, 416, 428 ] }, "nbformat": 4, "nbformat_minor": 5 }