qat.ir.waveforms module

Contains elementary IR units for waveforms, including waveform types and pulses.

class AbstractWaveform(**data)

Bases: AllowExtraFieldsModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod name()
Return type:

str

class BlackmanWaveform(**data)

Bases: Waveform

A Blackman-window shaped pulse.

The envelope is:

\[f(t) = a_0 - a_1\cos\!\bigl(2\pi(t/w + 0.5)\bigr) + a_2\cos\!\bigl(4\pi(t/w + 0.5)\bigr)\]

with \(a_0 = 7938/18608\), \(a_1 = 9240/18608\), \(a_2 = 1430/18608\), and \(w\) = width. These are the exact Blackman coefficients that minimise the sidelobe level.

The Blackman window offers excellent spectral leakage suppression. Only width (inherited) controls the shape. See original paper Blackman & Tukey (1958).

Parameters:
  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[BlackmanFunction]
class CosWaveform(**data)

Bases: Waveform

A cosine-oscillating envelope.

\[f(t) = \cos(2\pi\,f\,t + \varphi)\]

where \(f\) = frequency and \(\varphi\) = internal_phase.

Parameters:
  • frequency – Oscillation frequency in Hz.

  • internal_phase – Phase offset applied inside the cosine argument in radians. Shifts the cosine in phase without rotating the full IQ vector.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[Cos]
class DragGaussianWaveform(**data)

Bases: Waveform

A complex Gaussian envelope with an in-built first-order DRAG correction.

The envelope is (when zero_at_edges is False):

\[f(t) = \bigl(1 - i\,\beta\,t / \sigma^{2}\bigr) \;e^{-t^{2}/(8\sigma^{2})}\]

When zero_at_edges is True the Gaussian is offset and rescaled so it approaches zero at the pulse boundaries. See https://arxiv.org/abs/0901.0534 for background on the DRAG technique.

Parameters:
  • std_dev – Standard deviation controlling the width of the Gaussian in seconds.

  • beta – DRAG in-pulse correction coefficient. Controls the magnitude of the quadrature (Q) component; beta = 0 gives a real-valued Gaussian.

  • zero_at_edges – If True, subtracts a constant to make the envelope approach zero at the pulse edges.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Note

This class implements the DRAG correction inside the shape function itself (via the complex envelope). The top-level drag parameter on Waveform applies an additional derivative-based correction; normally only one of the two mechanisms is activated at a time.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[DragGaussianFunction]
class ExtraSoftSquareWaveform(**data)

Bases: Waveform

A heavily softened normalised square pulse with a 2×rise inset.

The raw envelope is:

\[g(t) = \tanh\!\bigl(\tfrac{t + \sigma/2 - 2r}{r}\bigr) - \tanh\!\bigl(\tfrac{t - \sigma/2 + 2r}{r}\bigr)\]

which is then min/max normalised to \([0, 1]\). Identical to SofterSquareWaveform but with a 2×rise inset instead of 1×rise.

Parameters:
  • std_dev – Width of the flat-top region in seconds. The tanh transitions are placed at ±std_dev / 2.

  • rise – Edge rise/fall scale in seconds. A larger value relative to std_dev causes the flat-top to shrink.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[ExtraSoftSquareFunction]
class GaussianSquareWaveform(**data)

Bases: Waveform

A flat-top pulse with Gaussian-shaped rise and fall flanks.

The envelope is:

\[\begin{split}f(t) = \begin{cases} e^{-(t + s/2)^{2}/(2\sigma^{2})} & t < -s/2 \\ 1 & |t| \le s/2 \\ e^{-(t - s/2)^{2}/(2\sigma^{2})} & t > s/2 \end{cases}\end{split}\]

where \(s\) = square_width and \(\sigma\) = std_dev. When zero_at_edges is True the envelope is offset and rescaled to be zero at the outermost samples. See Sheldon et al. (2016) for use in cross-resonance gates.

Parameters:
  • square_width – Duration of the central flat-top section in seconds.

  • std_dev – Standard deviation of the Gaussian flanks in seconds.

  • zero_at_edges – If True, the envelope is offset and rescaled to be exactly zero at the outermost sample points.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[GaussianSquareFunction]
class GaussianWaveform(**data)

Bases: Waveform

A standard Gaussian envelope pulse.

The envelope is:

\[f(t) = e^{-(t / k)^{2}}\]

where \(k = \text{width} \times \text{rise}\).

Parameters:
  • rise – Dimensionless shape parameter. A larger rise spreads the Gaussian; a smaller rise narrows it.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[GaussianFunction]
class GaussianZeroEdgeWaveform(**data)

Bases: Waveform

