# Installation

```python
!pip3 install gurobipy
!pip3 install qiskit[visualization]
!pip3 install pytket
!pip3 install pytket-qiskit
```

    Collecting gurobipy
      Downloading gurobipy-9.1.2-cp37-cp37m-manylinux1_x86_64.whl (11.1 MB)
         |████████████████████████████████| 11.1 MB 8.2 MB/s
    Installing collected packages: gurobipy
    Successfully installed gurobipy-9.1.2
    Collecting qiskit[visualization]
      Downloading qiskit-0.29.0.tar.gz (12 kB)
    Collecting qiskit-terra==0.18.1
      Downloading qiskit_terra-0.18.1-cp37-cp37m-manylinux2010_x86_64.whl (6.1 MB)
         |████████████████████████████████| 6.1 MB 6.5 MB/s
    Collecting qiskit-aer==0.8.2
      Downloading qiskit_aer-0.8.2-cp37-cp37m-manylinux2010_x86_64.whl (18.0 MB)
         |████████████████████████████████| 18.0 MB 130 kB/s
    Collecting qiskit-ibmq-provider==0.16.0
      Downloading qiskit_ibmq_provider-0.16.0-py3-none-any.whl (235 kB)
         |████████████████████████████████| 235 kB 66.1 MB/s
    Collecting qiskit-ignis==0.6.0
      Downloading qiskit_ignis-0.6.0-py3-none-any.whl (207 kB)
         |████████████████████████████████| 207 kB 72.2 MB/s
    Collecting qiskit-aqua==0.9.4
      Downloading qiskit_aqua-0.9.4-py3-none-any.whl (2.1 MB)
         |████████████████████████████████| 2.1 MB 72.3 MB/s
    Requirement already satisfied: matplotlib>=2.1 in /usr/local/lib/python3.7/dist-packages (from qiskit[visualization]) (3.2.2)
    Requirement already satisfied: ipywidgets>=7.3.0 in /usr/local/lib/python3.7/dist-packages (from qiskit[visualization]) (7.6.3)
    Requirement already satisfied: pydot in /usr/local/lib/python3.7/dist-packages (from qiskit[visualization]) (1.3.0)
    Requirement already satisfied: pillow>=4.2.1 in /usr/local/lib/python3.7/dist-packages (from qiskit[visualization]) (7.1.2)
    Collecting pylatexenc>=1.4
      Downloading pylatexenc-2.10.tar.gz (162 kB)
         |████████████████████████████████| 162 kB 60.9 MB/s
    Requirement already satisfied: seaborn>=0.9.0 in /usr/local/lib/python3.7/dist-packages (from qiskit[visualization]) (0.11.1)
    Requirement already satisfied: pygments>=2.4 in /usr/local/lib/python3.7/dist-packages (from qiskit[visualization]) (2.6.1)
    Requirement already satisfied: scipy>=1.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-aer==0.8.2->qiskit[visualization]) (1.4.1)
    Collecting pybind11>=2.6
      Downloading pybind11-2.7.1-py2.py3-none-any.whl (200 kB)
         |████████████████████████████████| 200 kB 55.4 MB/s
    Requirement already satisfied: numpy>=1.16.3 in /usr/local/lib/python3.7/dist-packages (from qiskit-aer==0.8.2->qiskit[visualization]) (1.19.5)
    Requirement already satisfied: h5py<3.3.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit[visualization]) (3.1.0)
    Collecting docplex>=2.21.207
      Downloading docplex-2.21.207.tar.gz (635 kB)
         |████████████████████████████████| 635 kB 50.3 MB/s
    Requirement already satisfied: psutil>=5 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit[visualization]) (5.4.8)
    Collecting dlx<=1.0.4
      Downloading dlx-1.0.4.tar.gz (5.5 kB)
    Requirement already satisfied: fastdtw<=0.3.4 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit[visualization]) (0.3.4)
    Requirement already satisfied: scikit-learn>=0.20.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit[visualization]) (0.22.2.post1)
    Collecting retworkx>=0.8.0
      Downloading retworkx-0.10.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.4 MB)
         |████████████████████████████████| 1.4 MB 44.1 MB/s
    Requirement already satisfied: sympy>=1.3 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit[visualization]) (1.7.1)
    Requirement already satisfied: setuptools>=40.1.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit[visualization]) (57.4.0)
    Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit[visualization]) (1.1.5)
    Collecting quandl
      Downloading Quandl-3.6.1-py2.py3-none-any.whl (26 kB)
    Collecting yfinance<0.1.63
      Downloading yfinance-0.1.62.tar.gz (26 kB)
    Collecting websocket-client>=1.0.1
      Downloading websocket_client-1.2.1-py2.py3-none-any.whl (52 kB)
         |████████████████████████████████| 52 kB 1.3 MB/s
    Requirement already satisfied: requests>=2.19 in /usr/local/lib/python3.7/dist-packages (from qiskit-ibmq-provider==0.16.0->qiskit[visualization]) (2.23.0)
    Requirement already satisfied: python-dateutil>=2.8.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-ibmq-provider==0.16.0->qiskit[visualization]) (2.8.2)
    Collecting requests-ntlm>=1.1.0
      Downloading requests_ntlm-1.1.0-py2.py3-none-any.whl (5.7 kB)
    Requirement already satisfied: urllib3>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from qiskit-ibmq-provider==0.16.0->qiskit[visualization]) (1.24.3)
    Collecting tweedledum<2.0,>=1.1
      Downloading tweedledum-1.1.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (943 kB)
         |████████████████████████████████| 943 kB 67.0 MB/s
    Collecting symengine>0.7
      Downloading symengine-0.7.2-cp37-cp37m-manylinux2010_x86_64.whl (33.9 MB)
         |████████████████████████████████| 33.9 MB 19 kB/s
    Requirement already satisfied: dill>=0.3 in /usr/local/lib/python3.7/dist-packages (from qiskit-terra==0.18.1->qiskit[visualization]) (0.3.4)
    Collecting python-constraint>=1.4
      Downloading python-constraint-1.4.0.tar.bz2 (18 kB)
    Collecting ply>=3.10
      Downloading ply-3.11-py2.py3-none-any.whl (49 kB)
         |████████████████████████████████| 49 kB 5.7 MB/s
    Requirement already satisfied: jsonschema>=2.6 in /usr/local/lib/python3.7/dist-packages (from qiskit-terra==0.18.1->qiskit[visualization]) (2.6.0)
    Collecting fastjsonschema>=2.10
      Downloading fastjsonschema-2.15.1-py3-none-any.whl (21 kB)
    Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from docplex>=2.21.207->qiskit-aqua==0.9.4->qiskit[visualization]) (1.15.0)
    Requirement already satisfied: cached-property in /usr/local/lib/python3.7/dist-packages (from h5py<3.3.0->qiskit-aqua==0.9.4->qiskit[visualization]) (1.5.2)
    Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.3.0->qiskit[visualization]) (1.0.0)
    Requirement already satisfied: nbformat>=4.2.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.3.0->qiskit[visualization]) (5.1.3)
    Requirement already satisfied: ipykernel>=4.5.1 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.3.0->qiskit[visualization]) (4.10.1)
    Requirement already satisfied: ipython>=4.0.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.3.0->qiskit[visualization]) (5.5.0)
    Requirement already satisfied: widgetsnbextension~=3.5.0 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.3.0->qiskit[visualization]) (3.5.1)
    Requirement already satisfied: traitlets>=4.3.1 in /usr/local/lib/python3.7/dist-packages (from ipywidgets>=7.3.0->qiskit[visualization]) (5.0.5)
    Requirement already satisfied: tornado>=4.0 in /usr/local/lib/python3.7/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.3.0->qiskit[visualization]) (5.1.1)
    Requirement already satisfied: jupyter-client in /usr/local/lib/python3.7/dist-packages (from ipykernel>=4.5.1->ipywidgets>=7.3.0->qiskit[visualization]) (5.3.5)
    Requirement already satisfied: simplegeneric>0.8 in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.8.1)
    Requirement already satisfied: decorator in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.3.0->qiskit[visualization]) (4.4.2)
    Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.4 in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.3.0->qiskit[visualization]) (1.0.18)
    Requirement already satisfied: pexpect in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.3.0->qiskit[visualization]) (4.8.0)
    Requirement already satisfied: pickleshare in /usr/local/lib/python3.7/dist-packages (from ipython>=4.0.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.7.5)
    Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.1->qiskit[visualization]) (1.3.1)
    Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.1->qiskit[visualization]) (2.4.7)
    Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=2.1->qiskit[visualization]) (0.10.0)
    Requirement already satisfied: ipython-genutils in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.2.0)
    Requirement already satisfied: jupyter-core in /usr/local/lib/python3.7/dist-packages (from nbformat>=4.2.0->ipywidgets>=7.3.0->qiskit[visualization]) (4.7.1)
    Requirement already satisfied: wcwidth in /usr/local/lib/python3.7/dist-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython>=4.0.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.2.5)
    Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19->qiskit-ibmq-provider==0.16.0->qiskit[visualization]) (2.10)
    Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19->qiskit-ibmq-provider==0.16.0->qiskit[visualization]) (3.0.4)
    Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19->qiskit-ibmq-provider==0.16.0->qiskit[visualization]) (2021.5.30)
    Collecting cryptography>=1.3
      Downloading cryptography-3.4.8-cp36-abi3-manylinux_2_24_x86_64.whl (3.0 MB)
         |████████████████████████████████| 3.0 MB 64.4 MB/s
    Collecting ntlm-auth>=1.0.2
      Downloading ntlm_auth-1.5.0-py2.py3-none-any.whl (29 kB)
    Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.7/dist-packages (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.16.0->qiskit[visualization]) (1.14.6)
    Requirement already satisfied: pycparser in /usr/local/lib/python3.7/dist-packages (from cffi>=1.12->cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.16.0->qiskit[visualization]) (2.20)
    Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.20.0->qiskit-aqua==0.9.4->qiskit[visualization]) (1.0.1)
    Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.7/dist-packages (from pandas->qiskit-aqua==0.9.4->qiskit[visualization]) (2018.9)
    Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.7/dist-packages (from sympy>=1.3->qiskit-aqua==0.9.4->qiskit[visualization]) (1.2.1)
    Requirement already satisfied: notebook>=4.4.1 in /usr/local/lib/python3.7/dist-packages (from widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (5.3.1)
    Requirement already satisfied: nbconvert in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (5.6.1)
    Requirement already satisfied: Send2Trash in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (1.8.0)
    Requirement already satisfied: jinja2 in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (2.11.3)
    Requirement already satisfied: terminado>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.11.0)
    Requirement already satisfied: pyzmq>=13 in /usr/local/lib/python3.7/dist-packages (from jupyter-client->ipykernel>=4.5.1->ipywidgets>=7.3.0->qiskit[visualization]) (22.2.1)
    Requirement already satisfied: ptyprocess in /usr/local/lib/python3.7/dist-packages (from terminado>=0.8.1->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.7.0)
    Requirement already satisfied: multitasking>=0.0.7 in /usr/local/lib/python3.7/dist-packages (from yfinance<0.1.63->qiskit-aqua==0.9.4->qiskit[visualization]) (0.0.9)
    Collecting lxml>=4.5.1
      Downloading lxml-4.6.3-cp37-cp37m-manylinux2014_x86_64.whl (6.3 MB)
         |████████████████████████████████| 6.3 MB 47.3 MB/s
    Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/dist-packages (from jinja2->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (2.0.1)
    Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.3)
    Requirement already satisfied: bleach in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (4.0.0)
    Requirement already satisfied: defusedxml in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.7.1)
    Requirement already satisfied: testpath in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.5.0)
    Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (1.4.3)
    Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python3.7/dist-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.8.4)
    Requirement already satisfied: webencodings in /usr/local/lib/python3.7/dist-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (0.5.1)
    Requirement already satisfied: packaging in /usr/local/lib/python3.7/dist-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets>=7.3.0->qiskit[visualization]) (21.0)
    Requirement already satisfied: more-itertools in /usr/local/lib/python3.7/dist-packages (from quandl->qiskit-aqua==0.9.4->qiskit[visualization]) (8.8.0)
    Collecting inflection>=0.3.1
      Downloading inflection-0.5.1-py2.py3-none-any.whl (9.5 kB)
    Building wheels for collected packages: qiskit, dlx, docplex, pylatexenc, python-constraint, yfinance
      Building wheel for qiskit (setup.py) ... done
      Created wheel for qiskit: filename=qiskit-0.29.0-py3-none-any.whl size=11179 sha256=622f9d83dee58cca1a4235f63ace7bb755566feae8033eefa52c2de053799739
      Stored in directory: /root/.cache/pip/wheels/4b/d3/1f/f1bc9f8c3b170b19b9471e55fda4819e53476c21e5618ee86c
      Building wheel for dlx (setup.py) ... done
      Created wheel for dlx: filename=dlx-1.0.4-py3-none-any.whl size=5719 sha256=6f3afd04ac665c79c3dfc8151ab985338dbdd848f7e439780ffd09baee00a866
      Stored in directory: /root/.cache/pip/wheels/78/55/c8/dc61e772445a566b7608a476d151e9dcaf4e092b01b0c4bc3c
      Building wheel for docplex (setup.py) ... done
      Created wheel for docplex: filename=docplex-2.21.207-py3-none-any.whl size=700544 sha256=de776858f7b4d96923f75063068431fb7c955755e99d99843b866eb5d9e92f1c
      Stored in directory: /root/.cache/pip/wheels/d8/4e/62/e43a45757e70549e6aa4712ccfcf67440a203c278ecb68de49
      Building wheel for pylatexenc (setup.py) ... done
      Created wheel for pylatexenc: filename=pylatexenc-2.10-py3-none-any.whl size=136833 sha256=ec463b7b622f1b8844da8753f64331a563a0db8b6e0abaedcba44ad854bd9d1b
      Stored in directory: /root/.cache/pip/wheels/f1/8a/f5/33ee79d4473eb201b519fa40f989b842e373237395a3421f52
      Building wheel for python-constraint (setup.py) ... done
      Created wheel for python-constraint: filename=python_constraint-1.4.0-py2.py3-none-any.whl size=24081 sha256=7ad281056011b14448ffe637187307cfa9fc12ad024698025c4d41765268914c
      Stored in directory: /root/.cache/pip/wheels/07/27/db/1222c80eb1e431f3d2199c12569cb1cac60f562a451fe30479
      Building wheel for yfinance (setup.py) ... done
      Created wheel for yfinance: filename=yfinance-0.1.62-py2.py3-none-any.whl size=23867 sha256=8b3f58c899a623ef11c5cdd2a0b92e6be247675e87c8b81feb8a3cc555c2e06d
      Stored in directory: /root/.cache/pip/wheels/4c/3a/2e/53936bb0b112189d5532492b32dd8f3e442cba9d832ceef3b6
    Successfully built qiskit dlx docplex pylatexenc python-constraint yfinance
    Installing collected packages: tweedledum, symengine, retworkx, python-constraint, ply, fastjsonschema, qiskit-terra, ntlm-auth, lxml, inflection, cryptography, yfinance, websocket-client, requests-ntlm, quandl, qiskit-ignis, pybind11, docplex, dlx, qiskit-ibmq-provider, qiskit-aqua, qiskit-aer, qiskit, pylatexenc
      Attempting uninstall: lxml
        Found existing installation: lxml 4.2.6
        Uninstalling lxml-4.2.6:
          Successfully uninstalled lxml-4.2.6
    Successfully installed cryptography-3.4.8 dlx-1.0.4 docplex-2.21.207 fastjsonschema-2.15.1 inflection-0.5.1 lxml-4.6.3 ntlm-auth-1.5.0 ply-3.11 pybind11-2.7.1 pylatexenc-2.10 python-constraint-1.4.0 qiskit-0.29.0 qiskit-aer-0.8.2 qiskit-aqua-0.9.4 qiskit-ibmq-provider-0.16.0 qiskit-ignis-0.6.0 qiskit-terra-0.18.1 quandl-3.6.1 requests-ntlm-1.1.0 retworkx-0.10.1 symengine-0.7.2 tweedledum-1.1.0 websocket-client-1.2.1 yfinance-0.1.62
    Collecting pytket
      Downloading pytket-0.13.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB)
         |████████████████████████████████| 5.8 MB 5.9 MB/s
    Collecting graphviz~=0.14
      Downloading graphviz-0.17-py3-none-any.whl (18 kB)
    Collecting numpy~=1.20
      Downloading numpy-1.21.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
         |████████████████████████████████| 15.7 MB 180 kB/s
    Collecting types-pkg-resources
      Downloading types_pkg_resources-0.1.3-py2.py3-none-any.whl (4.8 kB)
    Collecting types-Jinja2
      Downloading types_Jinja2-2.11.6-py3-none-any.whl (18 kB)
    Requirement already satisfied: sympy~=1.6 in /usr/local/lib/python3.7/dist-packages (from pytket) (1.7.1)
    Requirement already satisfied: networkx~=2.4 in /usr/local/lib/python3.7/dist-packages (from pytket) (2.6.2)
    Requirement already satisfied: jinja2~=2.11 in /usr/local/lib/python3.7/dist-packages (from pytket) (2.11.3)
    Collecting lark-parser~=0.7
      Downloading lark_parser-0.12.0-py2.py3-none-any.whl (103 kB)
         |████████████████████████████████| 103 kB 55.9 MB/s
    Requirement already satisfied: typing-extensions~=3.7 in /usr/local/lib/python3.7/dist-packages (from pytket) (3.7.4.3)
    Requirement already satisfied: scipy~=1.2 in /usr/local/lib/python3.7/dist-packages (from pytket) (1.4.1)
    Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/dist-packages (from jinja2~=2.11->pytket) (2.0.1)
    Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.7/dist-packages (from sympy~=1.6->pytket) (1.2.1)
    Collecting types-MarkupSafe
      Downloading types_MarkupSafe-1.1.6-py3-none-any.whl (4.0 kB)
    Installing collected packages: types-MarkupSafe, numpy, types-pkg-resources, types-Jinja2, lark-parser, graphviz, pytket
      Attempting uninstall: numpy
        Found existing installation: numpy 1.19.5
        Uninstalling numpy-1.19.5:
          Successfully uninstalled numpy-1.19.5
      Attempting uninstall: graphviz
        Found existing installation: graphviz 0.10.1
        Uninstalling graphviz-0.10.1:
          Successfully uninstalled graphviz-0.10.1
    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    tensorflow 2.6.0 requires numpy~=1.19.2, but you have numpy 1.21.2 which is incompatible.
    datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.
    albumentations 0.1.12 requires imgaug<0.2.7,>=0.2.5, but you have imgaug 0.2.9 which is incompatible.
    Successfully installed graphviz-0.17 lark-parser-0.12.0 numpy-1.21.2 pytket-0.13.0 types-Jinja2-2.11.6 types-MarkupSafe-1.1.6 types-pkg-resources-0.1.3

    Collecting pytket-qiskit
      Downloading pytket-qiskit-0.16.1.tar.gz (27 kB)
    Requirement already satisfied: pytket~=0.13.0 in /usr/local/lib/python3.7/dist-packages (from pytket-qiskit) (0.13.0)
    Collecting qiskit~=0.28.0
      Downloading qiskit-0.28.0.tar.gz (12 kB)
    Requirement already satisfied: sympy~=1.6 in /usr/local/lib/python3.7/dist-packages (from pytket~=0.13.0->pytket-qiskit) (1.7.1)
    Requirement already satisfied: types-Jinja2 in /usr/local/lib/python3.7/dist-packages (from pytket~=0.13.0->pytket-qiskit) (2.11.6)
    Requirement already satisfied: scipy~=1.2 in /usr/local/lib/python3.7/dist-packages (from pytket~=0.13.0->pytket-qiskit) (1.4.1)
    Requirement already satisfied: networkx~=2.4 in /usr/local/lib/python3.7/dist-packages (from pytket~=0.13.0->pytket-qiskit) (2.6.2)
    Requirement already satisfied: graphviz~=0.14 in /usr/local/lib/python3.7/dist-packages (from pytket~=0.13.0->pytket-qiskit) (0.17)
    Requirement already satisfied: lark-parser~=0.7 in /usr/local/lib/python3.7/dist-packages (from pytket~=0.13.0->pytket-qiskit) (0.12.0)
    Requirement already satisfied: jinja2~=2.11 in /usr/local/lib/python3.7/dist-packages (from pytket~=0.13.0->pytket-qiskit) (2.11.3)
    Requirement already satisfied: numpy~=1.20 in /usr/local/lib/python3.7/dist-packages (from pytket~=0.13.0->pytket-qiskit) (1.21.2)
    Requirement already satisfied: types-pkg-resources in /usr/local/lib/python3.7/dist-packages (from pytket~=0.13.0->pytket-qiskit) (0.1.3)
    Requirement already satisfied: typing-extensions~=3.7 in /usr/local/lib/python3.7/dist-packages (from pytket~=0.13.0->pytket-qiskit) (3.7.4.3)
    Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/dist-packages (from jinja2~=2.11->pytket~=0.13.0->pytket-qiskit) (2.0.1)
    Collecting qiskit-terra==0.18.0
      Downloading qiskit_terra-0.18.0-cp37-cp37m-manylinux2010_x86_64.whl (6.1 MB)
         |████████████████████████████████| 6.1 MB 5.6 MB/s
    Requirement already satisfied: qiskit-aer==0.8.2 in /usr/local/lib/python3.7/dist-packages (from qiskit~=0.28.0->pytket-qiskit) (0.8.2)
    Collecting qiskit-ibmq-provider==0.15.0
      Downloading qiskit_ibmq_provider-0.15.0-py3-none-any.whl (234 kB)
         |████████████████████████████████| 234 kB 51.2 MB/s
    Requirement already satisfied: qiskit-ignis==0.6.0 in /usr/local/lib/python3.7/dist-packages (from qiskit~=0.28.0->pytket-qiskit) (0.6.0)
    Requirement already satisfied: qiskit-aqua==0.9.4 in /usr/local/lib/python3.7/dist-packages (from qiskit~=0.28.0->pytket-qiskit) (0.9.4)
    Requirement already satisfied: pybind11>=2.6 in /usr/local/lib/python3.7/dist-packages (from qiskit-aer==0.8.2->qiskit~=0.28.0->pytket-qiskit) (2.7.1)
    Requirement already satisfied: psutil>=5 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (5.4.8)
    Requirement already satisfied: quandl in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (3.6.1)
    Requirement already satisfied: yfinance<0.1.63 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (0.1.62)
    Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (1.1.5)
    Requirement already satisfied: h5py<3.3.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (3.1.0)
    Requirement already satisfied: docplex>=2.21.207 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (2.21.207)
    Requirement already satisfied: setuptools>=40.1.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (57.4.0)
    Requirement already satisfied: scikit-learn>=0.20.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (0.22.2.post1)
    Requirement already satisfied: retworkx>=0.8.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (0.10.1)
    Requirement already satisfied: fastdtw<=0.3.4 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (0.3.4)
    Requirement already satisfied: dlx<=1.0.4 in /usr/local/lib/python3.7/dist-packages (from qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (1.0.4)
    Requirement already satisfied: websocket-client>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (1.2.1)
    Requirement already satisfied: requests>=2.19 in /usr/local/lib/python3.7/dist-packages (from qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (2.23.0)
    Requirement already satisfied: python-dateutil>=2.8.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (2.8.2)
    Requirement already satisfied: requests-ntlm>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (1.1.0)
    Requirement already satisfied: urllib3>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (1.24.3)
    Requirement already satisfied: tweedledum<2.0,>=1.1 in /usr/local/lib/python3.7/dist-packages (from qiskit-terra==0.18.0->qiskit~=0.28.0->pytket-qiskit) (1.1.0)
    Requirement already satisfied: python-constraint>=1.4 in /usr/local/lib/python3.7/dist-packages (from qiskit-terra==0.18.0->qiskit~=0.28.0->pytket-qiskit) (1.4.0)
    Requirement already satisfied: symengine>0.7 in /usr/local/lib/python3.7/dist-packages (from qiskit-terra==0.18.0->qiskit~=0.28.0->pytket-qiskit) (0.7.2)
    Requirement already satisfied: ply>=3.10 in /usr/local/lib/python3.7/dist-packages (from qiskit-terra==0.18.0->qiskit~=0.28.0->pytket-qiskit) (3.11)
    Requirement already satisfied: jsonschema>=2.6 in /usr/local/lib/python3.7/dist-packages (from qiskit-terra==0.18.0->qiskit~=0.28.0->pytket-qiskit) (2.6.0)
    Requirement already satisfied: fastjsonschema>=2.10 in /usr/local/lib/python3.7/dist-packages (from qiskit-terra==0.18.0->qiskit~=0.28.0->pytket-qiskit) (2.15.1)
    Requirement already satisfied: dill>=0.3 in /usr/local/lib/python3.7/dist-packages (from qiskit-terra==0.18.0->qiskit~=0.28.0->pytket-qiskit) (0.3.4)
    Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from docplex>=2.21.207->qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (1.15.0)
    Requirement already satisfied: cached-property in /usr/local/lib/python3.7/dist-packages (from h5py<3.3.0->qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (1.5.2)
    Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19->qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (3.0.4)
    Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19->qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (2.10)
    Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests>=2.19->qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (2021.5.30)
    Requirement already satisfied: ntlm-auth>=1.0.2 in /usr/local/lib/python3.7/dist-packages (from requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (1.5.0)
    Requirement already satisfied: cryptography>=1.3 in /usr/local/lib/python3.7/dist-packages (from requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (3.4.8)
    Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.7/dist-packages (from cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (1.14.6)
    Requirement already satisfied: pycparser in /usr/local/lib/python3.7/dist-packages (from cffi>=1.12->cryptography>=1.3->requests-ntlm>=1.1.0->qiskit-ibmq-provider==0.15.0->qiskit~=0.28.0->pytket-qiskit) (2.20)
    Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn>=0.20.0->qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (1.0.1)
    Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.7/dist-packages (from sympy~=1.6->pytket~=0.13.0->pytket-qiskit) (1.2.1)
    Requirement already satisfied: multitasking>=0.0.7 in /usr/local/lib/python3.7/dist-packages (from yfinance<0.1.63->qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (0.0.9)
    Requirement already satisfied: lxml>=4.5.1 in /usr/local/lib/python3.7/dist-packages (from yfinance<0.1.63->qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (4.6.3)
    Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.7/dist-packages (from pandas->qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (2018.9)
    Requirement already satisfied: more-itertools in /usr/local/lib/python3.7/dist-packages (from quandl->qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (8.8.0)
    Requirement already satisfied: inflection>=0.3.1 in /usr/local/lib/python3.7/dist-packages (from quandl->qiskit-aqua==0.9.4->qiskit~=0.28.0->pytket-qiskit) (0.5.1)
    Requirement already satisfied: types-MarkupSafe in /usr/local/lib/python3.7/dist-packages (from types-Jinja2->pytket~=0.13.0->pytket-qiskit) (1.1.6)
    Building wheels for collected packages: pytket-qiskit, qiskit
      Building wheel for pytket-qiskit (setup.py) ... done
      Created wheel for pytket-qiskit: filename=pytket_qiskit-0.16.1-py3-none-any.whl size=36308 sha256=bc4f2596128c72c3a3f4a50c1ca07d46d9877bf156036e75a888055f15910da8
      Stored in directory: /root/.cache/pip/wheels/ac/b0/ac/777e9de1a16577c6a42352291804dbc58171c78e98d87c8c44
      Building wheel for qiskit (setup.py) ... done
      Created wheel for qiskit: filename=qiskit-0.28.0-py3-none-any.whl size=11091 sha256=dea55d442942d844215b9106e3d044cfec17b85c14ad87336235a2b6ea74545c
      Stored in directory: /root/.cache/pip/wheels/aa/7f/f7/f684068656b60591be96f758a6e80454a5ea5af86152598539
    Successfully built pytket-qiskit qiskit
    Installing collected packages: qiskit-terra, qiskit-ibmq-provider, qiskit, pytket-qiskit
      Attempting uninstall: qiskit-terra
        Found existing installation: qiskit-terra 0.18.1
        Uninstalling qiskit-terra-0.18.1:
          Successfully uninstalled qiskit-terra-0.18.1
      Attempting uninstall: qiskit-ibmq-provider
        Found existing installation: qiskit-ibmq-provider 0.16.0
        Uninstalling qiskit-ibmq-provider-0.16.0:
          Successfully uninstalled qiskit-ibmq-provider-0.16.0
      Attempting uninstall: qiskit
        Found existing installation: qiskit 0.29.0
        Uninstalling qiskit-0.29.0:
          Successfully uninstalled qiskit-0.29.0
    Successfully installed pytket-qiskit-0.16.1 qiskit-0.28.0 qiskit-ibmq-provider-0.15.0 qiskit-terra-0.18.0

```python
!pip3 uninstall qiskit_helper_functions
!rm -r qiskit_helper_functions
!git clone https://github.com/arnavdas88/qiskit_helper_functions
!cp -r qiskit_helper_functions/* ./ && python3 setup.py install
```

    WARNING: Skipping qiskit-helper-functions as it is not installed.
    rm: cannot remove 'qiskit_helper_functions': No such file or directory
    Cloning into 'qiskit_helper_functions'...
    remote: Enumerating objects: 444, done.
    remote: Counting objects: 100% (444/444), done.
    remote: Compressing objects: 100% (292/292), done.
    remote: Total 444 (delta 279), reused 302 (delta 137), pack-reused 0
    Receiving objects: 100% (444/444), 80.91 KiB | 7.36 MiB/s, done.
    Resolving deltas: 100% (279/279), done.
    running install
    running bdist_egg
    running egg_info
    writing qiskit_helper_functions.egg-info/PKG-INFO
    writing dependency_links to qiskit_helper_functions.egg-info/dependency_links.txt
    writing top-level names to qiskit_helper_functions.egg-info/top_level.txt
    reading manifest file 'qiskit_helper_functions.egg-info/SOURCES.txt'
    adding license file 'LICENSE'
    writing manifest file 'qiskit_helper_functions.egg-info/SOURCES.txt'
    installing library code to build/bdist.linux-x86_64/egg
    running install_lib
    running build_py
    copying qiskit_helper_functions/setup.py -> build/lib/qiskit_helper_functions
    copying qiskit_helper_functions/tket_functions.py -> build/lib/qiskit_helper_functions
    creating build/lib/qiskit_helper_functions/qcg
    copying qiskit_helper_functions/qcg/generators.py -> build/lib/qiskit_helper_functions/qcg
    copying qiskit_helper_functions/qcg/__init__.py -> build/lib/qiskit_helper_functions/qcg
    creating build/lib/qiskit_helper_functions/qiskit_helper_functions
    copying qiskit_helper_functions/qiskit_helper_functions/tket_functions.py -> build/lib/qiskit_helper_functions/qiskit_helper_functions
    copying qiskit_helper_functions/qiskit_helper_functions/non_ibmq_functions.py -> build/lib/qiskit_helper_functions/qiskit_helper_functions
    copying qiskit_helper_functions/qiskit_helper_functions/schedule.py -> build/lib/qiskit_helper_functions/qiskit_helper_functions
    copying qiskit_helper_functions/qiskit_helper_functions/metrics.py -> build/lib/qiskit_helper_functions/qiskit_helper_functions
    copying qiskit_helper_functions/qiskit_helper_functions/conversions.py -> build/lib/qiskit_helper_functions/qiskit_helper_functions
    copying qiskit_helper_functions/qiskit_helper_functions/ibmq_functions.py -> build/lib/qiskit_helper_functions/qiskit_helper_functions
    copying qiskit_helper_functions/qiskit_helper_functions/__init__.py -> build/lib/qiskit_helper_functions/qiskit_helper_functions
    creating build/lib/qiskit_helper_functions/qcg/Supremacy
    copying qiskit_helper_functions/qcg/Supremacy/Qgrid_Sycamore.py -> build/lib/qiskit_helper_functions/qcg/Supremacy
    copying qiskit_helper_functions/qcg/Supremacy/Qbit_original.py -> build/lib/qiskit_helper_functions/qcg/Supremacy
    copying qiskit_helper_functions/qcg/Supremacy/Qgrid_original.py -> build/lib/qiskit_helper_functions/qcg/Supremacy
    copying qiskit_helper_functions/qcg/Supremacy/ABCD_layer_generation.py -> build/lib/qiskit_helper_functions/qcg/Supremacy
    copying qiskit_helper_functions/qcg/Supremacy/Qbit_Sycamore.py -> build/lib/qiskit_helper_functions/qcg/Supremacy
    copying qiskit_helper_functions/qcg/Supremacy/__init__.py -> build/lib/qiskit_helper_functions/qcg/Supremacy
    copying qiskit_helper_functions/qcg/Supremacy/cz_layer_generation.py -> build/lib/qiskit_helper_functions/qcg/Supremacy
    creating build/lib/qiskit_helper_functions/qcg/Dynamics
    copying qiskit_helper_functions/qcg/Dynamics/quantum_dynamics.py -> build/lib/qiskit_helper_functions/qcg/Dynamics
    copying qiskit_helper_functions/qcg/Dynamics/__init__.py -> build/lib/qiskit_helper_functions/qcg/Dynamics
    creating build/lib/qiskit_helper_functions/qcg/utils
    copying qiskit_helper_functions/qcg/utils/testhwea.py -> build/lib/qiskit_helper_functions/qcg/utils
    copying qiskit_helper_functions/qcg/utils/__init__.py -> build/lib/qiskit_helper_functions/qcg/utils
    creating build/lib/qiskit_helper_functions/qcg/QAOA
    copying qiskit_helper_functions/qcg/QAOA/hw_efficient_ansatz.py -> build/lib/qiskit_helper_functions/qcg/QAOA
    copying qiskit_helper_functions/qcg/QAOA/__init__.py -> build/lib/qiskit_helper_functions/qcg/QAOA
    creating build/lib/qiskit_helper_functions/qcg/BernsteinVazirani
    copying qiskit_helper_functions/qcg/BernsteinVazirani/bernstein_vazirani.py -> build/lib/qiskit_helper_functions/qcg/BernsteinVazirani
    copying qiskit_helper_functions/qcg/BernsteinVazirani/__init__.py -> build/lib/qiskit_helper_functions/qcg/BernsteinVazirani
    creating build/lib/qiskit_helper_functions/qcg/QWalk
    copying qiskit_helper_functions/qcg/QWalk/quantum_walk.py -> build/lib/qiskit_helper_functions/qcg/QWalk
    copying qiskit_helper_functions/qcg/QWalk/__init__.py -> build/lib/qiskit_helper_functions/qcg/QWalk
    creating build/lib/qiskit_helper_functions/qcg/VQE
    copying qiskit_helper_functions/qcg/VQE/uccsd_ansatz.py -> build/lib/qiskit_helper_functions/qcg/VQE
    copying qiskit_helper_functions/qcg/VQE/__init__.py -> build/lib/qiskit_helper_functions/qcg/VQE
    creating build/lib/qiskit_helper_functions/qcg/Arithmetic
    copying qiskit_helper_functions/qcg/Arithmetic/ripple_carry_adder.py -> build/lib/qiskit_helper_functions/qcg/Arithmetic
    copying qiskit_helper_functions/qcg/Arithmetic/__init__.py -> build/lib/qiskit_helper_functions/qcg/Arithmetic
    creating build/lib/qiskit_helper_functions/qcg/QFT
    copying qiskit_helper_functions/qcg/QFT/qft_circ.py -> build/lib/qiskit_helper_functions/qcg/QFT
    copying qiskit_helper_functions/qcg/QFT/__init__.py -> build/lib/qiskit_helper_functions/qcg/QFT
    creating build/bdist.linux-x86_64
    creating build/bdist.linux-x86_64/egg
    creating build/bdist.linux-x86_64/egg/qcg
    creating build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/Qgrid_Sycamore.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/Qbit_original.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/Qgrid_original.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/ABCD_layer_generation.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/Qbit_Sycamore.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/__init__.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/cz_layer_generation.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    creating build/bdist.linux-x86_64/egg/qcg/Dynamics
    copying build/lib/qcg/Dynamics/quantum_dynamics.py -> build/bdist.linux-x86_64/egg/qcg/Dynamics
    copying build/lib/qcg/Dynamics/__init__.py -> build/bdist.linux-x86_64/egg/qcg/Dynamics
    copying build/lib/qcg/generators.py -> build/bdist.linux-x86_64/egg/qcg
    creating build/bdist.linux-x86_64/egg/qcg/utils
    copying build/lib/qcg/utils/testhwea.py -> build/bdist.linux-x86_64/egg/qcg/utils
    copying build/lib/qcg/utils/__init__.py -> build/bdist.linux-x86_64/egg/qcg/utils
    creating build/bdist.linux-x86_64/egg/qcg/QAOA
    copying build/lib/qcg/QAOA/hw_efficient_ansatz.py -> build/bdist.linux-x86_64/egg/qcg/QAOA
    copying build/lib/qcg/QAOA/__init__.py -> build/bdist.linux-x86_64/egg/qcg/QAOA
    creating build/bdist.linux-x86_64/egg/qcg/BernsteinVazirani
    copying build/lib/qcg/BernsteinVazirani/bernstein_vazirani.py -> build/bdist.linux-x86_64/egg/qcg/BernsteinVazirani
    copying build/lib/qcg/BernsteinVazirani/__init__.py -> build/bdist.linux-x86_64/egg/qcg/BernsteinVazirani
    creating build/bdist.linux-x86_64/egg/qcg/QWalk
    copying build/lib/qcg/QWalk/quantum_walk.py -> build/bdist.linux-x86_64/egg/qcg/QWalk
    copying build/lib/qcg/QWalk/__init__.py -> build/bdist.linux-x86_64/egg/qcg/QWalk
    creating build/bdist.linux-x86_64/egg/qcg/VQE
    copying build/lib/qcg/VQE/uccsd_ansatz.py -> build/bdist.linux-x86_64/egg/qcg/VQE
    copying build/lib/qcg/VQE/__init__.py -> build/bdist.linux-x86_64/egg/qcg/VQE
    creating build/bdist.linux-x86_64/egg/qcg/Arithmetic
    copying build/lib/qcg/Arithmetic/ripple_carry_adder.py -> build/bdist.linux-x86_64/egg/qcg/Arithmetic
    copying build/lib/qcg/Arithmetic/__init__.py -> build/bdist.linux-x86_64/egg/qcg/Arithmetic
    copying build/lib/qcg/__init__.py -> build/bdist.linux-x86_64/egg/qcg
    creating build/bdist.linux-x86_64/egg/qcg/QFT
    copying build/lib/qcg/QFT/qft_circ.py -> build/bdist.linux-x86_64/egg/qcg/QFT
    copying build/lib/qcg/QFT/__init__.py -> build/bdist.linux-x86_64/egg/qcg/QFT
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/setup.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/tket_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/non_ibmq_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/schedule.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/metrics.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/conversions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/Qgrid_Sycamore.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/Qbit_original.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/Qgrid_original.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/ABCD_layer_generation.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/Qbit_Sycamore.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/cz_layer_generation.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Dynamics
    copying build/lib/qiskit_helper_functions/qcg/Dynamics/quantum_dynamics.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Dynamics
    copying build/lib/qiskit_helper_functions/qcg/Dynamics/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Dynamics
    copying build/lib/qiskit_helper_functions/qcg/generators.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/utils
    copying build/lib/qiskit_helper_functions/qcg/utils/testhwea.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/utils
    copying build/lib/qiskit_helper_functions/qcg/utils/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/utils
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QAOA
    copying build/lib/qiskit_helper_functions/qcg/QAOA/hw_efficient_ansatz.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QAOA
    copying build/lib/qiskit_helper_functions/qcg/QAOA/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QAOA
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/BernsteinVazirani
    copying build/lib/qiskit_helper_functions/qcg/BernsteinVazirani/bernstein_vazirani.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/BernsteinVazirani
    copying build/lib/qiskit_helper_functions/qcg/BernsteinVazirani/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/BernsteinVazirani
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QWalk
    copying build/lib/qiskit_helper_functions/qcg/QWalk/quantum_walk.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QWalk
    copying build/lib/qiskit_helper_functions/qcg/QWalk/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QWalk
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/VQE
    copying build/lib/qiskit_helper_functions/qcg/VQE/uccsd_ansatz.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/VQE
    copying build/lib/qiskit_helper_functions/qcg/VQE/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/VQE
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Arithmetic
    copying build/lib/qiskit_helper_functions/qcg/Arithmetic/ripple_carry_adder.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Arithmetic
    copying build/lib/qiskit_helper_functions/qcg/Arithmetic/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Arithmetic
    copying build/lib/qiskit_helper_functions/qcg/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QFT
    copying build/lib/qiskit_helper_functions/qcg/QFT/qft_circ.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QFT
    copying build/lib/qiskit_helper_functions/qcg/QFT/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QFT
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/tket_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/non_ibmq_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/schedule.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/metrics.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/conversions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/ibmq_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/ibmq_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/Qgrid_Sycamore.py to Qgrid_Sycamore.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/Qbit_original.py to Qbit_original.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/Qgrid_original.py to Qgrid_original.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/ABCD_layer_generation.py to ABCD_layer_generation.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/Qbit_Sycamore.py to Qbit_Sycamore.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/cz_layer_generation.py to cz_layer_generation.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Dynamics/quantum_dynamics.py to quantum_dynamics.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Dynamics/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/generators.py to generators.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/utils/testhwea.py to testhwea.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/utils/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QAOA/hw_efficient_ansatz.py to hw_efficient_ansatz.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QAOA/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/BernsteinVazirani/bernstein_vazirani.py to bernstein_vazirani.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/BernsteinVazirani/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QWalk/quantum_walk.py to quantum_walk.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QWalk/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/VQE/uccsd_ansatz.py to uccsd_ansatz.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/VQE/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Arithmetic/ripple_carry_adder.py to ripple_carry_adder.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Arithmetic/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QFT/qft_circ.py to qft_circ.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QFT/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/setup.py to setup.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/tket_functions.py to tket_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/non_ibmq_functions.py to non_ibmq_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/schedule.py to schedule.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/metrics.py to metrics.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/conversions.py to conversions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/Qgrid_Sycamore.py to Qgrid_Sycamore.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/Qbit_original.py to Qbit_original.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/Qgrid_original.py to Qgrid_original.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/ABCD_layer_generation.py to ABCD_layer_generation.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/Qbit_Sycamore.py to Qbit_Sycamore.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/cz_layer_generation.py to cz_layer_generation.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Dynamics/quantum_dynamics.py to quantum_dynamics.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Dynamics/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/generators.py to generators.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/utils/testhwea.py to testhwea.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/utils/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QAOA/hw_efficient_ansatz.py to hw_efficient_ansatz.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QAOA/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/BernsteinVazirani/bernstein_vazirani.py to bernstein_vazirani.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/BernsteinVazirani/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QWalk/quantum_walk.py to quantum_walk.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QWalk/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/VQE/uccsd_ansatz.py to uccsd_ansatz.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/VQE/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Arithmetic/ripple_carry_adder.py to ripple_carry_adder.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Arithmetic/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QFT/qft_circ.py to qft_circ.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QFT/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/tket_functions.py to tket_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/non_ibmq_functions.py to non_ibmq_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/schedule.py to schedule.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/metrics.py to metrics.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/conversions.py to conversions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/ibmq_functions.py to ibmq_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/ibmq_functions.py to ibmq_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/__init__.py to __init__.cpython-37.pyc
    creating build/bdist.linux-x86_64/egg/EGG-INFO
    copying qiskit_helper_functions.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying qiskit_helper_functions.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying qiskit_helper_functions.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying qiskit_helper_functions.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying qiskit_helper_functions.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    creating dist
    creating 'dist/qiskit_helper_functions-0.0.1-py3.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
    removing 'build/bdist.linux-x86_64/egg' (and everything under it)
    Processing qiskit_helper_functions-0.0.1-py3.7.egg
    creating /usr/local/lib/python3.7/dist-packages/qiskit_helper_functions-0.0.1-py3.7.egg
    Extracting qiskit_helper_functions-0.0.1-py3.7.egg to /usr/local/lib/python3.7/dist-packages
    Adding qiskit-helper-functions 0.0.1 to easy-install.pth file

    Installed /usr/local/lib/python3.7/dist-packages/qiskit_helper_functions-0.0.1-py3.7.egg
    Processing dependencies for qiskit-helper-functions==0.0.1
    Finished processing dependencies for qiskit-helper-functions==0.0.1

```python
!pip3 uninstall cutqc
!rm -r cutqc
!rm -r CutQC
!git clone https://github.com/arnavdas88/CutQC
!cp -r CutQC/* ./ && python3 setup.py install

# !git clone https://github.com/weiT1993/CutQC
# !cp -r CutQC/* ./ && python3 setup.py install
```

    WARNING: Skipping cutqc as it is not installed.
    rm: cannot remove 'cutqc': No such file or directory
    rm: cannot remove 'CutQC': No such file or directory
    Cloning into 'CutQC'...
    remote: Enumerating objects: 394, done.
    remote: Counting objects: 100% (394/394), done.
    remote: Compressing objects: 100% (196/196), done.
    remote: Total 394 (delta 144), reused 378 (delta 128), pack-reused 0
    Receiving objects: 100% (394/394), 232.69 KiB | 10.58 MiB/s, done.
    Resolving deltas: 100% (144/144), done.
    running install
    running bdist_egg
    running egg_info
    writing qiskit_helper_functions.egg-info/PKG-INFO
    writing dependency_links to qiskit_helper_functions.egg-info/dependency_links.txt
    writing top-level names to qiskit_helper_functions.egg-info/top_level.txt
    reading manifest file 'qiskit_helper_functions.egg-info/SOURCES.txt'
    adding license file 'LICENSE'
    writing manifest file 'qiskit_helper_functions.egg-info/SOURCES.txt'
    installing library code to build/bdist.linux-x86_64/egg
    running install_lib
    running build_py
    creating build/lib/cutqc
    copying cutqc/post_process.py -> build/lib/cutqc
    copying cutqc/verify.py -> build/lib/cutqc
    copying cutqc/cutter.py -> build/lib/cutqc
    copying cutqc/evaluator.py -> build/lib/cutqc
    copying cutqc/main.py -> build/lib/cutqc
    copying cutqc/__init__.py -> build/lib/cutqc
    copying cutqc/helper_fun.py -> build/lib/cutqc
    creating build/bdist.linux-x86_64/egg
    creating build/bdist.linux-x86_64/egg/cutqc
    copying build/lib/cutqc/post_process.py -> build/bdist.linux-x86_64/egg/cutqc
    copying build/lib/cutqc/verify.py -> build/bdist.linux-x86_64/egg/cutqc
    copying build/lib/cutqc/cutter.py -> build/bdist.linux-x86_64/egg/cutqc
    copying build/lib/cutqc/evaluator.py -> build/bdist.linux-x86_64/egg/cutqc
    copying build/lib/cutqc/main.py -> build/bdist.linux-x86_64/egg/cutqc
    copying build/lib/cutqc/__init__.py -> build/bdist.linux-x86_64/egg/cutqc
    copying build/lib/cutqc/helper_fun.py -> build/bdist.linux-x86_64/egg/cutqc
    creating build/bdist.linux-x86_64/egg/qcg
    creating build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/Qgrid_Sycamore.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/Qbit_original.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/Qgrid_original.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/ABCD_layer_generation.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/Qbit_Sycamore.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/__init__.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    copying build/lib/qcg/Supremacy/cz_layer_generation.py -> build/bdist.linux-x86_64/egg/qcg/Supremacy
    creating build/bdist.linux-x86_64/egg/qcg/Dynamics
    copying build/lib/qcg/Dynamics/quantum_dynamics.py -> build/bdist.linux-x86_64/egg/qcg/Dynamics
    copying build/lib/qcg/Dynamics/__init__.py -> build/bdist.linux-x86_64/egg/qcg/Dynamics
    copying build/lib/qcg/generators.py -> build/bdist.linux-x86_64/egg/qcg
    creating build/bdist.linux-x86_64/egg/qcg/utils
    copying build/lib/qcg/utils/testhwea.py -> build/bdist.linux-x86_64/egg/qcg/utils
    copying build/lib/qcg/utils/__init__.py -> build/bdist.linux-x86_64/egg/qcg/utils
    creating build/bdist.linux-x86_64/egg/qcg/QAOA
    copying build/lib/qcg/QAOA/hw_efficient_ansatz.py -> build/bdist.linux-x86_64/egg/qcg/QAOA
    copying build/lib/qcg/QAOA/__init__.py -> build/bdist.linux-x86_64/egg/qcg/QAOA
    creating build/bdist.linux-x86_64/egg/qcg/BernsteinVazirani
    copying build/lib/qcg/BernsteinVazirani/bernstein_vazirani.py -> build/bdist.linux-x86_64/egg/qcg/BernsteinVazirani
    copying build/lib/qcg/BernsteinVazirani/__init__.py -> build/bdist.linux-x86_64/egg/qcg/BernsteinVazirani
    creating build/bdist.linux-x86_64/egg/qcg/QWalk
    copying build/lib/qcg/QWalk/quantum_walk.py -> build/bdist.linux-x86_64/egg/qcg/QWalk
    copying build/lib/qcg/QWalk/__init__.py -> build/bdist.linux-x86_64/egg/qcg/QWalk
    creating build/bdist.linux-x86_64/egg/qcg/VQE
    copying build/lib/qcg/VQE/uccsd_ansatz.py -> build/bdist.linux-x86_64/egg/qcg/VQE
    copying build/lib/qcg/VQE/__init__.py -> build/bdist.linux-x86_64/egg/qcg/VQE
    creating build/bdist.linux-x86_64/egg/qcg/Arithmetic
    copying build/lib/qcg/Arithmetic/ripple_carry_adder.py -> build/bdist.linux-x86_64/egg/qcg/Arithmetic
    copying build/lib/qcg/Arithmetic/__init__.py -> build/bdist.linux-x86_64/egg/qcg/Arithmetic
    copying build/lib/qcg/__init__.py -> build/bdist.linux-x86_64/egg/qcg
    creating build/bdist.linux-x86_64/egg/qcg/QFT
    copying build/lib/qcg/QFT/qft_circ.py -> build/bdist.linux-x86_64/egg/qcg/QFT
    copying build/lib/qcg/QFT/__init__.py -> build/bdist.linux-x86_64/egg/qcg/QFT
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/setup.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/tket_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/non_ibmq_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/schedule.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/metrics.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/conversions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/Qgrid_Sycamore.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/Qbit_original.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/Qgrid_original.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/ABCD_layer_generation.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/Qbit_Sycamore.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    copying build/lib/qiskit_helper_functions/qcg/Supremacy/cz_layer_generation.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Dynamics
    copying build/lib/qiskit_helper_functions/qcg/Dynamics/quantum_dynamics.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Dynamics
    copying build/lib/qiskit_helper_functions/qcg/Dynamics/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Dynamics
    copying build/lib/qiskit_helper_functions/qcg/generators.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/utils
    copying build/lib/qiskit_helper_functions/qcg/utils/testhwea.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/utils
    copying build/lib/qiskit_helper_functions/qcg/utils/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/utils
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QAOA
    copying build/lib/qiskit_helper_functions/qcg/QAOA/hw_efficient_ansatz.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QAOA
    copying build/lib/qiskit_helper_functions/qcg/QAOA/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QAOA
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/BernsteinVazirani
    copying build/lib/qiskit_helper_functions/qcg/BernsteinVazirani/bernstein_vazirani.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/BernsteinVazirani
    copying build/lib/qiskit_helper_functions/qcg/BernsteinVazirani/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/BernsteinVazirani
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QWalk
    copying build/lib/qiskit_helper_functions/qcg/QWalk/quantum_walk.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QWalk
    copying build/lib/qiskit_helper_functions/qcg/QWalk/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QWalk
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/VQE
    copying build/lib/qiskit_helper_functions/qcg/VQE/uccsd_ansatz.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/VQE
    copying build/lib/qiskit_helper_functions/qcg/VQE/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/VQE
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Arithmetic
    copying build/lib/qiskit_helper_functions/qcg/Arithmetic/ripple_carry_adder.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Arithmetic
    copying build/lib/qiskit_helper_functions/qcg/Arithmetic/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Arithmetic
    copying build/lib/qiskit_helper_functions/qcg/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QFT
    copying build/lib/qiskit_helper_functions/qcg/QFT/qft_circ.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QFT
    copying build/lib/qiskit_helper_functions/qcg/QFT/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QFT
    creating build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/tket_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/non_ibmq_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/schedule.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/metrics.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/conversions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/ibmq_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/qiskit_helper_functions/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/ibmq_functions.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    copying build/lib/qiskit_helper_functions/__init__.py -> build/bdist.linux-x86_64/egg/qiskit_helper_functions
    byte-compiling build/bdist.linux-x86_64/egg/cutqc/post_process.py to post_process.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/cutqc/verify.py to verify.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/cutqc/cutter.py to cutter.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/cutqc/evaluator.py to evaluator.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/cutqc/main.py to main.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/cutqc/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/cutqc/helper_fun.py to helper_fun.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/Qgrid_Sycamore.py to Qgrid_Sycamore.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/Qbit_original.py to Qbit_original.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/Qgrid_original.py to Qgrid_original.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/ABCD_layer_generation.py to ABCD_layer_generation.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/Qbit_Sycamore.py to Qbit_Sycamore.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Supremacy/cz_layer_generation.py to cz_layer_generation.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Dynamics/quantum_dynamics.py to quantum_dynamics.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Dynamics/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/generators.py to generators.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/utils/testhwea.py to testhwea.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/utils/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QAOA/hw_efficient_ansatz.py to hw_efficient_ansatz.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QAOA/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/BernsteinVazirani/bernstein_vazirani.py to bernstein_vazirani.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/BernsteinVazirani/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QWalk/quantum_walk.py to quantum_walk.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QWalk/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/VQE/uccsd_ansatz.py to uccsd_ansatz.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/VQE/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Arithmetic/ripple_carry_adder.py to ripple_carry_adder.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/Arithmetic/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QFT/qft_circ.py to qft_circ.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qcg/QFT/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/setup.py to setup.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/tket_functions.py to tket_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/non_ibmq_functions.py to non_ibmq_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/schedule.py to schedule.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/metrics.py to metrics.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/conversions.py to conversions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/Qgrid_Sycamore.py to Qgrid_Sycamore.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/Qbit_original.py to Qbit_original.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/Qgrid_original.py to Qgrid_original.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/ABCD_layer_generation.py to ABCD_layer_generation.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/Qbit_Sycamore.py to Qbit_Sycamore.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Supremacy/cz_layer_generation.py to cz_layer_generation.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Dynamics/quantum_dynamics.py to quantum_dynamics.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Dynamics/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/generators.py to generators.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/utils/testhwea.py to testhwea.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/utils/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QAOA/hw_efficient_ansatz.py to hw_efficient_ansatz.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QAOA/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/BernsteinVazirani/bernstein_vazirani.py to bernstein_vazirani.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/BernsteinVazirani/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QWalk/quantum_walk.py to quantum_walk.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QWalk/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/VQE/uccsd_ansatz.py to uccsd_ansatz.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/VQE/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Arithmetic/ripple_carry_adder.py to ripple_carry_adder.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/Arithmetic/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QFT/qft_circ.py to qft_circ.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qcg/QFT/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/tket_functions.py to tket_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/non_ibmq_functions.py to non_ibmq_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/schedule.py to schedule.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/metrics.py to metrics.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/conversions.py to conversions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/ibmq_functions.py to ibmq_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/qiskit_helper_functions/__init__.py to __init__.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/ibmq_functions.py to ibmq_functions.cpython-37.pyc
    byte-compiling build/bdist.linux-x86_64/egg/qiskit_helper_functions/__init__.py to __init__.cpython-37.pyc
    creating build/bdist.linux-x86_64/egg/EGG-INFO
    copying qiskit_helper_functions.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying qiskit_helper_functions.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying qiskit_helper_functions.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying qiskit_helper_functions.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying qiskit_helper_functions.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    creating 'dist/qiskit_helper_functions-0.0.1-py3.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
    removing 'build/bdist.linux-x86_64/egg' (and everything under it)
    Processing qiskit_helper_functions-0.0.1-py3.7.egg
    removing '/usr/local/lib/python3.7/dist-packages/qiskit_helper_functions-0.0.1-py3.7.egg' (and everything under it)
    creating /usr/local/lib/python3.7/dist-packages/qiskit_helper_functions-0.0.1-py3.7.egg
    Extracting qiskit_helper_functions-0.0.1-py3.7.egg to /usr/local/lib/python3.7/dist-packages
    qiskit-helper-functions 0.0.1 is already the active version in easy-install.pth

    Installed /usr/local/lib/python3.7/dist-packages/qiskit_helper_functions-0.0.1-py3.7.egg
    Processing dependencies for qiskit-helper-functions==0.0.1
    Finished processing dependencies for qiskit-helper-functions==0.0.1

# Imports

```python
from time import time
import multiprocessing as mp

from cutqc.helper_fun import check_valid
from cutqc.cutter import find_cuts, cut_circuit
from cutqc.evaluator import run_subcircuit_instances
from cutqc.post_process import generate_summation_terms, build
from cutqc.verify import verify
```

# Initializers

```python
import numpy as np
from qiskit import QuantumCircuit, QuantumRegister
from inspect import signature

def random_circuit(width=3, depth=3, max_operands=3):
        """Generate random circuit of arbitrary size.
        Note: the depth is the layers of independent operation. true depth
        in the image may be more for visualization purposes, if gates overlap.
        Args:
            width (int): number of quantum wires
            depth (int): layers of operations
            max_operands (int): maximum operands of each gate
        Returns:
            QuantumCircuit: constructed circuit
        """
        qr = QuantumRegister(width, "q")
        qc = QuantumCircuit(qr)

        one_q_ops = "x,y,z,h"
        two_q_ops = "cx,cy,ch"
        three_q_ops = "ccx"

        seed = np.random.randint(0, np.iinfo(np.int32).max)
        rng = np.random.RandomState(seed)
        # apply arbitrary random operations at every depth
        for _ in range(depth):
            # choose either 1, 2, or 3 qubits for the operation
            remaining_qubits = list(range(width))
            while remaining_qubits:
                max_possible_operands = min(len(remaining_qubits), max_operands)
                num_operands = rng.choice(range(max_possible_operands)) + 1
                rng.shuffle(remaining_qubits)
                operands = remaining_qubits[:num_operands]
                remaining_qubits = [q for q in remaining_qubits if q not in operands]
                if num_operands == 1:
                    operation = rng.choice(one_q_ops.split(','))
                elif num_operands == 2:
                    operation = rng.choice(two_q_ops.split(','))
                elif num_operands == 3:
                    operation = rng.choice(three_q_ops.split(','))
                # every gate is defined as a method of the QuantumCircuit class
                # the code below is so we can call a gate by its name
                gate = getattr(QuantumCircuit, operation)
                register_operands = [qr[i] for i in operands]
                gate(qc, *register_operands)

        return qc

# Test
for _ in range(1000):
    random_circuit()

from qiskit_helper_functions.non_ibmq_functions import generate_circ

def generate_circuit(num_qubits=12, depth=20, circuit_type='bv'):

    if circuit_type == 'random':
        return random_circuit(width=num_qubits, depth=depth, max_operands=2)

    return generate_circ(num_qubits=num_qubits, depth=depth, circuit_type=circuit_type)
```

# Minors

```python
from qiskit import QuantumCircuit, execute

class CircuitLargerThanChip(Exception):
    pass

class NoSubcircuitFoundException(Exception):
    pass

def check_chip_compatiblity(backend, circuit, raise_exception=True):
    if backend._configuration.n_qubits < circuit.num_qubits:
        if raise_exception:
            raise CircuitLargerThanChip(f"Circuit is larger than chip size.\nChip:{backend}\tCircuit:{circuit.num_qubits}")
        else:
            return False
    # print(f"Chip:{backend} {backend._configuration.n_qubits}\tCircuit:{circuit.num_qubits}")
    return True

```

# Overrides

```python
from qiskit_helper_functions.non_ibmq_functions import read_dict, find_process_jobs, evaluate_circ, get_alloted_backend
from cutqc.evaluator import modify_subcircuit_instance, simulate_subcircuit, mutate_measurement_basis, measure_prob

class CutQC:
    '''
    The main module for CutQC
    cut --> evaluate results --> verify (optional)
    '''
    def __init__(self, task, verbose):
        '''
        Args:
        tasks (list): the input quantum circuits
        Each element is a dictionary with 'name', 'circuit' and 'kwargs'

        verbose: setting verbose to True to turn on logging information.
        Useful to visualize what happens,
        but may produce very long outputs for complicated circuits.
        '''
        self.task = task
        for field in ['name','circuit','kwargs']:
            if field not in self.task:
                raise ValueError('Missing %s'%field)
        check_valid(circuit=self.task['circuit'])
        self.verbose = verbose

    def cut(self):
        '''
        Cut the given circuits
        If use the MIP solver to automatically find cuts, the following are required:
        max_subcircuit_width: max number of qubits in each subcircuit
        The following are optional:
        max_cuts: max total number of cuts allowed
        num_subcircuits: list of subcircuits to try, CutQC returns the best solution found among the trials
        max_subcircuit_cuts: max number of cuts for a subcircuit
        max_subcircuit_size: max number of gates in a subcircuit
        quantum_cost_weight: quantum_cost_weight : MIP overall cost objective is given by
        quantum_cost_weight * num_subcircuit_instances + (1-quantum_cost_weight) * classical_postprocessing_cost

        Else supply the subcircuit_vertices manually
        Note that supplying subcircuit_vertices overrides all other arguments
        '''
        task = self.task
        circuit_name = task['name']
        circuit = task['circuit']
        kwargs = task['kwargs']
        if self.verbose:
            print('*'*20,'Cut %s'%circuit_name,'*'*20)
            print('width = %d depth = %d size = %d -->'%(circuit.num_qubits,circuit.depth(),circuit.size()))
            print(kwargs)
        if 'subcircuit_vertices' not in kwargs:
            if 'max_subcircuit_width' not in kwargs:
                raise AttributeError('Automatic MIP cut searcher requires users to define max subcircuit width!')
            cuts = find_cuts(**kwargs,circuit=circuit,verbose=self.verbose)
        else:
            cuts = cut_circuit(**kwargs,circuit=circuit,verbose=self.verbose)
        task.update(cuts)
        if cuts == {}:
            raise NoSubcircuitFoundException("No Sub-circuit Found")

    def evaluate(self, eval_mode, num_shots_fn, mem_limit, num_threads):
        '''
        eval_mode = qasm: simulate shots
        eval_mode = sv: statevector simulation
        num_shots_fn: a function that gives the number of shots to take for a given circuit
        '''
        if self.verbose:
            print('*'*20,'evaluation mode = %s'%(eval_mode),'*'*20,flush=True)

        self._generate_metadata()
        self._run_subcircuits(eval_mode=eval_mode,num_shots_fn=num_shots_fn)
        self._attribute_shots()
        self._build(mem_limit=mem_limit,num_threads=num_threads)

    def verify(self):
        task = self.task
        print('*'*20,'Verify %s'%task['name'],'*'*20,flush=True)
        reconstructed_output, metrics = verify(full_circuit=task['circuit'],
        unordered=task['unordered_prob'],
        complete_path_map=task['complete_path_map'],
        subcircuits=task['subcircuits'],
        smart_order=task['smart_order'])
        for quasi_conversion_mode in metrics:
            print('Quasi probability conversion mode: %s'%quasi_conversion_mode)
            for metric_name in metrics[quasi_conversion_mode]:
                print(metric_name,metrics[quasi_conversion_mode][metric_name])
        task['ordered_prob'] = reconstructed_output
        task['metrics'] = metrics
        return self.task

    def _generate_metadata(self):
        circ_dict = {}
        all_subcircuit_entries_sampled = {}
        task = self.task
        task['summation_terms'], task['subcircuit_entries'], task['subcircuit_instances'] = generate_summation_terms(
            subcircuits=task['subcircuits'],
            complete_path_map=task['complete_path_map'],
            num_cuts=task['num_cuts'])
        # if self.verbose:
        #     print('--> %s subcircuit_instances:'%task['name'],flush=True)
        #     for subcircuit_idx in task['subcircuit_instances']:
        #         for init_meas in task['subcircuit_instances'][subcircuit_idx]:
        #             subcircuit_instance_idx = task['subcircuit_instances'][subcircuit_idx][init_meas]
        #             print('Subcircuit {:d}, {}, instance_idx {:d}'.format(
        #                 subcircuit_idx,init_meas,subcircuit_instance_idx))
        #     print('--> %s subcircuit_entries:'%task['name'],flush=True)
        #     for subcircuit_idx in task['subcircuit_entries']:
        #         for subcircuit_entry_key in task['subcircuit_entries'][subcircuit_idx]:
        #             subcircuit_entry_idx, kronecker_term = task['subcircuit_entries'][subcircuit_idx][subcircuit_entry_key]
        #             print('Subcircuit {:d} {}, entry_idx {:d}, Kronecker term = {}'.format(
        #                 subcircuit_idx,subcircuit_entry_key,subcircuit_entry_idx,kronecker_term))
        #     print('--> %s summation_terms:'%task['name'])
        #     [print(summation_term) for summation_term in task['summation_terms']]

    def _run_subcircuits(self,eval_mode,num_shots_fn):
        '''
        Run all the subcircuit instances
        task['subcircuit_instance_probs'][subcircuit_idx][subcircuit_instance_idx] = measured prob
        '''
        task = self.task
        if self.verbose:
            print('--> Running Subcircuits %s'%task['name'],flush=True)
        task['subcircuit_instance_probs'] = self.run_subcircuit_instances(subcircuits=task['subcircuits'],subcircuit_instances=task['subcircuit_instances'],
        eval_mode=eval_mode,num_shots_fn=num_shots_fn)

    def simulate(self, subcircuit_instance_probs, subcircuit_idx, subcircuits,subcircuit_instances,init_meas,eval_mode,num_shots,tket):
                subcircuit_instance_idx = subcircuit_instances[subcircuit_idx][init_meas]
                if subcircuit_instance_idx not in subcircuit_instance_probs[subcircuit_idx]:
                    # print('Subcircuit %d instance %d'%(subcircuit_idx,subcircuit_instance_idx))
                    subcircuit_instance = modify_subcircuit_instance(
                        subcircuit=subcircuits[subcircuit_idx],
                        init=init_meas[0],meas=init_meas[1])
                    # subcircuit_inst_prob = simulate_subcircuit(subcircuit=subcircuit_instance,eval_mode=eval_mode,num_shots=num_shots)
                    if  type(eval_mode) is dict:
                        subcircuit_inst_prob = simulate_subcircuit(subcircuit=subcircuit_instance,eval_mode=get_alloted_backend(eval_mode, subcircuits[subcircuit_idx]),num_shots=num_shots, tket=tket)
                    else:
                        subcircuit_inst_prob = simulate_subcircuit(subcircuit=subcircuit_instance,eval_mode=eval_mode,num_shots=num_shots, tket=tket)
                    mutated_meas = mutate_measurement_basis(meas=init_meas[1])
                    for meas in mutated_meas:
                        measured_prob = measure_prob(unmeasured_prob=subcircuit_inst_prob,meas=meas)
                        mutated_subcircuit_instance_idx = subcircuit_instances[subcircuit_idx][(init_meas[0],meas)]
                        subcircuit_instance_probs[subcircuit_idx][mutated_subcircuit_instance_idx] = measured_prob
                        # print('Measured instance %d'%mutated_subcircuit_instance_idx)

    def run_subcircuit_instances(self, subcircuits,subcircuit_instances,eval_mode,num_shots_fn,tket=False):
        '''
        subcircuit_instance_probs[subcircuit_idx][subcircuit_instance_idx] = measured probability
        '''
        # print(f"subcircuit_instances : {len(subcircuit_instances)}, subcircuit_instances[0] : {len(subcircuit_instances[0])}")
        subcircuit_instance_probs = {}
        for subcircuit_idx in subcircuit_instances:
            subcircuit_instance_probs[subcircuit_idx] = {}
            num_shots = num_shots_fn(subcircuits[subcircuit_idx])
            # if eval_mode in ["sv", "qasm"]:
            [ self.simulate(subcircuit_instance_probs, subcircuit_idx, subcircuits,subcircuit_instances,init_meas,eval_mode,num_shots_fn,tket) for init_meas in subcircuit_instances[subcircuit_idx] ]

            # for init_meas in subcircuit_instances[subcircuit_idx]:

        return subcircuit_instance_probs

    def _attribute_shots(self):
        '''
        Attribute the shots into respective subcircuit entries
        task['subcircuit_entry_probs'][subcircuit_idx][subcircuit_entry_idx] = prob
        '''
        task = self.task
        if self.verbose:
            print('--> Attribute shots %s'%task['name'],flush=True)
        attribute_begin = time()
        task['subcircuit_entry_probs'] = {}
        for subcircuit_idx in task['subcircuit_entries']:
            task['subcircuit_entry_probs'][subcircuit_idx] = {}
            for label in task['subcircuit_entries'][subcircuit_idx]:
                subcircuit_entry_idx, kronecker_term = task['subcircuit_entries'][subcircuit_idx][label]
                # print('Subcircuit {:d} entry {:d} kronecker_term {}'.format(
                #     subcircuit_idx, subcircuit_entry_idx, kronecker_term
                # ))
                subcircuit_entry_prob = None
                for term in kronecker_term:
                    coefficient, subcircuit_instance_idx = term
                    if subcircuit_entry_prob is None:
                        subcircuit_entry_prob = coefficient * task['subcircuit_instance_probs'][subcircuit_idx][subcircuit_instance_idx]
                    else:
                        subcircuit_entry_prob += coefficient * task['subcircuit_instance_probs'][subcircuit_idx][subcircuit_instance_idx]
                task['subcircuit_entry_probs'][subcircuit_idx][subcircuit_entry_idx] = subcircuit_entry_prob
        attribute_time = time()-attribute_begin
        if self.verbose:
            print('%s attribute took %.3e seconds'%(task['name'],attribute_time),flush=True)

    def _build(self, mem_limit, num_threads):
        task = self.task
        if self.verbose:
            print('--> Build %s'%task['name'],flush=True)
            [print(summation_term,flush=True) for summation_term in task['summation_terms'][:10]]
            print('... Total %d summation terms\n'%len(task['summation_terms']),flush=True)

        build_begin = time()
        reconstructed_prob, smart_order, overhead = build(
            summation_terms=task['summation_terms'],
            subcircuit_entry_probs=task['subcircuit_entry_probs'],
            num_cuts=task['num_cuts'],
            num_threads=num_threads)
        build_time = time()-build_begin
        task['unordered_prob'] = reconstructed_prob
        task['build_time'] = build_time
        task['smart_order'] = smart_order

        if self.verbose:
            print('Overhead = {}, took {:.3e} seconds'.format(overhead,build_time))
```

# Run

```python
from qiskit.circuit import QuantumCircuit
from qiskit.quantum_info import random_unitary
```

```python
from pprint import pprint
```

```python
def build_arguments(circuit, min_subcircuit_width=None, max_subcircuit_width=None, max_subcircuit_size=None, verbose = True):
    circuit_const = int( circuit.size() / circuit.num_qubits )

    if not max_subcircuit_width:
        max_subcircuit_width = circuit.num_qubits - circuit_const
    if not min_subcircuit_width:
        min_subcircuit_width = 2
    # if not max_subcircuit_size:
    #     max_subcircuit_size = circuit.size() - circuit_const

    max_subcircuit_cuts = circuit.num_qubits - 2
    quantum_cost_weight = 1.0
    max_cuts = circuit.num_qubits - 2

    last_try = False
    circuit_const = circuit_const + 1

    if circuit_const < circuit.num_qubits - 1 and circuit_const > 1:
        num_subcircuits = [ s for s in range(circuit_const - 1, int(circuit.num_qubits / 1.5)) ]
    else:
        last_try = True
        num_subcircuits = [ s for s in range(2, int(circuit.num_qubits / 1.5)) ]

    kwargs = {
            "max_subcircuit_width": max_subcircuit_width,
            "min_subcircuit_width": min_subcircuit_width,
            "max_subcircuit_cuts": max_subcircuit_cuts,
            "max_subcircuit_size": max_subcircuit_size,
            "quantum_cost_weight": quantum_cost_weight,
            "max_cuts": max_cuts,
            "num_subcircuits": num_subcircuits
    }
    if verbose:
        pprint({"circuit_const":circuit_const, **kwargs})
    return kwargs

```

```python
circ = generate_circuit(num_qubits=12,depth=20,circuit_type='bv')
task_1 = {
        'name':'bv 2',
        'circuit':circ,
        'kwargs': build_arguments(circ, min_subcircuit_width=2, max_subcircuit_width=20, verbose=True)
    }
```

    {'circuit_const': 4,
     'max_cuts': 10,
     'max_subcircuit_cuts': 10,
     'max_subcircuit_size': None,
     'max_subcircuit_width': 20,
     'min_subcircuit_width': 2,
     'num_subcircuits': [3, 4, 5, 6, 7],
     'quantum_cost_weight': 1.0}

```python
from qiskit_helper_functions.non_ibmq_functions import available_backend
available_backend
```

    {'FakeMelbourne': qiskit.test.mock.backends.melbourne.fake_melbourne.FakeMelbourne,
     'FakePoughkeepsie': qiskit.test.mock.backends.poughkeepsie.fake_poughkeepsie.FakePoughkeepsie,
     'FakeRueschlikon': qiskit.test.mock.backends.rueschlikon.fake_rueschlikon.FakeRueschlikon,
     'FakeTenerife': qiskit.test.mock.backends.tenerife.fake_tenerife.FakeTenerife,
     'FakeTokyo': qiskit.test.mock.backends.tokyo.fake_tokyo.FakeTokyo,
     'FakeVigo': qiskit.test.mock.backends.vigo.fake_vigo.FakeVigo}

```python
# # Debug
# from pprint import pprint
# import qiskit_helper_functions
from qiskit_helper_functions.non_ibmq_functions import evaluate_circ

# def logger_evaluate_circ(*args, **kwargs):
#     print("evaluate_circ () => ")
#     pprint(args)
#     pprint(kwargs)
#     return e_circ(*args, **kwargs)

# qiskit_helper_functions.non_ibmq_functions.evaluate_circ = logger_evaluate_circ
```

```python
cutqc = CutQC(task_1, verbose=True)
cutqc.cut()

def constant_shots_fn(circuit):
    return 1024

cutqc.evaluate(eval_mode='FakeTokyo',num_shots_fn=constant_shots_fn,mem_limit=1024,num_threads=200)
# cutqc.evaluate(eval_mode='sv',num_shots_fn=constant_shots_fn,mem_limit=1024,num_threads=200)
result = cutqc.verify()
```

    ******************** Cut bv 2 ********************
    width = 12 depth = 14 size = 36 -->
    {'max_subcircuit_width': 20, 'min_subcircuit_width': 2, 'max_subcircuit_cuts': 10, 'max_subcircuit_size': None, 'quantum_cost_weight': 1.0, 'max_cuts': 10, 'num_subcircuits': [3, 4, 5, 6, 7]}
    4 subcircuits : NO SOLUTIONS
    5 subcircuits : NO SOLUTIONS
    6 subcircuits : NO SOLUTIONS
    7 subcircuits : NO SOLUTIONS
    --------------------
    Cutter result:
    3 subcircuits, 6 cuts
    subcircuit 0
    ρ qubits = 2, O qubits = 2, width = 6, effective = 4, depth = 4, size = 12
         ┌───┐                    ┌───┐
    q_0: ┤ H ├─────────────────■──┤ H ├
         ├───┤          ┌───┐  │  └───┘
    q_1: ┤ H ├───────■──┤ H ├──┼───────
         ├───┤       │  └───┘  │  ┌───┐
    q_2: ┤ H ├───────┼────■────┼──┤ H ├
         ├───┤┌───┐  │    │  ┌─┴─┐└───┘
    q_3: ┤ X ├┤ H ├──┼────┼──┤ X ├─────
         └───┘└───┘┌─┴─┐  │  └───┘
    q_4: ──────────┤ X ├──┼────────────
                   └───┘┌─┴─┐┌───┐
    q_5: ───────────────┤ X ├┤ H ├─────
                        └───┘└───┘
    subcircuit 1
    ρ qubits = 2, O qubits = 2, width = 4, effective = 2, depth = 3, size = 6
         ┌───┐     ┌───┐
    q_0: ┤ H ├──■──┤ H ├─────
         ├───┤  │  └───┘┌───┐
    q_1: ┤ H ├──┼────■──┤ H ├
         └───┘┌─┴─┐  │  └───┘
    q_2: ─────┤ X ├──┼───────
              └───┘┌─┴─┐
    q_3: ──────────┤ X ├─────
                   └───┘
    subcircuit 2
    ρ qubits = 2, O qubits = 2, width = 8, effective = 6, depth = 7, size = 18
         ┌───┐     ┌───┐
    q_0: ┤ H ├──■──┤ H ├─────────────────────────
         ├───┤  │  └───┘┌───┐
    q_1: ┤ H ├──┼────■──┤ H ├────────────────────
         ├───┤  │    │  └───┘┌───┐
    q_2: ┤ H ├──┼────┼────■──┤ H ├───────────────
         ├───┤  │    │    │  └───┘┌───┐
    q_3: ┤ H ├──┼────┼────┼────■──┤ H ├──────────
         ├───┤  │    │    │    │  └───┘┌───┐
    q_4: ┤ H ├──┼────┼────┼────┼────■──┤ H ├─────
         ├───┤  │    │    │    │    │  └───┘┌───┐
    q_5: ┤ H ├──┼────┼────┼────┼────┼────■──┤ H ├
         └───┘┌─┴─┐  │    │    │    │    │  └───┘
    q_6: ─────┤ X ├──┼────┼────┼────┼────┼───────
              └───┘┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐
    q_7: ──────────┤ X ├┤ X ├┤ X ├┤ X ├┤ X ├─────
                   └───┘└───┘└───┘└───┘└───┘
    Classical cost = 1.704e+07. Quantum cost = 4.320e+02. quantum_cost_weight = 1.000
    Estimated cost = 4.320e+02
    Model objective value = 4.33e+02
    MIP runtime: 0.018665075302124023
    OPTIMAL, MIP gap = 0.0
    --------------------
    ******************** evaluation mode = FakeTokyo ********************
    --> Running Subcircuits bv 2
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit
    Executing Circuit

```python

```