M operation

Namespace: Microsoft.Quantum.Intrinsic

Package: Microsoft.Quantum.QSharp.Core

Performs a measurement of a single qubit in the Pauli $Z$ basis.

operation M (qubit : Qubit) : Result


Description

The output result is given by the distribution \begin{align} \Pr(\texttt{Zero} | \ket{\psi}) = \braket{\psi | 0} \braket{0 | \psi}. \end{align}

Input

qubit : Qubit

Qubit to be measured.

Output : Result

Zero if the $+1$ eigenvalue is observed, and One if the $-1$ eigenvalue is observed.

Remarks

Equivalent to:

Measure([PauliZ], [qubit]);