BoolArrayAsPauli 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.Convert

Package: Microsoft.Quantum.Standard

Given a bit string, returns a multi-qubit Pauli operator represented as an array of single-qubit Pauli operators.

function BoolArrayAsPauli (pauli : Pauli, bitApply : Bool, bits : Bool[]) : Pauli[]

Input

pauli : Pauli

Pauli operator to apply to qubits where bitsApply == bits[idx].

bitApply : Bool

apply Pauli if bit is this value.

bits : Bool[]

Boolean array.

Output : Pauli[]

Remarks

The Boolean array and the quantum register must be of equal length.