ZBits function

Warning

This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.

Namespace: Microsoft.Quantum.Bitwise

Package: Microsoft.Quantum.QSharp.Foundation

Returns an integer representing the Z bits of an array of Pauli operators.

function ZBits (paulis : Pauli[]) : Int

Input

paulis : Pauli[]

An array of Pauli operators to be represented as an integer.

Output : Int

An integer $x$ with binary representation $(p_{62},p_{61},\dots,p_0)$, where $p_i = 0$ if paulis[i] is PauliI or PauliX and where $p_i = 1$ if paulis[i] is PauliY or PauliZ.

Remarks

The function will fail if the length of paulis array is greater than 63.

See Also