Skip to content
Arithmetic library for IBM Qiskit
HTML Jupyter Notebook Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
AUTHORS
Demo-Oracle.ipynb
LICENSE
QArithmetic.ipynb
QArithmetic.py
QArithmetic.slides.html
README.md
qft.py
setup.py

README.md

QArithmetic

Arithmetic library for IBM Qiskit

This is our great, awesome, extremely impressive, daunting, inspiring arithmetic library.

List of operations implemented:

Bit-wise operations

Controlled Toffoli gate (qc,ctrl,a,b,c)

qc->quantum circuit, ctrl->control bit, a->toffoli control input1, b->toffoli control input2, c->target qubit

Source: O. Scott, Nathan & Dueck, G.W.. (2008). Pairwise decomposition of toffoli gates in a quantum circuit. 231-236. 10.1145/1366110.1366168.

Logical AND (qc, a, b, c, N)

qc->quantum circuit, a->input1, b->input2, c->output, N->bit-string length

Logical OR (qc, a, b, c, N)

qc->quantum circuit, a->input1, b->input2, c->output, N->bit-string length

Logical XOR (qc, a, b, c, N)

qc->quantum circuit, a->input1, b->input2, c->output, N->bit-string length

Logical NOT (qc, a, c, N)

qc->quantum circuit, a->input, c->output, N->bit-string length

Shift right (qc,reg,N,shift)

qc->quantum circuit, reg->shift register, N->shift register bit-length, shift->shift amount

Shift left (qc,reg,N,shift)

qc->quantum circuit, reg->shift register, N->shift register bit-length, shift->shift amount

Arithmetic operations

QFT-based add (Draper adder)

Source: Khosropour, A., Aghababa, H., & Forouzandeh, B. (2011). Quantum Division Circuit Based on Restoring Division Algorithm. 2011 Eighth International Conference on Information Technology: New Generations. doi:10.1109/itng.2011.177

Ripple carry add

Source: Vedral, V., Barenco, A., & Ekert, A. (1996). Quantum networks for elementary arithmetic operations. Physical Review A, 54(1), 147.

QFT-based sub

Uses the QFT-based adder and the fact that

a - b = ~(~a + b)

Ripple carry sub

Uses the ripple-carry adder and the fact that

a - b = ~(~a + b)

Multiply

Source: Nguyen, A. Q. (2004). TR-2004010: Optimal Reversible Quantum Circuit for Multiplication.

Divide

Source: Khosropour, A., Aghababa, H., & Forouzandeh, B. (2011). Quantum Division Circuit Based on Restoring Division Algorithm. 2011 Eighth International Conference on Information Technology: New Generations. doi:10.1109/itng.2011.177

You can’t perform that action at this time.