3.5. qupulse.parameter_scope¶
Contains various implementations of the parameter lookup interface Scope
-
class
qupulse.parameter_scope.
DictScope
(values, volatile=frozenset({}))[source]¶ Bases:
qupulse.parameter_scope.Scope
-
change_constants
(new_constants)[source]¶ Change values of constants. Constants not present in the scope are ignored.
Warning
NonVolatileChange: if a parameter that is not in get_volatile_parameters is updated
- Return type
- Returns
New scope instance
-
get_parameter
(parameter_name)[source]¶ - Parameters
parameter_name –
- Raises
ParameterNotProvidedException if the parameter is not provided by this scope –
- Return type
- Returns
Parameter value
-
get_volatile_parameters
()[source]¶ Returns: A mapping where the keys are the volatile parameters and the
- Return type
_FrozenDictByWrapping
[str
,Expression
]
-
items
¶
-
keys
¶
-
values
¶
-
-
class
qupulse.parameter_scope.
JointScope
(lookup)[source]¶ Bases:
qupulse.parameter_scope.Scope
-
change_constants
(new_constants)[source]¶ Change values of constants. Constants not present in the scope are ignored.
Warning
NonVolatileChange: if a parameter that is not in get_volatile_parameters is updated
- Return type
- Returns
New scope instance
-
get_volatile_parameters
()[source]¶ Returns: A mapping where the keys are the volatile parameters and the
- Return type
_FrozenDictByWrapping
[str
,Expression
]
-
-
class
qupulse.parameter_scope.
MappedScope
(scope, mapping)[source]¶ Bases:
qupulse.parameter_scope.Scope
-
change_constants
(new_constants)[source]¶ Change values of constants. Constants not present in the scope are ignored.
Warning
NonVolatileChange: if a parameter that is not in get_volatile_parameters is updated
- Return type
- Returns
New scope instance
-
get_volatile_parameters
()[source]¶ Returns: A mapping where the keys are the volatile parameters and the
- Return type
-
-
exception
qupulse.parameter_scope.
NonVolatileChange
[source]¶ Bases:
RuntimeWarning
Raised if a non volatile parameter is updated
-
exception
qupulse.parameter_scope.
ParameterNotProvidedException
(parameter_name)[source]¶ Bases:
KeyError
Indicates that a required parameter value was not provided.
-
property
parameter_name
¶
-
property
-
class
qupulse.parameter_scope.
Scope
[source]¶ Bases:
collections.abc.Mapping
,typing.Generic
- Abstract parameter lookup. Scopes are immutable. Internally it holds all dependencies of parameters and keeps
track which had been marked as volatile. This allows creating a new scope with different volatile dependencies.
Parameter: A key, value pair in this Mapping Constant: A Volatile constant:
Equality: Scopes may not be equal even if type and abstract properties are equal. If you need semantic equality use
Scope.as_dict()
-
abstract
change_constants
(new_constants)[source]¶ Change values of constants. Constants not present in the scope are ignored.
Warning
NonVolatileChange: if a parameter that is not in get_volatile_parameters is updated
- Return type
- Returns
New scope instance
-
abstract
get_volatile_parameters
()[source]¶ - Return type
_FrozenDictByWrapping
[str
,Expression
]- Returns
A mapping where the keys are the volatile parameters and the