View source on GitHub |
A class representing a Measurement Key.
cirq.MeasurementKey(
name: str, path: Tuple[str, ...] = dataclasses.field(default_factory=tuple)
)
Used in the notebooks
Used in the tutorials |
---|
Wraps a string key. If you just want the string measurement key, simply call str()
on this.
Attributes | |
---|---|
name
|
Dataclass field |
path
|
Dataclass field |
Methods
parse_serialized
@classmethod
parse_serialized( key_str: str ) -> 'MeasurementKey'
Parses the serialized string representation of Measurementkey
into a MeasurementKey
.
This is the only way to construct a MeasurementKey
from a nested string representation
(where the path is joined to the key name by the MEASUREMENT_KEY_SEPARATOR
)
replace
replace(
**changes
) -> 'MeasurementKey'
Returns a copy of this MeasurementKey with the specified changes.
with_key_path_prefix
with_key_path_prefix(
*path_component
)
Adds the input path component to the start of the path.
Useful when constructing the path from inside to out (in case of nested subcircuits), recursively.
__eq__
__eq__(
other
) -> bool
Return self==value.
__le__
__le__(
other
)
Return self<=value.
__lt__
__lt__(
other
)
Return self<value.