QuIDD-Optimised Quantum Algorithms by S K University of York Computer science 3 rd year project Supervisor: Prof Susan Stepney 03/05/2004 1
Project Objectives Investigate the QuIDD optimisation techniques Implement QFT transform step of Shor s factorisation algorithm using these techniques 03/05/2004 2
Topics The QuIDD Optimisation techniques Simulation of the QFT step of Shor s Algorithm Design Issues Implementation Results and Analysis Conclusions Future Work 03/05/2004 3
What is QuIDD anyway? It s an extension of Algebraic Decision Diagram (ADD), which is itself an extension of Binary Decision Diagram (BDD) More on next slides. BDD MTBDD ROBDD ADD 03/05/2004 4
Binary Decision Diagrams (BDD) Direct Acyclic Graph (DAG) Widely used in design and verification of digital systems Powerful representation of Boolean functions of the form f = x0.x1 + x1 Nodes represent function variables Terminals represent function values from the set {0, 1} 03/05/2004 5
BDD contd DAG Nodes variables Terminals values = 0 and 1 Solid edge is called the then edge and traversing this edge is same as assigning 1 to a variable represented by that edge Broken edge is known as the else edge, traversing this edge = assign 0 03/05/2004 6
ROBDD The original BDD was not canonical Lots of redundancy Bryant introduced reduction rules and variable ordering to make BDDs canonical Reduction rule1: Merge Isomorphic sub graphs. Applying this rule to the graph on slide 6 we get this ==> 03/05/2004 7
ROBDD Reduction rule 2 Collapse nodes whose then and else edges point to the same node Apply this rule to the graph on the right; to get the graph shown on the next slide 03/05/2004 8
ROBDD One gets canonical representation of f after the reductions The value of the function f depends only on the value of X1 03/05/2004 9
MTBDD Adopted the BDD; introduced multi terminal nodes Instead of two nodes representing 0 and 1 we can have multi-terminals terminals representing numbers from 0 to (2^n)- 1 Introduced algorithms for arithmetic symbolic computation on BDDs But limited to special class of matrices which arise in Walsh transform 03/05/2004 10
Algebraic Decision Diagrams (ADD) Bahar et all took the MTBDD and introduced broad symbolic algorithms Called it ADDs More efficient algorithms, however, remains exponential in worst case Efficiency dependent on the seize of ROBDD, which in turn depends on Variable ordering Finding optimal variable ordering is NP-complete However, efficient heuristics have been developed for many cases of interest Robust and well documented ADD based package - CUDD 03/05/2004 11
Quantum Information Decision Diagrams (QuIDDs) Viamontes et al observed that tensor products induces regularity into matrices representing quantum operators, which lend themselves to the ADD/BDD structure Restricted the values of terminals to set of complex numbers Used clever technique for implementing complex terminals => terminal nodes as array indices Designed a package called QUIDD Pro to simulate Quantum computations classically Its underlying package is a package called CUDD which implements ADDs 03/05/2004 12
Complexity Analysis ( A B) ), where a binary operator Tensor product O(ab), a and b are number of ADD nodes of A and B respectively Matrix multiplication O(ab)^2 03/05/2004 13
What has been done with QuIDDs so far Simulated Grover s search algorithm On quantum computers Ο(N^1/2) Classically O(N/2) = quadratic speed up 03/05/2004 14
Grover s algorithm decomposed Quantum circuit representation involves Five major components: An Oracle Controlled phase shift gates Sets of Hadamard gates The data qubits An Oracle Qubit 03/05/2004 15
Hadamard operator Tensor product of Hadamard operators => lots of repetition of equivalent blocks Recursive block sub-structure, structure, which means huge compression in the QuIDDs representation 03/05/2004 16
Complexity- Grover s Init = 00000 0> 1> = implemented by n-n tensor products O(n) memory and space complexity N Hadamard gates applied to the above state vector => matrix vector multiplication =>O(n^4) N-data qubits => O(1) By Similar analysis on the rest of the gates they O(A^16 n^14), A the size of the oracle 03/05/2004 17
Comments This is just after one Grover s iteration But we need O(N^1/2) iteration to boost the probability of finding the key N = 2^n I don t see a polynomial algorithm here, but then this is the worst case!? 03/05/2004 18
Can QuIDDs simulate Shor s algorithm efficiently? Factorisation can be reduced to Phase Estimation Phase estimation needs: The Quantum Fourier Transform 03/05/2004 19
The bottlenecks of SFA Quantum Fourier Transform (QFT) Modular Exponentiation The rest can be done efficiently classically If the QFT step can be simulated classically, efficiently then we can implement Shor s algorithm efficiently on classical computers 03/05/2004 20
Focus on QFT Naïve approach direct implementation of the 2^n x 2^n matrix O(2^2n) Attempted to simulate the QFT circuit by mimicking the circuit on QuIDD Pro Because of QuIDD pro s s limited primitive programming facilities, code become too large; moreover, couldn t t scale more than 7 qubits Investigated the definition for a better design 03/05/2004 21
Implementation Found a better way of implementing the QFT Now QuIDD Pro s primitive operators could be used to program the design in a simple and scalable way Managed to simulate up to 13 qubits of the QFT step of Shor s algorithm 32 qubits QFT step simulator is still running for over 45 hours 03/05/2004 22
Emperical results I QFT step simulator run-time in seconds qubits (n) output1 output2 output3 output4 output5 output6 output7 output8 output9 average 3 0.21 0.22 0.21 0.21 0.22 0.21 0.21 0.21 0.22 0.213333 4 0.6 0.6 0.6 0.6 0.62 0.62 0.61 0.61 0.6 0.606667 5 1.6 1.59 1.63 1.6 1.56 1.57 1.59 1.58 1.58 1.588889 6 4.06 4.09 4.12 4.07 4.12 4.09 4.07 4.11 4.05 4.086667 7 9.81 9.81 9.77 9.92 9.81 9.8 9.76 9.84 9.77 9.81 8 24.31 24.33 24.48 24.32 24.23 24.19 22.88 22.33 24.11 23.90889 9 59.31 59.79 59.75 59.45 59.24 59.74 59.04 59.29 59.19 59.42222 10 157.4 158.3 156.61 157.61 158.38 157.64 158.44 158.51 158.73 157.9578 11 421.35 422.71 421.52 421.27 419.48 422.24 420.53 420.19 419.11 420.9333 12 1348.42 1353.07 1350.95 1350.08 1348.31 1352.24 1347.92 1348.18 1347.6 1349.641 13 4155.45 4167.1 4157.41 4156.26 4154.07 4164.43 4150.91 4152.14 4153.26 4156.781 03/05/2004 23
Emperical Result II QFT step simulator Peak Memory Usage (MB) qubits (n) output1 output2 output3 output4 output5 output6 output7 output8 output9 average 3 0.128906 0.128906 0.101562 0.128906 0.128906 0.128906 0.128906 0.128906 0.128906 0.128906 4 0.003906 0.003906 0.003906 0.003906 0.003906 0.003906 0.003906 0.003906 0.003906 0.003906 5 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 0 8 0.007813 0.007813 0.007813 0.007813 0.007813 0.007813 0.007813 0.007813 0.007813 0.007813 9 0.019531 0.019531 0.019531 0.019531 0.019531 0.019531 0.019531 0.019531 0.019531 0.019531 10 0.035156 0.035156 0.035156 0.035156 0.035156 0.035156 0.035156 0.035156 0.035156 0.035156 11 0.074219 0.074219 0.074219 0.074219 0.074219 0.074219 0.074219 0.074219 0.074219 0.074219 12 0.152344 0.152344 0.152344 0.152344 0.152344 0.152344 0.152344 0.152344 0.152344 0.152344 13 0.414062 0.414062 0.414062 0.414062 0.414062 0.414062 0.414062 0.414062 0.414062 0.414062 03/05/2004 24
Clearly exponential RUNTIME 10000 1000 runtime in seconds 100 10 Series1 1 0.1 3 4 5 6 7 8 9 10 11 12 13 number of quibits 03/05/2004 25
Fairly good peak memory usage less than 0.5 MB! Mean Peak Memory Usage 0.45 0.4 0.35 peak memory usage in MB 0.3 0.25 0.2 0.15 Series1 0.1 0.05 0 3 4 5 6 7 8 9 10 11 12 13 number of quibits 03/05/2004 26
Current Work Working to be able to factor 77 Finding A way around a bug causing a measurement operator crush 03/05/2004 27
Conclusions Simulation of QFT on QuIDD Pro still requires exponential runtime resources Up to 13-qubits, peak memory usage of 0.5 MB is not bad at all! The constantly changing phase factor of the control phase shift gate appearing in the QFT circuit makes compression difficult for QuIDDs Don t know yet for what memory complexity will be for qubits >13 03/05/2004 28
Future Works QuIDD Pro implementation provides modest memory complexity for the QFT step of Shor s Simulation of the QFT Pro on a single basis state of 21-qubits are relatively faster than other implementation based (e.g. on MATLAB ) May be finding a way of parallelising this QFT step simulation and executing them in parallel, perhaps over clusters of processors, may reduce run time for large qubits significantly 03/05/2004 29
Future Work QuIDD Pro precision for larger qubits is not reliable, this is worsen by division by increasingly small numbers in the controlled phase shift gate of the QFT circuit It appeared to have impeded reductions of QuIDD nodes Approximate QFT implementation could ease this problem 03/05/2004 30