qml.measurements.MeasurementValue¶
- class MeasurementValue(measurements, processing_fn=None)[source]¶
Bases:
Generic[T]A class representing unknown measurement outcomes in the qubit model.
Measurements on a single qubit in the computational basis are assumed.
- Parameters:
measurements (list[.MidMeasureMP]) – The measurement(s) that this object depends on.
processing_fn (callable | None) – A lazy transformation applied to the measurement values.
Attributes
A dictionary representing all possible outcomes of the MeasurementValue.
Whether or not classical processing is applied to the measurement value.
A lazy transformation applied to the measurement values.
Returns a list of wires corresponding to the mid-circuit measurements.
- branches¶
A dictionary representing all possible outcomes of the MeasurementValue.
- has_processing¶
Whether or not classical processing is applied to the measurement value.
- name = 'MeasurementValue'¶
- processing_fn¶
A lazy transformation applied to the measurement values.
- wires¶
Returns a list of wires corresponding to the mid-circuit measurements.
Methods
concretize(measurements)Returns a concrete value from a dictionary of hashes with concrete values.
items()A generator representing all the possible outcomes of the MeasurementValue.
map_wires(wire_map)Returns a copy of the current
MeasurementValuewith the wires of each measurement changed according to the given wire map.A generator representing all the possible outcomes of the MeasurementValue, taking postselection into account.
- concretize(measurements)[source]¶
Returns a concrete value from a dictionary of hashes with concrete values.
- map_wires(wire_map)[source]¶
Returns a copy of the current
MeasurementValuewith the wires of each measurement changed according to the given wire map.- Parameters:
wire_map (dict) – dictionary containing the old wires as keys and the new wires as values
- Returns:
new
MeasurementValueinstance with measurement wires mapped- Return type: