v2.19 (in development)
- Add a section to
CONTRIBUTING.md
about publishing packages to conda-forge (@appleby, gh-1186). controlled
modifier now accepts either a Sequence of control qubits or a single control qubit. Previously, only a single control qubit was supported (@adamglos92, gh-1196)
v2.18 (March 3, 2020)
- Fixed the QCS access request link in the README (@amyfbrown, gh-1171).
- Fix the SDK download link and instructions in the docs (@amyfbrown, gh-1173).
- Fix broken link to example now in forest-tutorials (@jlapeyre, gh-1181).
- Removed HALT from valid Protoquil / supported Quil. (@kilimanjaro, gh-1176).
- Fix error in comment in Noise and Quantum Computation page (@jlapeyre gh-1180)
v2.17 (January 30, 2020)
- In order to make the pyQuil examples more accessible, we recently made a new repository, rigetti/forest-tutorials, which is set up so that the example notebooks can be run via a web browser in a preconfigured execution environment on Binder. The pyQuil README now has a "launch binder" badge for running these tutorial notebooks, as well as a "Quickstart" section explaining how they work. To run the tutorial notebooks, click the badge in the README or the link here (@karalekas, gh-1167).
- Pin the
antlr4-python3-runtime
package to belowv4.8
(@karalekas, gh-1163). - Expand upon the acknowledgements file to mention contributions from pre-QCS and list previous maintainers (@karalekas, gh-1165).
- Use the rigetti/gitlab-pipelines
repository's template YAMLs in the
.gitlab-ci.yml
, and add a section toCONTRIBUTING.md
about the CI/CD pipelines (@karalekas, gh-1166). - Add another round of improvements to the README (@karalekas, gh-1168).
- Replace references to non-existent
endpoint
init arg when constructingQPUCompiler
s intest_qpu.py
(@appleby, gh-1164). - Preserve program metadata when constructing and manipulating
Experiment
objects (@kilimanjaro, gh-1160).
v2.16 (January 10, 2020)
- The
TomographyExperiment
class has been renamed toExperiment
. In addition, there is a newQuantumComputer.calibration
method for performing readout calibration on a providedExperiment
, and utilities for applying the results of the calibration to correct for symmetrized readout error.ExperimentSetting
objects now also have anadditional_expectations
attribute for extracting simultaneously measurable expectation values from a single setting when usingQuantumComputer.experiment
(@karalekas, gh-1152, gh-1158).
- Type hints have been added to the
quil.py
file (@rht, gh-1115, gh-1134). - Use Black for code style
and enforce it (along with a line length of 100) via the
style
(flake8
) andformatcheck
(black --check
) CI jobs (@karalekas, gh-1132). - Ignore fewer
flake8
style rules, add theflake8-bugbear
plugin, and rename the style-relatedMakefile
targets and CI jobs so that they have a uniform naming convention:check-all
,check-format
,check-style
, andcheck-types
(@karalekas, gh-1133). - Added type hints to
noise.py
, began verifying in the CI (@rht, gh-1136). - Improved reStructuredText markup in docstrings (@peterjc, gh-1141).
- Add helper to separate
ExperimentResults
by groups of qubits on which their operator acts (@kylegulshen, gh-1078). - Added typing to the
pyquil/latex
module and added the module to thecheck-types
CI job (@karalekas, gh-1142). - Add helper to merge
TomographyExperiment
s in theexperiment
module's_group.py
file. Movegroup_experiments
fromoperator_estimation.py
to_group.py
and rename togroup_settings
but maintain backwards compatibility (@kylegulshen, gh-1077). - The code in
gate_matrices.py
,numpy_simulator.py
,reference_simulator.py
, andunitary_tools.py
has been typed and reorganized into a newsimulation
subdirectory, maintaining backwards compatibility (@karalekas, gh-1143). - Added a
.travis.yml
file to enable Travis CI for external-contributor builds, and upgraded GitLab CI style checks to py37 (@karalekas, gh-1145). - Delete
api/_job.py
,JobConnection
, andSyncConnection
, which have been deprecated for over a year and a half (@karalekas, gh-1144). - Added typing to the
pyquil/experiment
module and added the module to thecheck-types
CI job (@karalekas, gh-1146). - Use
dataclasses
instead ofnamedtuples
in thepyquil/device
module, and add type annotations to the entire module (@karalekas, gh-1149). - Reduced the number of
mypy
errors inpaulis.py
(@rht, gh-1147). - Compile to XY gates as well as CZ gates on dummy QVMs (@ecpeterson, gh-1151).
QAM.write_memory
now accepts either aSequence
of values or a single value (@tommy-moffat, gh-1114).- Added type hints for all remaining top-level files (@karalekas, gh-1150).
- Added type annotations to the whole
pyquil.api
module (@karalekas, gh-1157).
- Don't attach pipes to stdout/stderr when starting quilc and qvm processes in
local_forest_runtime
. This prevents the pipe buffers from getting full and causing hung quilc/qvm for long running processes (@appleby, gh-1122). - Pass a sequence to
np.vstack
to avoid aFutureWarning
, and add a protoquil keyword argument toMyLazyCompiler.quil_to_native_quil
to avoid aTypeError
in themigration2-qc.ipynb
notebook (@appleby, gh-1138). - Removed unused method
Program._out()
inquil.py
(@rht, gh-1137). - Fixed string concatenation style, caused by
black
(@peterjc, gh-1139).
v2.15 (December 20, 2019)
- PyQuil now supports encryption for communication with the QPU. It does so
by requesting an
Engagement
from Forest Dispatch, which includes the keys necessary for encryption along with the endpoints to use. This workflow is managed by the newForestSession
class, and in the general case is transparent to the user (@kalzoo, gh-1123).
- LaTeX circuit output now ignores
RESET
instructions by default, rendering instead the (equivalent) program withRESET
omitted (@kilimanjaro, gh-1118) - Broadened the scope of
flake8
compliance to the include theexamples
anddocs
directories, and thus the whole repository (@tommy-moffat, gh-1113). DEFGATE ... AS PAULI-SUM
is now supported (@ecpeterson, gh-1125).- Add unit test for validating Trotterization order (@jmbr, gh-1120).
- Updated the authentication mechanism to Forest server. Preferentially use
credentials found at
~/.qcs/user_auth_credentials
and fall back to~/.qcs/qmi_auth_credentials
(@erichulburd, gh-1123). - The log level can now be controlled with the
LOG_LEVEL
environment variable, set toLOG_LEVEL=DEBUG
to help diagnose problems. In addition, certain errors will no longer print their entire stack trace outside ofDEBUG
mode, for a cleaner console and better user experience. This is only true for errors where the cause is well known (@kalzoo, gh-1123). - Connection to the QPU compiler now supports both ZeroMQ and HTTP(S) (@kalzoo, gh-1127).
- Bump quilc / qvm parent Docker images to v1.15.1 (@karalekas, gh-1128).
- Pinned the
mypy
version to work around issue with nested types causing themake typecheck
CI job to fail (@erichulburd, gh-1119). - Minor fixes for
examples/1.3_vqe_demo.py
andexamples/quantum_walk.ipynb
(@appleby, gh-1116). - Only request engagement from Forest Dispatch when QPU and QPU Compiler addresses are not provided by other configuration sources (@kalzoo, gh-1130).
v2.14 (November 25, 2019)
- There is a new
QuantumComputer.experiment
method for running a collection of quantum programs as defined by aTomographyExperiment
. These objects have a main program body and a collection of state preparation and measurement specifications, which capture the structure of many near-term applications and algorithms like the variational quantum eigensolver (VQE). In addition, theTomographyExperiment
encodes information about symmetrization, active qubit reset, and the number of shots to perform on the quantum backend (e.g. the QVM or QPU). For more information check out the API documentation sections on the Quantum Computer and on the Experiment Module (@karalekas, gh-1100).
- Type hints have been added to the
PauliTerm
class (@rht, gh-1075). - The
rigetti/forest
Docker image now has less noisy output due to stdout and stderr redirection to log filesentrypoint.sh
(@karalekas, gh-1105). - Added a
make typecheck
target to runmypy
over a subset of the pyquil sources, and enabled typechecks in the GitLab CI pipeline (@appleby, gh-1098). - Added support for the
XY
(parameterizediSWAP
) gate family inProgram
s and inISA
s (@ecpeterson, gh-1096, gh-1107, gh-1111). - Removed the
tox.ini
andreadthedocs.yml
files (@karalekas, gh-1108). - Type hints have been added to the
PauliSum
class (@rht, gh-1104).
- Fixed a bug in the LaTeX output of controlled unitary operations (@kilimanjaro, gh-1103).
- Fixed an example of using the
qc.run
method in the docs to correctly declare the size of a memory register (@appleby, gh-1099). - Specify UTF-8 encoding when opening files that might contain non-ascii characters, such as when reading the pyquil README.md file in setup.py or when serializing / deserializing pyquil.experiment objects to/from JSON (@appleby, gh-1102).
v2.13 (November 7, 2019)
- Rather than installing pyQuil from PyPI, conda-forge, or the source directly,
users with Docker installed can pull and run the
rigetti/forest
Docker image to quickly get started with compiling and simulating quantum programs! When running the image, a user will be dropped into anipython
REPL that has pyQuil and its requirements preinstalled, along with quilc and qvm servers running in the background (@karalekas, gh-1035, gh-1039). - Circuit diagram generation has had a makeover! In particular, the
pyquil.latex
module provides two mechanisms for generating diagrams from pyQuil programs:pyquil.latex.to_latex
generates human-readable LaTeX output expressing aProgram
as a circuit diagram, andpyquil.latex.display
renders aProgram
as anIPython.display.Image
for inline viewing in Jupyter Notebooks. Learn more about these features in the new example notebook (@kilimanjaro, gh-1074).
- Added a
Makefile
with some simple targets for performing common build operations like creating and uploading a package (@karalekas, gh-1032). - Replaced symmetrization in
operator_estimation
with functionality contained withinQuantumComputer.run_symmetrized_readout
(@kylegulshen, gh-1047). - As part of the CI, we now package and push to TestPyPI on every commit, which
de-risks breaking the
setup.py
and aids with testing (@karalekas, gh-1017). - We now calculate code coverage as part of the CI pipeline (@karalekas, gh-1052).
- Moved the program generation from
measure_observables
into its own private function (@kylegulshen, gh-1043). - All uses of
__future__
andsix
have been dropped (@karalekas, gh-1060). - The
conftest.py
has been moved to the project root dir (@karalekas, gh-1064). - Using
protoquil
as a positional argument toqc.compile
has been deprecated, and it is now a keyword-only argument (@karalekas, gh-1071). PauliSum
objects are now hashable (@ecpeterson, gh-1073).- The code in
device.py
as been reorganized into a newdevice
subdirectory in a completely backwards-compatible fashion (@karalekas, gh-1066, gh-1094). PauliTerm
andPauliSum
now have__repr__
methods (@karalekas, gh-1080).- The experiment-schema-related code in
operator_estimation.py
has been moved into a newexperiment
subdirectory (@karalekas, gh-1084, gh-1094). - The keyword arguments to
measure_observables
are now captured as part of theTomographyExperiment
class (@karalekas, gh-1090). - Type hints have been added to the
pyquil.gates
,pyquil.quilatom
, andpyquil.quilbase
modules (@appleby, gh-999). - We now support Python 3.8 and it is tested in the CI (@karalekas, gh-1093).
- Updated
examples/meyer_penny_game.py
with the correct path to the Meyer Penny game exercise indocs/source/exercises.rst
(@appleby, gh-1045). - Fixed the Slack Workspace invite link in the README (@amyfbrown, gh-1042).
QPU.reset()
now checks whetherpyquil_config.qpu_url
exists before updating the endpoint so as not to break custom connections (@kylegulshen, gh-1072).- Fixed pretty printing of parameter expressions where π is involved (@notmgsk, gh-1076).
- Fixed a regression in
PyQVM.execute
that prevented it from running programs containing user-defined gates (@appleby, gh-1067). - Remove some stale code for pulling quilc version info (@notmgsk, gh-1089).
v2.12 (September 28, 2019)
- There is now a Contributing Guide for those who would like to participate in the development of pyQuil. Check it out! In addition, pyQuil now has a Bug Report Template, and a Feature Request Template, which contain sections to fill out when filing a bug or suggesting an enhancement (@karalekas, gh-985, gh-986, gh-996).
- The
local_qvm
context manager has been renamed tolocal_forest_runtime
, which now checks if the designated ports are used before startingqvm
/quilc
. The originallocal_qvm
has been deprecated (@sauercrowd, gh-976). - The test suite for pyQuil now runs against both Python 3.6 and 3.7 to ensure compatibility with the two most recent versions of Python (@karalekas, gh-987).
- Add support for the
FORKED
gate modifier (@kilimanjaro, gh-989). - Deleted the deprecated modules
parameters.py
andqpu.py
(@karalekas, gh-991). - The test suite for pyQuil now runs much faster, by setting the default value
of the
--use-seed
option forpytest
toTrue
(@karalekas, gh-992). - Support non-gate instructions (e.g.
MEASURE
) into_latex()
(@notmgsk, gh-975). - Test suite has been updated to reduce the use of deprecated features (@kilimanjaro, gh-998, gh-1005).
- Certain tests have been marked as "slow", and are skipped unless
the
--runslow
option is specified forpytest
(@kilimanjaro, gh-1001). PauliSum
objects can now be constructed from strings viafrom_compact_str()
andPauliTerm.from_compact_str()
supports multi-qubit strings (@jlbosse, gh-984).
- Strength two symmetrization was not correctly producing orthogonal arrays due to erroneous truncation, which has been fixed (@kylegulshen, gh-990).
- The
STORE
instruction now acceptsint
orfloat
in addition toMemoryReference
as itssource
argument. As a result, you can nowSTORE
an immediate value into a memory register. Also, theEQ
,LT
,LE
,GT
, andGE
instructions now all acceptfloat
in addition toint
orMemoryReference
as their third and final argument. As a result, you can now perform classical comparisons against an immediatefloat
value. Finally, theCONVERT
instruction now accepts any valid memory reference designator (aMemoryReference
, a string, or a tuple of type(str, int)
) for both its arguments (@appleby, gh-1010). - Raise an error if a gate with non-constant parameters is provided to
lifted_gate
(@notmgsk, gh-1012).
v2.11 (September 3, 2019)
- PyQuil's changelog has been overhauled and rewritten in Markdown instead of
RST, and can be found in the top-level directory of the repository as the
CHANGELOG.md file (which is the standard for most GitHub
repositories). However, during the build process, we use
pandoc
to convert it back to RST so that it can be included as part of the ReadTheDocs documentation here (@karalekas, gh-945, gh-973).
- Test suite attempts to retry specific tests that fail often. Tests are retried only a single time (@notmgsk, gh-951).
- The
QuantumComputer.run_symmetrized_readout()
method has been revamped, and now has options for using more advanced forms of readout symmetrization (@joshcombes, gh-919). - The ProtoQuil restrictions built in to PyQVM have been removed (@ecpeterson, gh-874).
- Add the ability to query for other memory regions after both QPU and QVM
runs. This removes a previously unnecessary restriction on the QVM, although
ro
remains the only QPU-writeable memory region during Quil execution (@ecpeterson, gh-873). - Now, running
QuantumComputer.reset()
(andQuantumComputer.compile()
when using the QPU) additionally resets the connection information for the underlyingQVM
/QPU
andQVMCompiler
/QPUCompiler
objects, which should resolve bugs that arise due to stale clients/connections (@karalekas, gh-872). - In addition to the simultaneous 1Q RB fidelities contained in device
specs prior to this release, there are now 1Q RB fidelities for
non-simultaneous gate operation. The names of these fields have been
changed for clarity, and standard errors for both fidelities have been
added as well. Finally, deprecation warnings have been added regarding
the
fCPHASE
andfBellState
device spec fields, which are no longer routinely updated and will be removed in release v2.13 (@jvalery2, gh-968). - The NOTICE has been updated to accurately reflect the third-party software used in pyQuil (@karalekas, gh-979).
- PyQuil now sends “modern” ISA payloads to quilc, which must be of version
>=
1.10.0
. Check out the details ofget_isa
for information on how to specify custom payloads (@ecpeterson, gh-961).
- The
MemoryReference
warnings have been removed from the unit tests (@maxKenngott, gh-950). - The
merge_programs
function now supports merging programs withDefPermutationGate
, instead of throwing an error, and avoids redundant readout declaration (@kylegulshen, gh-971). - Remove unsound logic to fill out non-"ro" memory regions when targeting a QPU (@notmgsk, gh-982).
v2.10 (July 31, 2019)
- Rewrote the README, adding a more in-depth overview of the purpose of pyQuil as a library, as well as two badges -- one for PyPI downloads and another for the Forest Slack workspace. Also, included an example section for how to get started with running a simple Bell state program on the QVM (@karalekas, gh-946, gh-949).
- The test suite for
pyquil.operator_estimation
now has an (optional) faster version that uses fixed random seeds instead of averaging over several experiments. This can be enabled with the--use-seed
command line option when runningpytest
(@msohaibalam, gh-928). - Deleted the deprecated modules
job_results.py
andkraus.py
(@karalekas, gh-957). - Updated the examples README. Removed an outdated notebook. Updated
remaining notebooks to use
MemoryReference
, and fix any parts that were broken (@notmgsk, gh-820). - The
AbstractCompiler.quil_to_native_quil()
function now accepts aprotoquil
keyword which tells the compiler to restrict both input and output to protoquil (i.e. Quil code executable on a QPU). Additionally, the compiler will return a metadata dictionary that contains statistics about the compiled program, e.g. its estimated QPU runtime. See the compiler docs for more information (@notmgsk, gh-940). - Updated the QCS and Slack invite links on the
index.rst
docs page (@starktech23, gh-965). - Provided example code for reading out the QPU runtime estimation for a program (@notmgsk, gh-963).
unitary_tools.lifted_gate()
was not properly handling modifiers such asDAGGER
andCONTROLLED
(@kylegulshen, gh-931).- Fixed warnings raised by Sphinx when building the documentation (@appleby, gh-929).
v2.9.1 (June 28, 2019)
- Relaxed the requirement for a quilc server to exist when users of
the
QuantumComputer
object only want to do simulation work with aQVM
orpyQVM
backend (@karalekas, gh-934).
v2.9 (June 25, 2019)
- PyQuil now has a Pull Request Template, which contains a checklist of things that must be completed (if applicable) before a PR can be merged (@karalekas, gh-921).
- Removed a bunch of logic around creating inverse gates from
user-defined gates in
Program.dagger()
in favor of a simpler call toGate.dagger()
(@notmgsk, gh-887). - The
RESET
instruction now works correctly withQubitPlaceholder
objects and theaddress_qubits
function (@jclapis, gh-910). ReferenceDensitySimulator
can now have a state that is persistent between rounds ofrun
orrun_and_measure
(@joshcombes, gh-920).
- Small negative probabilities were causing
ReferenceDensitySimulator
to fail (@joshcombes, gh-908). - The
dagger
function was incorrectly dropping gate modifiers likeCONTROLLED
(@jclapis, gh-914). - Negative numbers in classical instruction arguments were not being parsed (@notmgsk, gh-917).
- Inline math rendering was not working correctly in
intro.rst
(@appleby, gh-927).
Thanks to community member @jclapis for the contributions to this release!
v2.8 (May 20, 2019)
- PyQuil now verifies that you are using the correct version of the QVM and quilc (@karalekas, gh-913).
- Added support for defining permutation gates for use with the latest version of quilc (@notmgsk, gh-891).
- The rpcq dependency requirement has been raised to v2.5.1 (@notmgsk, gh-911).
- Added a note about the QVM's compilation mode to the documentation (@stylewarning, gh-900).
- Some measure_observables params now have the
Optional
type specification (@msohaibalam, gh-903).
- Preserve modifiers during
address_qubits
(@notmgsk, gh-907).
v2.7.2 (May 3, 2019)
- An additional backwards-incompatible change from gh-870 snuck through 2.7.1, and is addressed in this patch release (@karalekas, gh-901).
v2.7.1 (April 30, 2019)
- The changes to operator estimation (gh-870, gh-896) were not made in a backwards-compatible fashion, and therefore this patch release aims to remedy that. Going forward, there will be much more stringent requirements around backwards compatibility and deprecation (@karalekas, gh-899).
v2.7 (April 29, 2019)
- Standard deviation -> standard error in operator estimation (@msohaibalam, gh-870).
- Update what pyQuil expects from quilc in terms of rewiring pragmas -- they are now comments rather than distinct instructions (@ecpeterson, gh-878).
- Allow users to deprioritize QPU jobs -- mostly a Rigetti-internal feature (@jvalery2, gh-877).
- Remove the
qubits
field from theTomographyExperiment
dataclass (@msohaibalam, gh-896).
- Ensure that shots aren't lost when passing a
Program
throughaddress_qubits
(@notmgsk, gh-895). - Fixed the
conda
install command in the README (@seandiscovery, gh-890).
v2.6 (March 29, 2019)
- Added a CODEOWNERS file for default reviewers (@karalekas, gh-855).
- Bifurcated the
QPUCompiler
endpoint parameter into two --quilc_endpoint
andqpu_compiler_endpoint
-- to reflect changes in Quantum Cloud Services (@karalekas, gh-856). - Clarified documentation around the DELAY pragma (@willzeng, gh-862).
- Added information about the
local_qvm
context manager to the getting started documentation (@willzeng, gh-851). - Added strict version lower bounds on the rpcq and networkx dependencies (@notmgsk, gh-828).
- A slice of a
Program
object now returns aProgram
object (@notmgsk, gh-848).
- Added a non-None default timeout to the
QVMCompiler
object and theget_benchmarker
function (@karalekas, gh-850, gh-854). - Fixed the docstring for the
apply_clifford_to_pauli
function (@kylegulshen, gh-836). - Allowed the
apply_clifford_to_pauli
function to now work with the Identity as input (@msohaibalam, gh-849). - Updated a stale link to the Rigetti Forest Slack workspace (@karalekas, gh-860).
- Fixed a notation typo in the documentation for noise (@willzeng, gh-861).
- An
IndexError
is now raised when trying to access an out-of-bounds entry in aMemoryReference
(@notmgsk, gh-819). - Added a check to ensure that
measure_observables
takes as many shots as requested (@marcusps, gh-846).
Special thanks to @willzeng for all the contributions this release!
- PyQuil's Gate objects now expose
.controlled(q)
and.dagger()
modifiers, which turn a gate respectively into its controlled variant, conditional on the qubitq
, or into its inverse. - The operator estimation suite's
measure_observables
method now exposes areadout_symmetrize
argument, which helps mitigate a machine's fidelity asymmetry between recognizing a qubit in the ground state versus the excited state. - The
MEASURE
instruction in pyQuil now has a mandatory second argument. Previously, the second argument could be omitted to induce "measurement for effect", without storing the readout result to a classical register, but users found this to be a common source of accidental error and a generally rude surprise. To ensure the user really intends to measure only for effect, we now require that they supply an explicitNone
as the second argument.
- Some stale tests have been brought into the modern era.
- The Quil Compiler (quilc) and
the Quantum Virtual Machine
(QVM), which are part of the
Forest SDK, have been open sourced! In addition to downloading the
binaries, you can now build these applications locally from source,
or run them via the Docker images
rigetti/quilc and
rigetti/qvm. These Docker
images are now used as the
services
in the GitLab CI build plan YAML (gh-792, gh-794, gh-795).
- The
WavefunctionSimulator
now supports the use of parametric Quil programs, via thememory_map
parameter for its various methods (gh-787). - Operator estimation data structures introduced in v2.2 have
changed. Previously,
ExperimentSettings
had two members:in_operator
andout_operator
. Theout_operator
is unchanged, butin_operator
has been renamed toin_state
and its data type is nowTensorProductState
instead ofPauliTerm
. It was always an abuse of notation to interpret pauli operators as defining initial states. Analogous to the Pauli helper functions sI, sX, sY, and sZ,TensorProductState
objects are constructed by multiplying together terms generated by the helper functions plusX, minusX, plusY, minusY, plusZ, and minusZ. This functionality enables process tomography and process DFE (gh-770). - Operator estimation now offers a "greedy" method for grouping tomography-like experiments that share a natural tensor product basis (ntpb), as an alternative to the clique cover version (gh-754).
- The
quilc
endpoint for rewriting Quil parameter arithmetic has been changed fromresolve_gate_parameter_arithmetic
torewrite_arithmetic
(gh-802). - The difference between ProtoQuil and QPU-supported Quil is now better defined (gh-798).
- Resolved an issue with post-gate noise in the pyQVM (gh-801).
- A
TypeError
with a useful error message is now raised when aProgram
object is run on a QPU-backedQuantumComputer
, rather than a confusingAttributeError
(gh-799).
PyQuil 2.3 is the latest release of pyQuil, Rigetti's toolkit for constructing and running quantum programs. A major new feature is the release of a new suite of simulators:
- We're proud to introduce the first iteration of a Python-based
quantum virtual machine (QVM) called PyQVM. This QVM is completely
contained within pyQuil and does not need any external dependencies.
Try using it with
get_qc("9q-square-pyqvm")
or explore thepyquil.pyqvm.PyQVM
object directly. Under-the-hood, there are three quantum simulator backends:ReferenceWavefunctionSimulator
uses standard matrix-vector multiplication to evolve a statevector. This includes a suite of tools inpyquil.unitary_tools
for dealing with unitary matrices.NumpyWavefunctionSimulator
uses numpy's tensordot functionality to efficiently evolve a statevector. For most simulations, performance is quite good.ReferenceDensitySimulator
uses matrix-matrix multiplication to evolve a density matrix.
- Matrix representations of Quil standard gates are included in
pyquil.gate_matrices
(gh-552). - The density simulator has extremely limited support for Kraus-operator based noise models. Let us know if you're interested in contributing more robust noise-model support.
- This functionality should be considered experimental and may undergo minor API changes.
- Quil math functions (like COS, SIN, ...) used to be ambiguous with respect to case sensitivity. They are now case-sensitive and should be uppercase (gh-774).
- In the next release of pyQuil, communication with quilc will happen
exclusively via the rpcq protocol.
LocalQVMCompiler
andLocalBenchmarkConnection
will be removed in favor of a unifiedQVMCompiler
andBenchmarkConnection
. This change should be transparent if you useget_qc
andget_benchmarker
, respectively. In anticipation of this change we recommend that you upgrade your version of quilc to 1.3, released Jan 30, 2019 (gh-730). - When using a paramaterized gate, the QPU control electronics only
allowed multiplying parameters by powers of two. If you only ever
multiply a parameter by the same constant, this isn't too much of a
problem because you can fold the multiplicative constant into the
definition of the parameter. However, if you are multiplying the
same variable (e.g.
gamma
in QAOA) by different constants (e.g. weighted maxcut edge weights) it doesn't work. PyQuil will now transparently handle the latter case by expanding to a vector of parameters with the constants folded in, allowing you to multiply variables by whatever you want (gh-707).
- The CZ gate fidelity metric available in the Specs object now has
its associated standard error, which is accessible from the method
Specs.fCZ_std_errs
(gh-751). - Operator estimation code now correctly handles identity terms with coefficients. Previously, it would always estimate these terms as 1.0 (gh-758).
- Operator estimation results include the total number of counts (shots) taken.
- Operator estimation JSON serialization uses utf-8. Please let us know if this causes problems (gh-769).
- The example quantum die program now can roll dice that are not powers of two (gh-749).
- The teleportation and Meyer penny game examples had a syntax error (gh-778, gh-772).
- When running on the QPU, you could get into trouble if the QPU name
passed to
get_qc
did not match the lattice you booked. This is now validated (gh-771).
We extend thanks to community member @estamm12 for their contribution to this release.
PyQuil 2.2 is the latest release of pyQuil, Rigetti's toolkit for constructing and running quantum programs. Bug fixes and improvements include:
pauli.is_zero
andpaulis.is_identity
would sometimes return erroneous answers (gh-710).- Parameter expressions involving addition and subtraction are now
converted to Quil with spaces around the operators, e.g.
theta + 2
instead oftheta+2
. This disambiguates subtracting two parameters, e.g.alpha - beta
is not one variable namedalpha-beta
(gh-743). - T1 is accounted for in T2 noise models (gh-745).
- Documentation improvements (gh-723, gh-719, gh-720, gh-728, gh-732, gh-742).
- Support for PNG generation of circuit diagrams via LaTeX (gh-745).
- We've started transitioning to using Gitlab as our continuous integration provider for pyQuil (gh-741, gh-752).
This release includes a new module for facilitating the estimation of quantum observables/operators (gh-682). First-class support for estimating observables should make it easier to express near-term algorithms. This release includes:
- data structures for expressing tomography-like experiments and their results
- grouping of experiment settings that can be simultaneously estimated
- functionality to executing a tomography-like experiment on a quantum computer
Please look forward to more features and polish in future releases. Don't hesitate to submit feedback or suggestions as GitHub issues.
We extend thanks to community member @petterwittek for their contribution to this release.
Bugfix release 2.2.1 was released January 11 to maintain compatibility with the latest version of the quilc compiler (gh-759).
PyQuil 2.1 is an incremental release of pyQuil, Rigetti's toolkit for constructing and running quantum programs. Changes include:
- Major documentation improvements.
QuantumComputer.run()
accepts an optionalmemory_map
parameter to facilitate running parametric executables (gh-657).QuantumComputer.reset()
will reset the state of a QAM to recover from an error condition (gh-703).- Bug fixes (gh-674, gh-696).
- Quil parser improvements (gh-689, gh-685).
- Optional interleaver argument when generating RB sequences (gh-673).
- Our GitHub organization name has changed from
rigetticomputing
torigetti
(gh-713).
PyQuil 2.0 is a major release of pyQuil, Rigetti's toolkit for constructing and running quantum programs. This release contains many major changes including:
- The introduction of Quantum Cloud Services. Access Rigetti's QPUs from co-located classical compute resources for minimal latency. The web API for running QVM and QPU jobs has been deprecated and cannot be accessed with pyQuil 2.0
- Advances in classical control systems and compilation allowing the pre-compilation of parametric binary executables for rapid hybrid algorithm iteration.
- Changes to Quil---our quantum instruction language---to provide easier ways of interacting with classical memory.
The new QCS access model and features will allow you to execute hybrid quantum algorithms several orders of magnitude (!) faster than the previous web endpoint. However, to fully exploit these speed increases you must update your programs to use the latest pyQuil features and APIs. Please read the documentation on what is New in Forest 2 for a comprehensive migration guide.
An incomplete list of significant changes:
- Python 2 is no longer supported. Please use Python 3.6+
- Parametric gates are now normal functions. You can no longer write
RX(pi/2)(0)
to get a QuilRX(pi/2) 0
instruction. Just useRX(pi/2, 0)
. - Gates support keyword arguments, so you can write
RX(angle=pi/2, qubit=0)
. - All
async
methods have been removed fromQVMConnection
andQVMConnection
is deprecated.QPUConnection
has been removed in accordance with the QCS access model. Usepyquil.get_qc
as the primary means of interacting with the QVM or QPU. WavefunctionSimulator
allows unfettered access to wavefunction properties and routines. These methods and properties previously lived onQVMConnection
and have been deprecated there.- Classical memory in Quil must be declared with a name and type. Please read New in Forest 2 for more.
- Compilation has changed. There are now different
Compiler
objects that target either the QPU or QVM. You must explicitly compile your programs to run on a QPU or a realistic QVM.
Version 2.0.1 was released on November 9, 2018 and includes documentation changes only. This release is only available as a git tag. We have not pushed a new package to PyPI.
We're happy to announce the release of pyQuil 1.9. PyQuil is Rigetti's toolkit for constructing and running quantum programs. This release is the latest in our series of regular releases, and it's filled with convenience features, enhancements, bug fixes, and documentation improvements.
Special thanks to community members @sethuiyer, @vtomole, @rht, @akarazeev, @ejdanderson, @markf94, @playadust, and @kadora626 for contributing to this release!
One of the focuses of this release is a re-worked concept of "Qubit
Placeholders". These are logical qubits that can be used to construct
programs. Now, a program containing qubit placeholders must be
"addressed" prior to running on a QPU or QVM. The addressing stage
involves mapping each qubit placeholder to a physical qubit (represented
as an integer). For example, if you have a 3 qubit circuit that you want
to run on different sections of the Agave chip, you now can prepare one
Program and address it to many different subgraphs of the chip topology.
Check out the QubitPlaceholder
example notebook for more.
To support this idea, we've refactored parts of Pyquil to remove the
assumption that qubits can be "sorted". While true for integer qubit
labels, this probably isn't true in general. A notable change can be
found in the construction of a PauliSum
: now terms will stay in the
order they were constructed.
PauliTerm
now remembers the order of its operations.sX(1)*sZ(2)
will compile to different Quil code thansZ(2)*sX(1)
, although the terms will still be equal according to the__eq__
method. DuringPauliSum
combination of like terms, a warning will be emitted if two terms are combined that have different orders of operation.PauliTerm.id()
takes an optional argumentsort_ops
which defaults to True for backwards compatibility. However, this function should not be used for comparing term-type like it has been used previously. UsePauliTerm.operations_as_set()
instead. In the future,sort_ops
will default to False and will eventually be removed.Program.alloc()
has been deprecated. Please instantiateQubitPlaceholder()
directly or request a "register" (list) ofn
placeholders by using the class constructorQubitPlaceholder.register(n)
.- Programs must contain either (1) all instantiated qubits with
integer indexes or (2) all placeholder qubits of type
QubitPlaceholder
. We have found that most users use (1) but (2) will become useful with larger and more diverse devices. - Programs that contain qubit placeholders must be explicitly
addressed prior to execution. Previously, qubits would be assigned
"under the hood" to integers 0...N. Now, you must use
address_qubits
which returns a new program with all qubits indexed depending on thequbit_mapping
argument. The original program is unaffected and can be "readdressed" multiple times. PauliTerm
can now acceptQubitPlaceholder
in addition to integers.QubitPlaceholder
is no longer a subclass ofQubit
.LabelPlaceholder
is no longer a subclass ofLabel
.QuilAtom
subclasses' hash functions have changed.
Pyquil now includes support for performing a simple benchmarking routine
- randomized benchmarking. There is a new method in the
CompilerConnection
that will return sequences of pyquil programs, corresponding to elements of the Clifford group. These programs are uniformly randomly sampled, and have the property that they compose to the identity. When concatenated and run as one program, these programs can be used in a procedure called randomized benchmarking to gain insight about the fidelity of operations on a QPU.
In addition, the CompilerConnection
has another new method,
apply_clifford_to_pauli
which conjugates PauliTerms
by Program
that are composed of Clifford gates. That is to say, given a circuit C,
that contains only gates corresponding to elements of the Clifford
group, and a tensor product of elements P, from the Pauli group, this
method will compute $PCP^{dagger}$
Such a procedure can be used in
various ways. An example is predicting the effect a Clifford circuit
will have on an input state modeled as a density matrix, which can be
written as a sum of Pauli matrices.
This release includes some quality-of-life improvements such as the
ability to initialize programs with generator expressions, sensible
defaults for Program.measure_all
, and sensible defaults for
classical_addresses
in run
methods.
Program
can be initiated with a generator expression.Program.measure_all
(with no arguments) will measure all qubits in a program.classical_addresses
is now optional in QVM and QPUrun
methods. By default, any classical addresses targeted byMEASURE
will be returned.QVMConnection.pauli_expectation
acceptsPauliSum
as arguments. This offers a more sensible API compared toQVMConnection.expectation
.- pyQuil will now retry jobs every 10 seconds if the QPU is re-tuning.
CompilerConnection.compile
now takes an optional argumentisa
that allows per-compilation specification of the target ISA.- An empty program will trigger an exception if you try to run it.
We strongly support using Python 3 with Pyquil. Although this release works with Python 2, we are dropping official support for this legacy language and moving to community support for Python 2. The next major release of Pyquil will introduce Python 3.5+ only features and will no longer work without modification for Python 2.
shift_quantum_gates
has been removed. Users who relied on this functionality should useQubitPlaceholder
andaddress_qubits
to achieve the same result. Users should also double-check data resulting from use of this function as there were several edge cases which would cause the shift to be applied incorrectly resulting in badly-addressed qubits.- Slightly perturbed angles when performing RX gates under a Kraus noise model could result in incorrect behavior.
- The quantum die example returned incorrect values when
n = 2^m
.