qctrlopencontrols.dynamic_decoupling_sequences package

Submodules

qctrlopencontrols.dynamic_decoupling_sequences.driven_controls module

dynamic_decoupling_sequences.driven_controls

qctrlopencontrols.dynamic_decoupling_sequences.driven_controls.convert_dds_to_driven_control(dynamic_decoupling_sequence=None, maximum_rabi_rate=6.283185307179586, maximum_detuning_rate=6.283185307179586, **kwargs)

Creates a Driven Control based on the supplied DDS and other relevant information

Parameters:
  • dynamic_decoupling_sequence (qctrlopencontrols.DynamicDecouplingSequence) – The base DDS; Defaults to None
  • maximum_rabi_rate (float, optional) – Maximum Rabi Rate; Defaults to 1.0
  • maximum_detuning_rate (float, optional) – Maximum Detuning Rate; Defaults to None
  • kwargs (dict, optional) – options to make the corresponding filter type. I.e. the options for primitive is described in doc for the PrimitivePulse class.
Returns:

The Driven Control that contains the segments corresponding to the Dynamic Decoupling Sequence operation

Return type:

DrivenControls

Raises:

ArgumentsValueError – Raised when an argument is invalid or a valid driven control cannot be created from the sequence parameters, maximum rabi rate and maximum detuning rate provided

Notes

Driven pulse is defined as a sequence of control segments. Each segment performs an operation (rotation around one or more axes). While the dynamic decoupling sequence operation contains ideal instant operations, maximum rabi (detuning) rate defines a minimum time required to perform a given rotation operation. Therefore, each operation in sequence is converted to a flat-topped control segment with a finite duration. Each offset is taken as the mid-point of the control segment and the width of the segment is determined by (rotation/max_rabi(detuning)_rate).

If the sequence contains operations at either of the extreme ends \(\tau_0=0\) and \(\tau_{n+1}=\tau\) or finishing after the sequence duration \(t>\tau\). In these cases, the segments on either of the extreme ends are shifted appropriately so that their start/end time falls entirely within the duration of the sequence.

Moreover, a check is made to make sure the resulting control segments are non-overlapping.

If appropriate control segments cannot be created, the conversion process raises an ArgumentsValueError.

qctrlopencontrols.dynamic_decoupling_sequences.dynamic_decoupling_sequence module

dynamic_decoupling_sequences.dynamic_decoupling_sequence

class qctrlopencontrols.dynamic_decoupling_sequences.dynamic_decoupling_sequence.DynamicDecouplingSequence(duration=1.0, offsets=None, rabi_rotations=None, azimuthal_angles=None, detuning_rotations=None, name=None)

Bases: object

Create a dynamic decoupling sequence. Can be made of perfect operations, or realistic pulses.

Parameters:
  • duration (float) – Defaults to 1. The total time in seconds for the sequence.
  • offsets (list) – Defaults to None. The times offsets in s for the center of pulses. If None, defaults to one operation at halfway [0.5].
  • rabi_rotations (list) – Default to None. The rabi rotations at each time offset. If None, defaults to np.pi at each time offset.
  • azimuthal_angles (list) – Default to None. The azimuthal angles at each time offset. If None, defaults to 0 at each time offset.
  • detuning_rotations (list) – Default to None. The detuning rotations at each time offset. If None, defaults to 0 at each time offset.
  • name (str) – Name of the sequence; Defaults to None
Raises:

qctrlopencontrols.exceptions.ArgumentsValueError – is raised if one of the inputs is invalid.

export()

Returns a dictionary formatted for plotting using the qctrl-visualizer package.

Returns:Dictionary with plot data that can be used by the plot_sequences method of the qctrl-visualizer package. It has keywords ‘Rabi’ and ‘Detuning’.
Return type:dict
export_to_file(filename=None, file_format='Q-CTRL expanded', file_type='CSV', coordinates='cylindrical', maximum_rabi_rate=6.283185307179586, maximum_detuning_rate=6.283185307179586)

Prepares and saves the dynamic decoupling sequence in a file.

