Arithmetic library for IBM Qiskit
This is our great, awesome, extremely impressive, daunting, inspiring arithmetic library.
List of operations implemented:
qc->quantum circuit, a->input1, b->input2, c->output, N->bit-string length
qc->quantum circuit, a->input1, b->input2, c->output, N->bit-string length
qc->quantum circuit, a->input1, b->input2, c->output, N->bit-string length
qc->quantum circuit, a->input, c->output, N->bit-string length
qc->quantum circuit, reg->shift register, N->shift register bit-length, shift->shift amount
qc->quantum circuit, reg->shift register, N->shift register bit-length, shift->shift amount
Uses the QFT-based adder and the fact that
a - b = ~(~a + b)
Uses the ripple-carry adder and the fact that
a - b = ~(~a + b)
Source: Nguyen, A. Q. (2004). TR-2004010: Optimal Reversible Quantum Circuit for Multiplication.
Uses a custom implementation of QFT-based controlled adder
a ^ 2 = a*20 + a*21 + .... + a*2n-2 + a*2n-1
Uses the QFT-adder based cmult and the fact that
a ^ b = a0 * a1 * .... * ab-2 * ab-1