In the paper presented by Smith, Curtis and Zeng, Quil specifies the instruction set for a Quantum Abstract Machine (QAM,) akin to a Turing machine, yet more practical for accomplishing "real-world" tasks.9 The state of the QAM can be represented as a 6-tuple ( | Ψ ⟩ , C , G , G ′ , P , κ ) {\displaystyle (|\Psi \rangle ,C,G,G',P,\kappa )} where:
The semantics of the QAM are defined using tensor products of Hilbert spaces and the linear maps between them.10
Quil has support for defining possibly parametrized gates in matrix form (the language does not include a way to verify that the matrices are unitary, which is a necessary condition for the physical realizability of the defined gate) and their application on qubits. The language also supports macro-like definitions of possibly parametrized quantum circuits and their expansion, qubit measurement and recording of the outcome in classical memory, synchronization with classical computers with the WAIT instruction which pauses the execution of a Quil program until a classical program has ended its execution, conditional and unconditional branching, pragma support, as well as inclusion of files for use as libraries (a standard set of gates is provided as one of the libraries.)
Rigetti Computing developed a quantum virtual machine in Common Lisp that simulates the defined Quantum Abstract Machine on a classical computer and is capable of the parsing and execution of Quil programs with possibly remote execution via HTTP.11
The following example demonstrates the classical control flow needed to do quantum teleportation of the qubit in register 2 to register 1:1213
Examples of the implementations of the quantum fourier transform and the variational quantum Eigensolver are given in the paper.
Smith, Robert S.; Curtis, Michael J.; Zeng, William J. (2016-08-10). "A Practical Quantum Instruction Set Architecture". arXiv:1608.03355 [quant-ph]. /wiki/ArXiv_(identifier) ↩
McClean, Jarrod R.; Romero, Jonathan; Babbush, Ryan; Aspuru-Guzik, Alán (2016-02-04). "The theory of variational hybrid quantum-classical algorithms". New Journal of Physics. 18 (2): 023023. arXiv:1509.04279. Bibcode:2016NJPh...18b3023M. doi:10.1088/1367-2630/18/2/023023. ISSN 1367-2630. S2CID 92988541. /wiki/ArXiv_(identifier) ↩
Rubin, Nicholas C. (2016-10-21). "A Hybrid Classical/Quantum Approach for Large-Scale Studies of Quantum Systems with Density Matrix Embedding Theory". arXiv:1610.06910 [quant-ph]. /wiki/ArXiv_(identifier) ↩
Farhi, Edward; Goldstone, Jeffrey; Gutmann, Sam (2014-11-14). "A Quantum Approximate Optimization Algorithm". arXiv:1411.4028 [quant-ph]. /wiki/ArXiv_(identifier) ↩
"Rigetti Launches Full-Stack Quantum Computing Service and Quantum IC Fab". IEEE Spectrum: Technology, Engineering, and Science News. 26 June 2017. Retrieved 2017-07-06. https://spectrum.ieee.org/rigetti-launches-fullstack-quantum-computing-service-and-quantum-ic-fab ↩
"Rigetti Quietly Releases Beta of Forest Platform for Quantum Programming in the Cloud | Quantum Computing Report". quantumcomputingreport.com. 8 March 2017. Retrieved 2017-07-06. https://quantumcomputingreport.com/news/rigetti-quietly-releases-beta-of-forest-platform-for-quantum-programming-in-the-cloud/ ↩
"XACC Rigetti Accelerator". ornl-qci.github.io. Retrieved 2017-07-06. https://ornl-qci.github.io/xacc/accelerators/rigetti ↩
Doiron, Nick (2017-03-07), jsquil: Quantum computer instructions for JavaScript developers, retrieved 2017-07-06 https://github.com/mapmeld/jsquil ↩
The @rigetti high-performance quantum virtual machine.: rigetti/qvm, Rigetti Computing, 2019-04-26, retrieved 2019-04-28 https://github.com/rigetti/qvm ↩
Nielsen, Michael A.; Chuang, Isaac L. (2000). Quantum Computation and Quantum Information. Cambridge University Press. p. 27. ISBN 978-0-521-63503-5. 978-0-521-63503-5 ↩
Computing, Rigetti (28 May 2019). "pyQuil Documentation" (PDF). pyQuil Documentaion. Retrieved 6 June 2019. https://media.readthedocs.org/pdf/pyquil/latest/pyquil.pdf ↩