qctrlopencontrols.driven_controls package¶
Submodules¶
qctrlopencontrols.driven_controls.driven_control module¶
driven_controls.driven_controls¶
-
class
qctrlopencontrols.driven_controls.driven_control.DrivenControl(rabi_rates=None, azimuthal_angles=None, detunings=None, durations=None, name=None)¶ Bases:
objectCreates a driven control. A driven is a set of segments made up of amplitude vectors and corresponding durations.
Parameters: - rabi_rates (numpy.ndarray, optional) – 1-D array of size nx1 where n is number of segments; Each entry is the rabi rate for the segment. Defaults to None
- azimuthal_angles (numpy.ndarray, optional) – 1-D array of size nx1 where n is the number of segments; Each entry is the azimuthal angle for the segment; Defaults to None
- detunings (numpy.ndarray, optional) – 1-D array of size nx1 where n is the number of segments; Each entry is the detuning angle for the segment; Defaults to None
- durations (numpy.ndarray, optional) – 1-D array of size nx1 where n is the number of segments; Each entry is the duration of the segment (in seconds); Defaults to None
- name (string, optional) – An optional string to name the driven control. Defaults to None.
Raises: ArgumentsValueError– Raised when an argument is invalid.-
amplitude_x¶ Return the X-Amplitude
Returns: X-Amplitude of each segment Return type: numpy.ndarray
-
amplitude_y¶ Return the Y-Amplitude
Returns: Y-Amplitude of each segment Return type: numpy.ndarray
-
angles¶ Returns the angles
Returns: Angles as 1-D array of floats Return type: numpy.darray
-
directions¶ Returns the directions
Returns: Directions as 1-D array of floats Return type: numpy.ndarray
-
duration¶ Returns the total duration of the control
Returns: Total duration of the control Return type: float
-
export(coordinates='cylindrical', dimensionless_rabi_rate=True)¶ Returns a dictionary formatted for plotting using the qctrl-visualizer package.
Parameters: - dimensionless_rabi_rate (boolean) – If True, normalizes the Rabi rate so that its largest absolute value is 1.
- coordinates (string) – Indicates whether the Rabi frequency should be plotted in terms of its ‘cylindrical’ or ‘cartesian’ components.
Returns: Dictionary with plot data that can be used by the plot_controls method of the qctrl-visualizer package. It has keywords ‘Rabi rate’ and ‘Detuning’ for ‘cylindrical’ coordinates and ‘X amplitude’, ‘Y amplitude’, and ‘Detuning’ for ‘cartesian’ coordinates.
Return type: dict
Raises: ArgumentsValueError– Raised when an argument is invalid.
-
export_to_file(filename=None, file_format='Q-CTRL expanded', file_type='CSV', coordinates='cylindrical')¶ Prepares and saves the driven control 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’
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.
-
maximum_detuning¶ Returns the maximum detuning of the control
Returns: The maximum detuning of the control Return type: float
-
maximum_duration¶ Returns the maximum duration of all the control segments
Returns: The maximum duration of all the control segments Return type: float
-
maximum_rabi_rate¶ Returns the maximum rabi rate of the control
Returns: The maximum rabi rate of the control Return type: float
-
minimum_duration¶ Returns the minimum duration of all the control segments
Returns: The minimum duration of all the controls segments Return type: float
-
number_of_segments¶ Returns the number of segments
Returns: The number of segments in the driven control Return type: int
-
times¶ Returns the time of each segment within the duration of the control
Returns: Segment times as 1-D array of floats Return type: numpy.ndarray
qctrlopencontrols.driven_controls.predefined module¶
driven_controls.predefined¶
More information and publication references to all driven controls defined here can be found at https://docs.q-ctrl.com/control-library
-
qctrlopencontrols.driven_controls.predefined.new_predefined_driven_control(scheme='primitive', **kwargs)¶ Create a new driven control
Parameters: - scheme (string, optional) – Defaults to None. The name of the driven control type, supported options are: - ‘primitive’ - ‘wimperis_1’ - ‘solovay_kitaev_1’ - ‘compensating_for_off_resonance_with_a_pulse_sequence’ - ‘compensating_for_off_resonance_with_a_pulse_sequence_with_wimperis’ - ‘compensating_for_off_resonance_with_a_pulse_sequence_with_solovay_kitaev’ - ‘walsh_amplitude_modulated_filter_1’ - ‘short_composite_rotation_for_undoing_length_over_and_under_shoot’ - ‘corpse_in_scrofulous’
- kwargs (dict, optional) – options to make the corresponding control type.
Returns: Returns a driven control corresponding to the driven_control_type.
Return type: qctrlopencontrols.DrivenControls
Raises: ArgumentsValueError– Raised when an argument is invalid.
Module contents¶
driven_controls module¶
-
qctrlopencontrols.driven_controls.BB1= 'BB1'¶ First-order Wimperis control, also known as BB1
-
qctrlopencontrols.driven_controls.CORPSE= 'CORPSE'¶ Dynamically corrected control - Compensating for Off-Resonance with a Pulse Sequence (COPRSE)
-
qctrlopencontrols.driven_controls.CORPSE_IN_BB1= 'CORPSE in BB1'¶ Concatenated dynamically corrected control - BB1 inside COPRSE
-
qctrlopencontrols.driven_controls.CORPSE_IN_SCROFULOUS= 'CORPSE in SCROFULOUS'¶ Concatenated dynamically corrected control - CORPSE inside SCROFULOUS
-
qctrlopencontrols.driven_controls.CORPSE_IN_SK1= 'CORPSE in SK1'¶ Concatenated dynamically corrected control - First order Solovay-Kitaev inside COPRSE
-
qctrlopencontrols.driven_controls.LOWER_BOUND_DURATION= 1e-12¶ Minimum allowed duration of a control
-
qctrlopencontrols.driven_controls.PRIMITIVE= 'primitive'¶ Primitive control
-
qctrlopencontrols.driven_controls.SCROFULOUS= 'SCROFULOUS'¶ Dynamically corrected control - Short Composite Rotation For Undoing Length Over and Under Shoot (SCROFULOUS)
-
qctrlopencontrols.driven_controls.SK1= 'SK1'¶ First-order Solovay-Kitaev control
-
qctrlopencontrols.driven_controls.UPPER_BOUND_DETUNING_RATE= 10000000000.0¶ Maximum allowed detuning rate
-
qctrlopencontrols.driven_controls.UPPER_BOUND_DURATION= 1000000.0¶ Maximum allowed duration of a control
-
qctrlopencontrols.driven_controls.UPPER_BOUND_RABI_RATE= 10000000000.0¶ Maximum allowed rabi rate
-
qctrlopencontrols.driven_controls.UPPER_BOUND_SEGMENTS= 10000¶ Maximum number of segments allowed in a control
-
qctrlopencontrols.driven_controls.WAMF1= 'WAMF1'¶ First-order Walsh sequence control