Download presentation
Presentation is loading. Please wait.
Published byJasper Perkins Modified over 9 years ago
1
Final Project for Phys 642: An Introduction to Quantum Information and Quantum Computing Fall 2013 Implementing a Computer Simulation of Shor’s Quantum Factoring Algorithm Mark Foerster December 9, 2013
2
Overview Implemented from scratch in C++, as a partly numeric and partly symbolic algebra system Followed Box 5.4 on page 235 of Nielsen & Chuang for guidance & verification steps: “Keep the train on the rails” Considerable further development and re- implementation needed to conform to original ambitions
3
Shor’s Algorithm (as broken down by Nielsen & Chuang)
4
Shor’s Algorithm Continued (Nielsen & Chuang)
5
Implementation Pieces A class for representing a complex number with magnitude limited to a maximum of one – Magnitude squared stored as separate numerator and denominator. – Phase angle stored as separate numerator and denominator, represents a fraction of 2π. – The above are features for printed expression for easy recognition. Better than reading cryptic floating point numbers all the time. – Floating point numbers for radius, theta, real and imaginary also stored as numeric backup for “hairy” calculation results (adding numbers that have different phases).
6
Implementation Pieces A QuBit class that contains two of the complex numbers. An entangled state class (QuTangle) that may contain an unlimited quantity of the complex numbers. A Hadamard gate class. A Rotation gate class. A quantum Fourier transform class. A driving program to use them all.
7
Matching the Simulation Steps to Box 5.4’s Narrative
10
The next step was to perform the implicit measurement of the work register, selecting one out of the four modular exponentiation states to survive. One may either generate a pseudo-random number for selection or make a fixed choice. The text’s suggestion of 4 was followed for the latter. Printed, it is: sqrt(1/512)|2> + sqrt(1/512)|6> + sqrt(1/512)|10> + sqrt(1/512)|14> + sqrt(1/512)|18> + … … + sqrt(1/512)|2034> + sqrt(1/512)|2038> + sqrt(1/512)|2042> + sqrt(1/512)|2046> …this matches perfectly to the example quoted in the box for choosing 4.
11
Matching the Simulation Steps to Box 5.4’s Narrative
12
The result from inverse Fourier transform was very satisfying: sqrt(1/4)|0> - sqrt(1/4)|512> + sqrt(1/4)|1024> - sqrt(1/4)|1536> This is exactly what is graphed for the probability distribution in box 5.4. The text’s further suggestion of choosing 1536 is available, and so the rest of the narrative may be satisfied to obtain 3 and 5 as factors of 15.
13
Further Directions The simulation code developed so far requires another revision of data structure and procedures to handle the requirements of quantum factoring in a natural and automatic fashion. The preceding was accomplished only by making several arbitrary external manipulations (hacks) of the data. A genuine quantum circuit for modular exponentiation needs to be worked out and employed for this simulation. Source code on Newton in /home/mfoerste/p642.
14
References Quantum Computation and Quantum Information 10 th Anniversary Edition, Michael A. Nielsen and Isaac L. Chuang, Cambridge University Press, ISBN 978-1-107-00217-3.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.