2.10. Definition of measurements¶
Many pulse templates allow us to declare measurements upon their
creation. Each measurement declaration is a tuple that consists of the
measurements name, the starting point in the pulse template and the
measurements length. The idea behind measurement names is that you can
put different types of measurements in one pulse and easily distinguish
between the results. qctoolkit
automatically configures the
acquisition driver to measure at the measurement windows.
The following example creates a pulse template that contains a measurement named ‘M’ and a measurement named ‘N’:
In [8]:
from qctoolkit.pulses import PointPT
meas = PointPT([(0, 'm'),
('t_meas', 'm')],
channel_names=('RF_X', 'RF_Y'),
measurements=[('M', 0, 't_meas'), ('N', 0, 't_meas/2')])
print(meas.measurement_names)
print(meas.measurement_declarations)
{'N', 'M'}
[('M', 0, 't_meas'), ('N', 0, 't_meas/2')]
The measurement windows may not reach out of the declaring pulse template. If that happens an exception is raised during sequencing.
It is also possible to rename the measurements:
In [7]:
from qctoolkit.pulses import SequencePT
my_complicated_pulse = SequencePT((meas, {'M': 'charge_scan'}),
(meas, {'M': 'dbz_fid'}))
print(my_complicated_pulse.measurement_names)
{'dbz_fid', 'N', 'charge_scan'}