Parameters:
  • filename (str, optional) – Name and path of the file to save the control into. Defaults to None
  • file_format (str) – Specified file format for saving the control. Defaults to ‘Q-CTRL expanded’; Currently it does not support any other format. For detail of the Q-CTRL Expanded Format consult Q-CTRL Control Data Format <https://docs.q-ctrl.com/output-data-formats#q-ctrl-hardware> _.
  • file_type (str, optional) – One of ‘CSV’ or ‘JSON’; defaults to ‘CSV’.
  • coordinates (str, optional) – Indicates the co-ordinate system requested. Must be one of ‘Cylindrical’, ‘Cartesian’; defaults to ‘Cylindrical’
  • maximum_rabi_rate (float, optional) – Maximum Rabi Rate; Defaults to \(2\pi\)
  • maximum_detuning_rate (float, optional) – Maximum Detuning Rate; Defaults to \(2\pi\)

References

Q-CTRL Control Data Format <https://docs.q-ctrl.com/output-data-formats#q-ctrl-hardware> _.

Raises:ArgumentsValueError – Raised if some of the parameters are invalid.

Notes

The sequence is converted to a driven control using the maximum rabi and detuning rate. The driven control is then exported. This is done to facilitate a coherent integration with Q-CTRL BLACK OPAL’s 1-Qubit workspace.

number_of_offsets

Returns the number of offsets

Returns:The number of offsets in the dynamic decoupling sequence
Return type:int

qctrlopencontrols.dynamic_decoupling_sequences.predefined module

dynamic_decoupling_sequences.predefined

qctrlopencontrols.dynamic_decoupling_sequences.predefined.new_predefined_dds(scheme='spin echo', **kwargs)

Create a new instance of ne of the predefined dynamic decoupling sequence

Parameters:
  • scheme (string) – The name of the sequence; Defaults to ‘Spin echo’ Available options are, - ‘Ramsey’ - ‘Spin echo’, - ‘Carr-Purcell’, - ‘Carr-Purcell-Meiboom-Gill’, - ‘Uhrig single-axis’ - ‘Periodic single-axis’ - ‘Walsh single-axis’ - ‘Quadratic’ - ‘X concatenated’ - ‘XY concatenated’
  • kwargs (dict, optional) – Additional keyword argument to create the sequence
Returns:

Returns a sequence corresponding to the name

Return type:

qctrlopencontrols.dynamic_decoupling_sequences.DynamicDecouplingSequence

Raises:

ArgumentsValueError – Raised when an argument is invalid.

Module contents

dynamic_decoupling_sequences

qctrlopencontrols.dynamic_decoupling_sequences.CARR_PURCELL = 'Carr-Purcell'

Carr-Purcell (CP) dynamical decoupling sequence

qctrlopencontrols.dynamic_decoupling_sequences.CARR_PURCELL_MEIBOOM_GILL = 'Carr-Purcell-Meiboom-Gill'

Carr-Purcell-Meiboom-Gill (CPMG) dynamical decoupling sequence

qctrlopencontrols.dynamic_decoupling_sequences.MATPLOTLIB = 'matplotlib'

Matplotlib format of data for plotting

qctrlopencontrols.dynamic_decoupling_sequences.PERIODIC_SINGLE_AXIS = 'periodic single-axis'

Periodical dynamical decoupling sequence

qctrlopencontrols.dynamic_decoupling_sequences.QUADRATIC = 'quadratic'

Quadratic dynamical decoupling sequence

qctrlopencontrols.dynamic_decoupling_sequences.RAMSEY = 'Ramsey'

Ramsey sequence

qctrlopencontrols.dynamic_decoupling_sequences.SPIN_ECHO = 'spin echo'

Spin echo (SE) dynamical decoupling sequence

qctrlopencontrols.dynamic_decoupling_sequences.UHRIG_SINGLE_AXIS = 'Uhrig single-axis'

Uhrig (single-axis) dynamical decoupling sequence

qctrlopencontrols.dynamic_decoupling_sequences.UPPER_BOUND_OFFSETS = 10000

Maximum number of offsets allowed in a Dynamical Decoupling sequence.

qctrlopencontrols.dynamic_decoupling_sequences.WALSH_SINGLE_AXIS = 'Walsh single-axis'

Walsh dynamical decoupling sequence

qctrlopencontrols.dynamic_decoupling_sequences.XY_CONCATENATED = 'XY concatenated'

XY-Concatenated dynamical decoupling sequence

qctrlopencontrols.dynamic_decoupling_sequences.X_CONCATENATED = 'X concatenated'

X-Concatenated dynamical decoupling sequence