PulseSequence
- class braket.pulse.pulse_sequence.PulseSequence[source]
Bases:
objectA representation of a collection of instructions to be performed on a quantum device and the requested results.
- to_time_trace()[source]
Generate an approximate trace of the amplitude, frequency, phase for each frame contained in the PulseSequence, under the action of the instructions contained in the pulse sequence.
- Return type:
- Returns:
PulseSequenceTrace – The approximation information with each attribute (amplitude, frequency and phase) mapping a str (frame id) to a TimeSeries (containing the time evolution of that attribute).
- property parameters: set[FreeParameter]
Returns the set of
FreeParameters in the PulseSequence.
- set_frequency(frame, frequency)[source]
Adds an instruction to set the frequency of the frame to the specified
frequencyvalue.- Parameters:
frame (Frame) – Frame for which the frequency needs to be set.
frequency (float | FreeParameterExpression) – frequency value to set for the specified frame.
- Return type:
- Returns:
PulseSequence – self, with the instruction added.
- shift_frequency(frame, frequency)[source]
Adds an instruction to shift the frequency of the frame by the specified
frequencyvalue.- Parameters:
frame (Frame) – Frame for which the frequency needs to be shifted.
frequency (float | FreeParameterExpression) – frequency value by which to shift the frequency for the specified frame.
- Return type:
- Returns:
PulseSequence – self, with the instruction added.
- set_phase(frame, phase)[source]
Adds an instruction to set the phase of the frame to the specified
phasevalue.- Parameters:
frame (Frame) – Frame for which the frequency needs to be set.
phase (float | FreeParameterExpression) – phase value to set for the specified frame.
- Return type:
- Returns:
PulseSequence – self, with the instruction added.
- shift_phase(frame, phase)[source]
Adds an instruction to shift the phase of the frame by the specified
phasevalue.- Parameters:
frame (Frame) – Frame for which the phase needs to be shifted.
phase (float | FreeParameterExpression) – phase value by which to shift the phase for the specified frame.
- Return type:
- Returns:
PulseSequence – self, with the instruction added.
- swap_phases(frame_1, frame_2)[source]
Adds an instruction to swap the phases between two frames.
- Parameters:
- Return type:
- Returns:
PulseSequence – self, with the instruction added.
- set_scale(frame, scale)[source]
Adds an instruction to set the scale on the frame to the specified
scalevalue.- Parameters:
frame (Frame) – Frame for which the scale needs to be set.
scale (float | FreeParameterExpression) – scale value to set on the specified frame.
- Return type:
- Returns:
PulseSequence – self, with the instruction added.
- delay(qubits_or_frames, duration)[source]
Adds an instruction to advance the frame clock by the specified
durationvalue.- Parameters:
qubits_or_frames (Frame | list[Frame] | QubitSet) – Qubits or frame(s) on which the delay needs to be introduced.
duration (float | FreeParameterExpression) – value (in seconds) defining the duration of the delay.
- Return type:
- Returns:
PulseSequence – self, with the instruction added.
- barrier(qubits_or_frames)[source]
Adds an instruction to align the frame clocks to the latest time across all the specified frames.
- play(frame, waveform)[source]
Adds an instruction to play the specified waveform on the supplied frame.
- Parameters:
- Return type:
- Returns:
PulseSequence – returns self.
- capture_v0(frame)[source]
Adds an instruction to capture the bit output from measuring the specified frame.
- Parameters:
frame (Frame) – Frame on which the capture operation needs to be performed.
- Return type:
- Returns:
PulseSequence – self, with the instruction added.
- make_bound_pulse_sequence(param_values)[source]
Binds FreeParameters based upon their name and values passed in. If parameters share the same name, all the parameters of that name will be set to the mapped value.
- Parameters:
param_values (dict[str, float]) – A mapping of FreeParameter names to a value to assign to them.
- Return type:
- Returns:
PulseSequence – Returns a PulseSequence with all present parameters fixed to their respective values.
- to_ir(sort_input_parameters=False)[source]
Converts this OpenPulse problem into IR representation.
- Parameters:
sort_input_parameters (bool) – whether input parameters should be printed in a sorted order. Defaults to False.
- Return type:
str- Returns:
str – a str representing the OpenPulse program encoding the PulseSequence.