FourierModAdder
QuICT.algorithm.arithmetic.adder.FourierModAdder ¶
FourierModAdder(qreg_size: int, addend: int, modulus: int, num_control: int = 0, in_fourier: bool = False, out_fourier: bool = False, name: str = None)
Bases: CompositeGate
Controlled modular adder, bea
Reference
[1]: "Circuit for Shor's algorithm using 2n+3 qubits": http://arxiv.org/abs/quant-ph/0205095v3
Parameters:
-
qreg_size(int) –Size of the quantum register waiting to be added. Needs to be greater than or equal to 2.
-
addend(int) –The integer that will be added to the qreg.
-
modulus(int) –The integer as modulus.
-
num_control(int, default:0) –Indicates the number of qubits for controlling the wired adder, up to 2 qubits. If not 0, the control bits will be on the highest bits.
-
in_fourier(bool, default:False) –If True, assuming the input register is already in ry-qft basis.
-
out_fourier(bool, default:False) –If True, after the addition, the qreg will be left in ry-qft basis.
-
name(str, default:None) –Name of the wired adder gate.
Raises:
-
GateParametersAssignedError–If
qreg_sizeis smaller than 2.