ControlledOnInt function

Namespace: Microsoft.Quantum.Canon

Package: Microsoft.Quantum.Standard

Returns a unitary operator that applies an oracle on the target register if the control register state corresponds to a specified positive integer.

function ControlledOnInt<'T> (numberState : Int, oracle : ('T => Unit is Adj + Ctl)) : ((Qubit[], 'T) => Unit is Adj + Ctl)

Input

numberState : Int

Positive integer.

oracle : 'T => Unit is Adj + Ctl

Unitary operator.

Output : (Qubit[],'T) => Unit is Adj + Ctl

A unitary operator that applies oracle on the target register if the control register state corresponds to the number state numberState.

Type Parameters

'T

Remarks

The value of numberState is interpreted using a little-endian encoding.