IncrementByInteger operation


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

Please see for the API documentation for the Modern QDK.

Namespace: Microsoft.Quantum.Arithmetic

Package: Microsoft.Quantum.Standard

Increments an unsigned quantum register by a classical integer, using phase rotations.

operation IncrementByInteger (increment : Int, target : Microsoft.Quantum.Arithmetic.LittleEndian) : Unit is Adj + Ctl


Suppose that target encodes an unsigned integer $x$ in a little-endian encoding and that increment is equal to $a$. Then, this operation implements the unitary $\ket{x} \mapsto \ket{x + a}$, where the addition is performed modulo $2^n$, where $n = \texttt{Length(target!)}$.


increment : Int

The integer by which the target is incremented by.

target : LittleEndian

A quantum register encoding an unsigned integer using little-endian encoding.

Output : Unit