quantify.scheduler

class quantify.scheduler.Operation(name: str, data: Optional[dict] = None)[source]

A JSON compatible data structure that contains information on how to represent the operation on the Gate, Pulse and/or Logical level. It also contains information on the Resource s used.

An operation always has the following attributes

  • duration (float) : duration of the operation in seconds (can be 0)

  • hash (str) : an auto generated unique identifier.

  • name (str) : a readable identifier, does not have to be unique

An Operation can contain information on several levels of abstraction. This information is used when different representations. Note that when initializing an operation not all of this information needs to be available as operations are typically modified during the compilation steps.

JSON schema for a quantify sequencer operation.

type

object

properties

  • name

type

string

  • gate_info

type

object

properties

  • unitary

A unitary matrix describing the operation.

  • qubits

A list of strings indicating the qubits the gate acts on. Valid qubits are strings that appear in the device_config.json file.

type

array

  • tex

latex snippet for plotting

type

string

  • plot_func

reference to a function for plotting this operation. If not specified, defaults to using quantify.scheduler.visualization.circuit_diagram.gate_box().

type

string / null

additionalProperties

True

  • pulse_info

A list containing the pulses that are part of the operation

type

array

items

Info to generate an individual pulse.

type

object

properties

  • port

A string specifying the port used by the pulse.

type

string / null

  • clock

A string specifying the clock used to modulate the pulse.

type

string

  • wf_func

reference to a function to generate the pulse of this operation.

type

string / null

  • t0

Starting time of the pulse with respect to the start of the operation in seconds.

type

number

  • duration

The duration of the pulse in seconds.

type

number

  • logic_info

Not Implemented.

additionalProperties

False

Note

Two different Operations containing the same information generate the same hash and are considered identical.

add_gate_info(gate_operation)[source]

Updates self.data[‘gate_info’] with contents of gate_operation.

Parameters

gate_operation (Operation) – an operation containing gate_info.

add_pulse(pulse_operation)[source]

Adds pulse_info of pulse_operation to self.

Parameters

pulse_operation (Operation) – an operation containing pulse_info.

property duration

Determine the duration of the operation based on the pulses described in pulse_info.

If the operation contains no pulse info, it is assumed to be ideal and have zero duration.

property hash

A hash based on the contents of the Operation.

mark_as_acquisition()[source]

Marks all pulses within an operation as acquisition.

For a typical measurement operation, this is applied to the acquisition pulse (operation) before it is added to the main measurement operation.

property valid_gate

An operation is a valid gate if it contains information on how to represent the operation on the gate level.

property valid_pulse

An operation is a valid pulse if it contains information on how to represent the operation on the pulse level.

class quantify.scheduler.Resource(dict=None, /, **kwargs)[source]

A resource corresponds to a physical resource such as a port or a clock.

JSON schema for a quantify resource.

type

object

properties

  • name

Name of the resource.

type

string

  • type

Type of the resource, this property can be used by compilation steps.

type

string

additionalProperties

True

class quantify.scheduler.Schedule(name: str, data: Optional[dict] = None)[source]

A collection of Operation objects and timing contraints that define relations between the operations.

The Schedule data structure is based on a dictionary. This dictionary contains:

operation_dict : a hash table containing the unique Operation s added to the schedule. timing_constraints : a list of all timing constraints added between operations.

JSON schema for a quantify schedule.

type

object

properties

  • name

Name of the schedule.

type

string

  • timing_constraints

A list containing timing constraints.

type

array

  • operation_dict

A dictionary of operations. Keys correspond to the hash attribute of operations.

type

object

  • resource_dict

A dictionary of resources.

type

object

additionalProperties

False

add(operation, rel_time: float = 0, ref_op: Optional[str] = None, ref_pt: str = 'end', ref_pt_new: str = 'start', label: Optional[str] = None)str[source]

Add an Operation to the schedule and specify timing constraints.

Parameters
  • operation (Operation) – The operation to add to the schedule

  • rel_time (float) – relative time between the the reference operation and added operation.

  • ref_op (str) – specifies the reference operation.

  • ref_pt (str) – reference point in reference operation must be one of (‘start’, ‘center’, ‘end’).

  • ref_pt_new (str) – reference point in added operation must be one of (‘start’, ‘center’, ‘end’).

  • label (str) – a label that can be used as an identifier when adding more operations.

