qse.signal.signals#

Definition of the Signal class.

Classes#

Signals

The Signal class represents a collection of Signals.

Module Contents#

class qse.signal.signals.Signals(signals=None)[source]#

The Signal class represents a collection of Signals.

Parameters:

signals (list[qse.Signal], optional) – The signals.

Examples

import qse
import numpy as np

x = qse.Signal([1], 10)
y = qse.Signal(np.linspace(0, 1, 5), 5)
ss = qse.Signals([x, y])
print(ss)
z = qse.Signals()
z += x
z += y
print(z)
Total duration=15
  Signal(duration=10, values=[1.])
  Signal(duration=5, values=[0.   0.25 0.5  0.75 1.  ])
Total duration=15
  Signal(duration=10, values=[1.])
  Signal(duration=5, values=[0.   0.25 0.5  0.75 1.  ])

As shown above, one can also create Signals by adding two signals.

to_pulser()[source]#

Convert to a Pulser Waveform.

Returns:

pulser.waveforms.Waveform – The waveform.

expand()[source]#

Get an array of length ‘duration’ whose entries are the signal values.

Returns:

np.ndarray – An array representing the signal.

draw(time_units=None, signal_units=None, title=None)[source]#

Draw the signal.

Parameters:
  • time_units (str, optional) – The units of the duration.

  • signal_units (str, optional) – The units of the signal.

  • title (str, optional) – A title for the plot.