View source on GitHub |
An object that is a measurement and has a measurement key or keys.
cirq.SupportsMeasurementKey(
*args, **kwargs
)
Measurement keys are used in referencing the results of a measurement.
Users are free to implement one of the following. Do not implement multiple of these returning different values. The protocol behavior will be unexpected in such a case.
_measurement_key_objs_
returning an iterable ofMeasurementKey
s_measurement_key_obj_
returning oneMeasurementKey
_measurement_key_names_
returning an iterable of strings_measurement_key_name_
returning one string
$$
\rho \rightarrow \sum_k A_k \rho A_k^\dagger
$$
where as a measurement enacts the evolution
$$
\rho \rightarrow A_k \rho A_k^\dagger
$$
conditional on the measurement outcome being \(k\).
Methods
_is_measurement_
_is_measurement_() -> bool
Return if this object is (or contains) a measurement.
_measurement_key_name_
_measurement_key_name_() -> str
Return the string key that will be used to identify this measurement.
When a measurement occurs, either on hardware, or in a simulation, this is the key value under which the results of the measurement will be stored.
_measurement_key_names_
_measurement_key_names_() -> Union[FrozenSet[str], NotImplementedType, None]
Return the string keys for measurements performed by the receiving object.
When a measurement occurs, either on hardware, or in a simulation, these are the key values under which the results of the measurements will be stored.
_measurement_key_obj_
_measurement_key_obj_() -> 'cirq.MeasurementKey'
Return the key object that will be used to identify this measurement.
When a measurement occurs, either on hardware, or in a simulation, this is the key value under which the results of the measurement will be stored.
_measurement_key_objs_
_measurement_key_objs_() -> Union[FrozenSet['cirq.MeasurementKey'], NotImplementedType, None]
Return the key objects for measurements performed by the receiving object.
When a measurement occurs, either on hardware, or in a simulation, these are the key values under which the results of the measurements will be stored.
_with_measurement_key_mapping_
_with_measurement_key_mapping_(
key_map: Mapping[str, str]
)
Return a copy of this object with the measurement keys remapped.
This method allows measurement keys to be reassigned at runtime.