This project contains a 2n + 3 Qubit implementation of Shor's algorithm based on this paper
The Qiskit sdk is used to build the Quantum Circuit and Qutech's Quantum Inspire platform is used to run a simulation. (Note that there is a time limit. For larger simulations a local simulator can be used).
./src/quantum/gates defines the gates (building blocks) of the circuit such as the Adder, Modular Adder, Controlled Multiplier, Controlled Swap. Which are used to finally construct the Controlled U Gate.
With the Controlled U Gate the Quantum Phase Estimation circuit can be built: control_qubits.py contains the code for this circuit with 2n control qubits and one_control_qubit.py contains the code using the "single control qubit trick".
Finally some postprocessing is performed in shor_algorithm.py to succesfully factorize a number into its prime factors.
- Stijn van de Water
- Andrzej Rubio Bizcaino
- Pepijn Habing
- Floris Scharmer