- Infrastructure - Use new qcodes syntax for adding parameters. (!758)
- Documentation - Fix missing images in Jupyter cell outputs in documentation deployed using Gitlab Pages. (!772, #404, counterpart of quantify-core!480)
- Documentation - Explain in Qblox Cluster docs the possibility of using `"{complex,real}_output_<n>"` hardware config keys for both playback and acquisitions. (!763)
- Documentation - Add a short explanation and examples of the `StitchedPulse` and `StitchedPulseBuilder` to the Schedules and Pulses tutorial. (!766)
- Infrastructure - Add `jinja2` as dependency to quantify-scheduler (needed for `pandas.DataFrame`) (!777)
- Documentation - Split source and build folders to simplify using [`sphinx-autobuild`](https://github.com/executablebooks/sphinx-autobuild) for its editing. (!774)
Note that we used the {class}`~quantify_scheduler.resources.BasebandClockResource` as a clock, which is always at 0 Hz and was added automatically to the schedule for convenience. We can see that the pulses start every 500 ns and are 200 ns long.
(sec-long-waveforms-via-stitchedpulse)=
## Long waveforms via StitchedPulse
```{note}
This feature is only available for Qblox hardware. More information about this feature can also be found in section {ref}`Long waveform support <sec-qblox-cluster-long-waveform-support-new>`.
```
The sequencers in Qblox modules have a waveform sample limit of {class}`~quantify_scheduler.backends.qblox.constants.MAX_SAMPLE_SIZE_WAVEFORMS`. Trying to play many (long) waveforms might cause you to exceed this limit. For certain waveforms, however, it is possible to use the available memory more efficiently. This section explains how to do this with the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse`.
For convenience, `quantify-scheduler` provides helper functions for the `square` ({func}`~quantify_scheduler.operations.pulse_factories.long_square_pulse`), `ramp` ({func}`~quantify_scheduler.operations.pulse_factories.long_ramp_pulse`) and `staircase` ({func}`~quantify_scheduler.operations.pulse_factories.staircase_pulse`) waveforms for when they become too long to fit into the waveform memory of the hardware.
```{code-cell} ipython3
from quantify_scheduler.operations.pulse_factories import (
long_ramp_pulse,
long_square_pulse,
staircase_pulse,
)
sched = Schedule("Basic long pulses")
sched.add(
long_square_pulse(
amp=0.5,
duration=10e-6,
port="q0:fl",
clock=BasebandClockResource.IDENTITY,
),
)
sched.add(
long_ramp_pulse(
amp=1.0,
duration=10e-6,
port="q0:fl",
offset=-0.5,
clock=BasebandClockResource.IDENTITY,
),
rel_time=5e-7,
)
sched.add(
staircase_pulse(
start_amp=-0.5,
final_amp=0.5,
num_steps=20,
duration=10e-6,
port="q0:fl",
clock=BasebandClockResource.IDENTITY,
),
rel_time=5e-7,
)
compilation.determine_absolute_timing(sched)
sched.plot_pulse_diagram(plot_backend="plotly")
```
Using these factory functions, the resulting square and staircase pulses use no waveform memory at all. The ramp pulse uses waveform memory for a short section of the waveform, which is repeated multiple times.
For more complicated shapes, the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulseBuilder` makes it possible to stitch together pulse shapes yourself. In the following example, we create a long soft square pulse where the constant-voltage middle part is created with a voltage offset instruction, using no waveform memory.
```{code-cell} ipython3
import numpy as np
from quantify_scheduler.operations.pulse_library import NumericalPulse
from quantify_scheduler.operations.stitched_pulse import StitchedPulseBuilder
Alternatively, the building methods of the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulseBuilder` can be conveniently **chained** to create a {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse` via more elegant syntax:
It is possible to play waveforms that are too long to fit in the waveform memory of Qblox modules. For a few standard waveforms, the square pulse, ramp pulse and staircase pulse, the following helper functions create operations that can readily be added to schedules:
The sequencers in Qblox modules have a sample limit of {class}`~quantify_scheduler.backends.qblox.constants.MAX_SAMPLE_SIZE_WAVEFORMS` per sequencer. For certain waveforms, however, it is possible to use the sequencers more efficiently and using less waveform memory, allowing for longer waveforms. This section explains how to do this, utilizing the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse`. Also see {ref}`sec-long-waveforms-via-stitchedpulse` of {ref}`sec-tutorial-sched-pulse`.
- For a few standard waveforms, the square pulse, ramp pulse and staircase pulse, the following helper functions create a {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse` that can readily be added to schedules:
More complex waveforms can be created from the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulseBuilder`. This class allows you to construct complex waveforms by stitching together available pulses, and adding voltage offsets in between. Voltage offsets can be specified with or without a duration. In the latter case, the offset will hold until the last operation in the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse` ends. For example,
- More complex waveforms can be created from the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulseBuilder`. This class allows you to construct complex waveforms by stitching together available pulses, and adding voltage offsets in between. Voltage offsets can be specified with or without a duration. In the latter case, the offset will hold until the last operation in the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse` ends. For example:
Pulses and offsets are appended to the end of the last added operation by default. By specifying the `append=False` keyword argument in the `add_pulse` and `add_voltage_offset` methods, in combination with the `rel_time` argument, you can insert an operation at the specified time relative to the start of the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse`. The example below uses this to generate a series of square pulses of various durations and amplitudes.
- Pulses and offsets are appended to the end of the last added operation by default. By specifying the `append=False` keyword argument in the `add_pulse` and `add_voltage_offset` methods, in combination with the `rel_time` argument, you can insert an operation at the specified time relative to the start of the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse`. The example below uses this to generate a series of square pulses of various durations and amplitudes:
@@ -759,7 +759,9 @@ The `"filter_func"` is a python function that we apply with `"kwargs"` arguments
(sec-qblox-cluster-long-waveform-support)=
## Long waveform support
It is possible to play waveforms that are too long to fit in the waveform memory of Qblox modules. For a few standard waveforms, the square pulse, ramp pulse and staircase pulse, the following helper functions create operations that can readily be added to schedules:
The sequencers in Qblox modules have a sample limit of {class}`~quantify_scheduler.backends.qblox.constants.MAX_SAMPLE_SIZE_WAVEFORMS` per sequencer. For certain waveforms, however, it is possible to use the sequencers more efficiently and using less waveform memory, allowing for longer waveforms. This section explains how to do this, utilizing the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse`. Also see {ref}`sec-long-waveforms-via-stitchedpulse` of {ref}`sec-tutorial-sched-pulse`.
- For a few standard waveforms, the square pulse, ramp pulse and staircase pulse, the following helper functions create a {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse` that can readily be added to schedules:
More complex waveforms can be created from the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulseBuilder`. This class allows you to construct complex waveforms by stitching together available pulses, and adding voltage offsets in between. Voltage offsets can be specified with or without a duration. In the latter case, the offset will hold until the last operation in the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse` ends. For example,
- More complex waveforms can be created from the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulseBuilder`. This class allows you to construct complex waveforms by stitching together available pulses, and adding voltage offsets in between. Voltage offsets can be specified with or without a duration. In the latter case, the offset will hold until the last operation in the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse` ends. For example:
```{code-cell} ipython3
---
@@ -810,7 +812,7 @@ repeat_pulse_with_offset = (
)
```
Pulses and offsets are appended to the end of the last added operation by default. By specifying the `append=False` keyword argument in the `add_pulse` and `add_voltage_offset` methods, in combination with the `rel_time` argument, you can insert an operation at the specified time relative to the start of the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse`. The example below uses this to generate a series of square pulses of various durations and amplitudes.
- Pulses and offsets are appended to the end of the last added operation by default. By specifying the `append=False` keyword argument in the `add_pulse` and `add_voltage_offset` methods, in combination with the `rel_time` argument, you can insert an operation at the specified time relative to the start of the {class}`~quantify_scheduler.operations.stitched_pulse.StitchedPulse`. The example below uses this to generate a series of square pulses of various durations and amplitudes: