ComputeReciprocalI 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.Arithmetic

Package: Microsoft.Quantum.Numerics

Computes the reciprocal 1/x for an unsigned integer x using integer division. The result, interpreted as an integer, will be floor(2^(2*n-1) / x).

operation ComputeReciprocalI (xs : Microsoft.Quantum.Arithmetic.LittleEndian, result : Microsoft.Quantum.Arithmetic.LittleEndian) : Unit is Adj + Ctl

Input

xs : LittleEndian

n-bit unsigned integer

result : LittleEndian

2n-bit output, must be in $\ket{0}$ initially.

Output : Unit

Remarks

For the input x=0, the output will be all-ones.