Skip to main content

Performing fully parallel constraint logic programming on a quantum annealer

  • SCOTT PAKIN (a1)

A quantum annealer exploits quantum effects to solve a particular type of optimization problem. The advantage of this specialized hardware is that it effectively considers all possible solutions in parallel, thereby potentially outperforming classical computing systems. However, despite quantum annealers having recently become commercially available, there are relatively few high-level programming models that target these devices. In this article, we show how to compile a subset of Prolog enhanced with support for constraint logic programming into a two-local Ising-model Hamiltonian suitable for execution on a quantum annealer. In particular, we describe the series of transformations one can apply to convert constraint logic programs expressed in Prolog into an executable form that bears virtually no resemblance to a classical machine model yet that evaluates the specified constraints in a fully parallel manner. We evaluate our efforts on a 1,095-qubit D-Wave 2X quantum annealer and describe the approach's associated capabilities and shortcomings.

Hide All
Barahona, F. 1982. On the computational complexity of Ising spin glass models. Journal of Physics A: Mathematical and General 15, 10, 3241.
Berkeley Logic Synthesis and Verification Group. 2016. ABC: A system for sequential synthesis and verification. URL: [Accessed on April 24, 2018].
Bravyi, S., Bessen, A. J. and Terhal, B. M. 2006. Merlin-Arthur games and stoquastic complexity. arXiv:quant-ph/0611021v2.
Bravyi, S. and Hastings, M. 2017. On complexity of the quantum Ising model. Communications in Mathematical Physics 349, 1, 145.
Brayton, R. and Mishchenko, A. 2010. ABC: An academic industrial-strength verification tool. In Proc. 22nd International Conference on Computer Aided Verification, Touili, T., Cook, B., and Jackson, P., Eds. Springer, Berlin, Heidelberg, Edinburgh, UK, 24–40.
Bunyk, P. I., Hoskinson, E. M., Johnson, M. W., Tolkacheva, E., Altomare, F., Berkley, A. J., Harris, R., Hilton, J. P., Lanting, T., Przybysz, A. J. and Whittaker, J. 2014. Architectural considerations in the design of a superconducting quantum annealing processor. IEEE Transactions on Applied Superconductivity 24, 4, 110.
Cai, J., Macready, B. and Roy, A. 2014. A practical heuristic for finding graph minors. arXiv:1406.2741 [quant-ph].
Choi, V. 2008. Minor-embedding in adiabatic quantum computation: I. The parameter setting problem. Quantum Information Processing 7, 5, 193209.
Cormen, T. H., Leiserson, C. E., Rivest, R. L. and Stein, C. 2001. Introduction to Algorithms, 2nd ed. MIT Press.
Cross, A. W., Bishop, L. S., Smolin, J. A. and Gambetta, J. M. 2017. Open quantum assembly language. arXiv:1707.03429 [quant-ph].
D-Wave Systems, Inc. 2017a. Developer Guide for Python. D-Wave Systems, Inc., Burnaby, British Columbia, Canada.
D-Wave Systems, Inc. 2017b. ToQ Overview. D-Wave Systems, Inc., Burnaby, British Columbia, Canada. ToQ documentation, qOp version 2.3.1.
Dahl, E. D. 2014. Deqo: A Direct Embedding Quantum Optimizer. D-Wave Systems, Inc.
Dutra, I. 2010. Constraint logic programming: A short tutorial. URL: [Accessed on April 24, 2018].
Farhi, E. and Gutmann, S. 1998. Analog analogue of a digital quantum computation. Physical Review A 57, 24032406.
Feynman, R. P. 1986. Quantum mechanical computers. Foundations of Physics 16, 6, 507531.
Finnila, A. B., Gomez, M. A., Sebenik, C., Stenson, C. and Doll, J. D. 1994. Quantum annealing: A new method for minimizing multidimensional functions. Chemical Physics Letters 219, 5, 343348.
Fujitsu Laboratories Ltd. 2017. Fujitsu Laboratories Develops New Architecture that Rivals Quantum Computers in Utility. Press release, 20 October 2016, Kawasaki, Japan. URL: [Accessed on April 24, 2018].
Gansner, E. R. and North, S. C. 2000. An open graph visualization system and its applications to software engineering. Software–-Practice and Experience 30, 11, 12031233.
Green, A. S., Lumsdaine, P. L., Ross, N. J., Selinger, P. and Valiron, B. 2013. Quipper: A scalable quantum programming language. In Proc. of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, New York, USA, 333–342.
Grover, L. K. 1996. A fast quantum mechanical algorithm for database search. In Proc. of the 28th Annual ACM Symposium on Theory of Computing. ACM, New York, NY, USA, 212–219.
Heim, B., Brown, E. W., Wecker, D. and Troyer, M. 2017. Designing adiabatic quantum optimization: A case study for the traveling salesman problem. arXiv:1702.06248v1 [quant-ph].
Hen, I. and Young, A. P. 2011. Exponential complexity of the quantum adiabatic algorithm for certain satisfiability problems. Physical Review E 84, 061152.
James, R. P., Ortiz, G. and Sabry, A. 2011. Quantum computing over finite fields. arXiv:1101.3764 [quant-ph].
JavadiAbhari, A., Patil, S., Kudrow, D., Heckey, J., Lvov, A., Chong, F. T. and Martonosi, M. 2015. ScaffCC: Scalable compilation and analysis of quantum programs. Parallel Computing 45, 217.
Johnson, M. W., Amin, M. H. S., Gildert, S., Lanting, T., Hamze, F., Dickson, N., Harris, R., Berkley, A. J., Johansson, J., Bunyk, P., Chapple, E. M., Enderud, C., Hilton, J. P., Karimi, K., Ladizinsky, E., Ladizinsky, N., Oh, T., Perminov, I., Rich, C., Thom, M. C., Tolkacheva, E., Truncik, C. J. S., Uchaikin, S., Wang, J., Wilson, B. and Rose, G. 2011. Quantum annealing with manufactured spins. Nature 473, 7346, 194198.
Kadowaki, T. and Nishimori, H. 1998. Quantum annealing in the transverse Ising model. Physical Review E 58, 53555363.
Kahn, H., La Fontaine, R. and Lau, R. 2000. Electronic design interchange format (EDIF): Part 2: Version 4 0 0. Standard IEC 61690-2:2000, International Electrotechnical Commission, Manchester, UK.
Kaminsky, W. M., Lloyd, S. and Orlando, T. P. 2004. Scalable superconducting architecture for adiabatic quantum computation. arXiv:quant-ph/0403090v2.
Kirkpatrick, S., Gelatt, C. D. and Vecchi, M. P. 1983. Optimization by simulated annealing. Science 220, 4598, 671680.
Knight, W. 2017. IBM Raises the Bar with a 50-Qubit Quantum Computer. MIT Technology Review. 10 November 2017. ISSN: 0040-1692. URL: [Accessed on April 24, 2018].
Lucas, A. 2014. Ising formulations of many NP problems. Frontiers in Physics 2, 5, 115.
Microsoft Corp. 2017. The Q# progamming language. URL: [Accessed on April 24, 2018].
Nethercote, N., Stuckey, P. J., Becket, R., Brand, S., Duck, G. J. and Tack, G. 2007. MiniZinc: Towards a standard CP modelling language. In Proc. of the 13th International Conference on Principles and Practice of Constraint Programming, Bessière, C., Ed. Springer, Berlin, Heidelberg, 529–543.
Pakin, S. 2016. A quantum macro assembler. In Proc. of the 2016 IEEE High Performance Extreme Computing Conference (HPEC).
Robinson, J. A. 1965. A machine-oriented logic based on the resolution principle. Journal of the ACM 12, 1, 2341.
Shor, P. W. 1999. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM Review 41, 2, 303332.
Smith, R. S., Curtis, M. J. and Zeng, W. J. 2017. A practical quantum instruction set architecture. arXiv:1608.03355 [quant-ph].
Thomas, D. and Moorby, P. 2002. The Verilog Hardware Description Language, 5th ed. Springer.
Triska, M. 2012. The finite domain constraint solver of SWI-Prolog. In Proc. of the 11th International Symposium on Functional and Logic Programming (FLOPS 2012). Lecture Notes in Computer Science, vol. 7294. Kobe, Japan, 307–316.
Wecker, D. and Svore, K. M. 2014. LIQUi|〉: A software design architecture and domain-specific language for quantum computing. arXiv:1402.4467 [quant-ph].
Wielemaker, J., Schrijvers, T., Triska, M. and Lager, T. 2012. SWI-Prolog. Theory and Practice of Logic Programming 12, 1–2, 6796.
Wolf, C. and Glaser, J. 2013. Yosys–-A free Verilog synthesis suite. In Proc. of the 21st Austrian Workshop on Microelectronics (Austrochip 2013). Linz, Austria.
Yamaoka, M., Yoshimura, C., Hayashi, M., Okuyama, T., Aoki, H. and Mizuno, H. 2016. A 20k-spin Ising chip to solve combinatorial optimization problems with CMOS annealing. IEEE Journal of Solid-State Circuits 51, 1, 303309.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Theory and Practice of Logic Programming
  • ISSN: 1471-0684
  • EISSN: 1475-3081
  • URL: /core/journals/theory-and-practice-of-logic-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *



Altmetric attention score

Full text views

Total number of HTML views: 0
Total number of PDF views: 3 *
Loading metrics...

Abstract views

Total abstract views: 61 *
Loading metrics...

* Views captured on Cambridge Core between 6th May 2018 - 26th May 2018. This data will be updated every 24 hours.