MultiplyAndAddByModularInteger 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.Standard
Performs a modular multiply-and-add by integer constants on a qubit register.
operation MultiplyAndAddByModularInteger (constMultiplier : Int, modulus : Int, multiplicand : Microsoft.Quantum.Arithmetic.LittleEndian, summand : Microsoft.Quantum.Arithmetic.LittleEndian) : Unit is Adj + Ctl
Description
Implements the map $$ \begin{align} \ket{x} \ket{b} \mapsto \ket{x} \ket{(b + a \cdot x) \operatorname{mod} N} \end{align} $$ for a given modulus $N$, constant multiplier $a$, and summand $b$.
Input
constMultiplier : Int
An integer $a$ by which multiplicand
is being multiplied.
Must be between 0 and modulus
-1, inclusive.
modulus : Int
The modulus $N$ which addition and multiplication is taken with respect to.
multiplicand : LittleEndian
A quantum register representing an unsigned integer whose value, multiplied by constMultiplier
, is to
be added to each basis state label of summand
. Corresponds to the
register in state $\ket{x}$ above.
summand : LittleEndian
A quantum register representing an unsigned integer to use as the target for this operation. Corresponds to the register initially in $\ket{b}$ above.
Output : Unit
Remarks
- For the circuit diagram and explanation see Figure 6 on Page 7 of arXiv:quant-ph/0205095v3
- This operation corresponds to CMULT(a)MOD(N) in arXiv:quant-ph/0205095v3
See Also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for