Gaussian

class qililab.Gaussian(amplitude, duration, num_sigmas)

Bases: Waveform

Gaussian waveform with peak at duration/2 and spanning for num_sigmas over the pulse duration.

Standard centered Gaussian pulse shape, symmetrically spanning for num_sigmas over the pulse duration.

The normal distribution’s parameters \(\mu\) (mean) and \(\sigma\) (standard deviation) will be therefore defined by \(\mu =\) duration \(/ 2\) and \(\sigma =\) duration \(/\) num_sigmas:

\[Gaussian(x) = A * exp(-0.5 * (x - \mu)^2 / \sigma^2)\]

You can think of it, as if an infinite expanding gaussian, is symmetrically cut in the given num_sigmas, then that cut is expanded to occupy all the pulse duration, and then is shifted down so that it starts at 0.

Examples

To get the envelope of a gaussian waveform, with num_sigmas equal to X, you need to do:

import qililab as ql

gaussian_envelope = ql.Gaussian(num_sigmas=X, duration=50, amplitude=1).envelope()

which for X being 1, 4, 6 or 8, look respectively like:

../../_images/gaussians.png
This comes from the following steps, parting from a “full” gaussian (big num_sigma) [blue]:
  1. you cut a full gaussian to the given num_sigmas, for example 1 [small purple].

  2. in reality this cut gaussian, actually extends all the duration [big purple],

  3. you shift/distortion down the cut gaussian, so it starts at 0 height [red].

../../_images/gaussian_explanation.png
Parameters:
  • amplitude (float) – Maximum amplitude of the pulse.

  • duration (int) – Duration of the pulse (ns).

  • num_sigmas (float) – Sigma number of the gaussian pulse shape. Defines the width of the gaussian pulse.

Methods

envelope([resolution])

Gaussian envelope centered with respect to the pulse.

get_duration()

Get the duration of the waveform.

Attributes

yaml_tag

envelope(resolution=1)

Gaussian envelope centered with respect to the pulse.

The gaussian is symmetrically cut in the given num_sigmas, meaning that it starts and ends at that sigma width.

And then to avoid introducing noise at time 0, the full gaussian is shifted down so that it starts at 0.

Parameters:

resolution (int, optional) – Resolution of the pulse. Defaults to 1.

Returns:

Height of the envelope for each time step.

Return type:

np.ndarray

get_duration()

Get the duration of the waveform.

Returns:

The duration of the waveform in ns.

Return type:

int