Returns

returns the (unique) label of the last added operation.

Return type

str

add_resource(resource)[source]

Add a resource such as a channel or qubit to the schedule.

property operations

A dictionary of all unique operations used in the schedule. This specifies information on what operation to apply where.

The keys correspond to the hash() and values are instances of Operation.

property resources

A dictionary containing resources. Keys are names (str), values are instances of Resource .

property timing_constraints

A list of dictionaries describing timing constraints between operations.

Each item in the list is a dictionary with the following keys:

[label, rel_time, ref_op, ref_pt_new, ref_pt, operation_hash]

The label is used as a unique identifier that can be used as a reference for other operations the operation_hash refers to the hash of a unique operation in operations().

types

class quantify.scheduler.types.Operation(name: str, data: Optional[dict] = None)[source]

A JSON compatible data structure that contains information on how to represent the operation on the Gate, Pulse and/or Logical level. It also contains information on the Resource s used.

An operation always has the following attributes

  • duration (float) : duration of the operation in seconds (can be 0)

  • hash (str) : an auto generated unique identifier.

  • name (str) : a readable identifier, does not have to be unique

An Operation can contain information on several levels of abstraction. This information is used when different representations. Note that when initializing an operation not all of this information needs to be available as operations are typically modified during the compilation steps.

JSON schema for a quantify sequencer operation.

type

object

properties

  • name

type

string

  • gate_info

type

object

properties

  • unitary

A unitary matrix describing the operation.

  • qubits

A list of strings indicating the qubits the gate acts on. Valid qubits are strings that appear in the device_config.json file.

type

array

  • tex

latex snippet for plotting

type

string

  • plot_func

reference to a function for plotting this operation. If not specified, defaults to using quantify.scheduler.visualization.circuit_diagram.gate_box().

type

string / null

additionalProperties

True

  • pulse_info

A list containing the pulses that are part of the operation

type

array

items

Info to generate an individual pulse.

type

object

properties

  • port

A string specifying the port used by the pulse.

type

string / null

  • clock

A string specifying the clock used to modulate the pulse.

type

string

  • wf_func

reference to a function to generate the pulse of this operation.

type

string / null

  • t0

Starting time of the pulse with respect to the start of the operation in seconds.

type

number

  • duration

The duration of the pulse in seconds.

type

number

  • logic_info

Not Implemented.

additionalProperties

False

Note

Two different Operations containing the same information generate the same hash and are considered identical.

add_gate_info(gate_operation)[source]

Updates self.data[‘gate_info’] with contents of gate_operation.

Parameters

gate_operation (Operation) – an operation containing gate_info.

add_pulse(pulse_operation)[source]

Adds pulse_info of pulse_operation to self.

Parameters

pulse_operation (Operation) – an operation containing pulse_info.

property duration

Determine the duration of the operation based on the pulses described in pulse_info.

If the operation contains no pulse info, it is assumed to be ideal and have zero duration.

property hash

A hash based on the contents of the Operation.

mark_as_acquisition()[source]

Marks all pulses within an operation as acquisition.

For a typical measurement operation, this is applied to the acquisition pulse (operation) before it is added to the main measurement operation.

property valid_gate

An operation is a valid gate if it contains information on how to represent the operation on the gate level.

property valid_pulse

An operation is a valid pulse if it contains information on how to represent the operation on the pulse level.

class quantify.scheduler.types.Schedule(name: str, data: Optional[dict] = None)[source]

A collection of Operation objects and timing contraints that define relations between the operations.

The Schedule data structure is based on a dictionary. This dictionary contains:

operation_dict : a hash table containing the unique Operation s added to the schedule. timing_constraints : a list of all timing constraints added between operations.

JSON schema for a quantify schedule.

type

object

properties

  • name

Name of the schedule.

type

string

  • timing_constraints

A list containing timing constraints.

type

array

  • operation_dict

A dictionary of operations. Keys correspond to the hash attribute of operations.

type

object

  • resource_dict

A dictionary of resources.

type

object

additionalProperties

