3.6.16. qupulse.pulses.table_pulse_template¶
This module defines the TablePulseTemplate, one of the elementary pulse templates and its waveform representation.
- Classes:
TablePulseTemplate: Defines a pulse via interpolation of a sequence of (time,voltage)-pairs.
- TableWaveform: A waveform instantiated from a TablePulseTemplate by providing values for its
declared parameters.
-
class
qupulse.pulses.table_pulse_template.
TablePulseTemplate
(entries, identifier=None, *, parameter_constraints=None, measurements=None, consistency_check=True, registry=None)[source]¶ Bases:
qupulse.pulses.pulse_template.AtomicPulseTemplate
,qupulse.pulses.parameters.ParameterConstrainer
The TablePulseTemplate class implements pulses described by a table with time, voltage and interpolation strategy inputs. The interpolation strategy describes how the voltage between the entries is interpolated(see also InterpolationStrategy.) It can define multiple channels of which each has a separate table. If they do not have the same length the shorter channels are extended to the longest duration.
If the time entries of all channels are equal it is more convenient to use the :paramrefPointPulseTemplate`.
Construct a TablePulseTemplate from a dict which maps channels to their entries. By default the consistency of the provided entries is checked. There are two static functions for convenience construction: from_array and from_entry_list.
- Parameters
entries (
Dict
[Union
[str
,int
],Sequence
[Union
[TableEntry
,Tuple
[Union
[ExpressionScalar
,str
,Real
],Union
[ExpressionScalar
,str
,Real
]],Tuple
[Union
[ExpressionScalar
,str
,Real
],Union
[ExpressionScalar
,str
,Real
],Union
[str
,InterpolationStrategy
]]]]]) – A dictionary that maps channel ids to a list of entries. An entry is a (time, voltage[, interpolation strategy]) tuple or a TableEntryparameter_constraints (
Optional
[List
[Union
[str
,ParameterConstraint
]]]) – Constraint list that is forwarded to the ParameterConstrainer superclassmeasurements (
Optional
[List
[Tuple
[str
,Union
[Expression
,str
,Real
],Union
[Expression
,str
,Real
]]]]) – Measurement declaration list that is forwarded to the MeasurementDefiner superclassconsistency_check (
bool
) – If True the consistency of the times will be checked on construction as far as possible
-
__init__
(entries, identifier=None, *, parameter_constraints=None, measurements=None, consistency_check=True, registry=None)[source]¶ Construct a TablePulseTemplate from a dict which maps channels to their entries. By default the consistency of the provided entries is checked. There are two static functions for convenience construction: from_array and from_entry_list.
- Parameters
entries (
Dict
[Union
[str
,int
],Sequence
[Union
[TableEntry
,Tuple
[Union
[ExpressionScalar
,str
,Real
],Union
[ExpressionScalar
,str
,Real
]],Tuple
[Union
[ExpressionScalar
,str
,Real
],Union
[ExpressionScalar
,str
,Real
],Union
[str
,InterpolationStrategy
]]]]]) – A dictionary that maps channel ids to a list of entries. An entry is a (time, voltage[, interpolation strategy]) tuple or a TableEntryparameter_constraints (
Optional
[List
[Union
[str
,ParameterConstraint
]]]) – Constraint list that is forwarded to the ParameterConstrainer superclassmeasurements (
Optional
[List
[Tuple
[str
,Union
[Expression
,str
,Real
],Union
[Expression
,str
,Real
]]]]) – Measurement declaration list that is forwarded to the MeasurementDefiner superclassconsistency_check (
bool
) – If True the consistency of the times will be checked on construction as far as possible
- Return type
None
-
build_waveform
(parameters, channel_mapping)[source]¶ Implements
build_waveform()
.- Return type
Union
[TableWaveform
,MultiChannelWaveform
,None
]
-
static
from_array
(times, voltages, channels)[source]¶ Static constructor to build a TablePulse from numpy arrays.
- Parameters
- Return type
- Returns
TablePulseTemplate with the given values, hold interpolation everywhere and no free parameters.
-
static
from_entry_list
(entry_list, channel_names=None, **kwargs)[source]¶ Static constructor for a TablePulseTemplate where all channel’s entries share the same times.
- Parameters
- Return type
- Returns
TablePulseTemplate with
-
get_serialization_data
(serializer=None)[source]¶ Returns all data relevant for serialization as a dictionary containing only base types.
Implementation hint: In the old serialization routines, if the Serializable contains complex objects which are itself Serializables, a serialized representation for these MUST be obtained by calling the dictify() method of serializer. The reason is that serializer may decide to either return a dictionary to embed or only a reference to the Serializable subelement. This is DEPRECATED behavior as of May 2018. In the new routines, this will happen automatically and every Serializable is only responsible for returning it’s own data and leave nested Serializables in object form.
For the transition time where both implementations are available, implementations of this method should support the old and new routines, using the presence of the serializer argument to differentiate between both. Don’t make use of the implementation in this base class when implementing this method for the old routines.
- Parameters
serializer (Serializer) – DEPRECATED (May 2018).A Serializer instance used to serialize complex subelements of this Serializable.
- Return type
- Returns
- A dictionary of Python base types (strings, integers, lists/tuples containing these,
etc..) which fully represent the relevant properties of this Serializable for storing and later reconstruction as a Python object.
-
interpolation_strategies
= {'default': <Hold Interpolation>, 'hold': <Hold Interpolation>, 'jump': <Jump Interpolation>, 'linear': <Linear Interpolation>}¶
-
property
parameter_names
¶ Implements
parameter_names
.