A Gaussian pulse optionally normalised to be exactly zero at its edges.

The envelope is:

\[g(t) = e^{-t^{2} / (2\sigma^{2})}\]

When zero_at_edges is True:

\[f(t) = \frac{g(t) - g(w/2)}{1 - g(w/2)}\]

ensuring \(f(\pm w/2) = 0\) and \(f(0) = 1\).

Parameters:
  • std_dev – Standard deviation of the Gaussian in seconds.

  • zero_at_edges – When True, the Gaussian is offset and rescaled so that it is exactly zero at t = ±width/2 and peaks at 1. When False, a standard Gaussian is returned.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[GaussianZeroEdgeFunction]
class Pulse(**data)

Bases: QuantumInstruction

Instructs a pulse channel to send a waveform.

The intention of the waveform (e.g. a drive or measure pulse) can be specified using the type.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

ignore_channel_scale: bool
model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'populate_by_name': True, 'use_enum_values': False, 'validate_assignment': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property pulse_channel
property target
update_duration(duration, sample_time=None)
classmethod validate_duration(data)
waveform: Waveform | SampledWaveform
class RoundedSquareWaveform(**data)

Bases: Waveform

A square pulse with erf-shaped (S-curve) rise and fall.

The envelope uses a pair of error-function steps:

\[S(v) = \tfrac{1}{2}\bigl[\operatorname{erf}(v) + 1\bigr]\]
\[f(t) = c\,\bigl[S\!\bigl(\tfrac{t - x_1}{r}\bigr) + S\!\bigl(\tfrac{-(t - x_2)}{r}\bigr) - 1\bigr]\]

where \(x_1 = (w - \sigma)/2\), \(x_2 = (w + \sigma)/2\), \(r\) = rise, \(w\) = width, and \(c\) is a normalisation constant.

Parameters:
  • rise – Steepness of the erf transition in seconds. Smaller values give a sharper step; larger values give a more gradual transition.

  • std_dev – Controls the flat-top width relative to the total width, in seconds.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[RoundedSquareFunction]
class SampledWaveform(**data)

Bases: AbstractWaveform

A waveform defined by an arbitrary complex array rather than an analytic function.

Use this class when the pulse envelope is provided as pre-computed samples, e.g. from an optimisation routine or when the compiler lowers an analytical Waveform into discrete samples for hardware that does not support analytic descriptions natively.

Parameters:
  • samples – Complex amplitude values, one per time step.

  • sample_time – Time between consecutive samples in seconds. Required to compute duration.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

property duration
model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

sample_time: float | None
samples: ComplexNDArray | FloatNDArray
class SechWaveform(**data)

Bases: Waveform

A hyperbolic-secant (sech) pulse envelope.

The envelope is:

\[f(t) = \operatorname{sech}(t / \sigma) = \frac{1}{\cosh(t / \sigma)}\]

The sech pulse has the desirable property of being its own Fourier transform (up to scaling), making it self-similar in time and frequency. See Rosen & Zener (1932).

Parameters:
  • std_dev – Width parameter \(\sigma\) of the sech pulse in seconds.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Note

The sech pulse does not reach zero at finite times; it decays exponentially.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[SechFunction]
class SetupHoldWaveform(**data)

Bases: Waveform

A two-level rectangular pulse: a high-amplitude setup portion followed by a lower-amplitude hold portion.

The setup section occupies the first rise seconds of the pulse; the hold section occupies the remainder (width - rise seconds).

Parameters:
  • rise – Duration of the high-amplitude setup section in seconds.

  • amp_setup – Amplitude of the setup section, dimensionless (same scale as amp). The hold section uses amp directly.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[SetupHoldFunction]
class SinWaveform(**data)

Bases: Waveform

A sine-oscillating envelope.

\[f(t) = \sin(2\pi\,f\,t + \varphi)\]

where \(f\) = frequency and \(\varphi\) = internal_phase.

Parameters:
  • frequency – Oscillation frequency in Hz.

  • internal_phase – Internal phase offset in radians.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Note

SinWaveform and CosWaveform are related by a 90° phase shift.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[Sin]
class SoftSquareWaveform(**data)

Bases: Waveform

A square pulse with tanh-shaped rise and fall edges.

The envelope is:

\[f(t) = \tfrac{1}{2}\bigl[ \tanh\!\bigl(\tfrac{t + (w-r)/2}{r}\bigr) - \tanh\!\bigl(\tfrac{t - (w-r)/2}{r}\bigr) \bigr]\]

where \(w\) = width and \(r\) = rise.

Edge sharpness depends on rise; very small values can introduce discontinuities at the truncation boundary.

