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
__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
Return type

None

build_waveform(parameters, channel_mapping)[source]

Implements build_waveform().

Return type

Union[TableWaveform, MultiChannelWaveform, None]

calculate_duration()[source]
Return type

ExpressionScalar

property defined_channels

Implements defined_channels.

Return type

Set[Union[str, int]]

property duration

Implements duration.

Return type

ExpressionScalar

property entries
Return type

Dict[Union[str, int], List[TableEntry]]

static from_array(times, voltages, channels)[source]

Static constructor to build a TablePulse from numpy arrays.

Parameters
  • times (ndarray) – 1D numpy array with time values

  • voltages (ndarray) – 1D or 2D numpy array with voltage values

  • channels (List[Union[str, int]]) – channels to define

Return type

TablePulseTemplate

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
  • entry_list (List[Tuple]) – List of tuples of the form (t, v_1, …, v_N[, interp])

  • channel_names (Optional[List[Union[str, int]]]) – Optional list of channel identifiers to use. Default is [0, …, N-1]

  • kwargs – Forwarded to TablePulseTemplate constructor

Return type

TablePulseTemplate

Returns

TablePulseTemplate with

get_entries_instantiated(parameters)[source]

Compute an instantiated list of the table’s entries.

Parameters

parameters (Dict(str -> Parameter)) – A mapping of parameter names to Parameter objects.

Return type

Dict[Union[str, int], List[TableWaveformEntry]]

Returns

(float, float)-list of all table entries with concrete values provided by the given

parameters.

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

Dict[str, Any]

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.

property integral

Implements integral.

Return type

Dict[Union[str, int], ExpressionScalar]

interpolation_strategies = {'default': <Hold Interpolation>, 'hold': <Hold Interpolation>, 'jump': <Jump Interpolation>, 'linear': <Linear Interpolation>}
property parameter_names

Implements parameter_names.

Return type

Set[str]

property table_parameters
Return type

Set[str]

qupulse.pulses.table_pulse_template.concatenate(*table_pulse_templates, **kwargs)[source]

Concatenate two or more table pulse templates

Return type

TablePulseTemplate