3.6.11. qupulse.pulses.parameters¶
This module defines parameter constriants.
Classes
|
A class that implements the testing of parameter constraints. |
|
A parameter constraint like 't_2 < 2.7' that can be used to set bounds to parameters. |
Exceptions
|
|
|
- exception ConstrainedParameterIsVolatileWarning(parameter_name: str, constraint: ParameterConstraint)[source]¶
Bases:
RuntimeWarning- property constraint: ParameterConstraint¶
- class ParameterConstrainer(*, parameter_constraints: Iterable[Expr | str | ParameterConstraint] | None)[source]¶
Bases:
objectA class that implements the testing of parameter constraints. It is used by the subclassing pulse templates.
- property constrained_parameters: AbstractSet[str]¶
- property parameter_constraints: List[ParameterConstraint]¶
- validate_parameter_constraints(parameters: [<class 'str'>, <class 'numbers.Real'>], volatile: ~typing.Set[str]) None[source]¶
Raises a ParameterConstraintViolation exception if one of the constraints is violated.
- Parameters:
parameters – These parameters are checked.
volatile – For each of these parameters a warning is raised if they appear in a constraint
- Raises:
ParameterConstraintViolation – if one of the constraints is violated.
Warning
ConstrainedParameterIsVolatileWarning: via ParameterConstraint.is_fulfilled
- class ParameterConstraint(relation: str | Expr)[source]¶
Bases:
AnonymousSerializableA parameter constraint like ‘t_2 < 2.7’ that can be used to set bounds to parameters.
- 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