False

add(operation, rel_time: float = 0, ref_op: Optional[str] = None, ref_pt: str = 'end', ref_pt_new: str = 'start', label: Optional[str] = None)str[source]

Add an Operation to the schedule and specify timing constraints.

Parameters
  • operation (Operation) – The operation to add to the schedule

  • rel_time (float) – relative time between the the reference operation and added operation.

  • ref_op (str) – specifies the reference operation.

  • ref_pt (str) – reference point in reference operation must be one of (‘start’, ‘center’, ‘end’).

  • ref_pt_new (str) – reference point in added operation must be one of (‘start’, ‘center’, ‘end’).

  • label (str) – a label that can be used as an identifier when adding more operations.

Returns

returns the (unique) label of the last added operation.

Return type

str

add_resource(resource)[source]

Add a resource such as a channel or qubit to the schedule.

property operations

A dictionary of all unique operations used in the schedule. This specifies information on what operation to apply where.

The keys correspond to the hash() and values are instances of Operation.

property resources

A dictionary containing resources. Keys are names (str), values are instances of Resource .

property timing_constraints

A list of dictionaries describing timing constraints between operations.

Each item in the list is a dictionary with the following keys:

[label, rel_time, ref_op, ref_pt_new, ref_pt, operation_hash]

The label is used as a unique identifier that can be used as a reference for other operations the operation_hash refers to the hash of a unique operation in operations().

gate_library

class quantify.scheduler.gate_library.CNOT(qC: str, qT: str)[source]

Conditional-NOT gate, a common entangling gate.

Performs an X gate on the target qubit qT conditional on the state of the control qubit qC.

This operation can be represented by the following unitary:

\[\begin{split}\mathrm{CNOT} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \ \end{bmatrix}\end{split}\]
class quantify.scheduler.gate_library.CZ(qC: str, qT: str)[source]

Conditional-phase gate, a common entangling gate.

Performs a Z gate on the target qubit qT conditional on the state of the control qubit qC.

This operation can be represented by the following unitary:

\[\begin{split}\mathrm{CZ} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \ \end{bmatrix}\end{split}\]
class quantify.scheduler.gate_library.Measure(*qubits)[source]

A projective measurement in the Z-basis.

Note

strictly speaking this is not a gate as it can not be described by a unitary.

class quantify.scheduler.gate_library.Reset(*qubits)[source]

Reset a qubit to the \(|0\rangle\) state.

Note

strictly speaking this is not a gate as it can not be described by a unitary.

class quantify.scheduler.gate_library.Rxy(theta: float, phi: float, qubit: str)[source]

A single qubit rotation around an axis in the equator of the Bloch sphere.

This operation can be represented by the following unitary:

\[\begin{split}\mathsf {R}_{xy} \left(\theta, \varphi\right) = \begin{bmatrix} \textrm {cos}(\theta /2) & -ie^{-i\varphi }\textrm {sin}(\theta /2) \\ -ie^{i\varphi }\textrm {sin}(\theta /2) & \textrm {cos}(\theta /2) \end{bmatrix}\end{split}\]
class quantify.scheduler.gate_library.X(qubit)[source]

A single qubit rotation of 180 degrees around the X-axis.

This operation can be represented by the following unitary:

\[\begin{split}X = \sigma_x = \begin{bmatrix} 0 & 1 \\ 1 & 0 \ \end{bmatrix}\end{split}\]
class quantify.scheduler.gate_library.X90(qubit)[source]

A single qubit rotation of 90 degrees around the X-axis.

class quantify.scheduler.gate_library.Y(qubit)[source]

A single qubit rotation of 180 degrees around the Y-axis.

\[\begin{split}\mathsf Y = \sigma_y = \begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix}\end{split}\]
class quantify.scheduler.gate_library.Y90(qubit)[source]

A single qubit rotation of 90 degrees around the Y-axis.

pulse_library

class quantify.scheduler.pulse_library.DRAGPulse(G_amp: float, D_amp: float, phase: float, clock: str, duration: float, port: str, t0: float = 0)[source]

DRAG pulse inteded for single qubit gates in transmon based systems.

