3.5.10. 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.

Classes

ConstantParameter(value)

Deprecated since version 0.5.

MappedParameter(expression[, namespace])

A pulse parameter whose value is derived from other parameters via some mathematical expression.

Parameter()

A parameter for pulses.

ParameterConstrainer(*, parameter_constraints)

A class that implements the testing of parameter constraints.

ParameterConstraint(relation)

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

Exceptions

ConstrainedParameterIsVolatileWarning(...)

InvalidParameterNameException(parameter_name)

ParameterConstraintViolation(constraint, ...)

class qupulse.pulses.parameters.ConstantParameter(value: Union[numbers.Real, numpy.ndarray, qupulse.expressions.Expression, str, sympy.core.expr.Expr])[source]

Bases: qupulse.pulses.parameters.Parameter

Deprecated since version 0.5.

A pulse parameter with a constant value.

Parameters

value – The value of the parameter

__init__(value: Union[numbers.Real, numpy.ndarray, qupulse.expressions.Expression, str, sympy.core.expr.Expr]) None[source]

Deprecated since version 0.5.

A pulse parameter with a constant value.

Parameters

value – The value of the parameter

get_value() Union[numbers.Real, numpy.ndarray][source]

Implements get_value().

property requires_stop: bool

Implements requires_stop.

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() numbers.Real[source]

Compute and return the parameter value.

abstract property requires_stop: bool

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.

Returns

True, if evaluating this Parameter instance requires an interruption.

class qupulse.pulses.parameters.ParameterConstraint(relation: Union[str, sympy.core.expr.Expr])[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: Set[str]
get_serialization_data() str[source]

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

Returns

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

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

  • volatile – 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

property sympified_expression: sympy.core.expr.Expr
exception qupulse.pulses.parameters.ParameterConstraintViolation(constraint: qupulse.pulses.parameters.ParameterConstraint, parameters: Dict[str, numbers.Real])[source]

Bases: Exception

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

Bases: KeyError

Indicates that a required parameter value was not provided.

property parameter_name