quantify_scheduler.backends.qblox.operation_handling.pulses

Classes for handling pulses.

Module Contents

Classes

PulseStrategyPartial

Contains the logic shared between all the pulses.

GenericPulseStrategy

Default class for handling pulses. No assumptions are made with regards to the

StitchedSquarePulseStrategy

If this strategy is used, a (long) square pulse is generated by stitching shorter

StaircasePulseStrategy

If this strategy is used, a staircase is generated through offset instructions,

Attributes

logger

_StaircaseParameters

Used to keep track of all the parameters that are to be used for generating the

logger[source]
class PulseStrategyPartial(operation_info: quantify_scheduler.backends.types.qblox.OpInfo, io_mode: str)[source]

Bases: quantify_scheduler.backends.qblox.operation_handling.base.IOperationStrategy

Contains the logic shared between all the pulses.

Constructor.

Parameters
  • operation_info – The operation info that corresponds to this pulse.

  • io_mode – Either “real”, “imag” or complex depending on whether the signal affects only path0, path1 or both.

property operation_info: quantify_scheduler.backends.types.qblox.OpInfo[source]

Property for retrieving the operation info.

_check_amplitudes_set()[source]
class GenericPulseStrategy(operation_info: quantify_scheduler.backends.types.qblox.OpInfo, io_mode: str)[source]

Bases: PulseStrategyPartial

Default class for handling pulses. No assumptions are made with regards to the pulse shape and no optimizations are done.

Constructor for this strategy.

Parameters
  • operation_info – The operation info that corresponds to this pulse.

  • io_mode – Either “real”, “imag” or “complex” depending on whether the signal affects only path0, path1 or both, respectively.

generate_data(wf_dict: Dict[str, Any])[source]

Generates the data and adds them to the wf_dict (if not already present).

In complex mode, real-valued data is produced on sequencer path0 (\(I_\text{IF}\)) and imaginary data on sequencer path1 (\(Q_\text{IF}\)) after the NCO mixing.

\[\begin{split}\underbrace{\begin{bmatrix} \cos\omega t & -\sin\omega t \\ \sin\omega t & \phantom{-}\cos\omega t \end{bmatrix}}_\text{NCO} \begin{bmatrix} I \\ Q \end{bmatrix} = \begin{matrix} \overbrace{ I \cdot \cos\omega t - Q \cdot\sin\omega t}^{\small \textbf{real} \Rightarrow \text{path0}} \\ \underbrace{I \cdot \sin\omega t + Q \cdot\cos\omega t}_{\small \textbf{imag} \Rightarrow \text{path1}} \end{matrix} = \begin{bmatrix} I_\text{IF} \\ Q_\text{IF} \end{bmatrix}\end{split}\]

In real mode, \(I_\text{IF}\) can be produced on either path0 (io_mode == "real") or path1 (io_mode == "imag").

For io_mode == imag, the real-valued input (\(I\)) on path0 is swapped with imaginary input (\(Q\)) on path1. We multiply \(Q\) by -1 (via amp_imag) to undo the 90-degree phase shift resulting from swapping the NCO input paths.

\[\begin{split}\underbrace{\begin{bmatrix} \cos\omega t & -\sin\omega t \\ \sin\omega t & \phantom{-}\cos\omega t \end{bmatrix}}_\text{NCO} \begin{bmatrix} -Q \\ I \end{bmatrix} = \begin{matrix} \\ \underbrace{-Q \cdot \sin\omega t + I \cdot\cos\omega t}_{\small \textbf{real} \Rightarrow \text{path1}} \end{matrix}= \begin{bmatrix} - \\ I_\text{IF} \end{bmatrix}\end{split}\]
Parameters

wf_dict – The dictionary to add the waveform to. N.B. the dictionary is modified in function.

Raises

ValueError – Data is complex (has an imaginary component), but the io_mode is not set to “complex”.

insert_qasm(qasm_program: quantify_scheduler.backends.qblox.qasm_program.QASMProgram)[source]

Add the assembly instructions for the Q1 sequence processor that corresponds to this pulse.

Parameters

qasm_program – The QASMProgram to add the assembly instructions to.

class StitchedSquarePulseStrategy(operation_info: quantify_scheduler.backends.types.qblox.OpInfo, io_mode: str)[source]

Bases: PulseStrategyPartial

If this strategy is used, a (long) square pulse is generated by stitching shorter square pulses together.

Parameters
  • operation_info – The operation info that corresponds to this pulse.

  • io_mode – Either “real”, “imag” or complex depending on whether the signal affects only path0, path1 or both.

generate_data(wf_dict: Dict[str, Any])[source]

Produces the waveform data for the stitched square pulse. This will be of a fixed duration.

If the output mode is set to “complex”, path1 will play all zeros. Otherwise both paths will play ones, but the amplitude will be set to 0 on one of them.

Parameters

wf_dict – The dictionary to add the waveform to. N.B. the dictionary is modified in function.

insert_qasm(qasm_program: quantify_scheduler.backends.qblox.qasm_program.QASMProgram)[source]

Add the assembly instructions for the Q1 sequence processor that corresponds to this pulse. If the pulse is at least twice the stitching duration, a loop will be used.

Parameters

qasm_program – The QASMProgram to add the assembly instructions to.

_StaircaseParameters[source]

Used to keep track of all the parameters that are to be used for generating the assembly for the staircase.

class StaircasePulseStrategy(operation_info: quantify_scheduler.backends.types.qblox.OpInfo, io_mode: str)[source]

Bases: PulseStrategyPartial

If this strategy is used, a staircase is generated through offset instructions, without using waveform memory.

Constructor.

Parameters
  • operation_info – The operation info that corresponds to this pulse.

  • io_mode – Either “real”, “imag” or complex depending on whether the signal affects only path0, path1 or both.

generate_data(wf_dict: Dict[str, Any])[source]

Returns None as no waveforms are generated in this strategy.

insert_qasm(qasm_program: quantify_scheduler.backends.qblox.qasm_program.QASMProgram)[source]

Add the assembly instructions for the Q1 sequence processor that corresponds to this pulse.

Steps are generated using offset instructions. Using io_mode “real” or “complex” will cause the signal to appear on path0, “imag” on path1.

Parameters

qasm_program – The QASMProgram to add the assembly instructions to.

_generate_staircase(qasm_program: quantify_scheduler.backends.qblox.qasm_program.QASMProgram, staircase_params: _StaircaseParameters)[source]

Generates the actual staircase.

_generate_step(qasm_program: quantify_scheduler.backends.qblox.qasm_program.QASMProgram, offs_reg: str, offs_reg_zero: str, amp_step_immediate: int)[source]

Generates the inner part of the loop.