├── .gitignore ├── .pylintrc ├── .toxcoveragerc ├── .travis.yml ├── ACKNOWLEDGEMENTS.md ├── LICENSE.txt ├── Makefile ├── README.md ├── docs ├── Makefile └── source │ ├── _static │ └── qf.css │ ├── backends.rst │ ├── channels.rst │ ├── circuits.rst │ ├── conf.py │ ├── datasets.rst │ ├── devnotes.rst │ ├── examples.rst │ ├── forest.rst │ ├── gates.rst │ ├── index.rst │ ├── intro.rst │ ├── measures.rst │ ├── ops.rst │ ├── programs.rst │ ├── qubits.rst │ ├── requirements.txt │ └── states.rst ├── examples ├── __init__.py ├── circuit_identities.ipynb ├── circuit_identities.py ├── circuit_visulizations.py ├── eager_fit_gate.py ├── qaoa_maxcut.py ├── quilc.py ├── state_prep_w16.py ├── state_prep_w4.py ├── swaptest.py ├── tensorflow2_fit_gate.py ├── tensorflow_fit_gate.py └── weyl.py ├── pytest.ini ├── quantumflow ├── __init__.py ├── backend │ ├── __init__.py │ ├── eagerbk.py │ ├── numpybk.py │ ├── tensorflow2bk.py │ ├── tensorflowbk.py │ └── torchbk.py ├── cbits.py ├── channels.py ├── circuits.py ├── config.py ├── dagcircuit.py ├── datasets │ ├── __init__.py │ └── data │ │ ├── README.md │ │ ├── graph10er100.g6 │ │ ├── graph11er100.g6 │ │ ├── graph12er100.g6 │ │ ├── graph13er100.g6 │ │ ├── graph14er100.g6 │ │ ├── graph15er100.g6 │ │ ├── graph16er100.g6 │ │ ├── graph17er100.g6 │ │ ├── graph18er100.g6 │ │ ├── graph19er100.g6 │ │ ├── graph20er100.g6 │ │ ├── graph21er100.g6 │ │ ├── graph22er100.g6 │ │ ├── graph23er100.g6 │ │ ├── graph24er100.g6 │ │ ├── graph25er100.g6 │ │ ├── graph26er100.g6 │ │ ├── graph27er100.g6 │ │ ├── graph28er100.g6 │ │ ├── graph29er100.g6 │ │ ├── graph30er100.g6 │ │ ├── graph31er100.g6 │ │ ├── graph32er100.g6 │ │ ├── graph6er100.g6 │ │ ├── graph7er100.g6 │ │ ├── graph8er100.g6 │ │ └── graph9er100.g6 ├── decompositions.py ├── forest │ ├── __init__.py │ └── pyquil.py ├── gates.py ├── measures.py ├── meta.py ├── ops.py ├── paulialgebra.py ├── programs.py ├── qaoa.py ├── qubits.py ├── states.py ├── stdgates.py ├── stdops.py ├── utils.py └── visualization.py ├── readthedocs.yml ├── requirements.txt ├── setup.py ├── tests ├── __init__.py ├── quil │ ├── bell.quil │ ├── classical_logic.quil │ ├── control_flow.quil │ ├── empty.quil │ ├── hello_world.quil │ ├── include.quil │ ├── measure.quil │ ├── qaoa.quil │ └── unparsable.quil ├── test_backend.py ├── test_cbits.py ├── test_channels.py ├── test_circuits.py ├── test_config.py ├── test_dagcircuit.py ├── test_datasets.py ├── test_decompositions.py ├── test_examples.py ├── test_forest.py ├── test_gates.py ├── test_measures.py ├── test_meta.py ├── test_parser.py ├── test_paulialgebra.py ├── test_programs.py ├── test_qaoa.py ├── test_qaoa_maxcut.py ├── test_qubits.py ├── test_quil.py ├── test_states.py ├── test_stdgates.py ├── test_stdops.py ├── test_tools.py ├── test_utils.py └── test_visualization.py ├── tools ├── benchmark.py ├── graph_generate.py └── mnist_rescale.py └── tox.ini /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | *.bak 6 | *.egg-info 7 | .DS_Store 8 | .cache 9 | .mypy_cache 10 | devnotes 11 | junk 12 | build 13 | _build 14 | dist 15 | .pytest_cache/ 16 | .tox/ 17 | .eggs/ 18 | .coverage 19 | docs/build 20 | 21 | quantumflow/version.py 22 | 23 | datasets/*.png 24 | datasets/*.npz 25 | 26 | devnotes.txt 27 | -------------------------------------------------------------------------------- /.toxcoveragerc: -------------------------------------------------------------------------------- 1 | 2 | # Configuration file for code coverage 3 | # 4 | # https://coverage.readthedocs.io/ 5 | # 6 | # Run test coverage with ``make coverage`` 7 | # 8 | # Use ``# pragma: no cover`` to exclude specific lines 9 | # 10 | 11 | # .toxcoverage used to configure coverage for tox testing. 12 | # Exclude backends (which can't all get 100% coverage)??? 13 | 14 | [run] 15 | omit = quantumflow/backend/* 16 | 17 | [report] 18 | exclude_lines = 19 | pragma: no cover 20 | from quantumflow.backend. -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | sudo: required 3 | dist: xenial 4 | 5 | python: 6 | - "3.6" 7 | 8 | install: 9 | - sudo apt-get update 10 | - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; 11 | - bash miniconda.sh -b -p $HOME/miniconda 12 | - export PATH="$HOME/miniconda/bin:$PATH" 13 | - hash -r 14 | - conda config --set always_yes yes --set changeps1 no 15 | - conda update -q conda 16 | - conda info -a 17 | - conda install -c conda-forge lapack 18 | - conda install -c cvxgrp cvxpy 19 | - conda install -c pytorch pytorch 20 | - conda list 21 | - pip install -q -r requirements.txt 22 | - pip install -q guzzle_sphinx_theme 23 | - pip install . 24 | 25 | script: 26 | - python -m quantumflow.meta 27 | - QUANTUMFLOW_BACKEND=numpy pytest --disable-pytest-warnings --cov=quantumflow --cov-config .toxcoveragerc --cov-fail-under 100 --cov-report term-missing tests/ 28 | - QUANTUMFLOW_BACKEND=eager pytest --disable-pytest-warnings 29 | - QUANTUMFLOW_BACKEND=torch pytest --disable-pytest-warnings 30 | - flake8 quantumflow examples tests tools setup.py 31 | - mypy -p quantumflow --ignore-missing-imports 32 | - sphinx-build -M html docs/source docs/build 33 | - sphinx-build -M doctest docs/source docs/build 34 | 35 | -------------------------------------------------------------------------------- /ACKNOWLEDGEMENTS.md: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | 3 | QuantumFlow began life in late 2017 as an internal project at Rigetti Computing 4 | to explore quantum machine learning on near-term quantum computers. Many 5 | people have contributed either directly or indirectly. 6 | 7 | QuantumFlow's model of hybrid quantum-classical programming is taken 8 | from Quil, Rigetti's quantum programming language detailed in *A Practical 9 | Quantum Instruction Set Architecture*, written by Robert S. Smith, Michael J. 10 | Curtis, and William J. Zeng [1]. Much code was borrowed from pyQuil and Rigetti's 11 | Grove, originally written by Robert Smith, Will Zeng, and Spike Curtis, with 12 | significant contributions from Anthony Polloreno, Peter Karalekas, Nikolas 13 | Tezak, Chris Osborn, Steven Heidel, and Matt Harrigan (among others). The 14 | quil parser is adapted from the python parser written by Steven Heidel. 15 | QuantumFlow's latex generation code was inspired by Anthony Polloreno's quil 16 | to latex module. Construction of the decomposition module was assisted by 17 | Eric C. Peterson (Of ECP gate fame), and Josh Combes made contributions to 18 | the measures module. Diamond norm was adapted from code originally written by 19 | Marcus P. da Silva. Keri McKerinan and Chris M. Wilson were early beta 20 | testers. And finally Nick Rubin undoubtably has the single greatest 21 | contribution, as the gate definitions, Kraus operators, and simulation model 22 | were all adapted from his reference-qvm [2]. 23 | 24 | 25 | Gavin E. Crooks (2018-11-01) 26 | 27 | 28 | [1] A Practical Quantum Instruction Set Architecture 29 | Robert S. Smith, Michael J. Curtis, William J. Zeng 30 | arXiv:1608.03355 https://arxiv.org/abs/1608.03355 31 | 32 | [2] reference-qvm: A reference implementation for a quantum virtual machine 33 | in Python https://github.com/rigetticomputing/reference-qvm -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | .DEFAULT_GOAL := help 3 | 4 | PROJECT = quantumflow 5 | FILES = quantumflow examples tests tools setup.py 6 | 7 | # Kudos: Adapted from Auto-documenting default target 8 | # https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html 9 | help: 10 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-12s\033[0m %s\n", $$1, $$2}' 11 | 12 | test: ## Run unittests with current backend 13 | pytest --disable-pytest-warnings tests/ 14 | 15 | testall: ## Run full tox build and test 16 | tox 17 | 18 | coverage: ## Report test coverage using current backend 19 | @echo 20 | pytest --disable-pytest-warnings --cov=quantumflow --cov-report term-missing tests/ 21 | @echo 22 | @echo "** Note: Only active backend will have full test coverage **" 23 | @echo 24 | 25 | lint: ## Delint python source 26 | flake8 $(FILES) 27 | 28 | typecheck: ## Static typechecking 29 | mypy -p quantumflow --ignore-missing-imports --disallow-untyped-defs 30 | 31 | docs: ## Build documentation 32 | (cd docs; make html) 33 | open docs/build/html/index.html 34 | 35 | doctest: ## Run doctests in documentation 36 | (cd docs; make doctest) 37 | 38 | doccover: ## Report documentation coverage 39 | (cd docs; make coverage && open build/coverage/python.txt) 40 | 41 | docclean: ## Clean documentation build 42 | (cd docs; make clean) 43 | 44 | lines: ## Count lines of code (Includes blank lines) 45 | @wc -l quantumflow/*.py quantumflow/*/*.py examples/*.py tests/*.py setup.py 46 | 47 | pragmas: ## Report all pragmas in code 48 | @echo 49 | @echo "** Code that needs something done **" 50 | @grep 'TODO' --color -r -n $(FILES) || echo "No TODO pragmas" 51 | @echo 52 | @echo "** Code that needs fixing **" || echo "No FIXME pragmas" 53 | @grep 'FIXME' --color -r -n $(FILES) 54 | @echo 55 | @echo "** Code that needs documentation **" || echo "No DOCME pragmas" 56 | @grep 'DOCME' --color -r -n $(FILES) 57 | @echo 58 | @echo "** Code that needs more tests **" || echo "No TESTME pragmas" 59 | @grep 'TESTME' --color -r -n $(FILES) 60 | @echo 61 | @echo "** Acknowledgments **" 62 | @grep 'kudos:' --color -r -n -i $(FILES) || echo "No kudos" 63 | @echo 64 | @echo "** Pragma for test coverage **" 65 | @grep 'pragma: no cover' --color -r -n $(FILES) || echo "No Typecheck Pragmas" 66 | @echo 67 | @echo "** flake8 linting pragmas **" 68 | @echo "(http://flake8.pycqa.org/en/latest/user/error-codes.html)" 69 | @grep '# noqa:' --color -r -n $(FILES) || echo "No flake8 pragmas" 70 | @echo 71 | @echo "** Typecheck pragmas **" 72 | @grep '# type:' --color -r -n $(FILES) || echo "No Typecheck Pragmas" 73 | 74 | meta: ## Report versions of dependent packages 75 | @echo 76 | @python -m quantumflow.meta 77 | 78 | .PHONY: help 79 | .PHONY: docs 80 | .PHONY: build -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | >Notice: This is research code that will not necessarily be maintained to 2 | >support further releases of Forest and other Rigetti Software. We welcome 3 | >bug reports and PRs but make no guarantee about fixes or responses. 4 | 5 | # QuantumFlow: A Quantum Algorithms Development Toolkit 6 | 7 | [![Build Status](https://travis-ci.org/rigetti/quantumflow.svg?branch=master)](https://travis-ci.org/rigetti/quantumflow) 8 | 9 | ## Installation for development 10 | 11 | It is easiest to install QuantumFlow's requirements using conda. 12 | ``` 13 | git clone https://github.com/rigetti/quantumflow.git 14 | cd quantumflow 15 | conda install -c conda-forge --file requirements.txt 16 | pip install -e . 17 | ``` 18 | 19 | You can also install with pip. However some of the requirements are tricky to install (notably tensorflow & cvxpy), and (probably) not everything in QuantumFlow will work correctly. 20 | ``` 21 | git clone https://github.com/rigetti/quantumflow.git 22 | cd quantumflow 23 | pip install -r requirements.txt 24 | pip install -e . 25 | ``` 26 | 27 | ## Example 28 | Train the QAOA algorithm, with back-propagation gradient descent, to perform 29 | MAXCUT on a randomly chosen 6 node graph. 30 | 31 | ```bash 32 | ./examples/qaoa_maxcut.py --verbose --steps 5 --nodes 6 random 33 | ``` 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = QuantumFlux 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /docs/source/_static/qf.css: -------------------------------------------------------------------------------- 1 | /* 2 | Overide guzzle.css defaults. 3 | https://github.com/guzzle/guzzle_sphinx_theme/blob/master/guzzle_sphinx_theme/guzzle_sphinx_theme/static/guzzle.css_t 4 | */ 5 | body { 6 | background-color: #fff; 7 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 8 | font-size: 15px; 9 | line-height: 1.4; 10 | } 11 | 12 | #left-column { 13 | overflow: hidden; 14 | } 15 | 16 | #right-column { 17 | float: left; 18 | } 19 | 20 | h1 > a, h2 > a, h3 > a, h4 > a, h5 > a, h6 > a { 21 | color: #990000; 22 | } 23 | 24 | h1, h2, h3, h4, h5, h6 { 25 | color: #990000; 26 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 27 | text-shadow: gray 1px 1px 1px; 28 | } 29 | 30 | h1 { 31 | font-size: 38px; 32 | background-color: #eee; 33 | } 34 | 35 | h2 { 36 | font-size: 28px; 37 | } 38 | 39 | h3 { 40 | font-size: 24px; 41 | } 42 | 43 | h4 { 44 | font-size: 20px; 45 | } 46 | 47 | h5 { 48 | font-size: 18px; 49 | } 50 | 51 | div.clearer { 52 | clear: both; 53 | } 54 | 55 | .container-wrapper { 56 | padding: 0; 57 | position: relative; 58 | } 59 | 60 | div.related { 61 | display: none; 62 | } 63 | 64 | p { 65 | padding: 0; 66 | font-family: inherit; 67 | font-size: inherit; 68 | color: #333; 69 | } 70 | 71 | code { 72 | padding: 2px 0.7px !important; 73 | } 74 | 75 | code, pre, tt { 76 | font-size: 16px; 77 | } 78 | 79 | pre { 80 | background-color: #f7f7f7; 81 | border-color: #f7f7f7; 82 | } 83 | 84 | div.highlight { 85 | background-color: none !important; 86 | } 87 | 88 | .breadcrumb { 89 | margin-bottom: -20px; 90 | margin-top: -20px; 91 | } 92 | 93 | div.sphinxsidebar { 94 | word-wrap: break-word; 95 | position: absolute; 96 | overflow-y: scroll; 97 | top: 0; 98 | left: 0; 99 | bottom: 0; 100 | right: -20px; 101 | height: 100%; 102 | } 103 | 104 | div.sphinxsidebar p { 105 | padding: 0px 10px; 106 | color: #666; 107 | text-transform: uppercase; 108 | font-size: 12px; 109 | font-weight: bold; 110 | letter-spacing: 1px; 111 | } 112 | 113 | div.sphinxsidebar .sidebar-toc a { 114 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 115 | } 116 | 117 | .sidebar-block h2 { 118 | display: none; 119 | } 120 | 121 | .text-logo { 122 | font-size: 22px; 123 | color: #990000; 124 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 125 | font-weight: normal; 126 | background-color: #eee; 127 | text-shadow: gray 1px 1px 1px; 128 | } 129 | 130 | .text-logo:hover { 131 | color: #fff; 132 | } 133 | 134 | .admonition-title { 135 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 136 | } 137 | 138 | 139 | @media print{ 140 | .rst-versions,footer,.wy-nav-side{ 141 | display:none 142 | } 143 | .wy-nav-content-wrap{ 144 | margin-left:0 145 | } 146 | } 147 | 148 | .rst-versions{ 149 | position:fixed; 150 | bottom:0; 151 | left:0; 152 | width:300px; 153 | color:#fcfcfc; 154 | background:#1f1d1d; 155 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 156 | z-index:400 157 | } 158 | -------------------------------------------------------------------------------- /docs/source/backends.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | Backend 3 | ======= 4 | 5 | .. module:: quantumflow.backend 6 | 7 | .. contents:: :local: 8 | 9 | 10 | Tensor Library Backends 11 | ####################### 12 | QuantumFlow is designed to use a modern tensor library as a backend. 13 | The current options are tensorflow, eager, pytorch, and numpy (default). 14 | 15 | - numpy (Default) 16 | Python classic. Relatively fast on a single CPU, but no GPU 17 | acceleration, and no backprop. 18 | 19 | - eager 20 | Tensorflow eager mode. Tensorflow can automatically figure out back-propagated 21 | gradients, so we can efficiently optimize quantum networks using 22 | stochastic gradient descent. 23 | 24 | - tensorflow 25 | Regular tensorflow. Eager mode recommened. 26 | 27 | - tensorflow2 28 | Tensorflow 2.x backend. Eager is now the default operation mode. 29 | 30 | - torch (Experimental) 31 | Experimental prototype. Fast on CPU and GPU. Unfortunately stochastic gradient 32 | decent not available due to pytorch's lack of support for complex math. 33 | Pytorch is not installed by default. See the pytorch website for installation 34 | instructions. 35 | 36 | 37 | Configuration 38 | ############# 39 | 40 | The default backend can be set in the configuration file, and can be overridden 41 | with the QUANTUMFLOW_BACKEND environment variable. e.g. :: 42 | 43 | > QUANTUMFLOW_BACKEND=numpy pytest tests/test_flow.py 44 | 45 | Options are tensorflow, eager, numpy, and torch. 46 | 47 | You can also set the environment variable in python before quantumflow is imported. 48 | 49 | >>> import os 50 | >>> os.environ["QUANTUMFLOW_BACKEND"] = "numpy" 51 | >>> import quantumflow as qf 52 | 53 | 54 | GPU 55 | ### 56 | 57 | Unfortunately, tensorflow does not fully supports complex numbers, 58 | so we cannot run with eager or tensofrlow mode on GPUs at present. 59 | The numpy backend does not have GPU acceleration either. 60 | 61 | The torch backened can run with GPU acceleration, which can lead to 62 | significant speed increase for simulation of large quantum states. 63 | Note that the main limiting factor is GPU memory. A single state uses 16 x 2^N bytes. 64 | We need to be able to place 2 states (and a bunch of smaller tensors) on a single GPU. 65 | Thus a 16 GiB GPU can simulate a 28 qubit system. 66 | 67 | > QUANTUMFLOW_DEVICE=gpu QUANTUMFLOW_BACKEND=torch ./benchmark.py 24 68 | > QUANTUMFLOW_DEVICE=cpu QUANTUMFLOW_BACKEND=torch ./benchmark.py 24 69 | 70 | 71 | Backend API 72 | ########### 73 | 74 | .. autofunction:: quantumflow.backend.tensormul 75 | 76 | Each backend is expected to implement the following methods, with semantics that match numpy. 77 | (For instance, tensorflow's acos() method is adapted to match numpy's arccos()) 78 | 79 | - absolute 80 | - arccos 81 | - conj 82 | - cos 83 | - diag 84 | - exp 85 | - matmul 86 | - minimum 87 | - real 88 | - reshape 89 | - sin 90 | - sum 91 | - transpose 92 | 93 | 94 | In addition each backend implements the following methods and variables. 95 | 96 | 97 | 98 | .. automodule:: quantumflow.backend.numpybk 99 | :members: 100 | -------------------------------------------------------------------------------- /docs/source/channels.rst: -------------------------------------------------------------------------------- 1 | ======== 2 | Channels 3 | ======== 4 | 5 | .. contents:: :local: 6 | .. currentmodule:: quantumflow 7 | 8 | 9 | Mixed States and Quantum Channels 10 | ################################# 11 | .. autoclass:: Density 12 | :members: 13 | 14 | .. autoclass:: Channel 15 | :members: 16 | 17 | .. autoclass:: Kraus 18 | :members: 19 | 20 | .. autoclass:: UnitaryMixture 21 | :members: 22 | 23 | 24 | Actions on Channels 25 | ################### 26 | .. autofunction:: join_channels 27 | .. autofunction:: channel_to_kraus 28 | .. autofunction:: kraus_iscomplete 29 | 30 | 31 | Standard channels 32 | ################# 33 | .. autoclass:: Dephasing 34 | :members: 35 | 36 | .. autoclass:: Damping 37 | :members: 38 | 39 | .. autoclass:: Depolarizing 40 | :members: 41 | -------------------------------------------------------------------------------- /docs/source/circuits.rst: -------------------------------------------------------------------------------- 1 | ======== 2 | Circuits 3 | ======== 4 | 5 | .. contents:: :local: 6 | .. currentmodule:: quantumflow 7 | 8 | 9 | Circuit objects 10 | ############### 11 | .. autoclass:: Circuit 12 | :members: 13 | 14 | .. autoclass:: DAGCircuit 15 | :members: 16 | 17 | 18 | Standard circuits 19 | ################# 20 | 21 | .. autofunction:: qft_circuit 22 | .. autofunction:: reversal_circuit 23 | .. autofunction:: control_circuit 24 | .. autofunction:: ccnot_circuit 25 | .. autofunction:: zyz_circuit 26 | .. autofunction:: phase_estimation_circuit 27 | .. autofunction:: addition_circuit 28 | .. autofunction:: ghz_circuit 29 | 30 | 31 | Gate decompositions 32 | ################### 33 | 34 | .. autofunction:: bloch_decomposition 35 | .. autofunction:: zyz_decomposition 36 | .. autofunction:: kronecker_decomposition 37 | .. autofunction:: canonical_decomposition 38 | .. autofunction:: canonical_coords 39 | 40 | 41 | Visualizations 42 | ############## 43 | 44 | .. autofunction:: circuit_to_latex 45 | .. autofunction:: render_latex 46 | 47 | 48 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import guzzle_sphinx_theme 5 | 6 | html_theme_path = guzzle_sphinx_theme.html_theme_path() 7 | html_theme = 'guzzle_sphinx_theme' 8 | 9 | html_title = "QuantumFlow Documentation" 10 | html_short_title = "QuantumFlow" 11 | 12 | 13 | # Custom sidebar templates, maps document names to template names. 14 | html_sidebars = { 15 | '**': ['logo-text.html', 'searchbox.html', 'globaltoc.html', ] 16 | } 17 | 18 | def setup(app): 19 | app.add_stylesheet("qf.css") # also can be a full URL 20 | 21 | # -- General configuration ------------------------------------------------ 22 | extensions = [ 23 | 'sphinx.ext.autodoc', 24 | 'sphinx.ext.todo', 25 | 'sphinx.ext.coverage', 26 | 'sphinx.ext.mathjax', 27 | 'sphinx.ext.githubpages', 28 | 'sphinx.ext.napoleon', 29 | 'sphinx.ext.doctest', 30 | # 'sphinx_autodoc_typehints', 31 | 'sphinx.ext.inheritance_diagram', 32 | ] 33 | 34 | extensions.append("guzzle_sphinx_theme") 35 | 36 | 37 | napoleon_use_ivar = True 38 | napoleon_use_rtype = False 39 | 40 | 41 | # Add any paths that contain templates here, relative to this directory. 42 | templates_path = ['_templates'] 43 | 44 | # The suffix(es) of source filenames. 45 | # You can specify multiple suffix as a list of string: 46 | # 47 | # source_suffix = ['.rst', '.md'] 48 | source_suffix = '.rst' 49 | 50 | # The master toctree document. 51 | master_doc = 'index' 52 | 53 | # General information about the project. 54 | project = 'QuantumFlow' 55 | copyright = """2016-2018, Rigetti Computing
56 | QuantumFlow: A Quantum Algorithms Development Toolikit, 57 | Gavin E. Crooks (2018)
""" 58 | author = 'Gavin E. Crooks' 59 | 60 | # The version info for the project you're documenting, acts as replacement for 61 | # |version| and |release|, also used in various other places throughout the 62 | # built documents. 63 | # 64 | # The short X.Y version. 65 | from quantumflow import __version__ 66 | # version = '0.0.0' 67 | # The full version, including alpha/beta/rc tags. 68 | release = __version__ # '0.0.0' 69 | 70 | # The language for content autogenerated by Sphinx. Refer to documentation 71 | # for a list of supported languages. 72 | # 73 | # This is also used if you do content translation via gettext catalogs. 74 | # Usually you set "language" from the command line for these cases. 75 | language = None 76 | 77 | # List of patterns, relative to source directory, that match files and 78 | # directories to ignore when looking for source files. 79 | # This patterns also effect to html_static_path and html_extra_path 80 | exclude_patterns = [] 81 | 82 | # The name of the Pygments (syntax highlighting) style to use. 83 | pygments_style = 'sphinx' 84 | 85 | # If true, `todo` and `todoList` produce output, else they produce nothing. 86 | todo_include_todos = True 87 | 88 | 89 | # -- Options for HTML output ---------------------------------------------- 90 | 91 | # Guzzle theme options (see theme.conf for more information) 92 | html_theme_options = { 93 | "project_nav_name": "QuantumFlow", 94 | } 95 | 96 | html_static_path = ['_static'] 97 | 98 | 99 | 100 | # Custom post sphinx substitutions 101 | import atexit 102 | import glob 103 | import os 104 | import re 105 | 106 | 107 | def do_edits(): 108 | 109 | pats = [ 110 | # Hacks to shorten type descriptors 111 | (r'quantumflow\.qubits', r'qf'), 112 | (r'quantumflow\.ops', r'qf'), 113 | (r'quantumflow\.gates', r'qf'), 114 | 115 | (r'quantumflow\.stdgates', r'qf'), 116 | (r'quantumflow\.states', r'qf'), 117 | (r'quantumflow\.circuits', r'qf'), 118 | (r'qf\.programs\.instructions\.', r'qf.'), 119 | (r'^/quantumflow\.', r'qf.'), 120 | # (r'qf\.readthedocs\.io', r'quantumflow.readthedocs.io'), 121 | 122 | 123 | # Hacks to fixup types 124 | (r'sympy\.core\.symbol\.Symbol', r'Parameter'), 125 | (r'Sequence\[collections\.abc\.Hashable\]', 'Qubits'), 126 | (r'collections\.abc\.Hashable', 'Qubit'), 127 | 128 | (r'tensor: Any', r'tensor: TensorLike'), 129 | (r'→ Any', r'→ BKTensor'), 130 | 131 | ] 132 | 133 | files = glob.glob('*build/html/*.html') 134 | for filename in files: 135 | with open(filename, 'r+') as f: 136 | text = f.read() 137 | for pattern, replacement in pats: 138 | text = re.sub(pattern, replacement, text) 139 | f.seek(0) 140 | f.truncate() 141 | f.write(text) 142 | 143 | print('Note: post sphinx text substitutions performed (conf.py)') 144 | 145 | 146 | atexit.register(do_edits) 147 | -------------------------------------------------------------------------------- /docs/source/datasets.rst: -------------------------------------------------------------------------------- 1 | 2 | ======== 3 | Datasets 4 | ======== 5 | 6 | .. module:: quantumflow 7 | 8 | .. contents:: :local: 9 | .. currentmodule:: quantumflow.datasets 10 | 11 | 12 | 13 | Standard Datasets 14 | ################# 15 | .. autofunction:: load_stdgraphs 16 | .. autofunction:: load_mnist 17 | 18 | -------------------------------------------------------------------------------- /docs/source/devnotes.rst: -------------------------------------------------------------------------------- 1 | .. _devnotes: 2 | 3 | ================= 4 | Development Notes 5 | ================= 6 | 7 | .. contents:: :local: 8 | 9 | Please refer to the github repository https://github.com/rigetti/quantumflow for source code, and to submit issues and pull requests. Documentation is hosted at readthedocs https://quantumflow.readthedocs.io/ . 10 | 11 | Installation 12 | ############ 13 | 14 | See the introduction for installation instructions. 15 | The Makefile contains targets for various common development tasks:: 16 | 17 | > make help 18 | 19 | Testing 20 | ####### 21 | 22 | Use pytest and tox for testing. Examples:: 23 | 24 | > make test # Run all unittests on current backend 25 | > pytest tests/test_states.py::test_zeros # Test a single method 26 | > make doctests # Test code snippets in documentation 27 | > make testall # Test all backends (Using tox) 28 | 29 | Some tests will be skipped depending on the current backend. 30 | 31 | The full tox testing suite should verifie against two consecutive versions of 32 | python, in order to ameliorate dependency hell. 33 | (But at present [Nov 2018] we're stuck on python 3.6 only until tensorflow supports 3.7) 34 | 35 | Test Coverage 36 | ############# 37 | 38 | To report test coverage:: 39 | 40 | > make coverage 41 | 42 | Note that only the active backend should expect full coverage. 43 | 44 | Some lines can't be covered. This happens, for instance, due to the conditional backend imports. 45 | The comment ``# pragma: no cover`` can be used to mark lines that can't be covered. ` 46 | 47 | 48 | Delinting 49 | ######### 50 | 51 | Delinting uses ``flake8`` :: 52 | 53 | > make lint 54 | 55 | 56 | Documentation 57 | ############# 58 | 59 | Documentation is complied with `sphinx `_ . :: 60 | 61 | > make docs 62 | 63 | Source is located at docs/source and output is located at 64 | `docs/build/html/index.html` 65 | 66 | Documentation coverage report:: 67 | 68 | > make doccover 69 | 70 | Google style docstrings: http://www.sphinx-doc.org/en/stable/ext/example_google.html 71 | 72 | 73 | Typecheck 74 | ######### 75 | Python type hints are used to document types of arguments and return values:: 76 | 77 | > make typecheck 78 | 79 | The ``# type: ignore`` pragma can be used to supress typechecking if necessary. 80 | 81 | 82 | Conventions 83 | ########### 84 | 85 | - nb -- Abbreviation for number 86 | - N -- number of qubits 87 | - theta -- gate angle (In Bloch sphere or equivalent) 88 | - t -- Number of half turns in Block sphere (quarter cycles) or equivalent. (theta = pi * t) 89 | - bk -- backend module for interfacing with tensor package (``import quantumflow.backend as bk``) 90 | - ket -- working state variable 91 | - rho -- density variable 92 | - chan -- channel variable 93 | - circ -- circuit variable 94 | - G -- Graph variable 95 | 96 | 97 | 98 | Import Hierarchy 99 | ################ 100 | :: 101 | 102 | version 103 | ^ 104 | | tensorflow torch numpy 105 | quantumflow --> config ^ ^ ^ 106 | | ^ ......:...... : : 107 | | | : : : : 108 | |---> backend ---> [tensorflowbk|eagerbk|torchbk] ---> numpybk 109 | | ^ 110 | | | 111 | |---> qubits 112 | | ^ 113 | | | 114 | |---> states 115 | | ^ 116 | | | 117 | |----> ops 118 | | ^ 119 | | | 120 | |---> gates 121 | | ^ 122 | | | 123 | |---> stdgates 124 | | ^ 125 | | | 126 | |---> channels 127 | | ^ 128 | | | 129 | |---> circuits 130 | | ^ 131 | | | 132 | |---> programs 133 | | ^ 134 | | | 135 | \---> forest 136 | 137 | 138 | 139 | Backends 140 | ######## 141 | 142 | Only the bare essential functionality has been implemented or imported for 143 | each backend. No doudt other methods could be added. Additional methods should 144 | follow numpy's conventions (where appropriate), and need to be implemented for 145 | each backend. (One of the backend unit tests checks that each backend claims 146 | to support every required method.) 147 | 148 | 149 | GEC 2018 -------------------------------------------------------------------------------- /docs/source/examples.rst: -------------------------------------------------------------------------------- 1 | 2 | ======== 3 | Examples 4 | ======== 5 | 6 | The examples folder contains various illustrations of QuantumFlow in action. 7 | 8 | 9 | - ``state_prep_w4.py`` 10 | 11 | Prepare a 4-qubit W state using sqrt(iswaps) and local gates. 12 | 13 | - ``state_prep_w16.py`` 14 | 15 | Prepare a 16-qubit W state using sqrt(iswaps) and local gates, 16 | respecting linear topology 17 | 18 | - ``swaptest.py`` 19 | 20 | Apply a Swap Test to measure fidelity between two qubits 21 | 22 | - ``tensorflow_fit_gate.py`` 23 | 24 | Tensorflow example. Given an arbitrary one-qubit gate, use gradient 25 | descent to find corresponding parameters of a universal ZYZ gate. 26 | 27 | - ``eager_fit_gate.py`` 28 | 29 | Tensorflow eager mode example. Given an arbitrary one-qubit gate, use 30 | gradient descent to find corresponding parameters of a universal ZYZ 31 | gate. 32 | 33 | -------------------------------------------------------------------------------- /docs/source/forest.rst: -------------------------------------------------------------------------------- 1 | 2 | ====== 3 | Forest 4 | ====== 5 | 6 | .. module:: quantumflow.forest 7 | 8 | Interface to pyQuil and the Rigetti Forest. 9 | 10 | 11 | .. autoclass:: QuantumFlowQVM 12 | :members: 13 | 14 | 15 | .. autofunction:: circuit_to_pyquil 16 | .. autofunction:: pyquil_to_circuit 17 | .. autofunction:: quil_to_program 18 | .. autofunction:: pyquil_to_program 19 | .. autofunction:: pyquil_to_image 20 | .. autofunction:: wavefunction_to_state 21 | .. autofunction:: state_to_wavefunction 22 | 23 | .. autodata:: QUIL_GATES 24 | -------------------------------------------------------------------------------- /docs/source/gates.rst: -------------------------------------------------------------------------------- 1 | 2 | ===== 3 | Gates 4 | ===== 5 | 6 | .. contents:: :local: 7 | .. currentmodule:: quantumflow 8 | 9 | 10 | Gate objects 11 | ############ 12 | .. autoclass:: Gate 13 | :members: 14 | 15 | Actions on gates 16 | ################# 17 | .. autofunction:: join_gates 18 | .. autofunction:: control_gate 19 | .. autofunction:: conditional_gate 20 | .. autofunction:: almost_unitary 21 | .. autofunction:: print_gate 22 | 23 | 24 | Standard gates 25 | ############## 26 | 27 | Standard gate set, as detailed in Quil whitepaper (arXiv:1608:03355v2) 28 | 29 | 30 | Standard one-qubit gates 31 | ************************ 32 | .. autoclass:: I 33 | .. autoclass:: X 34 | .. autoclass:: Y 35 | .. autoclass:: Z 36 | .. autoclass:: H 37 | .. autoclass:: S 38 | .. autoclass:: T 39 | .. autoclass:: PHASE 40 | .. autoclass:: RX 41 | .. autoclass:: RY 42 | .. autoclass:: RZ 43 | 44 | 45 | Standard two-qubit gates 46 | ************************ 47 | .. autoclass:: CZ 48 | .. autoclass:: CNOT 49 | .. autoclass:: SWAP 50 | .. autoclass:: ISWAP 51 | .. autoclass:: CPHASE00 52 | .. autoclass:: CPHASE01 53 | .. autoclass:: CPHASE10 54 | .. autoclass:: CPHASE 55 | .. autoclass:: PSWAP 56 | 57 | 58 | Standard three-qubit gates 59 | ************************** 60 | .. autoclass:: CCNOT 61 | .. autoclass:: CSWAP 62 | 63 | 64 | 65 | Additional gates 66 | ################ 67 | 68 | 69 | One-qubit gates 70 | *************** 71 | .. autoclass:: S_H 72 | .. autoclass:: T_H 73 | .. autoclass:: TX 74 | .. autoclass:: TY 75 | .. autoclass:: TZ 76 | .. autoclass:: TH 77 | .. autoclass:: ZYZ 78 | .. autoclass:: P0 79 | .. autoclass:: P1 80 | 81 | 82 | 83 | Two-qubit gates 84 | *************** 85 | .. autoclass:: CANONICAL 86 | .. autoclass:: XX 87 | .. autoclass:: YY 88 | .. autoclass:: ZZ 89 | .. autoclass:: PISWAP 90 | .. autoclass:: EXCH 91 | 92 | 93 | 94 | Multi-qubit gates 95 | ***************** 96 | .. autofunction:: identity_gate 97 | .. autofunction:: random_gate 98 | 99 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | 2 | 3 | QuantumFlow: A Quantum Algorithms Development Toolkit 4 | ----------------------------------------------------- 5 | 6 | * Code: https://github.com/rigetti/quantumflow 7 | * Docs: https://quantumflow.readthedocs.io/ 8 | 9 | The core of QuantumFlow is a simulation of a gate based quantum computer, which can run 10 | on top of modern optimized tensor libraries (numpy, tensorflow, or torch). The 11 | tensorflow backend can calculate the analytic gradient of a quantum circuit 12 | with respect to the circuit's parameters, and circuits can be optimized to perform a function 13 | using (stochastic) gradient descent. The torch and tensorflow backend can also accelerate the 14 | quantum simulation using commodity classical GPUs. 15 | 16 | *Notice: This is research code that will not necessarily be maintained to support 17 | further releases of Forest and other* `Rigetti `_ *Software. 18 | We welcome bug reports and PRs but make no guarantee about fixes or responses*. 19 | 20 | 21 | 22 | .. toctree:: 23 | :maxdepth: 3 24 | :caption: Contents: 25 | 26 | intro 27 | qubits 28 | states 29 | ops 30 | gates 31 | channels 32 | circuits 33 | measures 34 | programs 35 | forest 36 | backends 37 | datasets 38 | examples 39 | 40 | 41 | .. toctree:: 42 | :hidden: 43 | 44 | devnotes 45 | 46 | * :ref:`devnotes` 47 | * :ref:`genindex` 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/source/intro.rst: -------------------------------------------------------------------------------- 1 | =============== 2 | Getting Started 3 | =============== 4 | 5 | 6 | Installation 7 | ############ 8 | 9 | It is easiest to install QuantumFlow's requirements using conda. 10 | 11 | .. code-block:: console 12 | 13 | > git clone https://github.com/rigetti/quantumflow.git 14 | > cd quantumflow 15 | > conda install -c conda-forge --yes --file requirements.txt 16 | > pip install -e . 17 | > make docs 18 | 19 | You can also install with pip. However some of the requirements are tricky to install (i.e. tensorflow & cvxpy), and (probably) not everything in QuantumFlow will work correctly. 20 | 21 | .. code-block:: console 22 | 23 | > git clone https://github.com/rigetti/quantumflow.git 24 | > cd quantumflow 25 | > pip install -r requirements.txt 26 | > pip install -e . 27 | > make docs 28 | 29 | 30 | Basic Operation 31 | ############### 32 | 33 | The principle operations are creating states and then applying sequences of quantum gates 34 | 35 | .. doctest:: 36 | 37 | >>> import quantumflow as qf # Import QuantumFlow 38 | >>> ket = qf.zero_state(1) # Create a zero state with 1 qubit 39 | >>> qf.print_state(ket) # Print state amplitudes 40 | 0 : (1+0j) 41 | 1 : 0j 42 | 43 | >>> ket = qf.H(0).run(ket) # Apply a Hadamard gate to the 0th qubit 44 | >>> qf.print_state(ket) 45 | 0 : (0.7071067811865475+0j) 46 | 1 : (0.7071067811865475+0j) 47 | 48 | 49 | Create a Bell state 50 | 51 | .. doctest:: 52 | 53 | >>> ket = qf.zero_state(2) # Create a zero state with 2 qubits 54 | >>> ket = qf.H(0).run(ket) 55 | >>> ket = qf.CNOT(0, 1).run(ket) # Apply a cnot to qubits 0 and 1 56 | >>> qf.print_state(ket) 57 | 00 : (0.7071067811865475+0j) 58 | 01 : 0j 59 | 10 : 0j 60 | 11 : (0.7071067811865475+0j) 61 | 62 | States 63 | ###### 64 | 65 | States contain a tensor object defined by QuantumFlow's tensor library backend. The 66 | ``qf.asarray()`` method converts backend tensors back to ordinary python objects. 67 | 68 | .. doctest:: 69 | 70 | >>> ket.tensor 71 | array([[0.70710678+0.j, 0. +0.j], 72 | [0. +0.j, 0.70710678+0.j]]) 73 | >>> ket.tensor.shape 74 | (2, 2) 75 | 76 | Typically the state of N qubits would be represented by a complex vector of 77 | length 2**N. However, QuantumFlow takes advantage of the tensor product 78 | structure of N qubits, and instead represents an N qubit 79 | state by a complex tensor of rank N and shape ([2]*N). (e.g. (2,2) for N=2, 80 | or (2, 2, 2, 2) for N=4). Each rank of the tensor represents a different qubit. 81 | 82 | We can also generate a new state directly from a vector of amplitudes. QuantumFlow 83 | will take care of reshaping and converting the vector into a QuantumFlow tensor. 84 | (As long as the number of elements is a power of 2). 85 | 86 | .. doctest:: 87 | 88 | >>> import numpy as np 89 | >>> ket = qf.State(np.array([1,0,0,1])) 90 | >>> ket = ket.normalize() 91 | >>> qf.print_state(ket) 92 | 00 : (0.7071067811865475+0j) 93 | 01 : 0j 94 | 10 : 0j 95 | 11 : (0.7071067811865475+0j) 96 | 97 | Since we can only measure our quantum computer in the computational basis, the measurement hermitian 98 | operator must be diagonal. We represent these measurements by arrays (or tensors) of shape ([2]*N). 99 | 100 | .. doctest:: 101 | 102 | >>> qf.asarray(ket.expectation(np.array([1,0,0,0]))) # Probability of being in 00 state 103 | 0.4999999999999999 104 | 105 | Values are returned as a backend Tensor object, which can be converted 106 | to an ordinary python or numpy value with the ``qf.asarray(tensor)`` method. We can convert an 107 | array to a backend tensor explicitly if desired. But for ordinary operations 108 | you should not need to interact with the backend directly. 109 | 110 | .. doctest:: 111 | 112 | >>> from quantumflow import backend as bk 113 | >>> tensor = bk.astensor(np.array([1,0,0,0])) 114 | 115 | Gates 116 | ##### 117 | 118 | A gate acting on K qubits is a unitary operator of shape (2**K, 2**K), which 119 | QuantumFlow represents as a mixed tensor of shape ([2]*(2*K)). e.g. for 120 | 2 qubits the gate tensor's shape is (2, 2), and for 4 qubits 121 | the gate shape is (2, 2, 2, 2, 2, 2, 2, 2). 122 | 123 | .. doctest:: 124 | 125 | >>> qf.X().asoperator() 126 | array([[0.+0.j, 1.+0.j], 127 | [1.+0.j, 0.+0.j]]) 128 | 129 | 130 | The speed critical core of QuantumFlow is the Gate.run() method, which applies the action of a 131 | K-qubit gate to an N-qubit state. Rather than promoting the gate to the full 132 | N-qubit state space (As discussed in the quil paper), we instead reshape the 133 | state so that it is (essentially) a tensor product of K and N-K qubit spaces. 134 | The necessary permutations and resizings of the state array can be succinctly 135 | expressed with a few standard tensor methods thanks to the product 136 | representation of states. 137 | 138 | 139 | We can also apply the action of a gate upon another gate. 140 | 141 | .. doctest:: 142 | 143 | >>> gate0 = qf.CNOT(0, 1) 144 | >>> gate1 = qf.CNOT(0, 1) 145 | >>> gate = gate1 @ gate0 # A cnot followed by a cnot is the identity 146 | >>> op = gate.asoperator() 147 | >>> np.reshape(op, (4,4)) 148 | array([[1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j], 149 | [0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j], 150 | [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j], 151 | [0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j]]) 152 | 153 | There are various other methods for manipulating, inspecting, and comparing gates and states. 154 | For instance, we can calculate the gate angle (a measure of distance between two gates) 155 | between the previous gate and the 2-qubit identity, proving that they are identical. 156 | 157 | .. doctest:: 158 | 159 | >>> qf.asarray(qf.gate_angle(qf.identity_gate(2), gate)) 160 | 0.0 161 | 162 | 163 | Circuits 164 | ######## 165 | 166 | A QuantumFlow circuit is a sequence of gates. 167 | 168 | .. doctest:: 169 | 170 | >>> circ = qf.Circuit() # Build a Bell state preparation circuit 171 | >>> circ += qf.H(0) # Apply a Hadamard gate to the 0th qubit 172 | >>> circ += qf.CNOT(0, 1) # Apply a CNOT between qubits 0 and 1 173 | >>> ket = qf.zero_state([0, 1]) # Prepare initial state 174 | >>> ket = circ.run(ket) # Run circuit 175 | >>> qf.print_state(ket) 176 | 00 : (0.7071067811865475+0j) 177 | 01 : 0j 178 | 10 : 0j 179 | 11 : (0.7071067811865475+0j) 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | -------------------------------------------------------------------------------- /docs/source/measures.rst: -------------------------------------------------------------------------------- 1 | ======== 2 | Measures 3 | ======== 4 | 5 | .. contents:: :local: 6 | .. currentmodule:: quantumflow 7 | 8 | 9 | Distances in Hilbert Space 10 | ########################## 11 | 12 | .. autofunction:: inner_product 13 | .. autofunction:: fubini_study_angle 14 | .. autofunction:: vectors_close 15 | 16 | 17 | State distances 18 | ############### 19 | 20 | .. autofunction:: state_angle 21 | .. autofunction:: states_close 22 | .. autofunction:: state_fidelity 23 | 24 | 25 | Mixed state distances 26 | ###################### 27 | 28 | .. autofunction:: density_angle 29 | .. autofunction:: densities_close 30 | .. autofunction:: fidelity 31 | .. autofunction:: bures_distance 32 | .. autofunction:: bures_angle 33 | .. autofunction:: entropy 34 | .. autofunction:: mutual_info 35 | 36 | 37 | Gate distances 38 | ############## 39 | 40 | .. autofunction:: gate_angle 41 | .. autofunction:: gates_close 42 | 43 | 44 | Channel distances 45 | ################# 46 | 47 | .. autofunction:: channel_angle 48 | .. autofunction:: channels_close 49 | .. autofunction:: diamond_norm 50 | 51 | -------------------------------------------------------------------------------- /docs/source/ops.rst: -------------------------------------------------------------------------------- 1 | ========== 2 | Operations 3 | ========== 4 | 5 | .. contents:: :local: 6 | .. currentmodule:: quantumflow 7 | 8 | 9 | QuantumFlow supports several different quantum operations that act upon either pure or mixed states (or both). The four main types are Gate, which represents the action of an operator (typically unitary) on a state; Channel, which represents the action of a superoperator on a state (used for mixed quantum-classical dynamics); Kruas, which represents a Channel as a collection of operators; and Circuit, which is a list of other operations that act in sequence. Circuits can contain any instance of the abstract quantum operation superclass, Operation, including other circuits. 10 | 11 | We consider the elemental quantum operations, such as Gate, Channel, and Kraus, as immutable. (Although immutability is not enforced in general.) Transformations of these operations return new copies. On the other hand the composite operation Circuit is mutable. 12 | 13 | 14 | .. autoclass:: Operation 15 | :members: 16 | 17 | -------------------------------------------------------------------------------- /docs/source/programs.rst: -------------------------------------------------------------------------------- 1 | ======== 2 | Programs 3 | ======== 4 | 5 | .. contents:: :local: 6 | .. currentmodule:: quantumflow 7 | 8 | A QuantumFlow Program is an implementation of the Quantum Abstract Machine from 9 | *A Practical Quantum Instruction Set Architecture*. [1]_ A Program can be built 10 | programatically by appending Instuctions, or can be parsed from code written 11 | in Rigetti's Quantum Instruction Language (Quil). This Quantum Virtual Machine 12 | represents a hybrid device with quantum computation and classical control flow. 13 | 14 | .. [1] A Practical Quantum Instruction Set Architecture 15 | Robert S. Smith, Michael J. Curtis, William J. Zeng 16 | arXiv:1608.03355 https://arxiv.org/abs/1608.03355 17 | 18 | .. doctest:: 19 | 20 | import quantumflow as qf 21 | 22 | # Create an empty Program 23 | prog = qf.Program() 24 | 25 | # Measure qubit 0 and store result in classical bit (cbit) o 26 | prog += qf.Measure(0, 0) 27 | 28 | # Apply an X gate to qubit 0 29 | prog += qf.Call('X', params=[], qubits=[0]) 30 | 31 | # Measure qubit 0 and store result in cbit 1. 32 | prog += qf.Measure(0, 1) 33 | 34 | # Compile and run program 35 | prog.run() 36 | 37 | # Contents of classical memory 38 | assert prog.memory == {0: 0, 1: 1} 39 | 40 | 41 | Programs 42 | ######### 43 | .. autoclass:: Instruction 44 | :members: 45 | 46 | .. autoclass:: Program 47 | :members: 48 | 49 | .. autoclass:: DefCircuit 50 | .. autoclass:: Wait 51 | .. autoclass:: Nop 52 | .. autoclass:: Halt 53 | .. autoclass:: Reset 54 | .. autoclass:: And 55 | .. autoclass:: Or 56 | .. autoclass:: Move 57 | .. autoclass:: Exchange 58 | .. autoclass:: Not 59 | .. autoclass:: Label 60 | .. autoclass:: Jump 61 | .. autoclass:: JumpWhen 62 | .. autoclass:: JumpUnless 63 | .. autoclass:: Pragma 64 | .. autoclass:: Measure 65 | .. autoclass:: Include 66 | .. autoclass:: Call 67 | 68 | 69 | -------------------------------------------------------------------------------- /docs/source/qubits.rst: -------------------------------------------------------------------------------- 1 | 2 | ==================== 3 | Qubit Hilbert Spaces 4 | ==================== 5 | 6 | .. module:: quantumflow 7 | 8 | .. contents:: :local: 9 | .. currentmodule:: quantumflow 10 | 11 | 12 | States, gates, and various other methods accept a list of qubits labels upon which the given State or Gate acts. A Qubit label can be any hashable python object, but typically an integer or string. e.g. `[0, 1, 2]`, or `['a', 'b', 'c']`. Note that some operations expect the qubits to be sortable, so don't mix different uncomparable data types. 13 | 14 | 15 | .. autoclass:: QubitVector 16 | :members: 17 | 18 | -------------------------------------------------------------------------------- /docs/source/requirements.txt: -------------------------------------------------------------------------------- 1 | # A slimmed down requirements file for readthedocs 2 | quantumflow 3 | numpy 4 | scipy >= 1.0.0 5 | networkx >= 2.1 6 | sphinx >= 1.6.6 7 | guzzle_sphinx_theme 8 | pillow 9 | keras 10 | pillow 11 | pyquil >= 2.0.0b1 12 | antlr4-python3-runtime 13 | cvxpy 14 | sympy 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/source/states.rst: -------------------------------------------------------------------------------- 1 | 2 | ====== 3 | States 4 | ====== 5 | 6 | .. module:: quantumflow 7 | 8 | .. contents:: :local: 9 | .. currentmodule:: quantumflow 10 | 11 | 12 | State objects 13 | ############# 14 | .. autoclass:: State 15 | :members: 16 | 17 | 18 | Standard states 19 | ############### 20 | .. autofunction:: zero_state 21 | .. autofunction:: w_state 22 | .. autofunction:: ghz_state 23 | .. autofunction:: random_state 24 | 25 | 26 | Actions on states 27 | ################# 28 | .. autofunction:: join_states 29 | .. autofunction:: print_state 30 | .. autofunction:: print_probabilities 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /examples/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rigetti/quantumflow/bf965f0ca70cd69b387f9ca8407ab38da955e925/examples/__init__.py -------------------------------------------------------------------------------- /examples/circuit_visulizations.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | """ 9 | QuantumFlow: Example visualizations of Circuits using LaTeX. 10 | Requires external dependencies `pdflatex` and `poppler`. 11 | """ 12 | 13 | import shutil 14 | import sys 15 | 16 | import quantumflow as qf 17 | 18 | from pyquil.quil import Program 19 | from pyquil.gates import Z, CNOT, CZ, CCNOT 20 | 21 | 22 | if shutil.which('pdflatex') is None: 23 | print('Failed: External dependency `pdflatex` not found.') 24 | sys.exit() 25 | 26 | if shutil.which('pdftocairo') is None: 27 | print('Failed: External dependency `pdftocairo` not found. ' 28 | 'Install `poppler`.') 29 | sys.exit() 30 | 31 | # Display Bell state preparation 32 | qf.circuit_to_image(qf.ghz_circuit([0, 1])).show() 33 | 34 | # 4-qubit GHZ state preparation 35 | qf.circuit_to_image(qf.ghz_circuit([0, 1, 2, 3])).show() 36 | 37 | # 4-qubit ripple add 38 | circ = qf.addition_circuit(['a[0]', 'a[1]', 'a[2]', 'a[3]'], 39 | ['b[0]', 'b[1]', 'b[2]', 'b[3]'], 40 | ['cin', 'cout']) 41 | order = ['cin', 'a[0]', 'b[0]', 'a[1]', 'b[1]', 'a[2]', 'b[2]', 'a[3]', 42 | 'b[3]', 'cout'] 43 | latex = qf.circuit_to_latex(circ, order) 44 | img = qf.render_latex(latex) 45 | img.show() 46 | 47 | # Visualize pyquil protoquil programs 48 | prog = Program() 49 | prog = prog.inst(Z(0)) 50 | prog = prog.inst(CNOT(0, 1)) 51 | prog = prog.inst(CZ(0, 1)) 52 | prog = prog.inst(CCNOT(0, 1, 2)) 53 | qf.forest.pyquil_to_image(prog).show() 54 | -------------------------------------------------------------------------------- /examples/eager_fit_gate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | """ 9 | QuantumFlow Examples 10 | """ 11 | 12 | import sys 13 | import os 14 | import numpy as np 15 | 16 | os.environ['QUANTUMFLOW_BACKEND'] = 'eager' 17 | import quantumflow as qf # noqa: E402 18 | import quantumflow.backend as bk # noqa: E402 19 | 20 | 21 | def fit_zyz(target_gate): 22 | """ 23 | Tensorflow eager mode example. Given an arbitrary one-qubit gate, use 24 | gradient descent to find corresponding parameters of a universal ZYZ 25 | gate. 26 | """ 27 | assert bk.BACKEND == 'eager' 28 | 29 | tf = bk.TL 30 | tfe = bk.tfe 31 | 32 | steps = 4000 33 | 34 | dev = '/gpu:0' if bk.DEVICE == 'gpu' else '/cpu:0' 35 | 36 | with tf.device(dev): 37 | t = tfe.Variable(np.random.normal(size=[3]), name='t') 38 | 39 | def loss_fn(): 40 | """Loss""" 41 | gate = qf.ZYZ(t[0], t[1], t[2]) 42 | ang = qf.fubini_study_angle(target_gate.vec, gate.vec) 43 | return ang 44 | 45 | loss_and_grads = tfe.implicit_value_and_gradients(loss_fn) 46 | # opt = tf.train.GradientDescentOptimizer(learning_rate=0.005) 47 | opt = tf.train.AdamOptimizer(learning_rate=0.001) 48 | # train = opt.minimize(ang, var_list=[t]) 49 | 50 | for step in range(steps): 51 | loss, grads_and_vars = loss_and_grads() 52 | sys.stdout.write('\r') 53 | sys.stdout.write("step: {:3d} loss: {:10.9f}".format(step, 54 | loss.numpy())) 55 | if loss < 0.0001: 56 | break 57 | opt.apply_gradients(grads_and_vars) 58 | 59 | print() 60 | return bk.evaluate(t) 61 | 62 | 63 | if __name__ == "__main__": 64 | def main(): 65 | """CLI""" 66 | print(fit_zyz.__doc__) 67 | 68 | print('Fitting randomly selected 1-qubit gate...') 69 | target = qf.random_gate(1) 70 | params = fit_zyz(target) 71 | print('Fitted parameters:', params) 72 | 73 | main() 74 | -------------------------------------------------------------------------------- /examples/quilc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | """ 9 | QuantumFlow: Example use of `quilc` to compile to Rigetti native gate set. 10 | """ 11 | 12 | import quantumflow as qf 13 | 14 | # Construct a rippler adder circuit to add two N-qubit registers 15 | N = 2 16 | circ = qf.addition_circuit(list(range(N)), # first register 17 | list(range(N, 2 * N)), # second register 18 | [2 * N, 2 * N + 1]) # carry bits 19 | 20 | # Render pre-compilation circuit 21 | qf.circuit_to_image(circ).show() 22 | 23 | # Compile circuit 24 | compiler = qf.forest.get_compiler(circ.qubit_nb) 25 | prog = qf.forest.circuit_to_pyquil(circ) 26 | with qf.pyquil.local_qvm(): 27 | prog = compiler.quil_to_native_quil(prog) 28 | 29 | # Render post-compilation circuit 30 | circ = qf.forest.pyquil_to_circuit(prog) 31 | qf.circuit_to_image(circ).show() 32 | -------------------------------------------------------------------------------- /examples/state_prep_w16.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | """ 9 | QuantumFlow examples 10 | """ 11 | 12 | import quantumflow as qf 13 | 14 | 15 | def prepare_w16(): 16 | """ 17 | Prepare a 16-qubit W state using sqrt(iswaps) and local gates, 18 | respecting linear topology 19 | 20 | """ 21 | ket = qf.zero_state(16) 22 | circ = w16_circuit() 23 | ket = circ.run(ket) 24 | return ket 25 | 26 | 27 | def w16_circuit() -> qf.Circuit: 28 | """ 29 | Return a circuit that prepares the the 16-qubit W state using\ 30 | sqrt(iswaps) and local gates, respecting linear topology 31 | """ 32 | 33 | gates = [ 34 | qf.X(7), 35 | 36 | qf.ISWAP(7, 8) ** 0.5, 37 | qf.S(8), 38 | qf.Z(8), 39 | 40 | qf.SWAP(7, 6), 41 | qf.SWAP(6, 5), 42 | qf.SWAP(5, 4), 43 | 44 | qf.SWAP(8, 9), 45 | qf.SWAP(9, 10), 46 | qf.SWAP(10, 11), 47 | 48 | 49 | qf.ISWAP(4, 3) ** 0.5, 50 | qf.S(3), 51 | qf.Z(3), 52 | 53 | qf.ISWAP(11, 12) ** 0.5, 54 | qf.S(12), 55 | qf.Z(12), 56 | 57 | qf.SWAP(3, 2), 58 | qf.SWAP(4, 5), 59 | qf.SWAP(11, 10), 60 | qf.SWAP(12, 13), 61 | 62 | 63 | qf.ISWAP(2, 1) ** 0.5, 64 | qf.S(1), 65 | qf.Z(1), 66 | 67 | qf.ISWAP(5, 6) ** 0.5, 68 | qf.S(6), 69 | qf.Z(6), 70 | 71 | qf.ISWAP(10, 9) ** 0.5, 72 | qf.S(9), 73 | qf.Z(9), 74 | 75 | qf.ISWAP(13, 14) ** 0.5, 76 | qf.S(14), 77 | qf.Z(14), 78 | 79 | 80 | qf.ISWAP(1, 0) ** 0.5, 81 | qf.S(0), 82 | qf.Z(0), 83 | 84 | qf.ISWAP(2, 3) ** 0.5, 85 | qf.S(3), 86 | qf.Z(3), 87 | 88 | qf.ISWAP(5, 4) ** 0.5, 89 | qf.S(4), 90 | qf.Z(4), 91 | 92 | qf.ISWAP(6, 7) ** 0.5, 93 | qf.S(7), 94 | qf.Z(7), 95 | 96 | qf.ISWAP(9, 8) ** 0.5, 97 | qf.S(8), 98 | qf.Z(8), 99 | 100 | qf.ISWAP(10, 11) ** 0.5, 101 | qf.S(11), 102 | qf.Z(11), 103 | 104 | qf.ISWAP(13, 12) ** 0.5, 105 | qf.S(12), 106 | qf.Z(12), 107 | 108 | qf.ISWAP(14, 15) ** 0.5, 109 | qf.S(15), 110 | qf.Z(15), 111 | ] 112 | circ = qf.Circuit(gates) 113 | 114 | return circ 115 | 116 | 117 | if __name__ == "__main__": 118 | def main(): 119 | """CLI""" 120 | print(prepare_w16.__doc__) 121 | print('states : probabilities') 122 | ket = prepare_w16() 123 | qf.print_probabilities(ket) 124 | main() 125 | -------------------------------------------------------------------------------- /examples/state_prep_w4.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | """ 9 | QuantumFlow Examples 10 | """ 11 | 12 | 13 | import quantumflow as qf 14 | 15 | 16 | def prepare_w4(): 17 | """ 18 | Prepare a 4-qubit W state using sqrt(iswaps) and local gates 19 | """ 20 | circ = qf.Circuit() 21 | circ += qf.X(1) 22 | 23 | circ += qf.ISWAP(1, 2) ** 0.5 24 | circ += qf.S(2) 25 | circ += qf.Z(2) 26 | 27 | circ += qf.ISWAP(2, 3) ** 0.5 28 | circ += qf.S(3) 29 | circ += qf.Z(3) 30 | 31 | circ += qf.ISWAP(0, 1) ** 0.5 32 | circ += qf.S(0) 33 | circ += qf.Z(0) 34 | 35 | ket = circ.run() 36 | 37 | return ket 38 | 39 | 40 | if __name__ == "__main__": 41 | def main(): 42 | """CLI""" 43 | print(prepare_w4.__doc__) 44 | print('states amplitudes') 45 | ket = prepare_w4() 46 | qf.print_state(ket) 47 | main() 48 | -------------------------------------------------------------------------------- /examples/swaptest.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | """ 9 | QauntumFlow Examples 10 | """ 11 | 12 | import quantumflow as qf 13 | import quantumflow.backend as bk 14 | 15 | 16 | def swap_test(ket, q0: qf.Qubit, q1: qf.Qubit, q2: qf.Qubit) -> bk.BKTensor: 17 | """ 18 | Apply a Swap Test to measure fidelity between qubits q1 and q2. 19 | 20 | Qubit q0 is an ancilla, which should be zero state initially. The qubits 21 | cannot be initially entangled. 22 | """ 23 | circ = qf.Circuit() 24 | circ += qf.H(q0) 25 | circ += qf.CSWAP(q0, q1, q2) 26 | circ += qf.H(q0) 27 | circ += qf.P0(q0) # Measure 28 | ket = circ.run(ket) 29 | 30 | fid = bk.fcast(2)*ket.norm() - bk.fcast(1.0) # return fidelity 31 | return fid 32 | 33 | 34 | if __name__ == "__main__": 35 | def main(): 36 | """CLI""" 37 | print(swap_test.__doc__) 38 | 39 | print('Randomly generating two 1-qubit states...') 40 | 41 | ket0 = qf.zero_state([0]) 42 | ket1 = qf.random_state([1]) 43 | ket2 = qf.random_state([2]) 44 | 45 | ket = qf.join_states(ket0, ket1, ket2) 46 | 47 | fid = qf.state_fidelity(ket1, ket2.relabel([1])) 48 | st_fid = swap_test(ket, 0, 1, 2) 49 | 50 | print('Fidelity: ', qf.asarray(fid)) 51 | print('Fidelity from swap test:', qf.asarray(st_fid)) 52 | main() 53 | -------------------------------------------------------------------------------- /examples/tensorflow2_fit_gate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | """ 9 | QuantumFlow Examples: Fit a 1-qubit gate using gradient descent, 10 | using tensorflow 2.0 11 | """ 12 | 13 | import os 14 | import tensorflow as tf 15 | 16 | os.environ['QUANTUMFLOW_BACKEND'] = 'tensorflow2' 17 | import quantumflow as qf # noqa: E402 18 | import quantumflow.backend as bk # noqa: E402 19 | 20 | 21 | def fit_zyz(target_gate): 22 | """ 23 | Tensorflow 2.0 example. Given an arbitrary one-qubit gate, use 24 | gradient descent to find corresponding parameters of a universal ZYZ 25 | gate. 26 | """ 27 | 28 | steps = 1000 29 | 30 | dev = '/gpu:0' if bk.DEVICE == 'gpu' else '/cpu:0' 31 | 32 | with tf.device(dev): 33 | t = tf.Variable(tf.random.normal([3])) 34 | 35 | def loss_fn(): 36 | """Loss""" 37 | gate = qf.ZYZ(t[0], t[1], t[2]) 38 | ang = qf.fubini_study_angle(target_gate.vec, gate.vec) 39 | return ang 40 | 41 | opt = tf.optimizers.Adam(learning_rate=0.001) 42 | opt.minimize(loss_fn, var_list=[t]) 43 | 44 | for step in range(steps): 45 | opt.minimize(loss_fn, var_list=[t]) 46 | loss = loss_fn() 47 | print(step, loss.numpy()) 48 | if loss < 0.01: 49 | break 50 | else: 51 | print("Failed to coverge") 52 | 53 | return bk.evaluate(t) 54 | 55 | 56 | if __name__ == "__main__": 57 | def main(): 58 | """CLI""" 59 | print(fit_zyz.__doc__) 60 | 61 | print('Fitting randomly selected 1-qubit gate...') 62 | target = qf.random_gate(1) 63 | params = fit_zyz(target) 64 | print('Fitted parameters:', params) 65 | 66 | main() 67 | -------------------------------------------------------------------------------- /examples/tensorflow_fit_gate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | """ 9 | QuantumFlow examples 10 | """ 11 | 12 | import sys 13 | import os 14 | 15 | os.environ['QUANTUMFLOW_BACKEND'] = 'tensorflow' 16 | import quantumflow as qf # noqa: E402 17 | import quantumflow.backend as bk # noqa: E402 18 | 19 | 20 | def fit_zyz(target_gate): 21 | """ 22 | Tensorflow example. Given an arbitrary one-qubit gate, use gradient 23 | descent to find corresponding parameters of a universal ZYZ gate. 24 | """ 25 | 26 | assert bk.BACKEND == 'tensorflow' 27 | 28 | tf = bk.TL 29 | steps = 4000 30 | 31 | t = tf.get_variable('t', [3]) 32 | gate = qf.ZYZ(t[0], t[1], t[2]) 33 | 34 | ang = qf.fubini_study_angle(target_gate.vec, gate.vec) 35 | opt = tf.train.AdamOptimizer(learning_rate=0.001) 36 | train = opt.minimize(ang, var_list=[t]) 37 | 38 | with tf.Session() as sess: 39 | init_op = tf.global_variables_initializer() 40 | sess.run(init_op) 41 | 42 | for step in range(steps): 43 | sess.run(train) 44 | loss = sess.run(ang) 45 | sys.stdout.write('\r') 46 | sys.stdout.write("step: {} gate_angle: {}".format(step, loss)) 47 | if loss < 0.0001: 48 | break 49 | print() 50 | return sess.run(t) 51 | 52 | 53 | if __name__ == "__main__": 54 | def main(): 55 | """CLI""" 56 | print(fit_zyz.__doc__) 57 | 58 | print('Fitting randomly selected 1-qubit gate...') 59 | target_gate = qf.random_gate(1) 60 | t = fit_zyz(target_gate) 61 | print('Fitted parameters:', t) 62 | main() 63 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | testpaths = tests/ -------------------------------------------------------------------------------- /quantumflow/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | QuantumFlow: prototype simulator of gate-based quantum computers. 3 | """ 4 | 5 | from quantumflow.config import version as __version__ # noqa: F401 6 | from quantumflow import backend # noqa: F401 7 | from quantumflow.cbits import * # noqa: F401,F403 8 | from quantumflow.qubits import * # noqa: F401,F403 9 | from quantumflow.states import * # noqa: F401,F403 10 | from quantumflow.ops import * # noqa: F401,F403 11 | from quantumflow.stdops import * # noqa: F401,F403 12 | from quantumflow.gates import * # noqa: F401,F403 13 | from quantumflow.stdgates import * # noqa: F401,F403 14 | from quantumflow.channels import * # noqa: F401,F403 15 | from quantumflow.circuits import * # noqa: F401,F403 16 | from quantumflow.paulialgebra import * # noqa: F401,F403 17 | from quantumflow.programs import * # noqa: F401,F403 18 | from quantumflow.decompositions import * # noqa: F401,F403 19 | from quantumflow.measures import * # noqa: F401,F403 20 | from quantumflow.dagcircuit import * # noqa: F401,F403 21 | from quantumflow.visualization import * # noqa: F401,F403 22 | import quantumflow.forest # noqa: F401 23 | import quantumflow.datasets # noqa: F401 24 | # Fin GEC 2018 25 | -------------------------------------------------------------------------------- /quantumflow/backend/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | QuantumFlow's Tensor Library Backend 9 | """ 10 | from quantumflow.config import BACKEND, SEED 11 | from .numpybk import set_random_seed as np_set_random_seed 12 | 13 | 14 | if BACKEND == 'tensorflow': # pragma: no cover 15 | from quantumflow.backend.tensorflowbk import * # noqa: F403 16 | elif BACKEND == 'eager': # pragma: no cover 17 | from quantumflow.backend.eagerbk import * # noqa: F403 18 | elif BACKEND == 'tensorflow2': # pragma: no cover 19 | from quantumflow.backend.tensorflow2bk import * # noqa: F403 20 | elif BACKEND == 'torch': # pragma: no cover 21 | from quantumflow.backend.torchbk import * # type: ignore # noqa: F403 22 | else: # pragma: no cover 23 | from quantumflow.backend.numpybk import * # noqa: F403 24 | 25 | __all__ = [ # noqa: F405 26 | 'BKTensor', 'CTYPE', 'DEVICE', 'FTYPE', 'MAX_QUBITS', 'TENSOR', 27 | 'TL', 'TensorLike', 'absolute', 'arccos', 'astensor', 28 | 'ccast', 'cis', 'conj', 'cos', 'diag', 'evaluate', 'exp', 'fcast', 29 | 'gpu_available', 'imag', 'inner', 'minimum', 30 | 'outer', 'matmul', 31 | 'rank', 'real', 'reshape', 'set_random_seed', 'sin', 32 | 'sqrt', 'sum', 'tensormul', 'trace', 'transpose', 33 | 'getitem', 'astensorproduct', 'productdiag', 34 | 'EINSUM_SUBSCRIPTS', 'einsum', 35 | '__version__', '__name__'] 36 | 37 | if SEED is not None: # pragma: no cover 38 | np_set_random_seed(SEED) 39 | set_random_seed(SEED) # noqa: F405 40 | -------------------------------------------------------------------------------- /quantumflow/backend/eagerbk.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | Tensorflow eager mode backend for QuantumFlow 9 | """ 10 | 11 | # FIXME: use "with device" rather than .gpu()? 12 | 13 | import math 14 | import os 15 | 16 | import tensorflow as tf 17 | from tensorflow.contrib.eager.python import tfe 18 | tfe.enable_eager_execution() 19 | 20 | from tensorflow import transpose, minimum # noqa: F401 21 | from tensorflow import exp, cos, sin, reshape # noqa: F401 22 | from tensorflow import conj, real, imag, sqrt, matmul, trace # noqa: F401 23 | from tensorflow import abs as absolute # noqa: F401 24 | from tensorflow import diag_part as diag # noqa: F401 25 | 26 | from .tensorflowbk import ( # noqa: F401 27 | rank, sum, ccast, CTYPE, FTYPE, TENSOR, BKTensor, TensorLike, inner, 28 | outer, gpu_available, set_random_seed, cis, arccos, getitem, size, 29 | productdiag, EINSUM_SUBSCRIPTS, einsum, tensormul) 30 | 31 | 32 | DEFAULT_DEVICE = 'gpu' if gpu_available() else 'cpu' 33 | DEVICE = os.getenv('QUANTUMFLOW_DEVICE', DEFAULT_DEVICE) 34 | assert DEVICE in {'cpu', 'gpu'} 35 | 36 | 37 | TL = tf 38 | name = TL.__name__ 39 | version = TL.__version__ 40 | 41 | 42 | # The effective maximum size is 28 qubits for a 16 GiB GPU (probably 29 qubits 43 | # for 24 GiB) 44 | MAX_QUBITS = 32 45 | 46 | 47 | def evaluate(tensor: BKTensor) -> TensorLike: 48 | """Return the value of a tensor""" 49 | return tensor.numpy() 50 | 51 | 52 | def fcast(value: float) -> TensorLike: 53 | """Cast to float tensor""" 54 | newvalue = tf.cast(value, FTYPE) 55 | if DEVICE == 'gpu': 56 | newvalue = newvalue.gpu() # Why is this needed? # pragma: no cover 57 | return newvalue 58 | 59 | 60 | def astensor(array: TensorLike) -> BKTensor: 61 | """Convert to product tensor""" 62 | tensor = tf.convert_to_tensor(array, dtype=CTYPE) 63 | if DEVICE == 'gpu': 64 | tensor = tensor.gpu() # pragma: no cover 65 | 66 | # size = np.prod(np.array(tensor.get_shape().as_list())) 67 | N = int(math.log2(size(tensor))) 68 | tensor = tf.reshape(tensor, ([2]*N)) 69 | 70 | return tensor 71 | 72 | 73 | def astensorproduct(array: TensorLike) -> BKTensor: 74 | """Returns: array as a product tensor""" 75 | return astensor(array) 76 | -------------------------------------------------------------------------------- /quantumflow/backend/tensorflow2bk.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | QuantumFlow tensorflow backend. 9 | """ 10 | 11 | import math 12 | import typing 13 | import string 14 | import numpy as np 15 | 16 | 17 | import tensorflow as tf 18 | from tensorflow import transpose, minimum, exp, cos, sin # noqa: F401 19 | from tensorflow.math import real, imag, sqrt # noqa: F401 20 | from tensorflow.math import conj # noqa: F401 21 | from tensorflow import matmul # noqa: F401 22 | from tensorflow import abs as absolute # noqa: F401 23 | from tensorflow.linalg import diag_part as diag # noqa: F401 24 | from tensorflow.linalg import trace # noqa: F401 25 | from tensorflow import einsum, reshape # noqa: F401 26 | from tensorflow.python.client import device_lib 27 | 28 | from .numpybk import rank 29 | from .numpybk import set_random_seed as np_set_random_seed 30 | from .numpybk import TensorLike, BKTensor 31 | 32 | TL = tf 33 | name = TL.__name__ 34 | version = TL.__version__ 35 | 36 | 37 | tf.compat.v1.InteractiveSession() # TESTME: Is this safe to do? 38 | 39 | CTYPE = tf.complex128 40 | FTYPE = tf.float64 41 | 42 | TENSOR = tf.Tensor 43 | 44 | # Note if we use einsum in tensormul we will be limited to 26 qubits 45 | MAX_QUBITS = 32 46 | 47 | 48 | def gpu_available() -> bool: 49 | local_device_protos = device_lib.list_local_devices() 50 | gpus = [x.name for x in local_device_protos if x.device_type == 'GPU'] 51 | return len(gpus) != 0 52 | 53 | 54 | DEVICE = 'gpu' if gpu_available() else 'cpu' 55 | 56 | 57 | EINSUM_SUBSCRIPTS = string.ascii_lowercase 58 | # Tensorflow's einsum only allows 26 indices alas 59 | 60 | 61 | def ccast(value: complex) -> TensorLike: 62 | """Cast to complex tensor""" 63 | return tf.cast(value, CTYPE) 64 | 65 | 66 | def fcast(value: float) -> TensorLike: 67 | return tf.cast(value, FTYPE) 68 | 69 | 70 | def size(tensor: BKTensor) -> int: 71 | return np.prod(np.array(tensor.get_shape().as_list())) 72 | 73 | 74 | def astensor(array: TensorLike) -> BKTensor: 75 | """Covert numpy array to tensorflow tensor""" 76 | tensor = tf.convert_to_tensor(value=array, dtype=CTYPE) 77 | return tensor 78 | 79 | 80 | def astensorproduct(array: TensorLike) -> BKTensor: 81 | tensor = astensor(array) 82 | N = int(math.log2(size(tensor))) 83 | tensor = tf.reshape(tensor, ([2]*N)) 84 | return tensor 85 | 86 | 87 | def evaluate(tensor: BKTensor) -> TensorLike: 88 | """Return the value of a tensor""" 89 | return tensor.numpy() 90 | 91 | 92 | def inner(tensor0: BKTensor, tensor1: BKTensor) -> BKTensor: 93 | """Return the inner product between two states""" 94 | # Note: Relying on fact that vdot flattens arrays 95 | N = rank(tensor0) 96 | axes = list(range(N)) 97 | return tf.tensordot(tf.math.conj(tensor0), tensor1, axes=(axes, axes)) 98 | 99 | 100 | def outer(tensor0: BKTensor, tensor1: BKTensor) -> BKTensor: 101 | return tf.tensordot(tensor0, tensor1, axes=0) 102 | 103 | 104 | def cis(theta: float) -> BKTensor: 105 | """ cis(theta) = cos(theta)+ i sin(theta) = exp(i theta) """ 106 | return tf.exp(theta*1.0j) 107 | 108 | 109 | def arccos(theta: float) -> BKTensor: 110 | """Backend arccos""" 111 | return tf.acos(theta) 112 | 113 | 114 | def sum(tensor: BKTensor, 115 | axis: typing.Union[int, typing.Tuple[int]] = None, 116 | keepdims: bool = None) -> BKTensor: 117 | return tf.reduce_sum(input_tensor=tensor, axis=axis, keepdims=keepdims) 118 | 119 | 120 | def set_random_seed(seed: int) -> None: 121 | np_set_random_seed(seed) 122 | tf.compat.v1.set_random_seed(seed) 123 | 124 | 125 | def getitem(tensor: BKTensor, key: typing.Any) -> BKTensor: 126 | return tensor.__getitem__(key) 127 | 128 | 129 | def productdiag(tensor: BKTensor) -> BKTensor: 130 | N = rank(tensor) 131 | tensor = reshape(tensor, [2**(N//2), 2**(N//2)]) 132 | tensor = tf.linalg.tensor_diag_part(tensor) 133 | tensor = reshape(tensor, [2]*(N//2)) 134 | return tensor 135 | 136 | 137 | def tensormul(tensor0: BKTensor, tensor1: BKTensor, 138 | indices: typing.List[int]) -> BKTensor: 139 | N = rank(tensor1) 140 | K = rank(tensor0) // 2 141 | assert K == len(indices) 142 | 143 | gate = reshape(tensor0, [2**K, 2**K]) 144 | 145 | perm = list(indices) + [n for n in range(N) if n not in indices] 146 | inv_perm = np.argsort(perm) 147 | 148 | tensor = tensor1 149 | tensor = transpose(tensor, perm) 150 | tensor = reshape(tensor, [2**K, 2**(N-K)]) 151 | tensor = matmul(gate, tensor) 152 | tensor = reshape(tensor, [2]*N) 153 | tensor = transpose(tensor, inv_perm) 154 | 155 | return tensor 156 | -------------------------------------------------------------------------------- /quantumflow/backend/tensorflowbk.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | QuantumFlow tensorflow backend. 9 | """ 10 | 11 | import math 12 | import typing 13 | import string 14 | import numpy as np 15 | 16 | 17 | import tensorflow as tf 18 | from tensorflow import transpose, minimum, exp, cos, sin # noqa: F401 19 | from tensorflow import conj, real, imag, sqrt, matmul, trace # noqa: F401 20 | from tensorflow import abs as absolute # noqa: F401 21 | from tensorflow import diag_part as diag # noqa: F401 22 | from tensorflow import einsum, reshape # noqa: F401 23 | from tensorflow.python.client import device_lib 24 | 25 | from .numpybk import rank 26 | from .numpybk import set_random_seed as np_set_random_seed 27 | from .numpybk import TensorLike, BKTensor 28 | 29 | TL = tf 30 | name = TL.__name__ 31 | version = TL.__version__ 32 | 33 | 34 | tf.InteractiveSession() # TESTME: Is this safe to do? 35 | 36 | CTYPE = tf.complex128 37 | FTYPE = tf.float64 38 | 39 | TENSOR = tf.Tensor 40 | 41 | # Note if we use einsum in tensormul we will be limited to 26 qubits 42 | MAX_QUBITS = 32 43 | 44 | 45 | def gpu_available() -> bool: 46 | local_device_protos = device_lib.list_local_devices() 47 | gpus = [x.name for x in local_device_protos if x.device_type == 'GPU'] 48 | return len(gpus) != 0 49 | 50 | 51 | DEVICE = 'gpu' if gpu_available() else 'cpu' 52 | 53 | 54 | EINSUM_SUBSCRIPTS = string.ascii_lowercase 55 | # Tensorflow's einsum only allows 26 indices alas 56 | 57 | 58 | def ccast(value: complex) -> TensorLike: 59 | """Cast to complex tensor""" 60 | return tf.cast(value, CTYPE) 61 | 62 | 63 | def fcast(value: float) -> TensorLike: 64 | return tf.cast(value, FTYPE) 65 | 66 | 67 | def size(tensor: BKTensor) -> int: 68 | return np.prod(np.array(tensor.get_shape().as_list())) 69 | 70 | 71 | def astensor(array: TensorLike) -> BKTensor: 72 | """Covert numpy array to tensorflow tensor""" 73 | tensor = tf.convert_to_tensor(array, dtype=CTYPE) 74 | return tensor 75 | 76 | 77 | def astensorproduct(array: TensorLike) -> BKTensor: 78 | tensor = astensor(array) 79 | N = int(math.log2(size(tensor))) 80 | tensor = tf.reshape(tensor, ([2]*N)) 81 | return tensor 82 | 83 | 84 | def evaluate(tensor: BKTensor) -> TensorLike: 85 | """Return the value of a tensor""" 86 | return tensor.eval() # Requires a tensorflow session to be running. 87 | 88 | 89 | def inner(tensor0: BKTensor, tensor1: BKTensor) -> BKTensor: 90 | """Return the inner product between two states""" 91 | # Note: Relying on fact that vdot flattens arrays 92 | N = rank(tensor0) 93 | axes = list(range(N)) 94 | return tf.tensordot(tf.conj(tensor0), tensor1, axes=(axes, axes)) 95 | 96 | 97 | def outer(tensor0: BKTensor, tensor1: BKTensor) -> BKTensor: 98 | return tf.tensordot(tensor0, tensor1, axes=0) 99 | 100 | 101 | def cis(theta: float) -> BKTensor: 102 | """ cis(theta) = cos(theta)+ i sin(theta) = exp(i theta) """ 103 | return tf.exp(theta*1.0j) 104 | 105 | 106 | def arccos(theta: float) -> BKTensor: 107 | """Backend arccos""" 108 | return tf.acos(theta) 109 | 110 | 111 | def sum(tensor: BKTensor, 112 | axis: typing.Union[int, typing.Tuple[int]] = None, 113 | keepdims: bool = None) -> BKTensor: 114 | return tf.reduce_sum(tensor, axis, keepdims) 115 | 116 | 117 | def set_random_seed(seed: int) -> None: 118 | np_set_random_seed(seed) 119 | tf.set_random_seed(seed) 120 | 121 | 122 | def getitem(tensor: BKTensor, key: typing.Any) -> BKTensor: 123 | return tensor.__getitem__(key) 124 | 125 | 126 | def productdiag(tensor: BKTensor) -> BKTensor: 127 | N = rank(tensor) 128 | tensor = reshape(tensor, [2**(N//2), 2**(N//2)]) 129 | tensor = tf.diag_part(tensor) 130 | tensor = reshape(tensor, [2]*(N//2)) 131 | return tensor 132 | 133 | 134 | def tensormul(tensor0: BKTensor, tensor1: BKTensor, 135 | indices: typing.List[int]) -> BKTensor: 136 | N = rank(tensor1) 137 | K = rank(tensor0) // 2 138 | assert K == len(indices) 139 | 140 | gate = reshape(tensor0, [2**K, 2**K]) 141 | 142 | perm = list(indices) + [n for n in range(N) if n not in indices] 143 | inv_perm = np.argsort(perm) 144 | 145 | tensor = tensor1 146 | tensor = transpose(tensor, perm) 147 | tensor = reshape(tensor, [2**K, 2**(N-K)]) 148 | tensor = matmul(gate, tensor) 149 | tensor = reshape(tensor, [2]*N) 150 | tensor = transpose(tensor, inv_perm) 151 | 152 | return tensor 153 | -------------------------------------------------------------------------------- /quantumflow/cbits.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | QuantumFlow: References to classical memory 9 | """ 10 | 11 | from typing import Any, Hashable 12 | from functools import total_ordering 13 | 14 | 15 | __all__ = ['Register', 'Addr'] 16 | 17 | DTYPE = {'BIT', 'REAL', 'INT', 'OCTET', 'ANY'} 18 | 19 | DEFAULT_REGION = 'ro' 20 | 21 | 22 | # DOCME 23 | @total_ordering 24 | class Register: 25 | """Create addresses space for a register of classical memory""" 26 | def __init__(self, name: str = DEFAULT_REGION, dtype: str = 'BIT') -> None: 27 | assert dtype in DTYPE 28 | self.name = name 29 | self.dtype = dtype 30 | 31 | def __getitem__(self, key: Hashable) -> 'Addr': 32 | return Addr(self, key) 33 | 34 | def __lt__(self, other: Any) -> bool: 35 | if not isinstance(other, Register): 36 | return NotImplemented 37 | return (self.dtype, self.name) < (other.dtype, other.name) 38 | 39 | def __eq__(self, other: Any) -> bool: 40 | if not isinstance(other, Register): 41 | return NotImplemented 42 | return (self.dtype, self.name) == (other.dtype, other.name) 43 | 44 | def __hash__(self) -> int: 45 | return hash((self.dtype, self.name)) 46 | 47 | def __repr__(self) -> str: 48 | return ('Register' + '(' + repr(self.name) 49 | + ', ' + repr(self.dtype) + ')') 50 | 51 | 52 | @total_ordering 53 | class Addr: 54 | """An address for an item of classical memory""" 55 | def __init__(self, register: 'Register', key: Hashable) -> None: 56 | self.register = register 57 | self.key = key 58 | 59 | @property 60 | def dtype(self) -> str: 61 | return self.register.dtype 62 | 63 | def __str__(self) -> str: 64 | return '{}[{}]'.format(self.register.name, self.key) 65 | 66 | def __repr__(self) -> str: 67 | return repr(self.register)+'['+repr(self.key)+']' 68 | 69 | def __lt__(self, other: Any) -> bool: 70 | if not isinstance(other, Addr): 71 | return NotImplemented 72 | return (self.register, self.key) < (other.register, other.key) 73 | 74 | def __eq__(self, other: Any) -> bool: 75 | if not isinstance(other, Addr): 76 | return NotImplemented 77 | return (self.register, self.key) == (other.register, other.key) 78 | 79 | def __hash__(self) -> int: 80 | return hash((self.register, self.key)) 81 | -------------------------------------------------------------------------------- /quantumflow/config.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | QuantumFlow Configuration 9 | """ 10 | 11 | import os 12 | import random 13 | import logging 14 | 15 | # TODO: Device environment variables. Document 16 | # DOCME: docstrings 17 | 18 | 19 | _PREFIX = 'QUANTUMFLOW_' # Environment variable prefix 20 | 21 | 22 | # ==== Version number ==== 23 | try: 24 | from quantumflow.version import version 25 | except ImportError: # pragma: no cover 26 | # package is not installed 27 | version = "?.?.?" 28 | 29 | 30 | # ==== Logging Level ==== 31 | # Set logging level (CRITICAL, ERROR, WARNING (default), INFO, DEBUG) 32 | # https://docs.python.org/3.6/library/logging.html 33 | 34 | logging.getLogger('quantumflow').addHandler(logging.StreamHandler()) 35 | _LOGLEVEL = os.getenv(_PREFIX + 'LOG', None) 36 | if _LOGLEVEL is not None: 37 | logging.getLogger('quantumflow').setLevel(_LOGLEVEL) 38 | 39 | 40 | # ==== Tensor Library Backend ==== 41 | 42 | # FIXME: Should be in backend? 43 | DEFAULT_BACKEND = 'numpy' 44 | BACKENDS = ('tensorflow', 'tensorflow2', 'eager', 'torch', 'numpy') 45 | 46 | # Environment variable override 47 | BACKEND = os.getenv(_PREFIX + 'BACKEND', DEFAULT_BACKEND) 48 | if BACKEND not in BACKENDS: # pragma: no cover 49 | raise ValueError('Unknown backend: {}BACKEND={}'.format(_PREFIX, BACKEND)) 50 | logging.getLogger(__name__).info("QuantumFlow Backend: %s", BACKEND) 51 | 52 | 53 | # ==== TOLERANCE ==== 54 | TOLERANCE = 1e-6 55 | """Tolerance used in various floating point comparisons""" 56 | 57 | 58 | # ==== Random Seed ==== 59 | _ENVSEED = os.getenv(_PREFIX + 'SEED', None) 60 | SEED = int(_ENVSEED) if _ENVSEED is not None else None 61 | if SEED is not None: 62 | random.seed(SEED) # pragma: no cover 63 | -------------------------------------------------------------------------------- /quantumflow/dagcircuit.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016-2018, Rigetti Computing 2 | # 3 | # This source code is licensed under the Apache License, Version 2.0 found in 4 | # the LICENSE.txt file in the root directory of this source tree. 5 | 6 | """ 7 | QuantumFlow: Directed Acyclic Graph representations of a Circuit. 8 | """ 9 | 10 | from typing import List, Dict, Iterable, Iterator, Generator 11 | 12 | import numpy as np 13 | import networkx as nx 14 | 15 | from .qubits import Qubit, Qubits 16 | from .states import State, Density 17 | from .ops import Operation, Gate, Channel 18 | from .circuits import Circuit 19 | from .utils import invert_map 20 | 21 | 22 | __all__ = 'DAGCircuit', 23 | 24 | 25 | class DAGCircuit(Operation): 26 | """A Directed Acyclic Graph representation of a Circuit. 27 | 28 | The circuit is converted to a networkx directed acyclic multi-graph, 29 | stored in the `graph` attribute. 30 | 31 | There are 3 node types, 'in' nodes representing qubits at the start of a 32 | circuit; operation nodes; and 'out' nodes for qubits at the 33 | end of a circuit. Edges are directed from 'in' to 'out' via the Operation 34 | nodes. Each edge is keyed to a qubit. 35 | 36 | A DAGCircuit is considered a mutable object, like Circuit, the other 37 | composite Operation class. 38 | 39 | DAGCircuit is iterable, yielding all of the operation nodes in 40 | topological sort order. 41 | 42 | Note: Provisional API 43 | """ 44 | def __init__(self, elements: Iterable[Operation]) -> None: 45 | G = nx.MultiDiGraph() 46 | 47 | for elem in elements: 48 | if isinstance(elem, tuple): # Filter in and out nodes 49 | continue 50 | G.add_node(elem) 51 | for qubit in elem.qubits: 52 | qin = ('in', qubit) 53 | qout = ('out', qubit) 54 | if not G.has_node(qout): 55 | G.add_edge(qin, qout) 56 | prev = list(G.predecessors(qout))[0] 57 | G.remove_edge(prev, qout) 58 | G.add_edge(prev, elem, key=qubit) 59 | G.add_edge(elem, qout, key=qubit) 60 | 61 | self.graph = G 62 | 63 | @property 64 | def qubits(self) -> Qubits: 65 | G = self.graph 66 | in_nodes = [node for node, deg in G.in_degree() if deg == 0] 67 | if not in_nodes: 68 | return () 69 | _, qubits = zip(*in_nodes) 70 | qubits = tuple(sorted(qubits)) 71 | return qubits 72 | 73 | @property 74 | def qubit_nb(self) -> int: 75 | return len(self.qubits) 76 | 77 | @property 78 | def H(self) -> 'DAGCircuit': 79 | return DAGCircuit(Circuit(self).H) 80 | 81 | def run(self, ket: State) -> State: 82 | for elem in self: 83 | ket = elem.run(ket) 84 | return ket 85 | 86 | def evolve(self, rho: Density) -> Density: 87 | for elem in self: 88 | rho = elem.evolve(rho) 89 | return rho 90 | 91 | def asgate(self) -> Gate: 92 | return Circuit(self).asgate() 93 | 94 | def aschannel(self) -> Channel: 95 | return Circuit(self).aschannel() 96 | 97 | def depth(self, local: bool = True) -> int: 98 | """Return the circuit depth. 99 | 100 | Args: 101 | local: If True include local one-qubit gates in depth 102 | calculation. Else return the multi-qubit gate depth. 103 | """ 104 | G = self.graph 105 | if not local: 106 | def remove_local(dagc: DAGCircuit) \ 107 | -> Generator[Operation, None, None]: 108 | for elem in dagc: 109 | if dagc.graph.degree[elem] > 2: 110 | yield elem 111 | G = DAGCircuit(remove_local(self)).graph 112 | 113 | return nx.dag_longest_path_length(G) - 1 114 | 115 | def size(self) -> int: 116 | """Return the number of operations.""" 117 | return self.graph.order() - 2 * self.qubit_nb 118 | 119 | def component_nb(self) -> int: 120 | """Return the number of independent components that this 121 | DAGCircuit can be split into.""" 122 | return nx.number_weakly_connected_components(self.graph) 123 | 124 | def components(self) -> List['DAGCircuit']: 125 | """Split DAGCircuit into independent components""" 126 | comps = nx.weakly_connected_component_subgraphs(self.graph) 127 | return [DAGCircuit(comp) for comp in comps] 128 | 129 | def layers(self) -> Circuit: 130 | """Split DAGCircuit into layers, where the operations within each 131 | layer operate on different qubits (and therefore commute). 132 | 133 | Returns: A Circuit of Circuits, one Circuit per layer 134 | """ 135 | node_depth: Dict[Qubit, int] = {} 136 | G = self.graph 137 | 138 | for elem in self: 139 | depth = np.max(list(node_depth.get(prev, -1) + 1 140 | for prev in G.predecessors(elem))) 141 | node_depth[elem] = depth 142 | 143 | depth_nodes = invert_map(node_depth, one_to_one=False) 144 | 145 | layers = [] 146 | for nd in range(0, self.depth()): 147 | elements = depth_nodes[nd] 148 | circ = Circuit(list(elements)) 149 | layers.append(circ) 150 | 151 | return Circuit(layers) 152 | 153 | def __iter__(self) -> Iterator[Operation]: 154 | for elem in nx.topological_sort(self.graph): 155 | if isinstance(elem, Operation): 156 | yield elem 157 | 158 | # DOCME TESTME 159 | def next_element(self, elem: Operation, qubit: Qubit = None) -> Operation: 160 | for _, node, key in self.graph.edges(elem, keys=True): 161 | if qubit is None or key == qubit: 162 | return node 163 | assert False # pragma: no cover # Insanity check 164 | 165 | # DOCME TESTME 166 | def prev_element(self, elem: Operation, qubit: Qubit = None) -> Operation: 167 | for node, _, key in self.graph.in_edges(elem, keys=True): 168 | if qubit is None or key == qubit: 169 | return node 170 | assert False # pragma: no cover # Insanity check 171 | 172 | # End class DAGCircuit 173 | -------------------------------------------------------------------------------- /quantumflow/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | 8 | """ 9 | Standard QuantumFlow datasets. 10 | 11 | >>> import quantumflow as qf 12 | >>> graphs = qf.datasets.load_stdgraphs(10) 13 | """ 14 | 15 | from typing import Tuple, List 16 | 17 | import numpy as np 18 | 19 | import networkx as nx 20 | from PIL import Image 21 | 22 | 23 | def load_stdgraphs(size: int) -> List[nx.Graph]: 24 | """Load standard graph validation sets 25 | 26 | For each size (from 6 to 32 graph nodes) the dataset consists of 27 | 100 graphs drawn from the Erdős-Rényi ensemble with edge 28 | probability 50%. 29 | """ 30 | from pkg_resources import resource_stream 31 | 32 | if size < 6 or size > 32: 33 | raise ValueError('Size out of range.') 34 | 35 | filename = 'datasets/data/graph{}er100.g6'.format(size) 36 | fdata = resource_stream('quantumflow', filename) 37 | return nx.read_graph6(fdata) 38 | 39 | 40 | _MNIST_BORDER = 5 41 | 42 | 43 | def load_mnist(size: int = None, 44 | border: int = _MNIST_BORDER, 45 | blank_corners: bool = False, 46 | nums: List[int] = None) \ 47 | -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: 48 | """Download and rescale the MNIST database of handwritten digits 49 | 50 | MNIST is a dataset of 60,000 28x28 grayscale images handwritten digits, 51 | along with a test set of 10,000 images. We use Keras to download and 52 | access the dataset. The first invocation of this method may take a while 53 | as the dataset has to be downloaded and cached. 54 | 55 | If size is None, then we return the original MNIST data. 56 | For rescaled MNIST, we chop off the border, downsample to the 57 | desired size with Lanczos resampling, and then (optionally) zero out the 58 | corner pixels. 59 | 60 | Returns (x_train, y_train, x_test, y_test) 61 | 62 | x_train ndarray of shape (60000, size, size) 63 | y_train ndarray of shape (60000,) 64 | x_test ndarray of shape (10000, size, size) 65 | y_test ndarray of shape (10000,) 66 | """ 67 | # DOCME: Fix up formatting above, 68 | # DOCME: Explain nums argument 69 | 70 | # JIT import since keras startup is slow 71 | from keras.datasets import mnist 72 | 73 | def _filter_mnist(x: np.ndarray, y: np.ndarray, nums: List[int] = None) \ 74 | -> Tuple[np.ndarray, np.ndarray]: 75 | xt = [] 76 | yt = [] 77 | items = len(y) 78 | for n in range(items): 79 | if nums is not None and y[n] in nums: 80 | xt.append(x[n]) 81 | yt.append(y[n]) 82 | xt = np.stack(xt) 83 | yt = np.stack(yt) 84 | return xt, yt 85 | 86 | def _rescale(imgarray: np.ndarray, size: int) -> np.ndarray: 87 | N = imgarray.shape[0] 88 | 89 | # Chop off border 90 | imgarray = imgarray[:, border:-border, border:-border] 91 | 92 | rescaled = np.zeros(shape=(N, size, size), dtype=np.float) 93 | for n in range(0, N): 94 | img = Image.fromarray(imgarray[n]) 95 | img = img.resize((size, size), Image.LANCZOS) 96 | rsc = np.asarray(img).reshape((size, size)) 97 | rsc = 256.*rsc/rsc.max() 98 | rescaled[n] = rsc 99 | 100 | return rescaled.astype(dtype=np.uint8) 101 | 102 | def _blank_corners(imgarray: np.ndarray) -> None: 103 | # Zero out corners 104 | sz = imgarray.shape[1] 105 | corner = (sz//2)-1 106 | for x in range(0, corner): 107 | for y in range(0, corner-x): 108 | imgarray[:, x, y] = 0 109 | imgarray[:, -(1+x), y] = 0 110 | imgarray[:, -(1+x), -(1+y)] = 0 111 | imgarray[:, x, -(1+y)] = 0 112 | 113 | (x_train, y_train), (x_test, y_test) = mnist.load_data() 114 | 115 | if nums: 116 | x_train, y_train = _filter_mnist(x_train, y_train, nums) 117 | x_test, y_test = _filter_mnist(x_test, y_test, nums) 118 | 119 | if size: 120 | x_train = _rescale(x_train, size) 121 | x_test = _rescale(x_test, size) 122 | 123 | if blank_corners: 124 | _blank_corners(x_train) 125 | _blank_corners(x_test) 126 | 127 | return x_train, y_train, x_test, y_test 128 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/README.md: -------------------------------------------------------------------------------- 1 | # DATASETS 2 | ---- 3 | 4 | ## Graphs 5 | Randomly generated graph collections, from Erdős-Rényi ensmeble 6 | Generated with the script graph_generate.py. 7 | 8 | Filenames graph{nodes}{family}{samples}.g6 9 | nodes = 6 to 20 10 | family = 'er' 11 | samples = 100 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph10er100.g6: -------------------------------------------------------------------------------- 1 | IKNlUY`KG 2 | IUDoouHNW 3 | IBijh\|}G 4 | Ie@TBzsa_ 5 | I?NNVpwBw 6 | IintrPu~W 7 | IbwLehxT_ 8 | I_cf@lk^W 9 | ItR\@aCP_ 10 | IE]lmf~Kw 11 | I}nwX]YOO 12 | IuXJ@ZbOG 13 | ISQTm~@TO 14 | IIaKXLJMw 15 | IqN?Ny_{W 16 | I^]AsHBqo 17 | IiH~[I~[_ 18 | Is^G^H?GW 19 | Ij]lWCroo 20 | IBg`KbsXo 21 | IARV^`rdO 22 | IpzosUmzW 23 | IlO@yxAKW 24 | I~weH?mQ_ 25 | I@Pb]xYC? 26 | IV|bLwTYo 27 | IiGW]ZH^O 28 | IyWiBeeq? 29 | IcyiQzZJ_ 30 | IFH^nE@tw 31 | IU_xN[EB_ 32 | I`QlJ@btW 33 | I|`ZtT?Pw 34 | Ieb{FzjB? 35 | IMjxR_yt? 36 | IeEPVvZ|W 37 | Il[~{zMB_ 38 | IrmEJ{cN? 39 | IylTUH@vW 40 | IytVAcVHg 41 | IP{GsGvrw 42 | Il]ngSWlW 43 | I]?Fc^kR_ 44 | IrVqj}c[_ 45 | IKXqTSsIg 46 | I|?qDYkrO 47 | I`d[FbRJ_ 48 | IqMSna^AO 49 | IHRLPrlF_ 50 | Ig|]jf^@o 51 | IxroT?S|w 52 | IbDLQNmmw 53 | IIFn@acEo 54 | Ib_zV]M}_ 55 | ICG`hJL{W 56 | IelKZhsUo 57 | IloQPP^pw 58 | I^[c?Cy}O 59 | IXtwY}KjW 60 | I{]BGiFVw 61 | IVW]H\cX? 62 | Im__sllE? 63 | IfNg^YQy_ 64 | I_upB|Ay_ 65 | ILPLXLbIW 66 | IuD~kjv@o 67 | IhUmekfQO 68 | I}FE[_uWw 69 | I|MH@O?Gw 70 | I`gmSLJuw 71 | Ig}imVR{o 72 | IaTe\WNeg 73 | IW`|YabCo 74 | Iiqi@D`xO 75 | IwQVOT@vg 76 | IovBqKBNg 77 | IvbR?YiL_ 78 | IGyi?aK~_ 79 | Ishs~ewUo 80 | IrskUngrw 81 | IevdZTtkO 82 | IVC[cq^H? 83 | IbA}oUwd_ 84 | IwUCU|Wao 85 | ICGWhCfVg 86 | IjDL^ecIG 87 | Is[wuhxeO 88 | Iqu|[w^WG 89 | IT[?{BRlg 90 | Ieri`}U~o 91 | IxWA|NZ[W 92 | IP^IyffgW 93 | ImJGQBuOW 94 | IXrdslxCw 95 | Ip~mzlnr_ 96 | I_EiyvbmG 97 | IN~[]RO]O 98 | I\IZ}R[bG 99 | IsNSeWvrw 100 | IrfRI|e[O 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph11er100.g6: -------------------------------------------------------------------------------- 1 | JjvonXhRF}_ 2 | J\FpUL\vby_ 3 | J^ZpcH\vA`? 4 | Je?G?k`}Nb_ 5 | J]dF@oc]Kh_ 6 | JpVMes]V\]? 7 | Jw]sZ|XExv? 8 | Jn@BBHxy|k_ 9 | JaUHaJcJcd_ 10 | J[FVg?fow~? 11 | JXh~axDxmW? 12 | J~DeRq^XH`? 13 | JuLJ~XpgbM_ 14 | JOtXxZJ{qf? 15 | JxVLDG~u_{? 16 | J@w{utX_Lx_ 17 | Jnuc`[?Ipq_ 18 | JTvYlChpA@_ 19 | JjqFvc[WUr_ 20 | JaMhiDjUbs? 21 | Jnn??hWTP[_ 22 | JzkkJsDgCa? 23 | JdRqpTck`A? 24 | JS^h}bB]Li? 25 | JxmNHzQes@_ 26 | JBFUbpMs}g? 27 | J`f\iESXcK_ 28 | Jbn^hnyFK`_ 29 | JMDDW[^]xX? 30 | JDIhBqNyu^_ 31 | JsM^UB@?TU_ 32 | Jtjun@EXK~_ 33 | J]{@xx^L[E_ 34 | JCqAaMFNsS_ 35 | J~ZD^DYmWu_ 36 | JAugy]f@Ir_ 37 | J{VJsLKC?C? 38 | Jiz{@f_TjX? 39 | JEdMC^vmVa_ 40 | J@gAYqmjEk? 41 | JWCNvxA@yD_ 42 | JWvdvUQ^k~? 43 | JqOmZW^`ji? 44 | JW{pXKPZs]? 45 | J_|VZ}s_DV? 46 | J|dGenO]Kv_ 47 | J[@ZkJ{K?w_ 48 | Jg|}[SZUMQ_ 49 | JbSmRiUe\i_ 50 | JL?dN|z[TZ_ 51 | JSM}[{iUPh? 52 | JIHGGjFJYz? 53 | JrG`g\{g~f? 54 | JyBD@`X`qR? 55 | J@xQCRIwHH_ 56 | J@C^ktAc@i? 57 | J\tWKBQCia? 58 | Jj]GIWyySY_ 59 | JAnwIvi]wc? 60 | JmUX{rsBn__ 61 | JwnuN}vIh_? 62 | J}h]PSVtG__ 63 | Jx{seOxTBM? 64 | JitNdFlZsP? 65 | JzxWH`RwbL? 66 | Jxi[~\rllB? 67 | JMnKFRbigt? 68 | JB]bPPmM`M? 69 | J[QEV}^lcg? 70 | J{rYbBfduM_ 71 | JnTSqtCt[S? 72 | Jxp@Cy}sVr? 73 | J_Rgre@IEM? 74 | Jx}PWS^Ov@? 75 | JD@CpmKp^M_ 76 | JbwuUsMEyv? 77 | J]rVcaOjXS? 78 | JEbuA\NSkJ_ 79 | JYS@i{s}KZ? 80 | J]fjQ_A[Y^_ 81 | JLq?HUBPjK? 82 | JuhvnewFoH_ 83 | J^BSjYe@S`_ 84 | JabWCZG]te? 85 | JjO{o?^G?V? 86 | JA~sqkmbbJ? 87 | JzOzLQqrk@? 88 | Jfcb\mTeA^? 89 | J^TDtj{ysR_ 90 | JqDXRCRYNI? 91 | J@I@uiPcxO_ 92 | JRTellAhXv_ 93 | J{FPvS{`EZ_ 94 | JHkMNLx{`x? 95 | J~E]FyDcF|_ 96 | JBlemPA^MQ? 97 | JXnYN`rhIm? 98 | JAbXFTndCj? 99 | JPIGnPmI}[_ 100 | JRInw~vmSx_ 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph12er100.g6: -------------------------------------------------------------------------------- 1 | KgMW@_NeoYUm 2 | Kmjt?pVWgoLf 3 | KQ}BdrRl}mIR 4 | KE}@wwfAq]jn 5 | KWT}\AhQj~Ck 6 | KVFTurx\`qjq 7 | KcsYqVUbBRHe 8 | K_Qi__a]dNBc 9 | KmuyCjre_}Pi 10 | KgRp}[E|d[RC 11 | KF~DxLmaX\xY 12 | KDkoW`y|EmiF 13 | K`wbvZaoqWyT 14 | KP`lHLe^@iGM 15 | KGASjK`a_sWm 16 | KLDyBMG@CPkA 17 | KJfIJJwDN{DO 18 | Kn@[nBoSOiKp 19 | KUwItPtm?bt\ 20 | KJeUhl}`Sqfj 21 | K~hDpwBFljlG 22 | K~grXSX?IX~g 23 | KWYTIH}{V_y? 24 | K|Aan}btxwkW 25 | Kx`XGld^IPsS 26 | KMjKZAypoFKN 27 | K@h[gylQzmZc 28 | KiFN_pfW|fb] 29 | KXcpUa[iB|qo 30 | KJQQNq\~NKsA 31 | KzMLxatGslcG 32 | KSmLTlqOl[vH 33 | KLf^a\G]xya} 34 | KMle]\?{EHUY 35 | KlYYp[LVSKUt 36 | KBuIVwpNQx|y 37 | KJB[}^`vULcZ 38 | KJyWSUX^hP}J 39 | KjsWUiG@pAJY 40 | KXLYb`lKTAAO 41 | KNpjLd?NTQG? 42 | KwsLRG^iVOZ? 43 | KBBzeAZ~VySO 44 | Kze\\M{{KT[Q 45 | Kuyj`BkK_a|A 46 | KvYiCbuoLIkb 47 | KSJrdGkK{BRx 48 | KEuof{J}EPVp 49 | KKUiVnbLe~DJ 50 | KHskfeGF}c{Y 51 | KaSI?[E^XYh\ 52 | KzC_gCmwJsiw 53 | KOF~KE~DFs\D 54 | KuemVQlaA]Fp 55 | KnzD|C}u{Fph 56 | KP{igE[ZeO^t 57 | KDarY|m]IsgI 58 | KHJJKIDkNzov 59 | KuoZzY][mL\f 60 | KQ\S_teIxEQm 61 | Kn[jWjn_bOrC 62 | KohiYRYXjbKa 63 | KHgAwyKxL\Ns 64 | KLavAujXhb~R 65 | KNv@ClLDjFoP 66 | KjyVrXbmQs\t 67 | K[BXGPo[}?{m 68 | KPYEH]^RwSeg 69 | K``~oAWRK_S{ 70 | KASH\NeoPFMf 71 | KsGfgdv`}MrA 72 | Kc}REde|bhwZ 73 | Ksy{V_xM|PSv 74 | KYFty^MQEz]W 75 | K[XRaJ^cwDrf 76 | Kk_ZwOZE\gZC 77 | KCToz~XliGSo 78 | Ki@jhrIXq{LP 79 | KZXsooPoOoUT 80 | KGn^NKFBMRsT 81 | KYDR{srC`Bbq 82 | KYnZ`QpZfm`D 83 | KCJSLyA@WPWW 84 | KAVkB@JWCvR{ 85 | KZacE?FgWZ@] 86 | KmqyorhpyN~j 87 | KE]je@Yp`Ka| 88 | KsAq\uje[S}V 89 | KjbxtNvSVUmq 90 | KpXcJueOkDQ~ 91 | Kajb]om^urY[ 92 | KsRzMM`YAe|_ 93 | KGskGMm[OjBT 94 | KhkCUZEVcUmJ 95 | KLZyJhD?pDKn 96 | KEFJv]bK_`sC 97 | KA@SG\VEArNg 98 | KCcPPeDQuFk~ 99 | KZ]beUyTgVCo 100 | KI@B?_vPi}ZH 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph13er100.g6: -------------------------------------------------------------------------------- 1 | LQbDH?UcQvlm?L 2 | LC`OcfaP_VaOXP 3 | LK_NRP^at{[TSu 4 | L\qc\bC|sQBqfq 5 | LvN`P[ZmlBo`Xq 6 | LPlwaaj]eexEa[ 7 | LXhEHeevrBp|CC 8 | LGN?qY[HHVjuXS 9 | Li]\]~Uyg@u?En 10 | L{X@]Sdi@McH@~ 11 | LbgxedxtKgpgjq 12 | Lh}eA`?ZRBGmPV 13 | LJemnGYljiwIoM 14 | LJIjilLLZT`]CJ 15 | LUWabNXd{DG\SQ 16 | LkaOQjMtf?KFZZ 17 | LIKFrpTzq}l^Un 18 | LASHopSpk}BmF_ 19 | LicjmJ]}E_Siwp 20 | LqO]vmbVbaJEzB 21 | LGyZfM?`LtBVrR 22 | L?q\[Wc`r[scJ_ 23 | LPSQILGq`Malxv 24 | L}ZbwHZ\S{xKGu 25 | LXZMFDW|q?oS^F 26 | LX\Sw|]hlIMbWt 27 | L{uuztmQLSuE_c 28 | LeuLz~jcBCkMPd 29 | LIQI]kAJCrl{\M 30 | LVNVLNcY@^mzRv 31 | LUu[PIj|PTSB^S 32 | LjBbO\QnQbl~AL 33 | LtN\trbFD|PLSQ 34 | LU@R]ocYTnEpuo 35 | LilbyLByXvyhKW 36 | LzK{a@tg@\nAWA 37 | Lizv[MfaxRmDmm 38 | L\g_MvYAp~nnsx 39 | LP{VHLmolfXRBz 40 | L}gu`QKyeW|LZa 41 | LngheO]_Bh{Yz{ 42 | LHlfG|ut^zBztG 43 | LbkYtkC~xipKx\ 44 | L{[D~vw\\VrEsS 45 | LCXVYy\g}}c`kt 46 | LVyQ`lHBKqJgNG 47 | LUfMbpAKMmEEXJ 48 | LYVlbbBNn|M]fq 49 | L]S_RJlCUX{dT] 50 | LBp]l__@h@[k^S 51 | LyP{W]QGhy|gko 52 | LLgqePYqAQiKIS 53 | LLYv@MMdDw\|ku 54 | LUpXWl`xhTmrD{ 55 | LUhXCzTilkLyFx 56 | LSM_VHjX\x`VAH 57 | LzaovHxWYDcQmD 58 | Lfc~c^^TbcE?{p 59 | Locc]icqjjFP[L 60 | LiUyQDKIJ^UcGd 61 | L@r^UlbwS~Iehm 62 | LixZaT]HA{|lWL 63 | LA^gYMIBc_TT^F 64 | LkCSHWsOluZ~Ol 65 | LtbxVnfUUORpxM 66 | LSRkKmA\\oU?Gg 67 | L?tVPuwbB{~}C^ 68 | LOz}lvctfA~fdk 69 | Lbc?Fv[[LvMVsk 70 | LWZTSPFYFU}rXx 71 | LZe}c|nxmogHgi 72 | LNIEYrORMTKY_l 73 | LdgyFiHqX~rl`q 74 | L]|SKXFDx?O\qD 75 | LlIu}BLZrwUZGB 76 | LIzgm{UFAE]bH{ 77 | LXVjK}Nagd`gFo 78 | LkH\heaOvSaYOH 79 | L@OOfCNxS`kySF 80 | LwotFRNhsopkMQ 81 | LBO`IHGttA[XcR 82 | LMVs?RYbI}LtXS 83 | LjYsjezRK[IIt\ 84 | L~Tv@c@][vnz`m 85 | LlwPOXZ?RG_OaH 86 | LrPFSxADP`[UW^ 87 | LIivOT`~_\KKL? 88 | LPclaDC{fN_q|u 89 | LcG^o`GG~t|LEI 90 | L@PjyoXAasfwrS 91 | LdVV_]SHcX`tr^ 92 | L_nSpjgxN}tD]i 93 | LqlJwkXWCB|I^J 94 | LJ_cSB}SpuVwIi 95 | L^IkHVXfHPCV\w 96 | LcPpCSg\jQoxit 97 | L|xehS}rrLqoqN 98 | LN]~A@aNKa?Zz^ 99 | LfW[hf|uQU|Hrb 100 | Lu|jmVUKKxxAcj 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph14er100.g6: -------------------------------------------------------------------------------- 1 | MNxjWwAD@iLl}_Vv? 2 | M|Rt`alujg]k?UZi? 3 | Mpjj|VoTX{\MrXN}_ 4 | MXr|aBEPZAD\pNBx_ 5 | MRiMftAuV|_ZiPQf_ 6 | MeJ`bNIRVL\qqpQe_ 7 | MGG}BJKqo{IZUOIb? 8 | MvEEK@wT^wi\Wp{~? 9 | MdadXSZwBrb@rSef? 10 | MDY]]kdSnXh]H\DL? 11 | M|C\bHCbALzvznWb_ 12 | MUusHGmBYjmcleDq? 13 | ML`tvrw\CrMLRVTn? 14 | MwYe]XbLGKfzLDaw? 15 | Myqg_k`L\yZmmQ|k? 16 | MaRVwqck^zcm?grg? 17 | MjKJIfOhD\oK|}lr? 18 | M|?QHE@|co~mP[]C_ 19 | MNC``Fxb^{TCubJy? 20 | MgkrRjupA?ejQFjI_ 21 | MRRQTemTAG`]DIdk? 22 | MllLPVC[txpuGPMO_ 23 | Ms}YQIJkIaz\QzMO? 24 | MGhjdoRrvWDjnI|b_ 25 | MOpcHpXtxTGHiV`u_ 26 | MQAwPMrdnJUkS`kV_ 27 | MVUCF]GLOFmg{Esu? 28 | MFr_RgLTufj@Cm~A? 29 | MdgKFwG~kVJeljFg? 30 | Mvf?[rlmedyGAqiT? 31 | MlFt_gmtFUtbpYiE? 32 | MPbi`XWwRDcTW]m__ 33 | MHEnVp~pf[WfWpW]_ 34 | MzcrmCsnbZfehdmX_ 35 | MOA{[BF[JyqP|F{T_ 36 | MXokoBsZrJyH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M\DUj_AmEWmER||M? 86 | MhvgMHLp{Qgd\kdJ_ 87 | M[dVuZ^MzCb~Fhyi_ 88 | MGwerh~ghP`XRjdh_ 89 | M`H^XfTxYumItvgS_ 90 | MwJOn?YfvQGhmpmM? 91 | MpHzJi\@ElzyJbJK? 92 | M@vOcY@CC@Rt]OFU? 93 | McEl]Quko?iUaS``? 94 | MKNA?F_}bCdIMI?n? 95 | MSVNZKs`^EEApJUm? 96 | MECG~K@YiT?CjfCh? 97 | M?ZpYX?b@BzhXGGq_ 98 | M^XLTY_wshJt[|P_? 99 | MzvHL[wYd_hiMRC{? 100 | Mf\GeSwada^bekTY? 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph15er100.g6: -------------------------------------------------------------------------------- 1 | NmZZQLfwyls_JsotEng 2 | NZw}Zi[NAhPBOLxGykW 3 | N_YpNRoF?\[G_N`TNE_ 4 | NE{}r}CH~lkOJJBjgQO 5 | NqV@PxmhMejzy~N|qMG 6 | NkH|X@T~s_puKiDrAS_ 7 | NoV{Em\yEdlBGrIprUo 8 | N~E}cfsXclVzzF_w\qO 9 | Ndu?XyArutKjRZDoF]O 10 | NXEtyELbYBCGlVJ`JMw 11 | NrsV}acdqD{{UFJ`kW_ 12 | NLKrG{qyYK[zOm]`lP_ 13 | N~WJU]sQT_sqEh`Awxo 14 | NI~tnwCXgrZEZeHEydo 15 | NiDAyhwPviPnX[a?WUo 16 | NErR?IiiVzO?EP_AEk_ 17 | NsPwLFgt`GqdcIQNKSw 18 | NwztjDvdZbNQP?akYig 19 | NwsDXO\ek{ujM\TJAvw 20 | Nuj_qVMPMFuhUl`c}mG 21 | NcanOMwdOcTcGSD|]EG 22 | NRJoaxcK?laDiO_F[Zg 23 | NJEEZ}raZ`ZnEKgJPI? 24 | NQlenhjANasdmn}C{q_ 25 | NRA`DX\`XuiBl[f@JPO 26 | NHV@E{IO]UlI|hEkWRo 27 | NeTo_yaGV~|ay}_isQG 28 | NBq{~u\ni]WFLHsMAB? 29 |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| NxQzqWt^oyqjn__nyWO 75 | NPWsqTv[AWoHasKoC@_ 76 | NXq?itGGJphmF_k}fLw 77 | NkXmixsy@~NP\AKoeP_ 78 | NfL?zZxPmt`Y\{Oo[wo 79 | NvW[{odRohcLMU_iP]O 80 | N]uHsQ[S}OL@ebrafTG 81 | N?t^vDyNgpKs_{IGQd_ 82 | NURqqAnAUCZp_[oi_b_ 83 | NdHAtLXLzdQt?[TiXcO 84 | NjoplgEyuZrwqtRGW?G 85 | N^\bqx@REipfAQm\QEo 86 | N\]psAnCBIt`Vdzj`dG 87 | N[gh?|aTKJT]Kgt]oPw 88 | NUKqOdIX^vz_~w_m_Do 89 | NLdZUABjpBkuZNc@NPG 90 | Nu|PNqDq_|cKDR|LH|_ 91 | NpxrDs}ICDR]WTv_HH? 92 | N~r?ef^eFqg{}c@k~kO 93 | NM}?}j_}?LdSEhK~pTo 94 | NwiKJkwnB^Dj[l~[kJG 95 | Nt^NsP|\lcpwpgagasW 96 | NNeOrOoTdsBSKRdiZ`G 97 | N^]]vJYm@PygM{qP`g? 98 | NaePqFiyzJ\tjUCrKaO 99 | N\\qccVWscu@oVYVZnO 100 | N{VIJuW~p]MDKdw@wq_ 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph16er100.g6: -------------------------------------------------------------------------------- 1 | OLotvXZbUEP@NKOtitCOd 2 | OrHQ}j~]?sxh`T`R}{`ua 3 | OiUw_LOYHk[j_f}lzMjtj 4 | ORtgvEAACoNoncYDtg\DI 5 | OwbSIv{SgO^nVziz@pzJO 6 | OFluZVsb]aJUBwfbrRKjU 7 | OhVxpMwFjCd}?cNM~UpC_ 8 | OatkxFmCh}oJKfhTQNR~q 9 | Ohj]ePWBP_vPvJB^@@oUE 10 | OQcJE\mss|?TOsiSQvd^z 11 | OzZfTZGk^mx\_}LYIOH}L 12 | OZIN^@Lq^KvzublSbieo@ 13 | Og[eYN?KXwA]y?cFEpadB 14 | OJk`uPpRNo]mxVJx_DLhX 15 | O}JLpmg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DFUt|}|UGO~[CjrrdI 99 | OHAjPLOursh`WXlXzZguq 100 | O?v^^Hluteh~T@zDBfMM[ 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph17er100.g6: -------------------------------------------------------------------------------- 1 | PE_}PO^`~yjEYkRFIIFlyqsW 2 | PUyDw?|[XJGXrNFk[NXbq{JO 3 | P\LvLPZFy?MYTdyMMYIULi@W 4 | PMbWvI\PI|x{c?tUmktgCHYO 5 | PUVXFuu[gQK[ydjNpMixLBhc 6 | PUK_ratl`oS}sBRi?pzB@BNk 7 | PKMWcwCQMv|nST|XQf[aYDlw 8 | PLFSEn|gMjfUMYfEYmrKCxIK 9 | PLWX|JUhfpJSHl\Omtep@IB[ 10 | PoCUDhrvIeeWj~UnaApsLMqs 11 | PiLAPap^HmfCJCbuVOwHEL^W 12 | PSguYARzqpw\}]U??NgIa[UW 13 | PXwbZSsw]lazp~CW{uIbQEWg 14 | Pwkxqw{wBT@k]SR}Of~?z{Co 15 | PYi`nU}SWWYXtrWwHnoRqCP_ 16 | PnxCF[Frhnc_dQovxJ^QJmYO 17 | PVn[YWjKyeBAbMkXaiT}TmGo 18 | P}z]zkXkoRR@xbBVOKhZvBKs 19 | PTrG{UWp@ggWJcDQ[oG?aqDk 20 | PcD|QpNzKjjmsNOUXjJ~jK_c 21 | PU?{kLaS_Z@]qJsv[i[np|bO 22 | Pwr}zmfX?V~nIXUjHW?vKY\G 23 | P{N`pKNJr}LMSznKkMrNNmik 24 | PcfjjWUHvN?SONpCoKhBZcVs 25 | PcisdNj|J[o_[cMwCQEa}Xpw 26 | Pi{jnPbGRolZ{NFfKKs|TwE{ 27 | PvubLhP]HFX|Y[iQjdsOYwxo 28 | P^RRT|uiqaLYdbYS^YPXX~lo 29 | PStxbeF^wv}Wh\i^lsUYgMcc 30 | P]cZ{bOwAh}AON[X`XU]zMbG 31 | PCp}FhC[B\rWwpPLSlAmYZIw 32 | PIm?@otyUvJRxXo{LyJ|[Mhc 33 | PbdOk@Qb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Rc|VK 70 | P_Vrj[rb\Rz|pUwzG]bN_^CW 71 | PEsAwKNoRldCCXkAoTuSwNVo 72 | PXe\qUR@QCVcyg\KWYxgChaW 73 | PiBYk`Hbjy`qFObY{AtJrA\[ 74 | P@`JWmnpaiVdRX_XQXCCZcRS 75 | PJA[l^AVYqEtMSsLIq{VOzvG 76 | PxGccdGcrld_kaerDhlR`WVw 77 | PalIpERnqGqeB}[oQGT@hND{ 78 | Pq}Ao}^NZZBnB`r^hLh|`Tu{ 79 | PzsCM~d[sHeWlkFf`DL[brGg 80 | PGqteO`w|DU{pbMfcrKmMrvw 81 | POOqnujl|U]Y]nKbPavhZGw[ 82 | PlC?\bOHcMexbdpm}ZZ?QlsC 83 | P_BMRKfIKqHae?Y?]mFwdrEG 84 | P~DqPlwRhxlRwftkhUQE^EQg 85 | PD`T?s@sdkUAeWtwnwwif{B[ 86 | P}AJ{{A{M\MuVFLPap}EUEqk 87 | PE@||fj|RiOwrHr_GaNXNhcw 88 | P[TfEd`Sq}|Oy[agqUuWn~Yc 89 | PHx^MlSmh]ODCIgiLZ^qbcAs 90 | PdlFQqWeb\]C{s[@Tv^OauMs 91 | PYmLSXAAlUR|KfN_mObVs\Qw 92 | PaKeBB?Db~O\ugbrkjnf\sr? 93 | P~g|w}fYX?wmXGv\]MBYUaZG 94 | P{ytbYs^|w@xbMXgqUwd|_n? 95 | Ph|g@yHNqk~zZWXnmLfbWIfs 96 | P[r]dGvBxuc]TkPAeUQbqov{ 97 | PTEqrqN_VuKiESzuDShct[|[ 98 | PaaIiWfvFveYOrJaHXLDJYN_ 99 | PJ[]dPVCr~VZd[}uBRsbc?p? 100 | PC]B~qzQhmIOp~zahTIIc{RK 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph18er100.g6: -------------------------------------------------------------------------------- 1 | Q}OcIdF[ZhONELiJ{kKlWyLoA_g 2 | Q`coFh`q^lpeXkBipivJntDK?B? 3 | QxpxNFwuE?nsGEB}b]tAZv`yNEO 4 | Qyp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Jm}at]? 71 | QAsF`ssnWGvXb\nqce`bc`uG[`? 72 | Q{@fYIuSlYWVMJB}GpSl[KU`DUO 73 | QhY]YELzO^~NyBkt`lPRwFDk`Ho 74 | Qbv?uZNrCixzcrzrEJU?{{TlwOO 75 | Q_nHHfW}xDdM{|MWa\c_RmiMzfg 76 | Q^DZHofYLLsNxLxRYdnWZDsB`ew 77 | Q^wrpAxTQVeNs{W@QA{F@yASiCo 78 | QBeDtY?tBSIx|~i?p]t`ycyM\\O 79 | QZKAOnL|kCrsknSPniL{ofRZ_To 80 | QreRPMkhodS]TLHnam^NCGj~OMg 81 | Qu[gOz{P^fhdON\rGGK}hFdSJag 82 | QKdRq@{d`k{HjbIgbGe\fu[[KZw 83 | Q[fqaZRlJVxAu`vpr`ryRKwLybW 84 | Q?B{HkoMRIsbWofGU[MhlSwWnpw 85 | QjAv{ny?uphP`\gn~o]zX[_CCM_ 86 | Qa[EjeJU?UP{WgPmb@K?MSqKi~O 87 | Q{~I[vucIDbTBTe\PGouhaeeLaW 88 | QpE?mCPJb@PSC~mSwp]iwCMtTm_ 89 | QhDlthWqQx|GbrkqI|yt}@O|xew 90 | QO{xkG~aAPMZ@DD{rDsYAUjULW_ 91 | Qx\\CBVoCzsMqwH}AH~Gsm?JfTw 92 | Qe}YLHVkUwW`GKubtjoUG{MWWko 93 | Q{pFd}sXCTVL{iWhhK}reGHgoaw 94 | QN\hGfShElsSGloDgyJNQsCWmv? 95 | Qpsp{TA[Fdi[@w]YtFo_JYV`}bW 96 | QG^lauy|w_|oFs`jarfxvf?{qW_ 97 | QxA^Mh_zIy\\|DHgn}]UCqdnFtW 98 | QWRK~yfxX|{Q\Tj?|iPostOvYO_ 99 | QF}A\ZQx`^y}V]]F^mEIyxSzBeg 100 | QdL@b]bO^@F@zriffKAioQtxprG 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph19er100.g6: -------------------------------------------------------------------------------- 1 | ROTfy}CfKgFQ~~WqsnNSXLJgEthGAg 2 | R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OVSrg 94 | R\ju@bWwpbuIhSDTFVIBIUEGmo^hfg 95 | R`bDR}HeOyMrfdhXGJhM`ueO\OLHUO 96 | RVur[odYOE^JtKDs|H@v\^UOoq@MoG 97 | RIv?a}^Zome^y@CcAYO{@]tqdixqQO 98 | Rcj~OF}ARlgWusmsFBHYW{?iW[^gB? 99 | ReXVD[W{BwtZKxM_DhkhenOWVQE_AO 100 | R{VWGFSiVyDfPQFvIBcWMb@]NWSTVo 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph20er100.g6: -------------------------------------------------------------------------------- 1 | STHW@b?EoPXNMz?X|l?ULm~jrRurxSqu[ 2 | S_pOxb]stK\dZtDKhL[TBFlxmrZ_Ay_zK 3 | SCO[}JONuKeJi|Uag|X}~@xjMInqNyGcK 4 | SIr\t~O[~CwCkwk_xOWZuAe]H?gla@JF{ 5 | SD\?kVGLEj[MkZpuoHqGdajGD~bQjQqK_ 6 | SRIoB{mTSAOH_dymdJdqMTwRE\PDL|V{W 7 | Sj|AqI`AvdKi`bskeOxNL\Gpi{BwltRVg 8 | SNM?E]EOK^|wzUpZ^{Vyxzh^AD^HoG[cS 9 | SHDjQXYbrsi?HMgZPXIUHf{]TRj[Ap~zO 10 | SGlgqhpCbkQBN}wZi}LApcW[}^|mehknK 11 | SofQ~Pf]qDaPNT|ryw\coXglqAy`OrTLW 12 | SMYMt|nI]VqHsaAkX[SG?pvp_@ZLX_oMw 13 | SC}AkAKMl]dFm~{FRXif[rC|yyG^ISvb[ 14 | SfSKUHOTax[QlbzKZ^_gqGCi|TU[chSyK 15 | SC`PBzEo}`kk?weIWHeqLGqVz[pagO~Lc 16 | SfZUE^Iy}cSSgxRf\wLO{vLL?X]_Sd?_O 17 | Sh]z_YoCqCUl~V|Nc`jFOH~be?fwGN[bk 18 | SC}]EKHFAXc^ZS\wEgZVpmZ`jhC[?EPkK 19 | SYG`XqUPSlSa`XE?~eE~VUvkLOiRn~?G[ 20 | SIqiexyRLhNPMJVPe}@xRqSc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xO{RLc[vBMG_ 77 | SChayGqBhvPKDsPW^h?xyrBvoNeoOg@}o 78 | S{]rGFTpWULrn@NzVTOCy|eE}eXPQqXmC 79 | SXG]x]dyABOOfiL^PZhrqP@w`lwy{mgi{ 80 | SgbCZH]{vvMf?SEH[PTRVaKdqkAJTWDDk 81 | SLvldhwpXQJ\??c`cYpvki@d~]{ehqJIg 82 | SxjwrXwzYVSnAxN|maFvixbHvNvcyzKVC 83 | SnAxpmXNCXJxppVAeav]mIj{heGKVT`po 84 | SSRo]AXe|SsnCo}g[xAiQmlkfdXiSvUkc 85 | ScabpnHnHdl\WEGrYf{M@}upwlGS{eimO 86 | SGZkX?atsLZHvXYU^uwhwlWPqnqfPd|c{ 87 | SpQuRZHPg_KfLUxC[JF[\NHDHYkFHeNf[ 88 | Sak^`UeSjM{EYD@JHipLKKxqhgVe`^df[ 89 | Sga`XAaFCENedYz~RQ_CrpEKz]seDQRO{ 90 | Se~CiI[}hsf?ilZIc^K?|D|pUnvUntJ\[ 91 | SOL|qA{C@@xgCXuZg~\XsIS\JtzZu[q]W 92 | S_ePvYYO~gNoSj_CpJpKaLwvmfDjrZzHo 93 | SKkN|S\qxHfiBEt{pL?obt]gmX}ScWm@g 94 | SbrCvt~wV]MI@IRIyZsfPuVdHY[IalHEW 95 | SRxbFTGlrFDOdw?|[uixsEL{bJwSVAjO{ 96 | ShyevhKLnqi~wAV|yoGwJ|yW{CQt[sNyc 97 | SVHBhTeNVMHceCVADMfMgUDu[[MMWgQKw 98 | Sn\uC`NCvNRkz}f`IzaMc?UO_CXJAFcz[ 99 | SV`Ds_h{q[AJb^oENRLuYVzMLaGdNzhf? 100 | Sjo\CDB{wJLUGDTmVzsr_HXz`ZJU@NlJk 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph21er100.g6: -------------------------------------------------------------------------------- 1 | TA`hxDCapWZPgdK{}_TdljOghcpURgyI[s^m 2 | TqgOgFfp^tDIGYO|qWx]j^IixWK|?~JWh~Ux 3 | T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 81 | TaAcdOl~OECIi@uTuPFi]RoWA@juVFDNnxkD 82 | TCGs^vAp{xJMrGPeX}uHKX\~JinsCqLchW@} 83 | TzGjOcn@nx|Z[SSuOuRDiKeIy`Q?MxdRUpmG 84 | TT`aHGi}oS}bI]@t?jw~FZCd~pjTXzc_gLIt 85 | T`~QOuAOKj\n`Y^NelHVpcSes^MljeYHiMco 86 | TzCukPuRNHtPemMKgEql\lm@c}mXpDdRltH_ 87 | Tr{]~]JkNQzAo|]_INWnN@WWuyxYK[~_VmdU 88 | T|xTPy_nD}QUi|m{gQXWMFaqufeSue~Kz^Bb 89 | T`c]]@AbjN@TsGVhCJ[bQDWFqsMxwv^A?^}M 90 | TM?WgpfBCX[{uWwkX_lixy_|JK@TpffNJOkG 91 | TCN@GVBFkLtX]BB{aqTHaLmd`Zz_o]OJTTQE 92 | T^JSMv\EkHFg\RIGTvS_ECUUZkMd~XsXwO?g 93 | TLbT{|iyShSNeok\LbCNSfCJc\WlZf?lsdD[ 94 | TBJyGTWWu`oZx_NttdtRWsKZtUh_Me}velDS 95 | TvKo{XGRL_TqfNB\iiruikqDeSgIa?nQuQTS 96 | Tco|\rdRqxzlxYNpUwUNwj@[uTpAnWnPqE@] 97 | TxY{?M|I{{VJFhtaUIttI_Vq?yuZhbANY@Zf 98 | T]NhtJVEyZDwhaOLuva?}E[RJWOExOtVgQ}\ 99 | T|XWzKK?dG}lytYOOOxu`EXqfqC{gxKJW\Oh 100 | TJp@A[Sgb`a~]orozQ|ZeABXiN|DgPoR_nRs 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph22er100.g6: -------------------------------------------------------------------------------- 1 | U_JOmwIwq@vtNsFKu\wWfI}Dso\Ou}tHY?wsKhn_ 2 | UxAozc]jA]Q_TdgcwxMY?MfVRuU{AcshNxfDk[Co 3 | UmO|{iks[~R]MH{|wWTFLpnA?~\_Ox@EKhsgIcLw 4 | UTzbaBJTCzCutGCxMn\W]gUFZMyOr@e]]i|NWlWo 5 | Uc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r~lC]DZig}}N}iPHoSs{eU`tkdS}sM}?vJ? 100 | UYqrR}SUp?[ZsF_Sjdis~\o`jt{`[MCI?wu}`DWg 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph23er100.g6: -------------------------------------------------------------------------------- 1 | VXrFfW?{zm\gHmKpzQeZfFlEGNu}_gKK`C\oXtEeBxx? 2 | V_[?Eu~WwBnoNoxR@FJNFRliEy`frbXIXnZ?x?]puu_? 3 | VaVZ@Ab{`jPyFD[nGJ}Od}}]\@T_|mKAcB]}pMWyvPx? 4 | VMax_c|qJ[@n]{o{{qH^xw]rUhmVGXP~RX_TTgN|fH}_ 5 | VloWFi~x~G|L^T\_fLU[IgtiBu]`gzpLirymeBnm~yY? 6 | V|ZcMH]uUWfNt?C?[PJTvqG~QaC}o@K}TWCO}Z_^OFN_ 7 | V`Nw?OsBqxDRh}K[bOxiWgfivfQTPwNQEZd_wiKX]IX_ 8 | VnsoDvM`DY@{KeSZOJ}wGsGXV]bfSHzbvKGbf?tYCeB? 9 | VRiDpBlbO@}@bGGScVobzn`ejwEJ[ME]XIsajwlv^Dr? 10 | VQl_tn]MQ?QPa\NiTfjC@|IjzgkoPjgeeMR[ymD~Qy\? 11 | VaOFQQ[B^dYdt}BiCVKexwXRhZcKh[?g{CykYz|LS~}_ 12 | VcQveNvYKzXraSGVQGPgRIRYMtWDwNqmm|yiV\to[AT? 13 | Vg{\EtakhniovW`}nRCHTpxOgEtd\_`IJ?QO\?vU]Il? 14 | VFhZQ~a?~Q~QTJsvXCY}s]\Y^^gAeiB_oHPUYrRXc`h? 15 | VTVIbYzy[TJv]pcmdSmnzt{exdarfAyaDpYlQAlftE__ 16 | V@sbIlihuJ[fP~{I`{DElvxmVKtVi?b?gynzaPEvgp^? 17 | VYspcEc`i\[h~]@LSkex@KhDb[ekg[]vPbFNR]LlcR?_ 18 | VTKw}ZX@CXMLIk^tI@nx|NGQHDe_ATgNsKsGQ[\wA@\_ 19 | VREy{OvlrgkaSHI^f?]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VZNJm@g|oosH]X@B]EEdd`H{M`{MakdJB_axInArFzc? 85 | V_rc?MKNvFBuy|scFiNHUynn^Yv|wu?eTj_{Qi\X\sS_ 86 | VAlvXSfgSpDiWr[[{qnSDgr@YASPgbuOocGCfhOkCZS? 87 | VxYxN}WR]_|BMcJV{NiCBI?mayAZLlZglxIdQjjhd`\? 88 | VuD@c?k`~?nRkPPAyWvOT^LaS?_iNZCaW`n|fjvbKbq_ 89 | V~klR[NB_@Qqhkcw[kfJRwAScaLQrAO\@|FjwLHkbrN_ 90 | Vwff}JZCNV~EabB^x[xbVfPu_Hx|uaAOhad{tzNonmI? 91 | VY]OGYrLtmgVHGfLdiMhLGnip{VuKa]xDiWGqI{afRr? 92 | VDuPE^iZ`uQA][Npq~VBEpbuFfwoevJR^qt\Wly?ZMC? 93 | V_[}XSV`nNm?EysWwgxrIJl`pZ^h{nMiJgMsc?oIh^a_ 94 | VnGuRKkx\duoxLIpYzun]JjjpJlOO_Xx@zaP~gEoR@?? 95 | V|`^vVMADKVCEwE[NwWSq~RYT^QP?ZLF?qv@~mDV]FT_ 96 | VB^Bn?dV~TLStP`yGF[hJHnWUUIVYSIXrLgPRIb|?Kc? 97 | V]W`RNgxHv]iqEb`MkbzeUzgfswATs?}mpRj@S}mHZL? 98 | VgOIMg{Sp_UzUpFpggbdlpeYc?Vmwdnzkk@s~wYBs\C? 99 | VF\KXMFNkgceq\GemYUGGPp|@DjuawuKc|ejLBM}@sk_ 100 | VwHDHLjGHnYGX@sHCzdf_E^{Qg}Zf|UniJngxx|QbrA? 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph24er100.g6: -------------------------------------------------------------------------------- 1 | WqC]GgIXb_G?h_P|N^O~@{CkQpp[hoDQV?hDvCeh^vELRuR 2 | W|v}RQVG`~lOU@X__isSAzBWjQOxn|ZAfz~ObIeYKnrpFPo 3 | WL{QFHdRUJkabVdxAIkB`cdubEKGofHt\vHGcJwl_Tkmx?W 4 | WlA_cBdZKVKl_LZ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v{\XY 86 | WMsrLdytk\ELo\pxV]uaWWvSzgnr^?^KFxh`J|`ypsaud`t 87 | WROuEjKoCn`DknQeObtD\jT[AU@mz\{wkbKfaIEEJV@O|bp 88 | WgPHr@z\Ov]chf{uqiS[hQXf@hfvOjDeTqUylQ_cBrcnvtM 89 | W_B?xYEB[a`j^\eRJoljkxxrV|RwM?Yxmjy@vX~eAaGX}pS 90 | WrZgvQ`^bO\H]oh^d^_EKIfVMwfk?g@]^]}isDwEBe@FqV@ 91 | WXeiWLdVlrJIVKjgrBDibE~H{RBD[DHBHYwNws]UBTLadzQ 92 | WoZ]zVlRhzIycVZED@wW\UKqy]~Tts@wUApU^yqEAWee]}U 93 | WjGSPZVeSGYOHtosn\pD]oyhGvk^yLrYzic^HEW?EAIt{ko 94 | WVpZ{xRJdpsHB{GahtvbF@JpOqKF@XyvpIO?{rbPJfK@_\e 95 | WnfwZfFQmOSwsN[t]MsR_U`[XxPmRjgFTvcz~BlMoCOaCgQ 96 | WkTFiiPDh^dQ[gGvWJexE?tA_{uLawJwxuEqNbsvccll_wd 97 | W^IYttqm{|spICYCEfh\TZhg{z~LiemT?gYxllrgNqNhenl 98 | WiGPYUKD_waa}Apu`dzmdw`sT`_CWdaWmuF{]dT_VpbQrea 99 | WYDd_mz{_f]kG_v_ruECawf_GzleJfQjx{`tMTWC^diD?rl 100 | WyZuzI@uJE{bKU{gqcIyqTSSdY{YTTtcrYfx{MtwbaQlnLr 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph25er100.g6: -------------------------------------------------------------------------------- 1 | XNdEfq{W]mav{E[j]fO`ycdQBmxZ~H]r}Ch|{{NtRtSan{MJzID 2 | XPwAj_vkaWsjCUUZBK^I]Y[\^OclB[sSq@i?xkcS?XMzofvM?vH 3 | XeLu~P_?kNyTnWzW_U]LzdPHkRGVMolH[ezR_HWP}of?R|FvQob 4 | X{|ceHo?GzQ?OQ`^LUiJ[aSyBUXDiHoDfnFdJhCH\sRmUlvIN[W 5 | X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W\{X^YR 100 | XzrEliMiLEJxQETWSLUuh?^ACYc`pi|dxDri~TMX]l``qX`ifwx 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph26er100.g6: -------------------------------------------------------------------------------- 1 | Y\SJeTrBx\aeUyDxyI^pRJLQ]i~nPm\Y`hU?nMaKGZJiPRUCQhFEFRj? 2 | YNs\G`Ruw[BBLrpS~X||exHXPSuS[{@x_|z\L`mr@GJdbjAwNblI]dd? 3 | Y~rmgBCRTTM^\D}fH]fFA\Cnf{aKmGUfJ?v[\Ve[F^wo@ftiYAXzffI? 4 | Y_|jxElJLq_ROFydxZVnkmZpz~q{GaxANqWQfmQqk~{ybSNFX_k?j~J_ 5 | YEIVMNMK}fJ[o_[w~deF?|xuSwmOn}oxzh{MDLy\WDfiLwVSjtym^Cy_ 6 | YSZIQ}@{vjZf^@srNzgvhChDL~GVgzJ@I]eL\Hz^tUQgtzP^^ghcQzm_ 7 | YUhG]`lXWFyWl~ytL^tY\lNeu?Ifve@osKdTvxV^^gtaOKlFUHZESvn? 8 | YHz}wy|hgecCE^[bISoGhjfYmDhVKrTQzbDsA}DbFTgK}`Vns^_bhU~? 9 | YLlM\Unsc^DJqvpBad@\LUPo@zkXEOSG?Xtgc[AQ_\`lAXDOXL[Vno{? 10 | Yw{}CJmXtTsAbCnBn|sf]_pinExEQdHuBYXxkXckKhft_V[DLkyVSPH_ 11 | Yq|NJcJs?jyYuOzLysDtgbCkHdmNgAMbpSrmcp{bGilp?kwWV`wY[]@? 12 | YUrpRe]OypCu[dvhjhJ|Zb^rdSu[|_tnb\XCHa~gpa]Kx}dbvps|UKm_ 13 | YLyr`u^`^FvJckKImfPjnaTJbl[{A\[LmN[GoQ]s|uty_lPpSTcTckU_ 14 | Y\qxewtgGIPw\VAH[KErmhOi~iRI?W^Yv]e[h~rQeNwSF{`|jJdWmVT? 15 | YJblKHS@N_l`MqOH}rlgFsN^f|oaJa]a|TmqzFBmmTtX[ZSlKbSXMtM? 16 | YUWSg^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[fyWBSRJb`jX]k{IRNl_ 86 | YXepQd}`{kayqzHFZTUVOERdWCrsBumNlB`@w?M{~~oAucbdRA@n^Mi_ 87 | Yr^YMHfNaY|AE[yJEqT^cSDUxRQilxrCP@FQoxhuMBRJvW^o^Ojc`\V? 88 | YwgfmpCvq@E?q~~\LhpNUt_@LFXyUJwkyXxk`s_{mqSE?PKPdpNdZR|_ 89 | YMsNAfHGmjRBF^\Ckc|\@~Ng?EJkoKB@SEi[XBvUS}AjuoBl~gPVQ\C_ 90 | YN[EKDtsIiKfizj{HLDGGerBhk\aVgVPIlPUxL\juj@UyX@DvnLbjm_? 91 | YxUEG`YCksJy]xlb?xLROFOlgDhw}lJ]Cv@pSwE}bJt{qQPpNGlrIjH? 92 | YC|vt`Yh_@I}dz|F_|epl}@m}Gf]G\brgsvNf{bTYtmB\roIb|Qy}d__ 93 | YjVRZ\Bg^BoGChDvyNjV@t\pqR`Sa@QTju]RFLHbt]DZFhhHrbugCFF? 94 | Y`c[FfQfCAqn@aDDacZyVUzmyMmjNtjmcEzqXs@kPHoeIsumUvMZjOK? 95 | YvzbHyVw\_IjfPoFoWU``F{RK~VV~XSI{ojynQ?GNyr_JrxJtF@LmfG? 96 | Y{ppmKu\aEWeUxcnV_jt[ni]RPfQC}K`f}m?mA@AXrklY}|bJtTiiH@? 97 | YevINQ}IaVkT\RQqilYhsnI]BR~dWWfzbTEogxgS[gcOctyLr@NjuXj_ 98 | YJfxVTKAnu]BAUM_zwkIxxDrtsvlpPdNXvh|DIZKc^AT|S{VAA@O`Q?_ 99 | Yx~PgHrTjVNOg?QnTlrTlSUXuYqoBRbQCsXmgO{ciJNmdPPkhD`wapb? 100 | YZds?k\Io@[dyIMHcDqDgb^h|ZWNl^qJ|j?}R~RTkQjtS@~l}D|EiA\? 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph27er100.g6: -------------------------------------------------------------------------------- 1 | ZJyCH{bs_JKUO[{XyA|un{vVCN}B@Y|m}aReSyynS^zJIP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CEc\QcOuCDzU`[vPk^L@x]jMy|ZRnE`aLvvRvPIk? 99 | ZRtrgJtdRQv}GurWkSXhtFseEOKOlkaWhpkNvRG@NV\ImdAQKDA@KJJeIHOW 100 | ZqV\jWKhSW]?lABUzitpLnpnJKEB\?JyT]RLXNRh[EvbuVWAwrM`tQ}^~aYO 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph6er100.g6: -------------------------------------------------------------------------------- 1 | EnRG 2 | Euv? 3 | EV@O 4 | EtxO 5 | E@Zg 6 | E^Iw 7 | EMTg 8 | ET^W 9 | EsbG 10 | EKAo 11 | E{to 12 | E{\g 13 | EBzo 14 | EV~_ 15 | Efw? 16 | Ent? 17 | EBTO 18 | E|MG 19 | EVDG 20 | E^mw 21 | E\~W 22 | E_B_ 23 | EPXo 24 | ELqO 25 | EY_? 26 | EUNW 27 | E`GG 28 | Edwg 29 | E@_w 30 | EYrG 31 | E@s_ 32 | EF}? 33 | El|o 34 | EU]? 35 | ELkg 36 | Ehqo 37 | EjHg 38 | ED[o 39 | Exwo 40 | E@wG 41 | Etxg 42 | Ep@G 43 | Ex~w 44 | ETHw 45 | EF~g 46 | E_`O 47 | E]nW 48 | El^w 49 | Ei|G 50 | El~G 51 | EI`W 52 | E[@? 53 | EZLw 54 | E|EG 55 | EEpO 56 | ETj? 57 | Ebh_ 58 | E}bG 59 | E_k_ 60 | Eu|W 61 | Ejt_ 62 | EDYg 63 | Eb?G 64 | Ea|_ 65 | EfT? 66 | Evh_ 67 | EGQG 68 | EhEG 69 | EPZO 70 | EDV? 71 | EbX_ 72 | EIU_ 73 | EBW_ 74 | E|C? 75 | EqCo 76 | Eg`G 77 | EELW 78 | Em\o 79 | E[H_ 80 | E~dg 81 | EU}G 82 | EaBW 83 | ECmO 84 | ENYW 85 | EA@? 86 | EQ`? 87 | EhwW 88 | EVo? 89 | EU?W 90 | E\U? 91 | ElHW 92 | ENug 93 | EuMg 94 | EnZ? 95 | EdHo 96 | EKBg 97 | E@kO 98 | EefW 99 | Emdw 100 | EW}? 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph7er100.g6: -------------------------------------------------------------------------------- 1 | FvmyG 2 | FuLf? 3 | FHgO? 4 | FHt?O 5 | Fcidg 6 | F|uR_ 7 | FvkgW 8 | FHvdg 9 | FPN[G 10 | Fw[lg 11 | FLTco 12 | FSTco 13 | F|cMo 14 | FuT]G 15 | FQTb_ 16 | FhIE? 17 | Fhdx_ 18 | FHSW_ 19 | FHuL? 20 | FnKx_ 21 | FPaH? 22 | FieLw 23 | FFurG 24 | F`ea_ 25 | FKOvo 26 | Fq~Xw 27 | F@EVW 28 | FYfS_ 29 | Fct__ 30 | FtyCg 31 | F^mgG 32 | Fg]eW 33 | Fi~uO 34 | FKvsw 35 | Faofw 36 | Fo~~g 37 | FSQmg 38 | FEIl_ 39 | Fiux? 40 | FenNo 41 | FEyQ_ 42 | F^va_ 43 | FJyyg 44 | FXkDG 45 | Fk^j_ 46 | Fps_G 47 | Fd?DW 48 | Fayf? 49 | FT^bo 50 | FCqEo 51 | Fmmeg 52 | FfJkO 53 | FK~{G 54 | FKR|G 55 | FUb`O 56 | FxKp? 57 | FTyho 58 | FmAXG 59 | F^kwo 60 | FkoR? 61 | Fzyq? 62 | Fobeg 63 | FxpZg 64 | FVyJ_ 65 | F~~f_ 66 | FEAAg 67 | FsO]w 68 | FVbeg 69 | F{By_ 70 | FVXeo 71 | F_YO? 72 | FTnv_ 73 | FlW^g 74 | FL?f? 75 | F^pc_ 76 | F_iG? 77 | FLXSG 78 | FpykW 79 | FTe|? 80 | FGyho 81 | FcKbW 82 | FkXO_ 83 | Fqm@G 84 | FEYtW 85 | FnIDw 86 | Fmjig 87 | FiBAg 88 | FaMVG 89 | Fvg{W 90 | Ft[]G 91 | FFb\o 92 | FVCaG 93 | Fu`JW 94 | FtlR? 95 | F|Iz_ 96 | FbO~g 97 | Fn~F? 98 | FZCaG 99 | FkwpW 100 | FhV}O 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph8er100.g6: -------------------------------------------------------------------------------- 1 | G}FGwC 2 | GIon^_ 3 | G_o_eC 4 | Gr`Mds 5 | GxYeUg 6 | GwNAuw 7 | GpKJVk 8 | Gq`Ptw 9 | G|gPxw 10 | G{\]iC 11 | Gp~U[k 12 | GXnBlc 13 | GY_gJ_ 14 | G?QCb{ 15 | Gp|O?C 16 | GfX\R_ 17 | GXmzVs 18 | GQFB_O 19 | GhZmus 20 | GIOYgS 21 | GnWo@w 22 | GxzCMc 23 | Goe~o? 24 | GxykLs 25 | GAuPfs 26 | GV[b^[ 27 | GGDfRC 28 | GCBMcO 29 | GQ}JWo 30 | GLQg_S 31 | GOD\Qg 32 | GtkrZO 33 | GsO[eO 34 | G_rm[C 35 | Gmj]g_ 36 | GgaG^[ 37 | GYyMjS 38 | GzJ{hg 39 | GPb?{O 40 | GxCHr? 41 | G|K@No 42 | GTvgMk 43 | Gy\c^o 44 | G^^BUs 45 | G_OAw{ 46 | G`AFok 47 | GZlw_O 48 | GVX[Vs 49 | GVxEB{ 50 | Gv@``S 51 | GnOGr_ 52 | GwiIOK 53 | GKIO?c 54 | Gg\VV{ 55 | G`_z}W 56 | GI?juO 57 | GDstak 58 | GQxMMg 59 | GoD_R_ 60 | GUjb\W 61 | G?wW{_ 62 | GgXTts 63 | Gmt|@w 64 | G|TVU? 65 | GxWbys 66 | GAJDzG 67 | G~OrIk 68 | GjgCa{ 69 | GN@hsG 70 | G{XxgK 71 | GUSGQ_ 72 | G?s[jc 73 | GMpOgc 74 | GvXe\g 75 | Gv?ETg 76 | GP}SqO 77 | GjA[^k 78 | GMRWR[ 79 | GzsI}S 80 | GwGIi[ 81 | GvI^Pk 82 | Gkvnxo 83 | GKQ_po 84 | GnNMHS 85 | G^FMfc 86 | GSN~ZW 87 | GsGI}s 88 | GZGp~_ 89 | GpSDX? 90 | GsHXlK 91 | G@akh? 92 | GYUe~W 93 | GhB{\W 94 | Gam{Gs 95 | GWtnCW 96 | Gv{hgG 97 | GY~Ei_ 98 | G`O`eo 99 | GmerC[ 100 | GWEcLo 101 | -------------------------------------------------------------------------------- /quantumflow/datasets/data/graph9er100.g6: -------------------------------------------------------------------------------- 1 | HBUSG_E 2 | H|hSro_ 3 | Hwowkgr 4 | HIjXxmn 5 | HBB]@}^ 6 | H`A^VoX 7 | HDLJABf 8 | H]cqbdc 9 | HfyyZhF 10 | H]eV{PB 11 | HEY|TnE 12 | HTy~LPi 13 | HrIhqCH 14 | HWGoyz\ 15 | HBhHP?o 16 | HzgJnt~ 17 | HywQyeE 18 | HK\OnrE 19 | HMhqiJc 20 | HG^HjLy 21 | HWcVRaZ 22 | HLEi\vV 23 | H|Y[g^B 24 | H{IOhgL 25 | HkeIgLV 26 | HC}wuTN 27 | HKhoYDc 28 | Hyk[TVR 29 | H]s?kaW 30 | HsHh?vm 31 | Hzv|~}F 32 | HIfWL|U 33 | HUSO}hd 34 | HvPISdU 35 | HHNqcDb 36 | HOdmPDm 37 | HU^U_kh 38 | HJI|gPZ 39 | Hu?Qd`E 40 | HCgE_BP 41 | HoXVu@f 42 | HJ|`_MC 43 | HmAINlE 44 | H{PCFSE 45 | HqrmMdb 46 | HwtW\\G 47 | HDkwLLP 48 | H[rI|GG 49 | HZpwfix 50 | HKtqppW 51 | Hex@jLB 52 | Hx]`@VA 53 | Ha{?GLn 54 | HKdAC^F 55 | HcOvyGH 56 | H_hQAgZ 57 | HKqROz\ 58 | HjvZ|pu 59 | H{FvhxJ 60 | HGUngdE 61 | Hk^kwc^ 62 | H^{NB?G 63 | HgFM~}j 64 | HSCwwMN 65 | Hi}rFea 66 | Hn@}LiE 67 | HT^ay_r 68 | HGV]?s] 69 | HJJ]qwg 70 | HHY|}On 71 | HCyavn^ 72 | HvcOKFQ 73 | HJeS[iE 74 | HMLJU\x 75 | HjydP@v 76 | HGjI^WI 77 | HzXLIM| 78 | H`~?I}_ 79 | HmdBoOT 80 | Hdk?|~V 81 | HZVzuHD 82 | H|OPW[Q 83 | Hm`yiw? 84 | HkdFcRz 85 | HWK{N~Q 86 | Hxv|T]N 87 | HrDqVvZ 88 | HpIja|} 89 | HYtV@mY 90 | HBXB]ZG 91 | HsTEo\B 92 | HLF_IQQ 93 | Hd[lWWw 94 | H}NK|lC 95 | HbFYhKZ 96 | HDKDs[@ 97 | Hen[rPC 98 | HvtVQjx 99 | HcX`gs] 100 | HMUC~GM 101 | -------------------------------------------------------------------------------- /quantumflow/forest/pyquil.py: -------------------------------------------------------------------------------- 1 | """ 2 | QuantumFlow pyQuil imports 3 | 4 | This is a temporary workaround to simplify pyquil importation. Instead 5 | of `from pyquil.gates import SWAP`, use `from quantumflow import pyquil`, 6 | then `pyquil.SWAP(...)`. 7 | 8 | Importation should be simplified in pyQuil 2.0 9 | (https://github.com/rigetti/pyquil/issues/302) 10 | """ 11 | 12 | # FIXME: star imports are not working as expected. 13 | # TODO: Add all relevant objects from pyquil 14 | 15 | from pyquil import * # noqa: F401,F403 16 | 17 | from pyquil.gates import ( # noqa: F401 18 | CCNOT, CNOT, CPHASE, CPHASE00, CPHASE01, CPHASE10, CSWAP, CZ, H, I, ISWAP, 19 | PHASE, PSWAP, RX, RY, RZ, S, SWAP, T, X, Y, Z, STANDARD_GATES) 20 | 21 | from pyquil.gates import ( # noqa: F401 22 | MEASURE, HALT, NOP, WAIT, RESET, TRUE, FALSE, NOT, AND, OR, MOVE, 23 | EXCHANGE) 24 | 25 | from pyquil.quil import Program # noqa: F401 26 | from pyquil.quilatom import Qubit, MemoryReference # noqa: F401 27 | from pyquil.wavefunction import Wavefunction # noqa: F401 28 | from pyquil.device import AbstractDevice, NxDevice, gates_in_isa # noqa: F401 29 | from pyquil.quilbase import * # noqa: F401,F403 30 | from pyquil.quilbase import Declare, Gate # noqa: F401 31 | 32 | from pyquil import api # noqa: F401 33 | from pyquil.api import * # noqa: F401,F403 34 | from pyquil.api._qac import AbstractCompiler # noqa: F401 35 | from pyquil.api import QuantumComputer # noqa: F401 36 | from pyquil.api import ForestConnection # noqa: F401 37 | from pyquil.api import QVM # noqa: F401 38 | from pyquil.api import local_qvm # noqa: F401 39 | 40 | from pyquil.noise import decoherence_noise_with_asymmetric_ro # noqa: F401 41 | 42 | import pyquil.parser as parser # noqa: F401 43 | -------------------------------------------------------------------------------- /quantumflow/gates.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | QuantumFlow Gates and actions on gates. 9 | """ 10 | 11 | from typing import TextIO, Union 12 | from functools import reduce 13 | import numpy as np 14 | import scipy.stats 15 | 16 | from .config import TOLERANCE 17 | from .qubits import Qubit, Qubits, qubits_count_tuple, asarray 18 | from .qubits import outer_product 19 | from .ops import Gate 20 | 21 | __all__ = ['identity_gate', 22 | 'random_gate', 23 | 'join_gates', 24 | 'control_gate', 25 | 'conditional_gate', 26 | 'P0', 'P1', 27 | 'almost_unitary', 28 | 'almost_identity', 29 | 'almost_hermitian', 30 | 'print_gate'] 31 | 32 | 33 | class I(Gate): # noqa: E742 34 | r""" 35 | The identity gate. 36 | 37 | This gate can take a variable number of qubits. 38 | 39 | .. math:: 40 | I() \equiv \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} 41 | """ 42 | def __init__(self, *qubits: Qubit) -> None: 43 | if not qubits: 44 | qubits = (0,) 45 | N = len(qubits) 46 | tensor = np.eye(2**N) 47 | super().__init__(qubits=qubits, tensor=tensor) 48 | 49 | @property 50 | def H(self) -> Gate: 51 | return self # Hermitian 52 | 53 | def __pow__(self, t: float) -> Gate: 54 | return self 55 | 56 | 57 | def identity_gate(qubits: Union[int, Qubits]) -> Gate: 58 | """Returns the K-qubit identity gate""" 59 | _, qubits = qubits_count_tuple(qubits) 60 | return I(*qubits) 61 | 62 | 63 | def join_gates(*gates: Gate) -> Gate: 64 | """Direct product of two gates. Qubit count is the sum of each gate's 65 | bit count.""" 66 | vectors = [gate.vec for gate in gates] 67 | vec = reduce(outer_product, vectors) 68 | return Gate(vec.tensor, vec.qubits) 69 | 70 | 71 | def control_gate(control: Qubit, gate: Gate) -> Gate: 72 | """Return a controlled unitary gate. Given a gate acting on K qubits, 73 | return a new gate on K+1 qubits prepended with a control bit. """ 74 | 75 | if control in gate.qubits: 76 | raise ValueError('Gate and control qubits overlap') 77 | 78 | qubits = [control, *gate.qubits] 79 | gate_tensor = join_gates(P0(control), identity_gate(gate.qubits)).tensor \ 80 | + join_gates(P1(control), gate).tensor 81 | controlled_gate = Gate(qubits=qubits, tensor=gate_tensor) 82 | 83 | return controlled_gate 84 | 85 | 86 | def conditional_gate(control: Qubit, gate0: Gate, gate1: Gate) -> Gate: 87 | """Return a conditional unitary gate. Do gate0 on bit 1 if bit 0 is zero, 88 | else do gate1 on 1""" 89 | assert gate0.qubits == gate1.qubits # FIXME 90 | 91 | tensor = join_gates(P0(control), gate0).tensor 92 | tensor += join_gates(P1(control), gate1).tensor 93 | gate = Gate(tensor=tensor, qubits=[control, *gate0.qubits]) 94 | return gate 95 | 96 | 97 | def almost_unitary(gate: Gate) -> bool: 98 | """Return true if gate tensor is (almost) unitary""" 99 | res = (gate @ gate.H).asoperator() 100 | N = gate.qubit_nb 101 | return np.allclose(asarray(res), np.eye(2**N), atol=TOLERANCE) 102 | 103 | 104 | def almost_identity(gate: Gate) -> bool: 105 | """Return true if gate tensor is (almost) the identity""" 106 | N = gate.qubit_nb 107 | return np.allclose(asarray(gate.asoperator()), np.eye(2**N)) 108 | 109 | 110 | def almost_hermitian(gate: Gate) -> bool: 111 | """Return true if gate tensor is (almost) Hermitian""" 112 | return np.allclose(asarray(gate.asoperator()), 113 | asarray(gate.H.asoperator())) 114 | 115 | 116 | def print_gate(gate: Gate, ndigits: int = 2, 117 | file: TextIO = None) -> None: 118 | """Pretty print a gate tensor 119 | 120 | Args: 121 | gate: 122 | ndigits: 123 | file: Stream to which to write. Defaults to stdout 124 | """ 125 | N = gate.qubit_nb 126 | gate_tensor = gate.vec.asarray() 127 | lines = [] 128 | for index, amplitude in np.ndenumerate(gate_tensor): 129 | ket = "".join([str(n) for n in index[0:N]]) 130 | bra = "".join([str(index[n]) for n in range(N, 2*N)]) 131 | if round(abs(amplitude)**2, ndigits) > 0.0: 132 | lines.append('{} -> {} : {}'.format(bra, ket, amplitude)) 133 | lines.sort(key=lambda x: int(x[0:N])) 134 | print('\n'.join(lines), file=file) 135 | 136 | 137 | class P0(Gate): 138 | r"""Project qubit to zero. 139 | 140 | A non-unitary gate that represents the effect of a measurement. The norm 141 | of the resultant state is multiplied by the probability of observing 0. 142 | """ 143 | def __init__(self, q0: Qubit = 0) -> None: 144 | operator = [[1, 0], [0, 0]] 145 | super().__init__(operator, qubits=[q0]) 146 | 147 | 148 | class P1(Gate): 149 | r"""Project qubit to one. 150 | 151 | A non-unitary gate that represents the effect of a measurement. The norm 152 | of the resultant state is multiplied by the probability of observing 1. 153 | """ 154 | def __init__(self, q0: Qubit = 0) -> None: 155 | operator = [[0, 0], [0, 1]] 156 | super().__init__(operator, qubits=[q0]) 157 | 158 | 159 | def random_gate(qubits: Union[int, Qubits]) -> Gate: 160 | r"""Returns a random unitary gate on K qubits. 161 | 162 | Ref: 163 | "How to generate random matrices from the classical compact groups" 164 | Francesco Mezzadri, math-ph/0609050 165 | """ 166 | N, qubits = qubits_count_tuple(qubits) 167 | unitary = scipy.stats.unitary_group.rvs(2**N) 168 | return Gate(unitary, qubits=qubits, name='RAND{}'.format(N)) 169 | -------------------------------------------------------------------------------- /quantumflow/meta.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | QuantumFlow Meta 9 | """ 10 | 11 | import sys 12 | import typing 13 | import numpy as np 14 | import networkx as nx 15 | import cvxpy as cvx 16 | import pyquil 17 | import quantumflow as qf 18 | import quantumflow.backend as bk 19 | 20 | 21 | def print_versions(file: typing.TextIO = None) -> None: 22 | """ 23 | Print version strings of currently installed dependencies 24 | 25 | ``> python -m quantumflow.meta`` 26 | 27 | 28 | Args: 29 | file: Output stream. Defaults to stdout. 30 | """ 31 | 32 | print('** QuantumFlow dependencies (> python -m quantumflow.meta) **') 33 | print('quantumflow \t', qf.__version__, file=file) 34 | print('python \t', sys.version[0:5], file=file) 35 | print('numpy \t', np.__version__, file=file) 36 | print('networkx \t', nx.__version__, file=file) 37 | print('cvxpy \t', cvx.__version__, file=file) 38 | print('pyquil \t', pyquil.__version__, file=file) 39 | 40 | print(bk.name, ' \t', bk.version, '(BACKEND)', file=file) 41 | 42 | 43 | if __name__ == '__main__': 44 | print_versions() # pragma: no cover 45 | -------------------------------------------------------------------------------- /quantumflow/qaoa.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | QuantumFlow: QAOA (Quantum Approximate Optimization Algorithm) 9 | """ 10 | 11 | from typing import Sequence 12 | 13 | import numpy as np 14 | import networkx as nx 15 | 16 | from .circuits import Circuit 17 | from .stdgates import H, RX, RZ, ZZ 18 | 19 | 20 | # DOCME 21 | # TODO: Make Hamiltonian explicit 22 | def qubo_circuit( 23 | graph: nx.Graph, 24 | steps: int, 25 | beta: Sequence, 26 | gamma: Sequence) -> Circuit: 27 | """ 28 | A QAOA circuit for the Quadratic Unconstrained Binary Optimization 29 | problem (i.e. an Ising model). 30 | 31 | Args: 32 | graph : a networkx graph instance with optional edge and node weights 33 | steps : number of QAOA steps 34 | beta : driver parameters (One per step) 35 | gamma : cost parameters (One per step) 36 | 37 | """ 38 | 39 | qubits = list(graph.nodes()) 40 | 41 | # Initialization 42 | circ = Circuit() 43 | for q0 in qubits: 44 | circ += H(q0) 45 | 46 | # Run for given number of QAOA steps 47 | for p in range(0, steps): 48 | 49 | # Cost 50 | for q0, q1 in graph.edges(): 51 | weight = graph[q0][q1].get('weight', 1.0) 52 | # Note factor of pi due to parameterization of ZZ gate 53 | circ += ZZ(-weight * gamma[p] / np.pi, q0, q1) 54 | 55 | for q0 in qubits: 56 | node_weight = graph.nodes[q0].get('weight', None) 57 | if node_weight is not None: 58 | circ += RZ(node_weight, q0) 59 | 60 | # Drive 61 | for q0 in qubits: 62 | circ += RX(beta[p], q0) 63 | 64 | return circ 65 | 66 | 67 | # TODO: DOCME. Explain what's going on here. 68 | def graph_cuts(graph: nx.Graph) -> np.ndarray: 69 | """For the given graph, return the cut value for all binary assignments 70 | of the graph. 71 | """ 72 | 73 | N = len(graph) 74 | diag_hamiltonian = np.zeros(shape=([2]*N), dtype=np.double) 75 | for q0, q1 in graph.edges(): 76 | for index, _ in np.ndenumerate(diag_hamiltonian): 77 | if index[q0] != index[q1]: 78 | weight = graph[q0][q1].get('weight', 1) 79 | diag_hamiltonian[index] += weight 80 | 81 | return diag_hamiltonian 82 | -------------------------------------------------------------------------------- /readthedocs.yml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yml 2 | # https://docs.readthedocs.io/en/latest/yaml-config.html 3 | 4 | build: 5 | image: latest 6 | 7 | python: 8 | version: 3.6 9 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # QuantumFlow build, run, and test 2 | 3 | numpy 4 | scipy >= 1.0.0 5 | tensorflow >= 1.6.0 6 | # pytorch # Optional extra 7 | networkx >= 2.1 8 | sphinx >= 1.6.6 9 | pytest >= 2.6.0 10 | pytest-cov 11 | flake8 12 | tox 13 | mypy 14 | pillow 15 | keras 16 | matplotlib 17 | pillow 18 | pyquil >= 2.0.0b1 19 | cvxpy 20 | sympy 21 | 22 | # Needed for document generation, but not installable via conda 23 | # guzzle_sphinx_theme 24 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """QuantumFlow setup""" 4 | 5 | from setuptools import setup, find_packages 6 | 7 | 8 | with open("README.md", "r") as fh: 9 | long_description = fh.read() 10 | 11 | 12 | setup( 13 | name='quantumflow', 14 | python_requires='>=3.6', 15 | install_requires=[ 16 | 'numpy', 17 | 'scipy', 18 | 'tensorflow', 19 | 'networkx', 20 | 'pyquil>=2.0.0b1', 21 | 'pillow', 22 | 'cvxpy', 23 | 'sympy' 24 | ], 25 | use_scm_version={'write_to': 'quantumflow/version.py'}, 26 | setup_requires=['setuptools_scm'], 27 | packages=find_packages(), 28 | package_data={'': ['datasets/data/*.*']}, 29 | 30 | description="QuantumFlow: A Quantum Algorithms Development Toolkit", 31 | long_description=long_description, 32 | license='Apache-2.0', 33 | maintainer="Gavin Crooks", 34 | maintainer_email="gavin@rigetti.com", 35 | url="https://github.com/rigetticomputing/quantumflow/", 36 | classifiers=[ 37 | 'Development Status :: 4 - Beta', 38 | 'Intended Audience :: Science/Research', 39 | 'License :: OSI Approved :: Apache Software License', 40 | 'Topic :: Scientific/Engineering', 41 | 'Programming Language :: Python', 42 | 'Natural Language :: English', 43 | 'Topic :: Software Development :: Libraries', 44 | 'Topic :: Software Development :: Libraries :: Python Modules', 45 | 'Programming Language :: Python :: 3', 46 | 'Programming Language :: Python :: 3.6', 47 | 'Operating System :: OS Independent' 48 | ] 49 | ) 50 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | Unit tests for QuantumFlow 9 | """ 10 | import sys 11 | import pytest 12 | import shutil 13 | 14 | from quantumflow.config import TOLERANCE 15 | import quantumflow.backend as bk 16 | 17 | ALMOST_ZERO = pytest.approx(0.0, abs=TOLERANCE) 18 | ALMOST_ONE = pytest.approx(1.0) 19 | 20 | REPS = 16 # Repetitions 21 | 22 | skip_tensorflow = pytest.mark.skipif( 23 | bk.BACKEND == 'tensorflow', 24 | reason="Unsupported backend") 25 | 26 | tensorflow_only = pytest.mark.skipif( 27 | bk.BACKEND != 'tensorflow', 28 | reason="Unsupported backend") 29 | 30 | tensorflow2_only = pytest.mark.skipif( 31 | bk.BACKEND != 'tensorflow2', 32 | reason="Unsupported backend") 33 | 34 | eager_only = pytest.mark.skipif( 35 | bk.BACKEND != 'eager', 36 | reason="Unsupported backend") 37 | 38 | skip_windows = pytest.mark.skipif( 39 | sys.platform == 'win32', 40 | reason="Does not run on windows") 41 | 42 | skip_torch = pytest.mark.skipif( 43 | bk.BACKEND == 'torch', 44 | reason="Unsupported backend") 45 | 46 | skip_unless_pdflatex = pytest.mark.skipif( 47 | shutil.which('pdflatex') is None or shutil.which('pdftocairo') is None, 48 | reason='Necessary external dependencies not installed') 49 | -------------------------------------------------------------------------------- /tests/quil/bell.quil: -------------------------------------------------------------------------------- 1 | H 0 2 | CNOT 0 1 3 | -------------------------------------------------------------------------------- /tests/quil/classical_logic.quil: -------------------------------------------------------------------------------- 1 | # Classical logic instructions 2 | 3 | TRUE [4] 4 | FALSE [2] 5 | AND [1] [0] 6 | OR [2] [1] 7 | MOVE [0] [3] 8 | EXCHANGE [3] [4] 9 | 10 | -------------------------------------------------------------------------------- /tests/quil/control_flow.quil: -------------------------------------------------------------------------------- 1 | LABEL @START 2 | JUMP @MID 3 | LABEL @MID 4 | NOT [0] 5 | JUMP-WHEN @MID [0] 6 | JUMP-UNLESS @END [1] 7 | LABEL @END 8 | -------------------------------------------------------------------------------- /tests/quil/empty.quil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rigetti/quantumflow/bf965f0ca70cd69b387f9ca8407ab38da955e925/tests/quil/empty.quil -------------------------------------------------------------------------------- /tests/quil/hello_world.quil: -------------------------------------------------------------------------------- 1 | X 0 2 | MEASURE 0 [0] 3 | -------------------------------------------------------------------------------- /tests/quil/include.quil: -------------------------------------------------------------------------------- 1 | 2 | INCLUDE "bell.quil" 3 | -------------------------------------------------------------------------------- /tests/quil/measure.quil: -------------------------------------------------------------------------------- 1 | X 0 2 | X 1 3 | MEASURE 0 4 | MEASURE 1 [0] 5 | -------------------------------------------------------------------------------- /tests/quil/qaoa.quil: -------------------------------------------------------------------------------- 1 | RY(pi/2) 0 2 | RX(pi) 0 3 | RY(pi/2) 1 4 | RX(pi) 1 5 | CNOT 0 1 6 | RX(-pi/2) 1 7 | RY(4.71572463191) 1 8 | RX(pi/2) 1 9 | CNOT 0 1 10 | RX(-5.49947501158) 0 11 | RX(-5.49947501158) 1 12 | -------------------------------------------------------------------------------- /tests/quil/unparsable.quil: -------------------------------------------------------------------------------- 1 | BELL 2 | -------------------------------------------------------------------------------- /tests/test_backend.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | Unit tests for quantumflow.backend 9 | """ 10 | 11 | import numpy as np 12 | 13 | import quantumflow.backend as bk 14 | from . import ALMOST_ZERO 15 | 16 | if bk.BACKEND == 'tensorflow': 17 | import tensorflow as tf 18 | tf.InteractiveSession() 19 | 20 | 21 | def test_import(): 22 | 23 | # Backend 24 | assert bk.TL 25 | assert bk.MAX_QUBITS 26 | assert bk.gpu_available 27 | assert bk.set_random_seed 28 | 29 | # Conversions 30 | assert bk.TENSOR 31 | assert bk.CTYPE 32 | assert bk.FTYPE 33 | assert bk.TensorLike 34 | assert bk.BKTensor 35 | assert bk.ccast 36 | assert bk.fcast 37 | assert bk.astensor 38 | assert bk.evaluate 39 | 40 | # Math 41 | assert bk.conj 42 | assert bk.absolute 43 | assert bk.minimum 44 | assert bk.arccos 45 | assert bk.exp 46 | assert bk.cos 47 | assert bk.sin 48 | assert bk.real 49 | assert bk.cis 50 | 51 | # Tensor 52 | assert bk.diag 53 | assert bk.reshape 54 | assert bk.sum 55 | assert bk.matmul 56 | assert bk.transpose 57 | assert bk.inner 58 | assert bk.outer 59 | 60 | 61 | def test_gpu_available(): 62 | bk.gpu_available() 63 | 64 | 65 | def test_inner(): 66 | v0 = np.random.normal(size=[2, 2, 2, 2]) \ 67 | + 1.0j * np.random.normal(size=[2, 2, 2, 2]) 68 | v1 = np.random.normal(size=[2, 2, 2, 2]) \ 69 | + 1.0j * np.random.normal(size=[2, 2, 2, 2]) 70 | res = np.vdot(v0, v1) 71 | 72 | bkres = bk.evaluate(bk.inner(bk.astensor(v0), bk.astensor(v1))) 73 | 74 | print(bkres) 75 | assert np.abs(res-bkres) == ALMOST_ZERO 76 | 77 | 78 | def test_outer(): 79 | s0 = np.random.normal(size=[2, 2]) + 1.0j * np.random.normal(size=[2, 2]) 80 | s1 = np.random.normal(size=[2, 2, 2]) \ 81 | + 1.0j * np.random.normal(size=[2, 2, 2]) 82 | 83 | res = bk.astensorproduct(bk.outer(bk.astensor(s0), bk.astensor(s1))) 84 | assert bk.rank(res) == 5 85 | 86 | res2 = np.outer(s0, s1).reshape([2]*5) 87 | assert np.allclose(bk.evaluate(res), res2) 88 | 89 | 90 | def test_absolute(): 91 | t = bk.astensor([-2.25 + 4.75j, -3.25 + 5.75j]) 92 | t = bk.absolute(t) 93 | 94 | assert np.allclose(bk.evaluate(t), [5.25594902, 6.60492229]) 95 | 96 | t = bk.astensor([-2.25 + 4.75j]) 97 | t = bk.absolute(t) 98 | print(bk.evaluate(t)) 99 | assert np.allclose(bk.evaluate(t), [5.25594902]) 100 | 101 | 102 | def test_random_seed(): 103 | # Also tested indirectly by test_config::test_seed 104 | # But that doesn't get captured by coverage tool 105 | bk.set_random_seed(42) 106 | 107 | 108 | def test_size(): 109 | """size(tensor) should return the number of elements""" 110 | t = bk.astensor([[1, 0, 0, 0], 111 | [0, 1, 0, 0], 112 | [0, 0, 0, 1], 113 | [0, 0, 1, 0]]) 114 | assert bk.size(t) == 16 115 | 116 | 117 | def test_real_imag(): 118 | tensor = bk.astensor([1.0 + 2.0j, 0.5 - 0.2j]) 119 | t = bk.real(tensor) 120 | t = bk.evaluate(t) 121 | assert np.allclose(bk.evaluate(bk.real(tensor)), [1.0, 0.5]) 122 | assert np.allclose(bk.evaluate(bk.imag(tensor)), [2.0, -0.2]) 123 | 124 | 125 | def test_trace(): 126 | tensor = bk.astensor(np.asarray([[1, 0, 0, 0], 127 | [0, -1, 0, 0], 128 | [0, 0, 2.7, 1], 129 | [0, 0, 1, 0.3j]])) 130 | tensor = bk.reshape(tensor, (4, 4)) # FIXME astensor should not reshape 131 | tr = bk.evaluate(bk.trace(tensor)) 132 | print(tr) 133 | 134 | assert tr - (2.7+0.3j) == ALMOST_ZERO 135 | 136 | 137 | def test_productdiag(): 138 | t = bk.astensorproduct([[0., 0., 0., 6.], 139 | [0., 1., 0., 0.], 140 | [0., 0., 2., 1.], 141 | [4., 0., 1., 3.]]) 142 | print(t.shape) 143 | print(bk.productdiag(t).shape) 144 | assert np.allclose(bk.evaluate(bk.productdiag(t)), [[0, 1], [2, 3]]) 145 | 146 | 147 | # fin 148 | -------------------------------------------------------------------------------- /tests/test_cbits.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | import pytest 8 | 9 | import quantumflow as qf 10 | 11 | 12 | def test_register(): 13 | ro = qf.Register() 14 | assert ro.name == 'ro' 15 | assert str(ro) == "Register('ro', 'BIT')" 16 | 17 | 18 | def test_register_ordered(): 19 | assert qf.Register() == qf.Register('ro') 20 | assert qf.Register('a') < qf.Register('b') 21 | assert qf.Register('a') != qf.Register('b') 22 | assert qf.Register('c') != 'foobar' 23 | 24 | with pytest.raises(TypeError): 25 | qf.Register('c') < 'foobar' 26 | 27 | 28 | def test_addr(): 29 | c = qf.Register('c') 30 | c0 = c[0] 31 | assert c0.register.name == 'c' 32 | assert c0.key == 0 33 | assert c0.register.dtype == 'BIT' 34 | 35 | assert str(c0) == 'c[0]' 36 | assert repr(c0) == "Register('c', 'BIT')[0]" 37 | 38 | 39 | def test_addr_ordered(): 40 | key = qf.Register('c')[0] 41 | d = dict({key: '1234'}) 42 | assert d[key] == '1234' 43 | 44 | assert qf.Register('c')[0] == qf.Register('c')[0] 45 | assert qf.Register('c')[0] != qf.Register('c')[1] 46 | assert qf.Register('d')[0] != qf.Register('c')[0] 47 | 48 | assert qf.Register('c')[0] != 'foobar' 49 | assert qf.Register('c')[0] < qf.Register('c')[1] 50 | 51 | with pytest.raises(TypeError): 52 | qf.Register('c')[0] < 'foobar' 53 | -------------------------------------------------------------------------------- /tests/test_config.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | import os 8 | # from quantumflow.config import * 9 | 10 | from . import skip_windows 11 | 12 | 13 | @skip_windows 14 | def test_random_seed(): 15 | code = ('QUANTUMFLOW_SEED=42 python -c "import quantumflow as qf;' 16 | ' assert qf.config.SEED == 42"') 17 | assert os.system(code) == 0 18 | 19 | 20 | @skip_windows 21 | def test_logger(): 22 | 23 | cmd = ('QUANTUMFLOW_LOG=INFO python -c \'' 24 | 'import quantumflow as qf;' 25 | 'import logging;' 26 | 'logger = logging.getLogger("quantumflow");' 27 | 'assert logger.level == 20\'') 28 | 29 | print(cmd) 30 | 31 | assert os.system(cmd) == 0 32 | -------------------------------------------------------------------------------- /tests/test_dagcircuit.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016-2018, Rigetti Computing 2 | # 3 | # This source code is licensed under the Apache License, Version 2.0 found in 4 | # the LICENSE.txt file in the root directory of this source tree. 5 | 6 | """ 7 | Unit tests for quantumflow.dagcircuit 8 | """ 9 | 10 | 11 | import numpy as np 12 | 13 | import quantumflow as qf 14 | 15 | 16 | # TODO Refactor in test_circuit 17 | def _test_circ(): 18 | # Adapted from referenceQVM 19 | circ = qf.Circuit() 20 | circ += qf.TY(1/2, 0) 21 | circ += qf.TX(1, 0) 22 | circ += qf.TY(1/2, 1) 23 | circ += qf.TX(1, 1) 24 | circ += qf.CNOT(0, 1) 25 | circ += qf.TX(-1/2, 1) 26 | circ += qf.TY(4.71572463191 / np.pi, 1) 27 | circ += qf.TX(1/2, 1) 28 | circ += qf.CNOT(0, 1) 29 | circ += qf.TX(-2 * 2.74973750579 / np.pi, 0) 30 | circ += qf.TX(-2 * 2.74973750579 / np.pi, 1) 31 | return circ 32 | 33 | 34 | def _true_ket(): 35 | # Adapted from referenceQVM 36 | wf_true = np.array( 37 | [0.00167784 + 1.00210180e-05*1j, 0.50000000 - 4.99997185e-01*1j, 38 | 0.50000000 - 4.99997185e-01*1j, 0.00167784 + 1.00210180e-05*1j]) 39 | return qf.State(wf_true.reshape((2, 2))) 40 | 41 | 42 | def test_init(): 43 | dag = qf.DAGCircuit([]) 44 | assert dag.size() == 0 45 | 46 | 47 | def test_inverse(): 48 | dag = qf.DAGCircuit(_test_circ()) 49 | inv_dag = dag.H 50 | 51 | ket0 = qf.random_state(2) 52 | ket1 = dag.run(ket0) 53 | ket2 = inv_dag.run(ket1) 54 | 55 | assert qf.states_close(ket0, ket2) 56 | 57 | 58 | def test_ascircuit(): 59 | circ0 = qf.ghz_circuit(range(5)) 60 | dag = qf.DAGCircuit(circ0) 61 | circ1 = qf.Circuit(dag) 62 | 63 | assert tuple(circ1.qubits) == (0, 1, 2, 3, 4) 64 | assert dag.qubits == circ0.qubits 65 | assert dag.qubit_nb == 5 66 | 67 | 68 | def test_asgate(): 69 | gate0 = qf.ZYZ(0.1, 2.2, 0.5) 70 | circ0 = qf.zyz_circuit(0.1, 2.2, 0.5, 0) 71 | dag0 = qf.DAGCircuit(circ0) 72 | gate1 = dag0.asgate() 73 | assert qf.gates_close(gate0, gate1) 74 | 75 | 76 | def test_evolve(): 77 | rho0 = qf.random_state(3).asdensity() 78 | rho1 = qf.CCNOT(0, 1, 2).evolve(rho0) 79 | 80 | dag = qf.DAGCircuit(qf.ccnot_circuit([0, 1, 2])) 81 | rho2 = dag.evolve(rho0) 82 | 83 | assert qf.densities_close(rho1, rho2) 84 | 85 | 86 | def test_aschannel(): 87 | rho0 = qf.random_state(3).asdensity() 88 | rho1 = qf.CCNOT(0, 1, 2).evolve(rho0) 89 | 90 | dag = qf.DAGCircuit(qf.ccnot_circuit([0, 1, 2])) 91 | chan = dag.aschannel() 92 | rho2 = chan.evolve(rho0) 93 | 94 | assert qf.densities_close(rho1, rho2) 95 | 96 | 97 | def test_depth(): 98 | circ = qf.qft_circuit([0, 1, 2, 3]) 99 | dag = qf.DAGCircuit(circ) 100 | assert dag.depth() == 8 101 | 102 | circ = qf.ghz_circuit(range(5)) 103 | dag = qf.DAGCircuit(circ) 104 | assert dag.depth() == 5 105 | 106 | assert dag.depth(local=False) == 4 107 | 108 | 109 | def test_layers(): 110 | circ0 = qf.ghz_circuit(range(5)) 111 | dag = qf.DAGCircuit(circ0) 112 | layers = dag.layers() 113 | assert len(layers.elements) == dag.depth() 114 | 115 | 116 | def test_components(): 117 | circ = qf.Circuit() 118 | circ += qf.H(0) 119 | circ += qf.H(1) 120 | dag = qf.DAGCircuit(circ) 121 | assert dag.component_nb() == 2 122 | 123 | circ += qf.CNOT(0, 1) 124 | dag = qf.DAGCircuit(circ) 125 | assert dag.component_nb() == 1 126 | 127 | circ0 = qf.ghz_circuit([0, 2, 4, 6, 8]) 128 | circ1 = qf.ghz_circuit([1, 3, 5, 7, 9]) 129 | 130 | circ = qf.Circuit() 131 | circ.extend(circ0) 132 | circ.extend(circ1) 133 | dag = qf.DAGCircuit(circ) 134 | comps = dag.components() 135 | assert dag.component_nb() == 2 136 | 137 | circ0 = qf.qft_circuit([0, 2, 4, 6]) 138 | circ1 = qf.ghz_circuit([1, 3, 5, 7]) 139 | circ.extend(circ0) 140 | circ.extend(circ1) 141 | circ += qf.H(10) 142 | dag = qf.DAGCircuit(circ) 143 | comps = dag.components() 144 | assert dag.component_nb() == 3 145 | assert len(comps) == 3 146 | 147 | 148 | def test_next(): 149 | circ = qf.ghz_circuit([0, 2, 4, 6, 8]) 150 | elem = circ.elements[3] 151 | dag = qf.DAGCircuit(circ) 152 | 153 | assert dag.next_element(elem, elem.qubits[1]) == circ.elements[4] 154 | assert dag.prev_element(elem, elem.qubits[0]) == circ.elements[2] 155 | 156 | # FIXME: out and in nodes should also be Operation's ? 157 | assert dag.next_element(elem, elem.qubits[0]) == ('out', 4) 158 | assert dag.prev_element(elem, elem.qubits[1]) == ('in', 6) 159 | -------------------------------------------------------------------------------- /tests/test_datasets.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | import pytest 8 | 9 | import quantumflow as qf 10 | 11 | 12 | def test_load_stdgraphs(): 13 | graphs = qf.datasets.load_stdgraphs(6) 14 | assert len(graphs) == 100 15 | 16 | 17 | def test_load_mnist(): 18 | (x_train, y_train, x_test, y_test) = \ 19 | qf.datasets.load_mnist(size=4, blank_corners=True, nums=[0, 1]) 20 | 21 | assert x_train.shape == (12665, 4, 4) 22 | assert y_train.shape == (12665,) 23 | assert y_test.shape == (2115,) 24 | assert x_test.shape == (2115, 4, 4) 25 | 26 | 27 | def test_exceptions(): 28 | with pytest.raises(ValueError): 29 | qf.datasets.load_stdgraphs(1000) 30 | -------------------------------------------------------------------------------- /tests/test_examples.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | Unit tests for quantumflow examples. 9 | """ 10 | 11 | import subprocess 12 | 13 | import quantumflow as qf 14 | 15 | from . import ALMOST_ONE, tensorflow_only, tensorflow2_only, eager_only 16 | 17 | 18 | def test_prepare_w4(): 19 | import examples.state_prep_w4 as ex 20 | ket = ex.prepare_w4() 21 | assert qf.states_close(ket, qf.w_state(4)) 22 | 23 | 24 | def test_prepare_w4_main(): 25 | rval = subprocess.call(['examples/state_prep_w4.py']) 26 | assert rval == 0 27 | 28 | 29 | def test_prepare_w16(): 30 | import examples.state_prep_w16 as ex 31 | ket = ex.prepare_w16() 32 | assert qf.states_close(ket, qf.w_state(16)) 33 | 34 | 35 | def test_prepare_w16_main(): 36 | rval = subprocess.call(['examples/state_prep_w16.py']) 37 | assert rval == 0 38 | 39 | 40 | def test_swap_test(): 41 | import examples.swaptest as ex 42 | ket0 = qf.zero_state([0]) 43 | ket1 = qf.random_state([1]) 44 | ket2 = qf.random_state([2]) 45 | 46 | ket = qf.join_states(ket0, ket1) 47 | ket = qf.join_states(ket, ket2) 48 | 49 | fid = qf.state_fidelity(ket1, ket2.relabel([1])) 50 | st_fid = ex.swap_test(ket, 0, 1, 2) 51 | 52 | assert qf.asarray(fid)/qf.asarray(st_fid) == ALMOST_ONE 53 | 54 | 55 | def test_swap_test_main(): 56 | rval = subprocess.call(['examples/swaptest.py']) 57 | assert rval == 0 58 | 59 | 60 | def test_circuit_identities_main(): 61 | rval = subprocess.call(['examples/circuit_identities.py']) 62 | assert rval == 0 63 | 64 | 65 | @tensorflow_only 66 | def test_fit_zyz(): 67 | import examples.tensorflow_fit_gate as ex 68 | target_gate = qf.random_gate(1) 69 | 70 | t = ex.fit_zyz(target_gate) 71 | print(t) 72 | 73 | 74 | @tensorflow_only 75 | def test_fit_zyz_main(): 76 | rval = subprocess.call(['examples/tensorflow_fit_gate.py']) 77 | assert rval == 0 78 | 79 | 80 | @tensorflow2_only 81 | def test_fit_zyz_tf2(): 82 | rval = subprocess.call(['examples/tensorflow2_fit_gate.py']) 83 | assert rval == 0 84 | 85 | 86 | @eager_only 87 | def test_fit_zyz_eager(): 88 | import examples.eager_fit_gate as ex 89 | target_gate = qf.random_gate(1) 90 | 91 | t = ex.fit_zyz(target_gate) 92 | print(t) 93 | 94 | 95 | @eager_only 96 | def test_fit_zyz_eager_main(): 97 | rval = subprocess.call(['examples/eager_fit_gate.py']) 98 | assert rval == 0 99 | -------------------------------------------------------------------------------- /tests/test_meta.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | Unit tests for quantumflow.meta 9 | """ 10 | 11 | 12 | import io 13 | import subprocess 14 | 15 | from quantumflow import meta 16 | 17 | 18 | def test_print_versions(): 19 | out = io.StringIO() 20 | meta.print_versions(out) 21 | print(out) 22 | 23 | 24 | def test_print_versions_main(): 25 | rval = subprocess.call(['python', '-m', 'quantumflow.meta']) 26 | assert rval == 0 27 | -------------------------------------------------------------------------------- /tests/test_qaoa.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | Unit tests for quantumflow.qaoa 9 | """ 10 | 11 | import numpy as np 12 | import networkx as nx 13 | 14 | from quantumflow.qaoa import qubo_circuit, graph_cuts 15 | 16 | 17 | def test_qubo_circuit(): 18 | 19 | # Random graph 20 | graph = nx.gnp_random_graph(4, 0.5) 21 | circ = qubo_circuit(graph, 4, [10, 11, 12, 13], [20, 21, 22, 23]) 22 | # print(circ) 23 | 24 | # Circuit with edge weights 25 | graph = nx.Graph() 26 | graph.add_edge(0, 1, weight=0.1) 27 | graph.add_edge(1, 2, weight=0.4) 28 | 29 | circ = qubo_circuit(graph, 2, [1, 1], [2, 2]) 30 | assert len(circ.elements) == 13 31 | # print(circ) 32 | 33 | # Add node weights 34 | graph.nodes[0]['weight'] = 4 35 | circ = qubo_circuit(graph, 2, [1, 1], [2, 2]) 36 | assert len(circ.elements) == 15 37 | print(circ) 38 | 39 | 40 | def test_graph_cuts(): 41 | graph = nx.Graph() 42 | graph.add_edge(0, 1) 43 | graph.add_edge(1, 2) 44 | cut = graph_cuts(graph) 45 | cut = np.resize(cut, (8)) 46 | assert np.allclose(cut, [0.0, 1.0, 2.0, 1.0, 1.0, 2.0, 1.0, 0.0]) 47 | 48 | # Weighted graph 49 | graph = nx.Graph() 50 | graph.add_edge(0, 1, weight=0.1) 51 | graph.add_edge(1, 2, weight=0.4) 52 | graph.add_edge(0, 2, weight=0.35) 53 | cut = graph_cuts(graph) 54 | cut = np.resize(cut, (8)) 55 | assert np.allclose(cut, [0., 0.75, 0.5, 0.45, 0.45, 0.5, 0.75, 0.]) 56 | -------------------------------------------------------------------------------- /tests/test_qaoa_maxcut.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """Unittests for qaoa_maxcut.py""" 8 | 9 | from . import tensorflow_only 10 | 11 | 12 | @tensorflow_only 13 | def test_maxcut_qaoa(): 14 | """Test maxcut_qaoa""" 15 | # Late import so tox tests will run without installing tensorflow 16 | from examples.qaoa_maxcut import maxcut_qaoa 17 | 18 | ratio, opt_beta, opt_gamma = maxcut_qaoa([[0, 1], [1, 2], [1, 3]]) 19 | assert ratio > 0.95 20 | assert opt_beta is not None 21 | assert opt_gamma is not None 22 | -------------------------------------------------------------------------------- /tests/test_quil.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | import pytest 8 | 9 | import quantumflow as qf 10 | 11 | 12 | QUIL_FILES = [ 13 | 'hello_world.quil', 14 | 'empty.quil', 15 | 'classical_logic.quil', 16 | 'control_flow.quil', 17 | 'measure.quil', 18 | 'qaoa.quil', 19 | 'bell.quil', 20 | # 'include.quil', 21 | ] 22 | 23 | RUNNABLE_QUIL_FILES = QUIL_FILES[:-1] 24 | 25 | 26 | def test_parse_quilfile(): 27 | print() 28 | for quilfile in QUIL_FILES: 29 | filename = 'tests/quil/'+quilfile 30 | print("<<<"+filename+">>>") 31 | with open(filename, 'r') as f: 32 | quil = f.read() 33 | qf.forest.quil_to_program(quil) 34 | 35 | 36 | def test_run_quilfile(): 37 | print() 38 | for quilfile in RUNNABLE_QUIL_FILES: 39 | filename = 'tests/quil/'+quilfile 40 | print("<<<"+filename+">>>") 41 | with open(filename, 'r') as f: 42 | quil = f.read() 43 | prog = qf.forest.quil_to_program(quil) 44 | prog.run() 45 | 46 | 47 | def test_unparsable(): 48 | with pytest.raises(RuntimeError): 49 | filename = 'tests/quil/unparsable.quil' 50 | with open(filename, 'r') as f: 51 | quil = f.read() 52 | qf.forest.quil_to_program(quil) 53 | -------------------------------------------------------------------------------- /tests/test_stdops.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | 8 | import quantumflow as qf 9 | 10 | 11 | def test_measure(): 12 | prog = qf.Program() 13 | prog += qf.Measure(0, ('c', 0)) 14 | prog += qf.Call('X', params=[], qubits=[0]) 15 | prog += qf.Measure(0, ('c', 1)) 16 | ket = prog.run() 17 | 18 | assert ket.qubits == (0,) 19 | # assert ket.cbits == [('c', 0), ('c', 1)] # FIXME 20 | assert ket.memory[('c', 0)] == 0 21 | assert ket.memory[('c', 1)] == 1 22 | 23 | 24 | def test_barrier(): 25 | circ = qf.Circuit() 26 | circ += qf.Barrier(0, 1, 2) 27 | circ += qf.Barrier(0, 1, 2).H 28 | circ.run() 29 | circ.evolve() 30 | 31 | assert str(qf.Barrier(0, 1, 2)) == 'BARRIER 0 1 2' 32 | 33 | 34 | def test_if(): 35 | circ = qf.Circuit() 36 | c = qf.Register('c') 37 | circ += qf.Move(c[0], 0) 38 | circ += qf.Move(c[1], 1) 39 | circ += qf.If(qf.X(0), c[1]) 40 | circ += qf.Measure(0, c[0]) 41 | ket = circ.run() 42 | assert ket.memory[c[0]] == 1 43 | assert circ.evolve().memory[c[0]] == 1 44 | 45 | circ = qf.Circuit() 46 | c = qf.Register('c') 47 | circ += qf.Move(c[0], 0) 48 | circ += qf.Move(c[1], 0) 49 | circ += qf.If(qf.X(0), c[1]) 50 | circ += qf.Measure(0, c[0]) 51 | ket = circ.run() 52 | assert ket.memory[c[0]] == 0 53 | assert circ.evolve().memory[c[0]] == 0 54 | 55 | circ = qf.Circuit() 56 | c = qf.Register('c') 57 | circ += qf.Move(c[0], 0) 58 | circ += qf.Move(c[1], 0) 59 | circ += qf.If(qf.X(0), c[1], value=False) 60 | circ += qf.Measure(0, c[0]) 61 | ket = circ.run() 62 | assert ket.memory[c[0]] == 1 63 | assert circ.evolve().memory[c[0]] == 1 64 | 65 | 66 | def test_neg(): 67 | c = qf.Register('c') 68 | assert str(qf.Neg(c[10])) == 'NEG c[10]' 69 | 70 | 71 | def test_logics(): 72 | c = qf.Register('c') 73 | 74 | circ = qf.Circuit([qf.Move(c[0], 0), 75 | qf.Move(c[1], 1), 76 | qf.And(c[0], c[1])]) 77 | # assert len(circ) == 3 # FIXME 78 | # assert circ.cbits == [c[0], c[1]] # FIXME 79 | 80 | ket = circ.run() 81 | assert ket.memory == {c[0]: 0, c[1]: 1} 82 | 83 | circ += qf.Not(c[1]) 84 | circ += qf.And(c[0], c[1]) 85 | ket = circ.run(ket) 86 | assert ket.memory == {c[0]: 0, c[1]: 0} 87 | 88 | circ = qf.Circuit() 89 | circ += qf.Move(c[0], 0) 90 | circ += qf.Move(c[1], 1) 91 | circ += qf.Ior(c[0], c[1]) 92 | ket = circ.run() 93 | assert ket.memory == {c[0]: 1, c[1]: 1} 94 | 95 | circ = qf.Circuit() 96 | circ += qf.Move(c[0], 1) 97 | circ += qf.Move(c[1], 1) 98 | circ += qf.Xor(c[0], c[1]) 99 | ket = circ.run() 100 | assert ket.memory == {c[0]: 0, c[1]: 1} 101 | 102 | circ += qf.Exchange(c[0], c[1]) 103 | ket = circ.run(ket) 104 | assert ket.memory == {c[0]: 1, c[1]: 0} 105 | 106 | circ += qf.Move(c[0], c[1]) 107 | ket = circ.run(ket) 108 | assert ket.memory == {c[0]: 0, c[1]: 0} 109 | 110 | 111 | def test_add(): 112 | ro = qf.Register() 113 | prog = qf.Program() 114 | prog += qf.Move(ro[0], 1) 115 | prog += qf.Move(ro[1], 2) 116 | prog += qf.Add(ro[0], ro[1]) 117 | prog += qf.Add(ro[0], 4) 118 | ket = prog.run() 119 | assert ket.memory[ro[0]] == 7 120 | 121 | 122 | def test_density_add(): 123 | ro = qf.Register() 124 | circ = qf.Circuit() 125 | circ += qf.Move(ro[0], 1) 126 | circ += qf.Move(ro[1], 2) 127 | circ += qf.Add(ro[0], ro[1]) 128 | circ += qf.Add(ro[0], 4) 129 | rho = circ.evolve() 130 | assert rho.memory[ro[0]] == 7 131 | 132 | 133 | def test_mul(): 134 | ro = qf.Register() 135 | prog = qf.Program() 136 | prog += qf.Move(ro[0], 1) 137 | prog += qf.Move(ro[1], 2) 138 | prog += qf.Mul(ro[0], ro[1]) 139 | prog += qf.Mul(ro[0], 4) 140 | ket = prog.run() 141 | assert ket.memory[ro[0]] == 8 142 | 143 | 144 | def test_div(): 145 | ro = qf.Register() 146 | prog = qf.Program() 147 | prog += qf.Move(ro[0], 4) 148 | prog += qf.Move(ro[1], 1) 149 | prog += qf.Div(ro[0], ro[1]) 150 | prog += qf.Div(ro[0], 2) 151 | ket = prog.run() 152 | assert ket.memory[ro[0]] == 2 153 | 154 | 155 | def test_sub(): 156 | ro = qf.Register() 157 | prog = qf.Program() 158 | prog += qf.Move(ro[0], 1) 159 | prog += qf.Move(ro[1], 2) 160 | prog += qf.Sub(ro[0], ro[1]) 161 | prog += qf.Sub(ro[0], 4) 162 | prog += qf.Neg(ro[0]) 163 | ket = prog.run() 164 | assert ket.memory[ro[0]] == 5 165 | 166 | 167 | def test_comparisions(): 168 | ro = qf.Register() 169 | prog = qf.Program() 170 | prog += qf.Move(ro[0], 1) 171 | prog += qf.Move(ro[1], 2) 172 | prog += qf.EQ(('eq', 0), ro[0], ro[1]) 173 | prog += qf.GT(('gt', 0), ro[0], ro[1]) 174 | prog += qf.GE(('ge', 0), ro[0], ro[1]) 175 | prog += qf.LT(('lt', 0), ro[0], ro[1]) 176 | prog += qf.LE(('le', 0), ro[0], ro[1]) 177 | ket = prog.run() 178 | assert ket.memory[('eq', 0)] == 0 179 | assert ket.memory[('gt', 0)] == 0 180 | assert ket.memory[('ge', 0)] == 0 181 | assert ket.memory[('lt', 0)] == 1 182 | assert ket.memory[('le', 0)] == 1 183 | -------------------------------------------------------------------------------- /tests/test_tools.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright 2016-2018, Rigetti Computing 3 | # 4 | # This source code is licensed under the Apache License, Version 2.0 found in 5 | # the LICENSE.txt file in the root directory of this source tree. 6 | 7 | """ 8 | Unit tests for quantumflow tools. 9 | """ 10 | 11 | import subprocess 12 | 13 | 14 | def test_benchmark_main(): 15 | rval = subprocess.call(['tools/benchmark.py', '2']) 16 | assert rval == 0 17 | 18 | # TODO: test other scripts 19 | -------------------------------------------------------------------------------- /tests/test_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016-2018, Rigetti Computing 2 | # 3 | # This source code is licensed under the Apache License, Version 2.0 found in 4 | # the LICENSE.txt file in the root directory of this source tree. 5 | 6 | """ 7 | Unit tests for quantumflow.utils 8 | """ 9 | 10 | from math import pi 11 | 12 | import networkx as nx 13 | 14 | import pytest 15 | 16 | from quantumflow.utils import ( 17 | invert_map, bitlist_to_int, int_to_bitlist, to_graph6, from_graph6, 18 | spanning_tree_count, octagonal_tiling_graph, deprecated, 19 | rationalize, symbolize) 20 | 21 | 22 | def test_invert_dict(): 23 | foo = {1: 7, 2: 8, 3: 9} 24 | bar = invert_map(foo) 25 | assert bar == {7: 1, 8: 2, 9: 3} 26 | 27 | foo = {1: 7, 2: 8, 3: 7} 28 | bar = invert_map(foo, one_to_one=False) 29 | assert bar == {7: set([1, 3]), 8: set([2])} 30 | 31 | 32 | def test_deprecated(): 33 | class Something: 34 | @deprecated 35 | def some_thing(self): 36 | pass 37 | 38 | obj = Something() 39 | 40 | with pytest.deprecated_call(): 41 | obj.some_thing() 42 | 43 | 44 | def test_bitlist_to_int(): 45 | assert bitlist_to_int([1, 0, 0]) == 4 46 | 47 | 48 | def test_int_to_bitlist(): 49 | assert int_to_bitlist(4, 4) == [0, 1, 0, 0] 50 | assert int_to_bitlist(4) == [1, 0, 0] 51 | 52 | 53 | def test_graph6(): 54 | graph0 = nx.random_regular_graph(4, 10) 55 | g0 = to_graph6(graph0) 56 | graph1 = from_graph6(g0) 57 | g1 = to_graph6(graph1) 58 | 59 | assert g0 == g1 60 | 61 | 62 | def test_spanning_tree_count(): 63 | grp = nx.grid_2d_graph(3, 3) 64 | count = spanning_tree_count(grp) 65 | assert count == 192 66 | 67 | 68 | def test_octagonal_tiling_graph(): 69 | grp = octagonal_tiling_graph(4, 4) 70 | assert len(grp) == 128 71 | 72 | 73 | def test_rationalize(): 74 | flt = 1/12 75 | rationalize(flt) 76 | 77 | with pytest.raises(ValueError): 78 | rationalize(pi) 79 | 80 | 81 | def test_symbolize(): 82 | s = symbolize(1.0) 83 | assert str(s) == '1' 84 | 85 | with pytest.raises(ValueError): 86 | s = symbolize(1.13434538345) 87 | 88 | s = symbolize(pi * 123) 89 | assert str(s) == '123*pi' 90 | 91 | s = symbolize(pi / 64) 92 | assert str(s) == 'pi/64' 93 | 94 | s = symbolize(pi * 3 / 64) 95 | assert str(s) == '3*pi/64' 96 | 97 | s = symbolize(pi * 8 / 64) 98 | assert str(s) == 'pi/8' 99 | 100 | s = symbolize(-pi * 3 / 8) 101 | assert str(s) == '-3*pi/8' 102 | 103 | s = symbolize(5/8) 104 | assert str(s) == '5/8' 105 | 106 | # fin 107 | -------------------------------------------------------------------------------- /tests/test_visualization.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016-2018, Rigetti Computing 2 | # 3 | # This source code is licensed under the Apache License, Version 2.0 found in 4 | # the LICENSE.txt file in the root directory of this source tree. 5 | 6 | """ 7 | Unit tests for quantumflow.visualization 8 | """ 9 | 10 | from math import pi 11 | 12 | import pytest 13 | 14 | import quantumflow as qf 15 | 16 | from . import skip_unless_pdflatex 17 | 18 | 19 | def test_circuit_to_latex(): 20 | qf.circuit_to_latex(qf.ghz_circuit(range(15))) 21 | 22 | 23 | def test_circuit_to_latex_error(): 24 | circ = qf.Circuit([qf.CPHASE01(0.4, 0, 1)]) 25 | with pytest.raises(NotImplementedError): 26 | qf.circuit_to_latex(circ) 27 | 28 | 29 | def test_gates_to_latex(): 30 | circ = qf.Circuit() 31 | 32 | circ += qf.I(7) 33 | circ += qf.X(0) 34 | circ += qf.Y(1) 35 | circ += qf.Z(2) 36 | circ += qf.H(3) 37 | circ += qf.S(4) 38 | circ += qf.T(5) 39 | circ += qf.S_H(6) 40 | circ += qf.T_H(7) 41 | 42 | circ += qf.RX(-0.5*pi, 0) 43 | circ += qf.RY(0.5*pi, 4) 44 | circ += qf.RZ((1/3)*pi, 5) 45 | circ += qf.RY(0.222, 6) 46 | 47 | circ += qf.TX(0.5, 0) 48 | circ += qf.TY(0.5, 2) 49 | circ += qf.TZ(0.4, 2) 50 | circ += qf.TH(0.5, 3) 51 | circ += qf.TZ(0.47276, 1) 52 | # Gate with cunning hack 53 | gate = qf.RZ(0.4, 1) 54 | gate.params['theta'] = qf.Parameter('\\theta') 55 | circ += gate 56 | 57 | circ += qf.CNOT(1, 2) 58 | circ += qf.CNOT(2, 1) 59 | circ += qf.I(*range(8)) 60 | circ += qf.ISWAP(4, 2) 61 | circ += qf.ISWAP(6, 5) 62 | circ += qf.CZ(1, 3) 63 | circ += qf.SWAP(1, 5) 64 | 65 | # circ += qf.Barrier(0, 1, 2, 3, 4, 5, 6) # Not yet supported 66 | 67 | circ += qf.CCNOT(1, 2, 3) 68 | circ += qf.CSWAP(4, 5, 6) 69 | 70 | circ += qf.P0(0) 71 | circ += qf.P1(1) 72 | 73 | circ += qf.Reset(2) 74 | circ += qf.Reset(4, 5, 6) 75 | 76 | circ += qf.H(4) 77 | # circ += qf.Reset() # FIXME. Should fail with clear error message 78 | 79 | circ += qf.XX(0.25, 1, 3) 80 | circ += qf.XX(0.25, 1, 2) 81 | circ += qf.YY(0.75, 1, 3) 82 | circ += qf.ZZ(1/3, 3, 1) 83 | 84 | circ += qf.CPHASE(0, 5, 6) 85 | circ += qf.CPHASE(pi*1/2, 0, 4) 86 | 87 | circ += qf.CAN(1/3, 1/2, 1/2, 0, 1) 88 | circ += qf.CAN(1/3, 1/2, 1/2, 2, 4) 89 | circ += qf.CAN(1/3, 1/2, 1/2, 6, 5) 90 | circ += qf.Measure(0) 91 | 92 | circ += qf.PSWAP(pi/2, 6, 7) 93 | 94 | qf.circuit_to_latex(circ) 95 | 96 | # latex = qf.circuit_to_latex(circ) 97 | # qf.render_latex(latex).show() 98 | 99 | 100 | @skip_unless_pdflatex 101 | def test_render_latex(): 102 | # TODO: Double check this circuit is correct 103 | circ = qf.addition_circuit(['a[0]', 'a[1]', 'a[2]', 'a[3]'], 104 | ['b[0]', 'b[1]', 'b[2]', 'b[3]'], 105 | ['cin', 'cout']) 106 | order = ['cin', 'a[0]', 'b[0]', 'a[1]', 'b[1]', 'a[2]', 'b[2]', 'a[3]', 107 | 'b[3]', 'cout'] 108 | # order = ['cin', 'a0', 'a1', 'a2', 'a3', 'b0', 'b1', 'b2', 'b3','cout'] 109 | 110 | latex = qf.circuit_to_latex(circ, order) 111 | 112 | qf.render_latex(latex) 113 | # qf.render_latex(latex).show() 114 | -------------------------------------------------------------------------------- /tools/benchmark.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | """ 9 | Standard QuantumFlow Benchmark. 10 | 11 | A simple benchmark of QuantumFlow performance, measured in GOPS (Gate 12 | Operations Per Second). 13 | """ 14 | 15 | import argparse 16 | import random 17 | import timeit 18 | 19 | import quantumflow as qf 20 | 21 | __version__ = qf.__version__ 22 | __description__ = 'Simple benchmark of QuantumFlow performance' + \ 23 | 'measured in GOPS (Gate Operations Per Second)' 24 | 25 | 26 | GATES = 100 27 | REPS = 1 28 | QUBITS = 16 29 | 30 | 31 | def benchmark(N, gates): 32 | """Create and run a circuit with N qubits and given number of gates""" 33 | qubits = list(range(0, N)) 34 | ket = qf.zero_state(N) 35 | 36 | for n in range(0, N): 37 | ket = qf.H(n).run(ket) 38 | 39 | for _ in range(0, (gates-N)//3): 40 | qubit0, qubit1 = random.sample(qubits, 2) 41 | ket = qf.X(qubit0).run(ket) 42 | ket = qf.T(qubit1).run(ket) 43 | ket = qf.CNOT(qubit0, qubit1).run(ket) 44 | 45 | return ket.vec.tensor 46 | 47 | 48 | def benchmark_gops(N, gates, reps): 49 | """Return benchmark performance in GOPS (Gate operations per second)""" 50 | t = timeit.timeit(lambda: benchmark(N, gates), number=reps) 51 | gops = (GATES*REPS)/t 52 | gops = int((gops * 100) + 0.5) / 100.0 53 | return gops 54 | 55 | 56 | # ---------- Command Line Interface ---------- 57 | def _cli(): 58 | 59 | parser = argparse.ArgumentParser(description=__description__) 60 | 61 | parser.add_argument('--version', action='version', version=__version__) 62 | 63 | parser.add_argument('qubits', nargs='+', type=int, default=[QUBITS]) 64 | 65 | # Run command 66 | opts = vars(parser.parse_args()) 67 | qubits = opts.pop('qubits') 68 | 69 | print("# N\tGOPS") 70 | for N in qubits: 71 | gops = benchmark_gops(N, GATES, REPS) 72 | print(N, '\t', gops) 73 | 74 | 75 | if __name__ == '__main__': 76 | _cli() 77 | -------------------------------------------------------------------------------- /tools/graph_generate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | """ 9 | Utility script to generate random collections of graphs. 10 | """ 11 | 12 | import argparse 13 | import networkx as nx 14 | from qcml.utils import to_graph6 15 | 16 | __version__ = "0.1.0" 17 | __description__ = 'Generate a random collection of Erdős-Rényi graphs' + \ 18 | ' (in graph6 format)' 19 | 20 | 21 | # ---------- Command Line Interface ---------- 22 | def _cli(): 23 | 24 | parser = argparse.ArgumentParser( 25 | description=__description__) 26 | 27 | parser.add_argument('--version', action='version', version=__version__) 28 | 29 | parser.add_argument('-d', '--degree', type=float, action='store', 30 | help='Degree') 31 | 32 | parser.add_argument('--family', type=str, action='store', default='er', 33 | help='Graph family') 34 | 35 | parser.add_argument('N', type=int, action='store', help='Nodes') 36 | 37 | parser.add_argument('S', type=int, action='store', help='Samples') 38 | 39 | parser.add_argument('fout', action='store', 40 | metavar='OUT_FILE', help='Write graphs to file') 41 | 42 | opts = vars(parser.parse_args()) 43 | N = opts.pop('N') 44 | S = opts.pop('S') 45 | fout = opts.pop('fout') 46 | 47 | degree = opts.pop('degree') 48 | family = opts.pop('family') 49 | assert family in {'er', 'reg'} 50 | 51 | if family == 'reg': 52 | assert degree is not None 53 | degree = int(degree) 54 | 55 | with open(fout, 'w') as file: 56 | for _ in range(S): 57 | if family == 'er': 58 | graph = nx.gnp_random_graph(N, 0.5) 59 | elif family == 'reg': 60 | graph = nx.random_regular_graph(int(degree), N) 61 | else: 62 | assert False 63 | file.write(to_graph6(graph)) 64 | file.write('\n') 65 | 66 | 67 | if __name__ == "__main__": 68 | _cli() 69 | -------------------------------------------------------------------------------- /tools/mnist_rescale.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright 2016-2018, Rigetti Computing 4 | # 5 | # This source code is licensed under the Apache License, Version 2.0 found in 6 | # the LICENSE.txt file in the root directory of this source tree. 7 | 8 | 9 | """ 10 | Download and rescale the MNIST database of handwritten digits 11 | """ 12 | 13 | import argparse 14 | import random 15 | 16 | import numpy as np 17 | from PIL import Image 18 | 19 | import quantumflow as qf 20 | from quantumflow.datasets import _MNIST_BORDER 21 | 22 | 23 | # ---------- Command Line Interface ---------- 24 | def _cli(): 25 | 26 | parser = argparse.ArgumentParser(description='Download and rescale MNIST') 27 | 28 | parser.add_argument('--version', action='version', 29 | version=qf.__version__) 30 | 31 | parser.add_argument('size', type=int, action='store', 32 | help='Rescale to size x size pixels') 33 | 34 | parser.add_argument('--samples', type=int, action='store', default=0, 35 | help='Save this number of example rescaled images.') 36 | 37 | parser.add_argument('--corners', action='store_true', default=False, 38 | help='Blank out corners of images') 39 | 40 | parser.add_argument('--border', type=int, action='store', 41 | default=_MNIST_BORDER, 42 | help='Size of border to remove before rescaling') 43 | 44 | opts = vars(parser.parse_args()) 45 | size = opts.pop('size') 46 | samples = opts.pop('samples') 47 | corners = opts.pop('corners') 48 | border = opts.pop('border') 49 | 50 | print('Loading MNIST...') 51 | 52 | (x_train, y_train, _, _) = qf.datasets.load_mnist() 53 | 54 | (x_train_rescaled, y_train, x_test_rescaled, y_test) \ 55 | = qf.datasets.load_mnist(size, border, corners) 56 | 57 | # Save datafile 58 | outfile = 'mnist_{}x{}.npz'.format(size, size) 59 | np.savez(outfile, x_train=x_train_rescaled, 60 | y_train=y_train, x_test=x_test_rescaled, y_test=y_test) 61 | 62 | # Save a few examples as pngs so we can check this all worked 63 | output_size = (28*4, 28*4) 64 | for n in random.sample(range(60000), k=samples): 65 | 66 | digit = y_train[n] 67 | 68 | img = Image.fromarray(x_train[n]) 69 | img = img.resize(output_size) 70 | img.save('mnist_{}_{}.png'.format(n, digit)) 71 | 72 | img = Image.fromarray(x_train_rescaled[n]) 73 | img = img.resize(output_size) 74 | img.save('mnist_{}_{}_{}x{}.png'.format(n, digit, size, size)) 75 | 76 | 77 | if __name__ == "__main__": 78 | _cli() 79 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | # tox (https://tox.readthedocs.io/) is a tool for running tests 2 | # in multiple virtualenvs. This configuration file will run the 3 | # test suite on all supported python versions. To use it, "pip install tox" 4 | # and then run "tox" from this directory. 5 | 6 | # Expects both python 3.5 and 3.6 to be installed (Use pyenv) 7 | # Obscure error messages with 'tox -e py35-numpy' but not 8 | # 'tox -e py36-numpy' (or vice versa) may be due to python versions not 9 | # being avaliable. 10 | 11 | # FIXME: Make sure CPU/GPU gets tested (When GPU avalibale) 12 | 13 | 14 | 15 | [tox] 16 | envlist = 17 | # NOTE: NO SPACES!!! 18 | # Tensorflow currently removed because tests taking too long. 19 | # Should be two versions of python 20 | {py36}-{numpy,eager,torch,tensorflow2} 21 | lint 22 | typecheck 23 | coverage 24 | docs 25 | doctest 26 | 27 | 28 | 29 | # == Defaults for all enviroments == 30 | [testenv] 31 | setenv = 32 | numpy: QUANTUMFLOW_BACKEND=numpy 33 | tensorflow: QUANTUMFLOW_BACKEND=tensorflow 34 | tensorflow2: QUANTUMFLOW_BACKEND=tensorflow2 35 | eager: QUANTUMFLOW_BACKEND=eager 36 | torch: QUANTUMFLOW_BACKEND=torch 37 | 38 | deps = 39 | -rrequirements.txt 40 | 41 | commands = 42 | tensorflow2: pip install tensorflow -U --pre 43 | python -m quantumflow.meta 44 | pytest tests/ 45 | 46 | 47 | 48 | # ==== Test Coverage ==== 49 | # Note: Skips backends because inactive backends can't get 100% coverage 50 | [testenv:coverage] 51 | setenv = 52 | QUANTUMFLOW_BACKEND=numpy 53 | 54 | commands = 55 | pytest --cov=quantumflow --cov-config .toxcoveragerc --cov-fail-under 100 --cov-report term-missing tests/ 56 | 57 | 58 | # ==== Linting ==== 59 | [testenv:lint] 60 | 61 | commands = 62 | flake8 quantumflow examples tests tools setup.py 63 | 64 | 65 | 66 | # == Typecheck == 67 | 68 | [testenv:typecheck] 69 | 70 | commands = 71 | mypy -p quantumflow --ignore-missing-imports 72 | 73 | 74 | 75 | # == Docs == 76 | [testenv:docs] 77 | commands = 78 | pip install guzzle_sphinx_theme 79 | sphinx-build -M html docs/source docs/build 80 | 81 | 82 | [testenv:doctest] 83 | setenv = 84 | QUANTUMFLOW_BACKEND=numpy 85 | 86 | commands = 87 | python -m quantumflow.meta 88 | pip install guzzle_sphinx_theme 89 | sphinx-build -M doctest docs/source docs/build 90 | 91 | 92 | 93 | 94 | --------------------------------------------------------------------------------