A DRAG pulse is a gaussian pulse with a derivative component added to the out-of-phase channel to reduce unwanted excitations of the \(|1\rangle - |2\rangle\) transition.

The waveform is generated using waveforms.drag() .

References

  1. Gambetta, J. M., Motzoi, F., Merkel, S. T. & Wilhelm, F. K. Analytic control methods for high-fidelity unitary operations in a weakly nonlinear oscillator. Phys. Rev. A 83, 012308 (2011).

  1. F. Motzoi, J. M. Gambetta, P. Rebentrost, and F. K. Wilhelm Phys. Rev. Lett. 103, 110501 (2009).

class quantify.scheduler.pulse_library.IdlePulse(duration)[source]
class quantify.scheduler.pulse_library.RampPulse(amp: float, duration: float, port: str, clock: str, t0: float = 0)[source]
class quantify.scheduler.pulse_library.SoftSquarePulse(amp: float, duration: float, port: str, clock: str, t0: float = 0)[source]

Place holder pulse for mocking the CZ pulse until proper implementation. Replicates parameters.

class quantify.scheduler.pulse_library.SquarePulse(amp: float, duration: float, port: str, clock: str, phase: float = 0, t0: float = 0)[source]

resources

This module should be merged into types

class quantify.scheduler.resources.BasebandClockResource(name: str)[source]

Global identity for a virtual baseband clock

class quantify.scheduler.resources.ClockResource(name: str, freq: float, phase: float = 0)[source]
class quantify.scheduler.resources.Resource(dict=None, /, **kwargs)[source]

A resource corresponds to a physical resource such as a port or a clock.

JSON schema for a quantify resource.

type

object

properties

  • name

Name of the resource.

type

string

  • type

Type of the resource, this property can be used by compilation steps.

type

string

additionalProperties

True

waveforms

quantify.scheduler.waveforms.drag(t, G_amp: float, D_amp: float, duration: float, nr_sigma: int = 3, phase: float = 0, subtract_offset: str = 'average')[source]

Generates a DRAG pulse consisting of a Gaussian \(G\) as the I- and a Derivative \(D\) as the Q-component.

All inputs are in s and Hz. phases are in degree.

\(G(t) = G_{amp} e^{- \frac{(t-\mu)^2}{2\sigma^2}}\).

\(D(t) = -D_{amp} \frac{(t-\mu)}{\sigma} G(t)\).

Parameters
  • t (numpy.ndarray) – times at which to evaluate the function

  • G_amp (float) – Amplitude of the Gaussian envelope.

  • D_amp (float) – Amplitude of the derivative component, the DRAG-pulse parameter.

  • duration (float) – Duration of the pulse in seconds.

  • nr_sigma (int) – After how many sigma the Gaussian is cut off.

  • phase (float) – Phase of the pulse in degrees.

  • subtract_offset (str) –

    Instruction on how to subtract the offset in order to avoid jumps in the waveform due to the cut-off.

    • ’average’: subtract the average of the first and last point.

    • ’first’: subtract the value of the waveform at the first sample.

    • ’last’: subtract the value of the waveform at the last sample.

    • ’none’, None: don’t subtract any offset.

Returns

complex waveform

Return type

numpy.ndarray

References

  1. Gambetta, J. M., Motzoi, F., Merkel, S. T. & Wilhelm, F. K. Analytic control methods for high-fidelity unitary operations in a weakly nonlinear oscillator. Phys. Rev. A 83, 012308 (2011).

  1. F. Motzoi, J. M. Gambetta, P. Rebentrost, and F. K. Wilhelm Phys. Rev. Lett. 103, 110501 (2009).

quantify.scheduler.waveforms.modulate_wave(t, wave, freq_mod)[source]

Apply single sideband (SSB) modulation to a waveform.

The frequency convention we adhere to is:

freq_base + freq_mod = freq_signal

Parameters
  • t (numpy.ndarray) – times at which to determine the modulation.

  • wave (numpy.ndarray) – complex waveform, real component corresponds to I, imag component to Q.

  • freq_mod (float) – modulation frequency in Hz.

Returns

mod_wave – modulated waveform.

Return type

numpy.ndarray

Note

Pulse modulation is generally not included when specifying waveform envelopes as there are many hardware backends include this capability.

