Square

class qililab.Square(amplitude, duration)

Bases: Waveform

Square (rectangular) waveform. Given by a constant height line.

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

  • amplitude (float) – Maximum amplitude of the pulse.

Examples

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

import qililab as ql

square_envelope = ql.Square(amplitude=X, duration=50).envelope()

which for X being 1. and 0.75, look respectively like:

../../_images/rectangulars.png

Methods

envelope([resolution])

Constant amplitude envelope.

get_duration()

Get the duration of the waveform.

Attributes

yaml_tag

envelope(resolution=1)

Constant amplitude envelope.

Parameters:

resolution (float, 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