Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

qiskit.pulse.library.square

square(duration, amp, freq=None, phase=0, name=None)

GitHub

Generates square wave Waveform.

For A=A= amp, T=T= period, and ϕ=\phi= phase, applies the midpoint sampling strategy to generate a discrete pulse sampled from the continuous function:

f(x)=Asign[sin(2πxT+2ϕ)]f(x) = A \text{sign}\left[ \sin\left(\frac{2 \pi x}{T} + 2\phi\right) \right]

with the convention sign(0)=1\text{sign}(0) = 1.

Parameters

  • duration (int) – Duration of pulse. Must be greater than zero.
  • amp (complex) – Pulse amplitude. Wave range is [[- amp ,, amp ]].
  • freq (Optional[float]) – Pulse frequency, units of 1./dt. If None defaults to 1./duration.
  • phase (float) – Pulse phase.
  • name (Optional[str]) – Name of pulse.

Return type

Waveform

Was this page helpful?
Report a bug or request content on GitHub.