EmbedPauli 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.Canon

Package: Microsoft.Quantum.Standard

Given a single-qubit Pauli operator and the index of a qubit, returns a multi-qubit Pauli operator with the given single-qubit operator at that index and PauliI at every other index.

function EmbedPauli (pauli : Pauli, location : Int, n : Int) : Pauli[]

Input

pauli : Pauli

A single-qubit Pauli operator to be placed at the given location.

location : Int

An index such that output[location] == pauli, where output is the output of this function.

n : Int

Length of the array to be returned.

Output : Pauli[]

Example

To obtain the array [PauliI, PauliI, PauliX, PauliI]:

EmbedPauli(PauliX, 2, 3);