Simulations of Shor’s algorithm using matrix product states

  • D. S. Wang
  • Charles D. HillEmail author
  • L. C. L. Hollenberg


We show that under the matrix product state formalism the states produced in Shor’s algorithm can be represented using \(O(\max (4lr^2, 2^{2l}))\) space, where l is the number of bits in the number to factorise and r is the order and the solution to the related order-finding problem. The reduction in space compared to an amplitude formalism approach is significant, allowing simulations as large as 42 qubits to be run on a single processor with 32 GB RAM. This approach is readily adapted to a distributed memory environment, and we have simulated a 45-qubit case using 8 cores with 16 GB RAM in approximately 1 h.



This research was supported by the Australian Research Council Centre of Excellence for Quantum Computation and Communication Technology (Project Number CE110001027). DSW was supported in part by the Albert Shimmins Memorial Fund.


  1. 1.
    Nielson, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge University Press, Cambridge (2000)Google Scholar
  2. 2.
    Shor, P.W.: Algorithms for quantum computation: discrete logarithms and factoring. In: Proc. 35th Annu. Symp. Found. of Comput. Sci., pp. 124–134 (1994)Google Scholar
  3. 3.
    Shor, P.W.: Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM J. Comput. 26, 1484–1509 (1997)MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    Obenland, K.M., Despain, A.M.: A parallel quantum computer simulator. Presented at High Performance Computing (1998)Google Scholar
  5. 5.
    Niwa, J., Matsumoto, K., Imai, H.: General-purpose parallel simulator for quantum computing. Phys. Rev. A 66, 062317 (2002)ADSCrossRefzbMATHGoogle Scholar
  6. 6.
    Tabakin, F., Juliá-Díaz, B.: Qcmpi: a parallel environment for quantum computing. Comput. Phys. Commun. 180, 948–964 (2009)ADSMathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Raedt, K.D., Michielsen, K., Raedt, H.D., Trieu, B., Arnold, G., Richter, M., Lippert, T., Watanabe, H., Ito, N.: Massive parallel quantum computer simulator. Comput. Phys. Commun. 176, 121–136 (2007)ADSCrossRefzbMATHGoogle Scholar
  8. 8.
    Helmholtz Association of German Research Centres, World record: Jülich supercomputer simulates quantum computer, Press release, retrieved from (2010)
  9. 9.
    Vidal, G.: Efficient classical simulation of slightly entangled quantum computations. Phys. Rev. Lett. 91, 147902–147905 (2003)ADSCrossRefGoogle Scholar
  10. 10.
    Sanz, M., Egusquiza, I.L., Di Candia, R., Saberi, H., Lamata, L., Solano, E.: Entanglement classification with matrix product states. Sci Rep 5, 1–5 (2015). doi: 10.1038/srep30188 Google Scholar
  11. 11.
    Das, A., Chakrabarti, B.K.: Colloquium: quantum annealing and analog quantum computation. Rev. Mod. Phys. 80, 1061–1081 (2008)ADSMathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Dridi, R., Alghassi, H.: Prime factorization using quantum annealing and computational algebraic geometry, pp. 1–14 (2016). arXiv:1604.05796
  13. 13.
    Coppersmith, D.: An approximate Fourier transform useful in quantum factoring, Tech. Rep. RC 19642, T. J. Watson Research Center, IBM Corporation (1994)Google Scholar
  14. 14.
    Zalka, C.: Fast versions of Shor’s quantum factoring algorithm, quant-ph/9806084Google Scholar
  15. 15.
    Beauregard, S.: Circuit for Shor’s algorithm using 2n+3 qubits. Quantum Inf. Comput. 3, 175–185 (2003)MathSciNetzbMATHGoogle Scholar
  16. 16.
    Orus, R.: A practical introduction to tensor networks: matrix product states and projected entangled pair states. Ann. Phys. 349, 117–158 (2014)ADSMathSciNetCrossRefzbMATHGoogle Scholar
  17. 17.
    Browne, D.E.: Efficient classical simulation of the quantum Fourier transform. New J. Phys. 9, 146 (2007)ADSCrossRefGoogle Scholar
  18. 18.
    Yoran, N., Short, A.J.: Classical simulability and the significance of modular exponentiation in Shor’s algorithm. Phys. Rev. A 76, 060302(R) (2007)ADSCrossRefGoogle Scholar
  19. 19.
    Jozsa, R., Linden, N.: On the role of entanglement in quantum-computational speed-up. Proc. R. Soc. Lond. A 459, 2011–2032 (2003)ADSMathSciNetCrossRefzbMATHGoogle Scholar
  20. 20.
    Message passing interface forum.
  21. 21.
  22. 22.
    Blackford, L.S., Choi, J., Cleary, A., D’Azevedo, E., Demmel, J., Dhillon, I., Dongarra, J., Hammarling, S., Henry, G., Petitet, A., Stanley, K., Walker, D., Whaley, R.C.: ScaLAPACK Users’ Guide. Society for Industrial and Applied Mathematics, Philadelphia (1997)CrossRefzbMATHGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2017

Authors and Affiliations

  • D. S. Wang
    • 1
  • Charles D. Hill
    • 1
    Email author
  • L. C. L. Hollenberg
    • 1
  1. 1.Centre for Quantum Computation and Communication Technology, School of PhysicsThe University of MelbourneParkvilleAustralia

Personalised recommendations