You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 7, 2019. It is now read-only.
The referenceqvm is the reference implementation of the QVM outlined in the
arXiv:1608:03355 by Robert Smith, Spike Curtis, and Will Zeng. It is a research package that
supports rapid prototyping and development of quantum programs using pyQuil.
Currently, this QVM supports a subset of functionality in the Quil specifications,
excepting certain functions (DEFCIRCUIT, WAIT, NOP).
Noise models (dephasing, Kraus operators), parametrization with bits in
classical memory, and other features will be added in future releases.
Installation
You can install reference-qvm directly from the Python package manager pip using:
pip install referenceqvm
To instead install reference-qvm from source, clone this repository, cd into it, and run:
pip install -r requirements.txt -e .
This will install the reference-qvm's dependencies if you do not already have them.
Development and Testing
We use tox and pytest for testing. Tests can be executed from the top-level directory by simply
running:
tox
The setup is currently testing Python 2.7 and Python 3.6.
Building the Docs
We use sphinx to build the documentation. To do this, navigate into pyQuil's top-level directory and run:
sphinx-build -b html ./docs/source ./docs/build
To view the docs navigate to the newly-created docs/build directory and open
the index.html file in a browser. Note that we use the Read the Docs theme for
our documentation, so this may need to be installed using pip install sphinx_rtd_theme.
Interaction with the referenceqvm
The qvm can be accessed in a similar way to the Forest QVM access.
Start by importing the synchronous connection object from the referenceqvm.api module
fromreferenceqvm.apiimportQVMConnection
and initialize a connection to the reference-qvm
qvm=QVMConnection()
By default, the Connection object uses the wavefunction transition type.
Then call the qvm.wavefunction(prog) method to get back the classical memory and the
pyquil.Wavefunction object given a pyquil.quil.Program object prog.
The reference-qvm has the same functionality as Forest QVM and is useful for testing
small quantum programs on a local machine. For example, the same code (up to the
referenceqvm.api import) can be used to simulate pyquil programs.
QVMConnection can also initialize a QVM that does not return a wavefunction but instead a unitary corresponding
to the pyquil program. This can be extremely useful in terms of debugging and understanding gate physics. For example,
we can examine the unitary for a CNOT operator.
If you use the reference-qvm please cite the repository as follows:
bibTex:
@misc{rqvm2017.0.0.1,
author = {Rigetti Computing",
title = {Reference-QVM},
year = {2017},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/rigetticomputing},
commit = {the commit you used}
}
and the paper outlining the Mathematical specification of the quantum-abstract-machine:
bibTeX:
@misc{1608.03355,
title={A Practical Quantum Instruction Set Architecture},
author={Smith, Robert S and Curtis, Michael J and Zeng, William J},
journal={arXiv preprint arXiv:1608.03355},
year={2016}
}
About
A reference implementation for a quantum virtual machine in Python