quantify.scheduler.waveforms.rotate_wave(wave, phase: float)[source]

Rotate a wave in the complex plane.

Parameters
  • wave (numpy.ndarray) – complex waveform, real component corresponds to I, imag component to Q.

  • phase (float) – rotation angle in degrees

Returns

compilation

quantify.scheduler.compilation.add_pulse_information_transmon(schedule: Schedule, device_cfg: dict)[source]

Adds pulse information specified in the device config to the schedule.

Parameters
  • schedule (Schedule) – The schedule for which to add pulse information.

  • device_cfg (dict) – A dictionary specifying the required pulse information.

Returns

schedule – a new schedule object where the pulse information has been added.

Return type

Schedule

Supported operations

The following gate type operations are supported by this compilation step.

Configuration specification

JSON schema for a transmon based device configuration.

type

object

properties

  • backend

Specifies the function used for compiling from gate-level to pulse-level description. A valid specification is a period separated string e.g., ‘quantify.scheduler.compilation.add_pulse_information_transmon’.

type

string

  • qubits

A dictionary with qubit names (str) as keys e.g., ‘q0’. The items contain the informtation to compile gates on individual qubits to pulses acting on ports and clocks using the specified backend.

type

object

  • edges

A dictionary with pairs of qubit names separated by a dash (str) as keys e.g., ‘q0-q1’. The items contain the informtation to compile gates on pairs of qubits to pulses acting on ports and clocks using the specified backend.

type

object

additionalProperties

False

quantify.scheduler.compilation.determine_absolute_timing(schedule: Schedule, time_unit='physical')[source]

Determines the absolute timing of a schedule based on the timing constraints.

Parameters
  • schedule (Schedule) – The schedule for which to determine timings.

  • time_unit (str) – Must be (‘physical’, ‘ideal’) : whether to use physical units to determine the absolute time or ideal time. When time_unit == “physical” the duration attribute is used. When time_unit == “ideal” the duration attribute is ignored and treated as if it is 1.

Returns

schedule – a new schedule object where the absolute time for each operation has been determined.

Return type

Schedule

This function determines absolute timings for every operation in the timing_constraints. It does this by:

  1. iterating over all and elements in the timing_constraints.

  2. determining the absolute time of the reference operation.

  3. determining the of the start of the operation based on the rel_time and duration of operations.

quantify.scheduler.compilation.qcompile(schedule: Schedule, device_cfg: dict, hardware_mapping: dict = None, **kwargs)[source]

Compile and assemble a schedule into deployables.

Parameters
  • schedule (Schedule) – To be compiled

  • device_cfg (dict) – Device specific configuration, defines the compilation step from the gate-level to the pulse level description.

  • hardware_mapping (dict) – hardware mapping, defines the compilation step from the pulse-level to a hardware backend.

Returns

schedule – The prepared schedule if no backend is provided, otherwise whatever object returned by the backend

Return type

Schedule

Configuration specification

JSON schema for a transmon based device configuration.

type

object

properties

  • backend

Specifies the function used for compiling from gate-level to pulse-level description. A valid specification is a period separated string e.g., ‘quantify.scheduler.compilation.add_pulse_information_transmon’.

type

string

  • qubits

A dictionary with qubit names (str) as keys e.g., ‘q0’. The items contain the informtation to compile gates on individual qubits to pulses acting on ports and clocks using the specified backend.

type

object

  • edges

A dictionary with pairs of qubit names separated by a dash (str) as keys e.g., ‘q0-q1’. The items contain the informtation to compile gates on pairs of qubits to pulses acting on ports and clocks using the specified backend.

type

object

additionalProperties

False

Todo

Add a schema for the hardware mapping.

quantify.scheduler.compilation.validate_config(config: dict, scheme_fn: str)[source]

Validate a configuration using a schema.

Parameters
  • config (dict) – The configuration to validate

  • scheme_fn (str) – The name of a json schema in the quantify.scheduler.schemas folder.

Returns

True if valid

Return type

bool

frontends

quantify.scheduler.frontends.openQL_sequencer_frontend(filename: str)[source]

Reads an OpenQL cQASM file and converts

backends

pulsar_backend

