braket.pulse.pulse_sequence module
- class braket.pulse.pulse_sequence.PulseSequence[source]
Bases:
object
A representation of a collection of instructions to be performed on a quantum device and the requested results.
- to_time_trace() PulseSequenceTrace [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.
- 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
FreeParameter
s in the PulseSequence.
- set_frequency(frame: Frame, frequency: float | FreeParameterExpression) PulseSequence [source]
Adds an instruction to set the frequency of the frame to the specified
frequency
value.- Parameters:
frame (Frame) – Frame for which the frequency needs to be set.
frequency (Union[float, FreeParameterExpression]) – frequency value to set for the specified frame.
- Returns:
PulseSequence – self, with the instruction added.
- shift_frequency(frame: Frame, frequency: float | FreeParameterExpression) PulseSequence [source]
Adds an instruction to shift the frequency of the frame by the specified
frequency
value.- Parameters:
frame (Frame) – Frame for which the frequency needs to be shifted.
frequency (Union[float, FreeParameterExpression]) – frequency value by which to shift the frequency for the specified frame.
- Returns:
PulseSequence – self, with the instruction added.
- set_phase(frame: Frame, phase: float | FreeParameterExpression) PulseSequence [source]
Adds an instruction to set the phase of the frame to the specified
phase
value.- Parameters:
frame (Frame) – Frame for which the frequency needs to be set.
phase (Union[float, FreeParameterExpression]) – phase value to set for the specified frame.
- Returns:
PulseSequence – self, with the instruction added.
- shift_phase(frame: Frame, phase: float | FreeParameterExpression) PulseSequence [source]
Adds an instruction to shift the phase of the frame by the specified
phase
value.- Parameters:
frame (Frame) – Frame for which the phase needs to be shifted.
phase (Union[float, FreeParameterExpression]) – phase value by which to shift the phase for the specified frame.
- Returns:
PulseSequence – self, with the instruction added.
- set_scale(frame: Frame, scale: float | FreeParameterExpression) PulseSequence [source]
Adds an instruction to set the scale on the frame to the specified
scale
value.- Parameters:
frame (Frame) – Frame for which the scale needs to be set.
scale (Union[float, FreeParameterExpression]) – scale value to set on the specified frame.
- Returns:
PulseSequence – self, with the instruction added.
- delay(qubits_or_frames: Frame | list[Frame] | QubitSet, duration: float | FreeParameterExpression) PulseSequence [source]
Adds an instruction to advance the frame clock by the specified
duration
value.- Parameters:
qubits_or_frames (Union[Frame, list[Frame], QubitSet]) – Qubits or frame(s) on which the delay needs to be introduced.
duration (Union[float, FreeParameterExpression]) – value (in seconds) defining the duration of the delay.
- Returns:
PulseSequence – self, with the instruction added.
- barrier(qubits_or_frames: list[Frame] | QubitSet) PulseSequence [source]
Adds an instruction to align the frame clocks to the latest time across all the specified frames.
- play(frame: Frame, waveform: Waveform) PulseSequence [source]
Adds an instruction to play the specified waveform on the supplied frame.
- capture_v0(frame: Frame) PulseSequence [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.
- Returns:
PulseSequence – self, with the instruction added.
- make_bound_pulse_sequence(param_values: dict[str, float]) PulseSequence [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.
- Returns:
PulseSequence – Returns a PulseSequence with all present parameters fixed to their respective values.
- to_ir(sort_input_parameters: bool = False) str [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.
- Returns:
str – a str representing the OpenPulse program encoding the PulseSequence.