2.4. The PointPulseTemplate

The PointPulseTemplate(or short PointPT) can be understood as a specialization of the TablePulseTempalte. It restricts the channels to all having the same time points in their entries and the same expression for their voltages.

Let us first have a look at an simple example:

In [1]:
from qctoolkit.pulses import PointPT

point_template = PointPT([(0,   'v_0'),
                          (1,   'v_1', 'linear'),
                          ('t', 'v_0+v_1', 'jump')],
                         channel_names=('A', 'B'))

print(point_template.defined_channels)
{'A', 'B'}

As you can see the pulse template has two channels although we only provided one expression for the voltage per time point. The value of this expression can either be scalar as we will see now for v_0 or be a numpy array of the same length as the number of channels is like v_1. A value of the wrong length will result in an exception.

In [2]:
%matplotlib notebook
from qctoolkit.pulses.plotting import plot
import numpy as np

parameters = dict(t=3,
                  v_0=1,
                  v_1=np.array([1.2, 2.5]))

_ = plot(point_template, parameters, sample_rate=100)