class quantify.scheduler.backends.pulsar_backend.PulsarModulations(gain_I, gain_Q, offset, phase, phase_delta)
gain_I

Alias for field number 0

gain_Q

Alias for field number 1

offset

Alias for field number 2

phase

Alias for field number 3

phase_delta

Alias for field number 4

class quantify.scheduler.backends.pulsar_backend.Q1ASMBuilder[source]

Generates a q1asm program instruction by instruction. Handles splitting overflowing operation times.

get_str()[source]
Returns

The program

Return type

str

class quantify.scheduler.backends.pulsar_backend.QCM_sequencer(name: str, port: str, clock: str, nco_freq: float = 0, nco_phase: float = 0)[source]

A single sequencer unit contained in a Pulsar_QCM module.

For pulse-sequencing purposes, the Pulsar_QCM_sequencer can be considered a channel capabable of outputting complex valued signals (I, and Q).

property timing_tuples

A list of timing tuples.

class quantify.scheduler.backends.pulsar_backend.QRM_sequencer(name: str, port: str, clock: str, nco_freq: float = 0, nco_phase: float = 0)[source]
property timing_tuples

A list of timing tuples con

quantify.scheduler.backends.pulsar_backend.build_q1asm(timing_tuples: list, pulse_dict: dict, sequence_duration: int, acquisitions: set, iterations: int, pulsar_type: str)str[source]

Converts operations and waveforms to a q1asm program. This function verifies these hardware based constraints:

  • Each pulse must run for at least the INSTRUCTION_CLOCK_TIME

  • Each operation must have a timing separation of at least INSTRUCTION_CLOCK_TIME

Parameters
  • timing_tuples (list) – A sorted list of tuples matching timings to pulse_IDs.

  • pulse_dict (dict) – pulse_IDs to numerical waveforms with registered index in waveform memory.

  • sequence_duration (int) – maximum runtime of this sequence

  • acquisitions (set) – pulse_IDs which are acquisitions

  • iterations (int) – number of times to run this program

Returns

Return type

A q1asm program in a string.

quantify.scheduler.backends.pulsar_backend.build_waveform_dict(pulse_info: dict, acquisitions: set)dict[source]

Allocates numerical pulse representation to indices and formats for sequencer JSON.

Parameters
  • pulse_info (dict) – Pulse ID to array-like numerical representation

  • acquisitions (set) – Set of pulse_IDs which are acquisitions

Returns

Return type

Dictionary mapping pulses to numerical representation and memory index

quantify.scheduler.backends.pulsar_backend.configure_pulsars(config: dict, mapping: dict, hw_mapping_inverted: Optional[dict] = None)[source]

Configures multiple pulsar modules based on a configuration dictionary.

Parameters
  • config (dict) – Dictionary with resource_names as keys and filenames of sequencer config json files as values.

  • mapping (dict) – Hardware mapping dictionary

quantify.scheduler.backends.pulsar_backend.generate_sequencer_cfg(pulse_info, timing_tuples, sequence_duration: int, acquisitions: set, iterations: int, pulsar_type: str)[source]

Generate a JSON compatible dictionary for defining a sequencer configuration. Contains a list of waveforms and a program in a q1asm string.

Parameters
  • timing_tuples (list) – A sorted list of tuples matching timings to pulse_IDs.

  • pulse_info (dict) – pulse_IDs to numerical waveforms with registered index in waveform memory.

  • sequence_duration (int) – maximum runtime of this sequence

  • acquisitions (set) – pulse_IDs which are acquisitions

  • iterations (int) – number of times to run this program

Returns

Return type

Sequencer configuration

quantify.scheduler.backends.pulsar_backend.pulsar_assembler_backend(schedule, mapping: Optional[dict] = None, tuid=None, configure_hardware=False, debug=False, iterations=1)[source]

Create sequencer configuration files for multiple Qblox pulsar modules.

Sequencer configuration files contain assembly, a waveform dictionary and the parameters to be configured for every pulsar sequencer.

The sequencer configuration files are stored in the quantify datadir (see get_datadir())

