CustomWaveform
- class pulser.waveforms.CustomWaveform(samples)
Bases:
Waveform
A custom waveform.
- Parameters:
samples (ArrayLike | pm.TensorLike) – The modulation values at each time step. The number of samples dictates the duration, in ns.
Attributes
The duration of the pulse (in ns).
The first value in the waveform.
Integral of the waveform (in [waveform units].µs).
The last value in the waveform.
The value at each time step that describes the waveform.
Methods
Returns a new waveform with modified duration.
Draws the waveform.
The waveform samples as output of a given channel.
The minimal buffers needed around a modulated waveform.
Signatures
- change_duration(new_duration)
Returns a new waveform with modified duration.
- Parameters:
new_duration (
int
) – The duration of the new waveform.- Return type:
- draw(output_channel=None, ylabel=None)
Draws the waveform.
- Parameters:
output_channel (
Channel
|None
, default:None
) – The output channel. If given, will draw the modulated waveform on top of the input one.ylabel (
str
|None
, default:None
) – An optional label for the y-axis of the plot.
- Return type:
None
- modulated_samples(channel, eom=False)
The waveform samples as output of a given channel.
This duration is adjusted according to the minimal buffer times.
- Parameters:
channel (
Channel
) – The channel modulating the waveform.eom (
bool
, default:False
) – Whether to modulate for the EOM.
- Return type:
AbstractArray
- Returns:
The array of samples after modulation.
- modulation_buffers(channel, eom=False)
The minimal buffers needed around a modulated waveform.
- Parameters:
channel (
Channel
) – The channel modulating the waveform.eom (
bool
, default:False
) – Whether to calculate the modulation buffers with the EOM bandwidth.
- Return type:
tuple
[int
,int
]- Returns:
The minimum buffer times at the start and end of the samples, in ns.
- property duration: int
The duration of the pulse (in ns).
- property first_value: float
The first value in the waveform.
- property integral: float
Integral of the waveform (in [waveform units].µs).
- property last_value: float
The last value in the waveform.
- property samples: AbstractArray
The value at each time step that describes the waveform.
- Returns:
A numpy array with a value for each time step.