3.6.9. qupulse.pulses.parameters

This module defines parameters and parameter declaration for usage in pulse modelling.

Classes:
  • Parameter: A base class representing a single pulse parameter.

  • ConstantParameter: A single parameter with a constant value.

  • MappedParameter: A parameter whose value is mathematically computed from another parameter.

  • ParameterNotProvidedException.

class qupulse.pulses.parameters.Parameter[source]

Bases: object

A parameter for pulses.

Parameter specifies a concrete value which is inserted instead of the parameter declaration reference in a PulseTemplate if it satisfies the minimum and maximum boundary of the corresponding ParameterDeclaration. Implementations of Parameter may provide a single constant value or obtain values by computation (e.g. from measurement results).

abstract get_value()[source]

Compute and return the parameter value.

Return type

Real

abstract property requires_stop

Query whether the evaluation of this Parameter instance requires an interruption in execution/sequencing, e.g., because it depends on data that is only measured in during the next execution.

Return type

bool

Returns

True, if evaluating this Parameter instance requires an interruption.

class qupulse.pulses.parameters.ConstantParameter(value)[source]

Bases: qupulse.pulses.parameters.Parameter

Deprecated since version 0.5.

A pulse parameter with a constant value.

Parameters

value (Union[Real, ndarray, Expression, str, Expr]) – The value of the parameter

__init__(value)[source]

Deprecated since version 0.5.

A pulse parameter with a constant value.

Parameters

value (Union[Real, ndarray, Expression, str, Expr]) – The value of the parameter

Return type

None

get_value()[source]

Implements get_value().

Return type

Union[Real, ndarray]

property requires_stop

Implements requires_stop.

Return type

bool

exception qupulse.pulses.parameters.ParameterNotProvidedException(parameter_name)[source]

Bases: KeyError

Indicates that a required parameter value was not provided.

property parameter_name
exception qupulse.pulses.parameters.ParameterConstraintViolation(constraint, parameters)[source]

Bases: Exception

class qupulse.pulses.parameters.ParameterConstraint(relation)[source]

Bases: qupulse.serialization.AnonymousSerializable

A parameter constraint like ‘t_2 < 2.7’ that can be used to set bounds to parameters.

property affected_parameters
Return type

Set[str]

get_serialization_data()[source]

Return all data relevant for serialization as a JSON compatible type that is accepted as constructor argument

Return type

str

Returns

A JSON compatible type that can be used to construct an equal object.

is_fulfilled(parameters, volatile=frozenset({}))[source]
Parameters
  • parameters (Mapping[str, Any]) – These parameters are checked.

  • volatile (AbstractSet[str]) – For each of these parameters a warning is raised if they appear in a constraint

Raises

qupulse.parameter_scope.ParameterNotProvidedException – if a parameter is missing

Warning

ConstrainedParameterIsVolatileWarning: if a constrained parameter is volatile

Return type

bool

property sympified_expression
Return type

Expr