Parameters:
  • rise – Scale of the tanh transition in seconds. Larger values produce a more gradual edge; smaller values approach a sharp step.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[SoftSquareFunction]
class SofterGaussianWaveform(**data)

Bases: Waveform

A Gaussian envelope normalised so the minimum is zero and peak is one.

Uses the same underlying GaussianFunction as GaussianWaveform (with \(k = \text{width} \times \text{rise}\)) but subtracts the edge value and rescales, ensuring the pulse is exactly zero at the edges and peaks at 1.

Parameters:
  • rise – Dimensionless shape parameter.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[SofterGaussianFunction]
class SofterSquareWaveform(**data)

Bases: Waveform

A normalised double-tanh square pulse with extra edge softening.

The raw envelope is:

\[g(t) = \tanh\!\bigl(\tfrac{t + \sigma/2 - r}{r}\bigr) - \tanh\!\bigl(\tfrac{t - \sigma/2 + r}{r}\bigr)\]

which is then min/max normalised to \([0, 1]\). Here \(\sigma\) = std_dev and \(r\) = rise.

Parameters:
  • std_dev – Width of the flat-top region in seconds. The tanh transitions are placed at ±std_dev / 2.

  • rise – Edge rise/fall scale in seconds. The tanh transitions are shifted inward by one rise step on each side.

  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[SofterSquareFunction]
class SquareWaveform(**data)

Bases: Waveform

A flat (rectangular) pulse.

The envelope is uniform across the entire width.

Parameters:
  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz.

  • phase – Phase rotation in radians.

  • drag – DRAG derivative scaling coefficient.

  • scale_factor – Additional multiplicative scaling, defaults to 1.0.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

shape_function_type: type[SquareFunction]
class Waveform(**data)

Bases: AbstractWaveform

A time-dependent complex signal with a specific shape.

The envelope shape of the waveform will be calibrated to implement desired operations on the qubit such as gates or readout. The Waveform class stores the attributes which define the envelope shape. Calling sample() (or the convenience wrapper sample_waveform()) converts the waveform into discrete in-phase (I) and quadrature (Q) samples — see sample() for the mathematical formula.

Parameters:
  • width – Duration of the waveform in seconds.

  • amp – Amplitude pre-factor to the envelope in Hz. When the hardware channel is correctly calibrated (via PulseChannel.scale), constant amp drives Rabi oscillations at amp Hz.

  • phase – Phase rotation applied to the waveform in radians. Combined with the external phase_offset to rotate the IQ vector in the complex plane.

  • drag

    A coefficient which scales a quadrature component to the waveform envelope consisting of the time derivative of the in-phase component of the waveform envelope, see for example https://arxiv.org/abs/0901.0534.

  • scale_factor – Additional multiplicative scaling applied independently of amp, defaults to 1.0.

See sample() for the full mathematical formula.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

amp: float | complex
amp_setup: float
beta: float
drag: float
property duration
frequency: float
internal_phase: float
model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'use_enum_values': False, 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

phase: float | complex
rise: float
sample(t, phase_offset=0.0)

Evaluate the waveform at discrete times t and return a SampledWaveform.

The output samples are computed as:

\[s(t) = \text{scale\_factor} \cdot \text{amp} \cdot e^{\,i\,(\text{phase} + \text{phase\_offset})} \cdot \bigl[\,f(t) + i \cdot \text{drag} \cdot f'(t)\,\bigr]\]

where \(f(t)\) is the shape function determined by the subclass (via shape_function_type).

Correct calibration of the hardware channel (PulseChannel.scale) means that using constant amplitude amp will drive the qubit in Rabi oscillations of amp Hz. For example setting only amp=10e6 and PulseChannel.scale=1e-8 means 10e6 * 1e-8 = 0.1 peak amplitude of the waveform sent to the control hardware.

Parameters:
  • t (ndarray) – 1-D array of discrete sample times in seconds.

  • phase_offset (float) – Accumulated channel phase in radians, passed by the compiler at sample time. Added to phase before computing the complex exponential. Defaults to 0.0.

Return type:

SampledWaveform

Returns:

A SampledWaveform containing one complex sample per element of t.

Raises:

AttributeError – If shape_function_type is None.

scale_factor: float | complex
shape_function_type: type[ComplexFunction] | None
square_width: float
std_dev: float
width: float
zero_at_edges: bool
sample_waveform(waveform, sample_time)

Utility function to sample a waveform at a given time per sample (sample rate).

Parameters:
  • waveform (Waveform) – The analytical waveform to sample.

  • sample_time (float) – The time between samples, in seconds.

Return type:

SampledWaveform

Returns:

A SampledWaveform containing the sampled values.