qml.ftqc.measure_z¶
- measure_z(wires, reset=False, postselect=None)[source]¶
Perform a mid-circuit measurement in the Z basis. The measurements are performed using the 0, 1 convention rather than the ±1 convention.
Note
This function dispatches to
qml.measure
For more details on the results of mid-circuit measurements and how to use them, see
qml.measure
.- Parameters
wires (Wires) – The wire to measure.
reset (Optional[bool]) – Whether to reset the wire to the |0⟩ state after measurement.
postselect (Optional[int]) – Which basis state to postselect after a mid-circuit measurement. None by default. If postselection is requested, only the post-measurement state that is used for postselection will be considered in the remaining circuit.
- Returns
The mid-circuit measurement result linked to the created
MidMeasureMP
.- Return type
- Raises
QuantumFunctionError – if multiple wires were specified