cirq.SupportsMeasurementKey

An object that is a measurement and has a measurement key or keys.

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.

  1. _measurement_key_objs_ returning an iterable of MeasurementKeys
  2. _measurement_key_obj_ returning one MeasurementKey
  3. _measurement_key_names_ returning an iterable of strings
  4. _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_

View source

Return if this object is (or contains) a measurement.

_measurement_key_name_

View source

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_

View source

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_

View source

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_

View source

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_

View source

Return a copy of this object with the measurement keys remapped.

This method allows measurement keys to be reassigned at runtime.