3.7.3. qupulse.pulses.constant_pulse_template

This module defines the ConstantPulseTemplate, a pulse tempalte representating a pulse with constant values on all channels

Classes:
  • ConstantPulseTemplate: Defines a pulse via channel-value pairs

  • ConstantPulseWaveform: A waveform instantiated from a TablePulseTemplate by providing values for its

    declared parameters.

Classes

ConstantPulseTemplate(duration, amplitude_dict)

An atomic pulse template qupulse representing a multi-channel pulse with constant values.

class qupulse.pulses.constant_pulse_template.ConstantPulseTemplate(duration: qupulse.expressions.ExpressionLike, amplitude_dict: Dict[Union[str, int], qupulse.expressions.ExpressionLike], identifier: Optional[str] = None, name: Optional[str] = None, measurements: Optional[List[Tuple[str, Union[qupulse.expressions.sympy.Expression, str, numbers.Real], Union[qupulse.expressions.sympy.Expression, str, numbers.Real]]]] = None, registry: Optional[MutableMapping[str, Serializable]] = None)[source]

Bases: qupulse.pulses.pulse_template.AtomicPulseTemplate

An atomic pulse template qupulse representing a multi-channel pulse with constant values.

Parameters
  • duration – Duration of the template

  • amplitude_dict – Dictionary with values for the channels

  • name – Name for the template. Not used by qupulse

__init__(duration: qupulse.expressions.ExpressionLike, amplitude_dict: Dict[Union[str, int], qupulse.expressions.ExpressionLike], identifier: Optional[str] = None, name: Optional[str] = None, measurements: Optional[List[Tuple[str, Union[qupulse.expressions.sympy.Expression, str, numbers.Real], Union[qupulse.expressions.sympy.Expression, str, numbers.Real]]]] = None, registry: Optional[MutableMapping[str, Serializable]] = None) None[source]

An atomic pulse template qupulse representing a multi-channel pulse with constant values.

Parameters
  • duration – Duration of the template

  • amplitude_dict – Dictionary with values for the channels

  • name – Name for the template. Not used by qupulse

build_waveform(parameters: Dict[str, numbers.Real], channel_mapping: Dict[Union[str, int], Optional[Union[str, int]]]) Optional[Union[qupulse.program.waveforms.ConstantWaveform, qupulse.program.waveforms.MultiChannelWaveform]][source]

Implements build_waveform().

property defined_channels: AbstractSet[Union[str, int]]

Returns the number of hardware output channels this PulseTemplate defines.

classmethod deserialize(serializer: Optional = None, **kwargs) ConstantPulseTemplate[source]

Reconstructs the Serializable object from a dictionary.

Implementation hint: For greater clarity, implementations of this method should be precise in their return value, i.e., give their exact class name, and also replace the kwargs argument by a list of arguments required, i.e., those returned by get_serialization_data. Using old serialization routines, if this Serializable contains complex objects which are itself of type Serializable, their dictionary representations MUST be converted into objects using serializers deserialize() method. This is DEPRECATED behavior. Using the new routines, a serializable is only responsible to decode it’s own dictionary, not those of nested objects (i.e., all incoming arguments are already processed by the serialization routines). For the transition time where both variants are available, implementations of this method should support the old and new routines, using the presence of the serializer argument to differentiate between both. For the new routines, just call this base class function. After the transition period, subclasses likely need not implement deserialize separately anymore at all.

Parameters
  • serializer – DEPRECATED (May 2018). A serializer instance used when deserializing subelements.

  • **kwargs – All relevant properties of the object as keyword arguments. For every (key,value) pair returned by get_serialization_data, the same pair is given as keyword argument as input to this method.

property duration: qupulse.expressions.sympy.ExpressionScalar

An expression for the duration of this PulseTemplate.

property final_values: Dict[Union[str, int], qupulse.expressions.sympy.ExpressionScalar]

Values of defined channels at t == self.duration

get_serialization_data(serializer=None) Any[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.

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 initial_values: Dict[Union[str, int], qupulse.expressions.sympy.ExpressionScalar]

Values of defined channels at t == 0

property integral: Dict[Union[str, int], qupulse.expressions.sympy.ExpressionScalar]

Returns an expression giving the integral over the pulse.

property parameter_names: AbstractSet[str]

The set of names of parameters required to instantiate this PulseTemplate.