Parameters
  • schedule (Schedule :) – The schedule to convert into assembly.

  • mapping (mapping :) – The mapping that describes how the Pulsars are connected to the ports.

  • tuid (TUID :) – a tuid of the experiment the schedule belongs to. If set to None, a new TUID will be generated to store the sequencer configuration files.

  • configure_hardware (bool) – if True will configure the hardware to run the specified schedule.

  • debug (bool) – if True will produce extra debug output

  • iterations (int) – number of times to perform this program

Returns

  • schedule (Schedule :) – The schedule

  • config_dict (dict) – of sequencer names as keys with json filenames as values

visualization

circuit_diagram

quantify.scheduler.visualization.pulse_scheme.box_text(ax: Axes, x0: float, y0: float, text: str = '', w: float = 1.1, h: float = 0.8, color: str = 'black', fillcolor: Optional[str] = None, textcolor: str = 'black', fontsize: Optional[int] = None)None[source]

Draws a box filled with text at the specified position.

quantify.scheduler.visualization.pulse_scheme.fluxPulse(ax: Axes, pos: float, y_offs: float = 0.0, width: float = 2.5, s: float = 0.1, amp: float = 1.5, label: Optional[str] = None, label_height: float = 1.7, color: str = 'C1', **plot_kws)float[source]

Draw a smooth flux pulse, where the rising and falling edges are given by Fermi-Dirac functions. s: smoothness of edge

quantify.scheduler.visualization.pulse_scheme.interval(ax: Axes, start: float, stop: float, y_offs: float = 0.0, height: float = 1.5, label: Optional[str] = None, label_height: Optional[str] = None, vlines: bool = True, color: str = 'k', arrowstyle: str = '<|-|>', **plot_kws)None[source]

Draw an arrow to indicate an interval.

quantify.scheduler.visualization.pulse_scheme.meter(ax: Axes, x0: float, y0: float, y_offs: float = 0.0, w: float = 1.1, h: float = 0.8, color: str = 'black', fillcolor: Optional[str] = None)None[source]

Draws a measurement meter on the specified position.

quantify.scheduler.visualization.pulse_scheme.mwPulse(ax: Axes, pos: float, y_offs: float = 0.0, width: float = 1.5, amp: float = 1, label: Optional[str] = None, phase=0, label_height: float = 1.3, color: str = 'C0', modulation: str = 'normal', **plot_kws)float[source]

Draw a microwave pulse: Gaussian envelope with modulation.

quantify.scheduler.visualization.pulse_scheme.new_pulse_fig(figsize: Optional[Tuple[int, int]] = None) → Tuple[Figure, Union[Axes, List[Axes]]][source]

Open a new figure and configure it to plot pulse schemes.

quantify.scheduler.visualization.pulse_scheme.new_pulse_subplot(fig: Figure, *args, **kwargs) → Axes[source]

Add a new subplot configured for plotting pulse schemes to a figure.

All *args and **kwargs are passed to fig.add_subplot.

quantify.scheduler.visualization.pulse_scheme.pulse_diagram_plotly(schedule: Schedule, port_list: Optional[List[str]] = None, fig_ch_height: float = 150, fig_width: float = 1000, modulation_if: float = 0, modulation: bool = True, sampling_rate: int = 1000000000.0) → Figure[source]

Produce a plotly visualization of the pulses used in the schedule.

Parameters
  • schedule (Schedule) – The schedule to render.

  • port_list (list) – A list of ports to show. if set to None will use the first 8 ports it encounters in the sequence.

  • fig_ch_height (float) – Height for each channel subplot in px.

  • fig_width (float) – Width for the figure in px.

  • modulation (bool) – Determines if modulation is included in the visualization.

  • modulation_if (bool) – Determines if intermediate frequency is used for the modulation in the visualization.

  • sampling_rate (float) – The time resolution used in the visualization.

Returns

the plot

Return type

plotly.graph_objects.Figure

quantify.scheduler.visualization.pulse_scheme.ramZPulse(ax: Axes, pos: float, y_offs: float = 0.0, width: float = 2.5, s: float = 0.1, amp: float = 1.5, sep: float = 1.5, color: str = 'C1')float[source]

Draw a Ram-Z flux pulse, i.e. only part of the pulse is shaded, to indicate cutting off the pulse at some time.