ApplySeriesOfOps operation

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

Applies a list of ops and their targets sequentially on an array.

operation ApplySeriesOfOps<'T> (listOfOps : ('T[] => Unit)[], targets : Int[][], register : 'T[]) : Unit

Input

listOfOps : 'T[] => Unit []

List of ops, each taking a 'T array, to be applied. They are applied sequentially, lowest index first.

targets : Int[][]

Nested arrays describing the targets of the op. Each array should contain a list of ints describing the indices to be used.

register : 'T[]

Qubit register to be acted upon.

Output : Unit

Type Parameters

'T

Example

// The following applies Exp([PauliX, PauliY], 0.5) to qubits 0, 1 // then X to qubit 2 let ops = [Exp([PauliX, PauliY], 0.5, _), ApplyToFirstQubit(X, _)]; let indices = [[0, 1], [2]]; ApplySeriesOfOps(ops, indices, qubitArray);

See Also