Processing math: 100%

qml.ftqc.measure_y

measure_y(wires, reset=False, postselect=None)[source]

Perform a mid-circuit measurement in the Y basis. The measurements are performed using the 0, 1 convention rather than the ±1 convention.

For more details on the results of mid-circuit measurements and how to use them, see qml.measure.

For more details on mid-circuit measurements in an arbitrary basis (besides the computational basis), see measure_arbitrary_basis.

Warning

Measurements should be diagonalized before execution for any device that only natively supports mid-circuit measurements in the computational basis. To diagonalize, the diagonalize_mcms transform can be applied.

Skipping diagonalization for a circuit containing parametric mid-circuit measurements may result in a completed execution with incorrect results.

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

MeasurementValue

Raises

QuantumFunctionError – if multiple wires were specified