2024
Quantum Full Adder
Side project, built out of curiosity. A quantum circuit that adds two binary numbers — and, unintentionally, a very concrete demonstration of why simulating quantum circuits on a classical machine stops being practical so quickly.
The program takes two decimal numbers, converts them to binary, builds a quantum circuit that adds them using a Toffoli-gate approach for the carry logic, and reports the result in both binary and decimal. It runs on Qiskit's AerSimulator, so the whole thing executes on an ordinary computer rather than on quantum hardware.
That last detail is what makes it interesting. Simulating a quantum circuit classically means holding its full state vector in memory, and that grows exponentially with the number of qubits. Adding numbers up to 511 needs roughly 16 GB of RAM. The range 1024–2047 needs 128 GB. Beyond 2048 it runs to a terabyte — to perform an addition any pocket calculator does instantly.
It is a toy, but it puts a number on the exponential wall that motivates the rest of my work: the reason quantum simulation is hard classically is not subtle, and here it shows up as a hardware requirements table. The repository includes the main script, notebooks working through 2-, 3- and 4-bit additions, and is MIT licensed.
Methods & tools
- Qiskit
- Qiskit Aer
- Toffoli gates
- Python
- Jupyter