2023-03-29T13:37:27,419 Created temporary directory: /tmp/pip-ephem-wheel-cache-my1acsl8
2023-03-29T13:37:27,422 Created temporary directory: /tmp/pip-build-tracker-t7kk_0md
2023-03-29T13:37:27,422 Initialized build tracking at /tmp/pip-build-tracker-t7kk_0md
2023-03-29T13:37:27,422 Created build tracker: /tmp/pip-build-tracker-t7kk_0md
2023-03-29T13:37:27,423 Entered build tracker: /tmp/pip-build-tracker-t7kk_0md
2023-03-29T13:37:27,423 Created temporary directory: /tmp/pip-wheel-ie4nwkhq
2023-03-29T13:37:27,428 DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
2023-03-29T13:37:27,431 Created temporary directory: /tmp/pip-ephem-wheel-cache-ndi4s9mq
2023-03-29T13:37:27,464 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
2023-03-29T13:37:27,468 2 location(s) to search for versions of quantum-gates:
2023-03-29T13:37:27,468 * https://pypi.org/simple/quantum-gates/
2023-03-29T13:37:27,468 * https://www.piwheels.org/simple/quantum-gates/
2023-03-29T13:37:27,468 Fetching project page and analyzing links: https://pypi.org/simple/quantum-gates/
2023-03-29T13:37:27,469 Getting page https://pypi.org/simple/quantum-gates/
2023-03-29T13:37:27,470 Found index url https://pypi.org/simple
2023-03-29T13:37:27,527 Fetched page https://pypi.org/simple/quantum-gates/ as application/vnd.pypi.simple.v1+json
2023-03-29T13:37:27,531 Found link https://files.pythonhosted.org/packages/aa/3f/9847c7a7632d39bd15dbbf35b3c488375d55467c495d77b3ee45d0f96530/quantum-gates-0.1.0.tar.gz (from https://pypi.org/simple/quantum-gates/) (requires-python:>=3.9), version: 0.1.0
2023-03-29T13:37:27,531 Skipping link: No binaries permitted for quantum-gates: https://files.pythonhosted.org/packages/32/42/af7fffecf8e9d4589a97d98888600d445ac8aa601eb409073a1b57d7c1e8/quantum_gates-0.1.0-py3-none-any.whl (from https://pypi.org/simple/quantum-gates/) (requires-python:>=3.9)
2023-03-29T13:37:27,532 Found link https://files.pythonhosted.org/packages/c3/3d/75868bcd7fb640ff6766a01a01808eb4ba9ee705c2367426886f6d991214/quantum-gates-1.0.1.tar.gz (from https://pypi.org/simple/quantum-gates/) (requires-python:>=3.9), version: 1.0.1
2023-03-29T13:37:27,532 Skipping link: No binaries permitted for quantum-gates: https://files.pythonhosted.org/packages/52/26/1b9175d9c8a7b99d8286100d3cce5ccd888e35d956df8d26eddd54980ce1/quantum_gates-1.0.1-py3-none-any.whl (from https://pypi.org/simple/quantum-gates/) (requires-python:>=3.9)
2023-03-29T13:37:27,533 Found link https://files.pythonhosted.org/packages/77/e3/7a0bed808806378c0a3305f6125c61e091da081f619e34b0c0bcecc4ad6f/quantum-gates-1.0.2.tar.gz (from https://pypi.org/simple/quantum-gates/) (requires-python:>=3.9), version: 1.0.2
2023-03-29T13:37:27,534 Skipping link: No binaries permitted for quantum-gates: https://files.pythonhosted.org/packages/61/89/92284c3091cade2db4a02741e0f4304fe8d85c5f2d04d07871bfc54ba3d0/quantum_gates-1.0.2-py3-none-any.whl (from https://pypi.org/simple/quantum-gates/) (requires-python:>=3.9)
2023-03-29T13:37:27,535 Found link https://files.pythonhosted.org/packages/8f/b3/e4bcc6c0dd0a1c3bb6bad3b95c805263b0dbc7cf8f91f85db3f7c8a28988/quantum-gates-1.0.3.tar.gz (from https://pypi.org/simple/quantum-gates/) (requires-python:>=3.9), version: 1.0.3
2023-03-29T13:37:27,535 Skipping link: No binaries permitted for quantum-gates: https://files.pythonhosted.org/packages/0e/f0/05c991e001811eabe9a147e92813cb9c26a02846e2a0f61d1f3ce4039949/quantum_gates-1.0.3-py3-none-any.whl (from https://pypi.org/simple/quantum-gates/) (requires-python:>=3.9)
2023-03-29T13:37:27,536 Found link https://files.pythonhosted.org/packages/f7/ca/6db5444a3fa8f5803e2a584c7a4646ccf57c3f5aca5421b0adebc8fc4311/quantum-gates-1.0.4.tar.gz (from https://pypi.org/simple/quantum-gates/) (requires-python:>=3.9), version: 1.0.4
2023-03-29T13:37:27,536 Skipping link: No binaries permitted for quantum-gates: https://files.pythonhosted.org/packages/b3/c8/5e7a65276894db4adafef86671274c513e38412fafb234f84016dcc47ef4/quantum_gates-1.0.4-py3-none-any.whl (from https://pypi.org/simple/quantum-gates/) (requires-python:>=3.9)
2023-03-29T13:37:27,537 Fetching project page and analyzing links: https://www.piwheels.org/simple/quantum-gates/
2023-03-29T13:37:27,537 Getting page https://www.piwheels.org/simple/quantum-gates/
2023-03-29T13:37:27,539 Found index url https://www.piwheels.org/simple
2023-03-29T13:37:27,708 Fetched page https://www.piwheels.org/simple/quantum-gates/ as text/html
2023-03-29T13:37:27,712 Skipping link: No binaries permitted for quantum-gates: https://www.piwheels.org/simple/quantum-gates/quantum_gates-1.0.3-py3-none-any.whl#sha256=89d62df18c56f5b7889588a5f3c0d9fde65643cdcdbb22aa0c2900ea7d0aaf23 (from https://www.piwheels.org/simple/quantum-gates/) (requires-python:>=3.9)
2023-03-29T13:37:27,713 Skipping link: No binaries permitted for quantum-gates: https://www.piwheels.org/simple/quantum-gates/quantum_gates-1.0.2-py3-none-any.whl#sha256=5cc32a54bcc6142625ad7c3168ced8380dae5199414e0d55cd69b4a4d15cc247 (from https://www.piwheels.org/simple/quantum-gates/) (requires-python:>=3.9)
2023-03-29T13:37:27,714 Skipping link: No binaries permitted for quantum-gates: https://www.piwheels.org/simple/quantum-gates/quantum_gates-1.0.1-py3-none-any.whl#sha256=bfd74823d4fd7ab2b687b47667536f63b20fe9ae7ced3292f748c4970afdbe89 (from https://www.piwheels.org/simple/quantum-gates/) (requires-python:>=3.9)
2023-03-29T13:37:27,715 Skipping link: No binaries permitted for quantum-gates: https://www.piwheels.org/simple/quantum-gates/quantum_gates-0.1.0-py3-none-any.whl#sha256=8eb62bdb7f6aa105aca1a99632d5d5b2a7991140344f4637be275696057d5bd0 (from https://www.piwheels.org/simple/quantum-gates/) (requires-python:>=3.9)
2023-03-29T13:37:27,716 Skipping link: not a file: https://www.piwheels.org/simple/quantum-gates/
2023-03-29T13:37:27,716 Skipping link: not a file: https://pypi.org/simple/quantum-gates/
2023-03-29T13:37:27,749 Given no hashes to check 1 links for project 'quantum-gates': discarding no candidates
2023-03-29T13:37:27,767 Collecting quantum-gates==1.0.4
2023-03-29T13:37:27,769 Created temporary directory: /tmp/pip-unpack-utedlm9f
2023-03-29T13:37:28,006 Downloading quantum-gates-1.0.4.tar.gz (4.2 MB)
2023-03-29T13:37:29,961 Added quantum-gates==1.0.4 from https://files.pythonhosted.org/packages/f7/ca/6db5444a3fa8f5803e2a584c7a4646ccf57c3f5aca5421b0adebc8fc4311/quantum-gates-1.0.4.tar.gz to build tracker '/tmp/pip-build-tracker-t7kk_0md'
2023-03-29T13:37:29,968 Created temporary directory: /tmp/pip-build-env-8sdkmktu
2023-03-29T13:37:29,982 Installing build dependencies: started
2023-03-29T13:37:29,983 Running command pip subprocess to install build dependencies
2023-03-29T13:37:31,464 Using pip 23.0.1 from /home/piwheels/.local/lib/python3.9/site-packages/pip (python 3.9)
2023-03-29T13:37:32,214 DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
2023-03-29T13:37:32,248 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
2023-03-29T13:37:34,145 Collecting setuptools>=42
2023-03-29T13:37:34,285 Using cached https://www.piwheels.org/simple/setuptools/setuptools-67.6.1-py3-none-any.whl (1.1 MB)
2023-03-29T13:37:34,601 Collecting wheel
2023-03-29T13:37:34,626 Using cached https://www.piwheels.org/simple/wheel/wheel-0.40.0-py3-none-any.whl (64 kB)
2023-03-29T13:37:34,808 Collecting flit_core<4,>=3.2
2023-03-29T13:37:34,834 Using cached https://www.piwheels.org/simple/flit-core/flit_core-3.8.0-py3-none-any.whl (62 kB)
2023-03-29T13:37:37,434 Installing collected packages: wheel, setuptools, flit_core
2023-03-29T13:37:37,727 Creating /tmp/pip-build-env-8sdkmktu/overlay/bin
2023-03-29T13:37:37,730 changing mode of /tmp/pip-build-env-8sdkmktu/overlay/bin/wheel to 755
2023-03-29T13:37:40,784 Successfully installed flit_core-3.8.0 setuptools-67.6.1 wheel-0.40.0
2023-03-29T13:37:41,353 Installing build dependencies: finished with status 'done'
2023-03-29T13:37:41,359 Getting requirements to build wheel: started
2023-03-29T13:37:41,361 Running command Getting requirements to build wheel
2023-03-29T13:37:42,147 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'readme' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:42,149 !!
2023-03-29T13:37:42,152 ##########################################################################
2023-03-29T13:37:42,152 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:42,152 ##########################################################################
2023-03-29T13:37:42,152 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:42,153 `readme = '# Noisy Quantum Gates [![Made at QMTS!](https://img.shields.io/badge/University%20of%20Trieste-Bassi%20Group-brightgreen)](http://www.qmts.it/) [![Made at CERN!](https://img.shields.io/badge/CERN-CERN%20openlab-brightgreen)](https://openlab.cern/) [![Made at CERN!](https://img.shields.io/badge/CERN-Open%20Source-%232980b9.svg)](https://home.cern) [![Made at CERN!](https://img.shields.io/badge/CERN-QTI-blue)](https://quantum.cern/our-governance)\n\nImplementation of the Noisy Quantum Gates model, which is soon to be published. It is a novel method to simulate the noisy behaviour of quantum devices by incorporating the noise directly in the gates, which become stochastic matrices. \n\n\n## Documentations\nThe documentation for Noisy Quantum Gates can be accessed on the website \n Read the Docs.\n\n\n## How to install\n### Requirements\nThe Python version should be 3.9 or later. Find your Python version by typing `python` or `python3` in the CLI. \nWe recommend using the repo together with an [IBM Quantum Lab](https://quantum-computing.ibm.com/lab) account, \nas it necessary for circuit compilation with Qiskit in many cases. \n\n\n### Installation as a user\nThe library is available on the Python Package Index (PyPI) with `pip install quantum-gates`. \n\n\n### Installation as a contributor\nFor users who want to have control over the source code, we recommend the following installation. Clone the repository \nfrom [Github](https://github.com/CERN-IT-INNOVATION/quantum-gates), create a new virtual environment, and activate the \nenvironment. Then you can build the wheel and install it with the package manager of your choice as described in the \nsection [How to contribute](#how-to-contribute). This will install all dependencies in your virtual environment, \nand install a working version of the library.\n\n\n## Quickstart\nExecute the following code in a script or notebook. Add your IBM token to by defining it as the variable \nIBM_TOKEN = "your_token". \n\n```python\n# Standard libraries\nimport numpy as np\nimport json\n\n# Qiskit\nfrom qiskit import QuantumCircuit, transpile\nfrom qiskit.visualization import plot_histogram\n\n# Own library\nfrom quantum_gates.simulators import MrAndersonSimulator\nfrom quantum_gates.gates import standard_gates\nfrom quantum_gates.circuits import EfficientCircuit\nfrom quantum_gates.utilities import DeviceParameters\nfrom quantum_gates.utilities import setup_backend\nIBM_TOKEN = ""\n```\nWe create a quantum circuit with Qiskit. \n\n```python\ncirc = QuantumCircuit(2,2)\ncirc.h(0)\ncirc.cx(0,1)\ncirc.barrier(range(2))\ncirc.measure(range(2),range(2))\ncirc.draw(\'mpl\')\n```\n\nWe load the configuration from a json file or from code with\n```python\nconfig = {\n "backend": {\n "hub": "ibm-q",\n "group": "open",\n "project": "main",\n "device_name": "ibmq_manila"\n },\n "run": {\n "shots": 1000,\n "qubits_layout": [0, 1],\n "psi0": [1, 0, 0, 0]\n }\n}\n```\n... and setup the Qiskit backend used for the circuit transpilation.\n\n```python\nbackend_config = config["backend"]\nbackend = setup_backend(Token=IBM_TOKEN, **backend_config)\nrun_config = config["run"]\n```\n\nThis allows us to load the device parameters, which represent the noise of the quantum hardware. \n```python\nqubits_layout = run_config["qubits_layout"]\ndevice_param = DeviceParameters(qubits_layout)\ndevice_param.load_from_backend(backend)\ndevice_param_lookup = device_param.__dict__()\n```\n\nLast, we perform the simulation ... \n```python\nsim = MrAndersonSimulator(gates=standard_gates, CircuitClass=EfficientCircuit)\n\nt_circ = transpile(\n circ,\n backend,\n scheduling_method=\'asap\',\n initial_layout=qubits_layout,\n seed_transpiler=42\n)\n\nprobs = sim.run(\n t_qiskit_circ=t_circ, \n qubits_layout=qubits_layout, \n psi0=np.array(run_config["psi0"]), \n shots=run_config["shots"], \n device_param=device_param_lookup,\n nqubit=2)\n\ncounts_ng = {format(i, \'b\').zfill(2): probs[i] for i in range(0, 4)}\n```\n... and analyse the result. \n\n```python\nplot_histogram(counts_ng, bar_labels=False, legend=[\'Noisy Gates simulation\'])\n```\n\n\n# Usage\nWe recommend to read the [overview](https://quantum-gates.readthedocs.io/en/latest/index.html) of the documentation as a 2-minute preparation. \n\n\n## Imports\nThere are two ways of importing the package. 1) If you installed the code with pip, then the imports are simply of the form seen in the [Quickstart](<#quickstart>). \n\n```python\nfrom quantum_gates.simulators import MrAndersonSimulator\nfrom quantum_gates.gates import standard_gates\nfrom quantum_gates.circuits import EfficientCircuit\nfrom quantum_gates.utilities import DeviceParameters, setup_backend\n```\n\n2) If you use the source code directly and develop within the repository, then the imports become\n\n```python\nfrom src.quantum_gates._simulation.simulator import MrAndersonSimulator\nfrom src.quantum_gates._gates.gates import standard_gates\nfrom src.quantum_gates._simulation.circuit import EfficientCircuit\nfrom src.quantum_gates._utility.device_parameters import (\n DeviceParameters, \n setup_backend\n)\n``` \n\n\n# Functionality\nThe main components are the [gates](https://quantum-gates.readthedocs.io/en/latest/gates.html), \nand the [simulator](https://quantum-gates.readthedocs.io/en/latest/simulators.html). \nOne can configure the gates with different [pulse shapes](https://quantum-gates.readthedocs.io/en/latest/pulses.html>), \nand the simulator with different [circuit classes](https://quantum-gates.readthedocs.io/en/latest/circuits.html>) and \n[backends](https://quantum-gates.readthedocs.io/en/latest/backends.html). The circuit classes use a specific \nbackend for the statevector simulation. \nThe [EfficientBackend](https://quantum-gates.readthedocs.io/en/latest/backends.html) has the same functionality as \nthe [StandardBackend](https://quantum-gates.readthedocs.io/en/latest/backends.html), but is much more performant \nthanks to optimized tensor contraction algorithms. We also provide various\n[quantum algorithms](https://quantum-gates.readthedocs.io/en/latest/quantum_algorithms.html) as circuits, and \nscripts to run the circuits with the simulator, the IBM simulator, and a real IBM backend. Last, all functionality is \nunit tested and one can get sample code from the unit tests.\n\n\n# How to contribute\nContributions are welcomed and should apply the usual git-flow: fork this repo, create a local branch named \n\'feature-...\'. Commit often to ensure that each commit is easy to understand. Name your commits \n\'[feature-...] Commit message.\', such that it possible to differentiate the commits of different features in the \nmain line. Request a merge to the mainline often. Please remember to follow the \n[PEP 8 style guide](https://peps.python.org/pep-0008/), and add comments whenever it helps. The corresponding \n[authors](<#authors>) are happy to support you. \n\n\n## Build \nYou may also want to create your own distribution and test it. Navigate to the repository in your CLI of choice. \nBuild the wheel with the command `python3 -m build --sdist --wheel .` and navigate to the distribution with `cd dist`. \nUse `ls` to display the name of the wheel, and run `pip install .whl` with the correct filename. \nNow you can use your version of the library. \n\n\n# Credits\nPlease cite the work using the following Bibtex entry:\n```text\n@misc{dibartolomeo2023novel,\n title={A novel approach to noisy gates for simulating quantum computers}, \n author={Giovanni Di Bartolomeo and Michele Vischi and Francesco Cesa and Roman Wixinger and Michele Grossi and Sandro Donadi and Angelo Bassi},\n year={2023},\n eprint={2301.04173},\n archivePrefix={arXiv},\n primaryClass={quant-ph}\n}\n```\n\n\n# Authors\nThis project has been developed thanks to the effort of the following people:\n\n* Giovanni Di Bartolomeo (dibartolomeo.giov@gmail.com)\n* Michele Vischi (vischimichele@gmail.com)\n* Francesco Cesa\n* Michele Grossi (michele.grossi@cern.ch) \n* Sandro Donadi\n* Angelo Bassi \n* Roman Wixinger (roman.wixinger@gmail.com)\n'`
2023-03-29T13:37:42,154 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:42,154 consider this value unless 'readme' is listed as `dynamic`.
2023-03-29T13:37:42,154 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:42,155 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:42,155 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:42,155 follow strictly the standard.
2023-03-29T13:37:42,155 To prevent this warning, you can list 'readme' under `dynamic` or alternatively
2023-03-29T13:37:42,155 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:42,155 configuration.
2023-03-29T13:37:42,156 !!
2023-03-29T13:37:42,156 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:42,156 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'requires-python' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:42,156 !!
2023-03-29T13:37:42,157 ##########################################################################
2023-03-29T13:37:42,157 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:42,158 ##########################################################################
2023-03-29T13:37:42,158 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:42,158 `requires-python = '>=3.9'`
2023-03-29T13:37:42,159 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:42,159 consider this value unless 'requires-python' is listed as `dynamic`.
2023-03-29T13:37:42,159 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:42,159 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:42,160 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:42,160 follow strictly the standard.
2023-03-29T13:37:42,160 To prevent this warning, you can list 'requires-python' under `dynamic` or alternatively
2023-03-29T13:37:42,160 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:42,161 configuration.
2023-03-29T13:37:42,161 !!
2023-03-29T13:37:42,162 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:42,162 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'license' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:42,162 !!
2023-03-29T13:37:42,163 ##########################################################################
2023-03-29T13:37:42,163 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:42,163 ##########################################################################
2023-03-29T13:37:42,164 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:42,164 `license = 'MIT'`
2023-03-29T13:37:42,164 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:42,165 consider this value unless 'license' is listed as `dynamic`.
2023-03-29T13:37:42,165 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:42,165 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:42,165 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:42,166 follow strictly the standard.
2023-03-29T13:37:42,166 To prevent this warning, you can list 'license' under `dynamic` or alternatively
2023-03-29T13:37:42,166 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:42,166 configuration.
2023-03-29T13:37:42,167 !!
2023-03-29T13:37:42,167 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:42,167 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'classifiers' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:42,167 !!
2023-03-29T13:37:42,168 ##########################################################################
2023-03-29T13:37:42,168 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:42,168 ##########################################################################
2023-03-29T13:37:42,169 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:42,169 `classifiers = ['Programming Language :: Python :: 3', 'License :: OSI Approved :: MIT License', 'Operating System :: Unix', 'Topic :: Scientific/Engineering :: Mathematics']`
2023-03-29T13:37:42,169 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:42,169 consider this value unless 'classifiers' is listed as `dynamic`.
2023-03-29T13:37:42,170 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:42,170 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:42,170 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:42,170 follow strictly the standard.
2023-03-29T13:37:42,171 To prevent this warning, you can list 'classifiers' under `dynamic` or alternatively
2023-03-29T13:37:42,171 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:42,171 configuration.
2023-03-29T13:37:42,172 !!
2023-03-29T13:37:42,172 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:42,529 running egg_info
2023-03-29T13:37:42,536 writing src/quantum_gates.egg-info/PKG-INFO
2023-03-29T13:37:42,539 writing dependency_links to src/quantum_gates.egg-info/dependency_links.txt
2023-03-29T13:37:42,542 writing requirements to src/quantum_gates.egg-info/requires.txt
2023-03-29T13:37:42,544 writing top-level names to src/quantum_gates.egg-info/top_level.txt
2023-03-29T13:37:42,570 reading manifest file 'src/quantum_gates.egg-info/SOURCES.txt'
2023-03-29T13:37:42,594 reading manifest template 'MANIFEST.in'
2023-03-29T13:37:42,657 adding license file 'LICENSE'
2023-03-29T13:37:42,667 writing manifest file 'src/quantum_gates.egg-info/SOURCES.txt'
2023-03-29T13:37:42,807 Getting requirements to build wheel: finished with status 'done'
2023-03-29T13:37:42,819 Created temporary directory: /tmp/pip-modern-metadata-lnczvd3x
2023-03-29T13:37:42,822 Preparing metadata (pyproject.toml): started
2023-03-29T13:37:42,823 Running command Preparing metadata (pyproject.toml)
2023-03-29T13:37:43,484 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'readme' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:43,486 !!
2023-03-29T13:37:43,487 ##########################################################################
2023-03-29T13:37:43,488 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:43,489 ##########################################################################
2023-03-29T13:37:43,490 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:43,491 `readme = '# Noisy Quantum Gates [![Made at QMTS!](https://img.shields.io/badge/University%20of%20Trieste-Bassi%20Group-brightgreen)](http://www.qmts.it/) [![Made at CERN!](https://img.shields.io/badge/CERN-CERN%20openlab-brightgreen)](https://openlab.cern/) [![Made at CERN!](https://img.shields.io/badge/CERN-Open%20Source-%232980b9.svg)](https://home.cern) [![Made at CERN!](https://img.shields.io/badge/CERN-QTI-blue)](https://quantum.cern/our-governance)\n\nImplementation of the Noisy Quantum Gates model, which is soon to be published. It is a novel method to simulate the noisy behaviour of quantum devices by incorporating the noise directly in the gates, which become stochastic matrices. \n\n\n## Documentations\nThe documentation for Noisy Quantum Gates can be accessed on the website \n Read the Docs.\n\n\n## How to install\n### Requirements\nThe Python version should be 3.9 or later. Find your Python version by typing `python` or `python3` in the CLI. \nWe recommend using the repo together with an [IBM Quantum Lab](https://quantum-computing.ibm.com/lab) account, \nas it necessary for circuit compilation with Qiskit in many cases. \n\n\n### Installation as a user\nThe library is available on the Python Package Index (PyPI) with `pip install quantum-gates`. \n\n\n### Installation as a contributor\nFor users who want to have control over the source code, we recommend the following installation. Clone the repository \nfrom [Github](https://github.com/CERN-IT-INNOVATION/quantum-gates), create a new virtual environment, and activate the \nenvironment. Then you can build the wheel and install it with the package manager of your choice as described in the \nsection [How to contribute](#how-to-contribute). This will install all dependencies in your virtual environment, \nand install a working version of the library.\n\n\n## Quickstart\nExecute the following code in a script or notebook. Add your IBM token to by defining it as the variable \nIBM_TOKEN = "your_token". \n\n```python\n# Standard libraries\nimport numpy as np\nimport json\n\n# Qiskit\nfrom qiskit import QuantumCircuit, transpile\nfrom qiskit.visualization import plot_histogram\n\n# Own library\nfrom quantum_gates.simulators import MrAndersonSimulator\nfrom quantum_gates.gates import standard_gates\nfrom quantum_gates.circuits import EfficientCircuit\nfrom quantum_gates.utilities import DeviceParameters\nfrom quantum_gates.utilities import setup_backend\nIBM_TOKEN = ""\n```\nWe create a quantum circuit with Qiskit. \n\n```python\ncirc = QuantumCircuit(2,2)\ncirc.h(0)\ncirc.cx(0,1)\ncirc.barrier(range(2))\ncirc.measure(range(2),range(2))\ncirc.draw(\'mpl\')\n```\n\nWe load the configuration from a json file or from code with\n```python\nconfig = {\n "backend": {\n "hub": "ibm-q",\n "group": "open",\n "project": "main",\n "device_name": "ibmq_manila"\n },\n "run": {\n "shots": 1000,\n "qubits_layout": [0, 1],\n "psi0": [1, 0, 0, 0]\n }\n}\n```\n... and setup the Qiskit backend used for the circuit transpilation.\n\n```python\nbackend_config = config["backend"]\nbackend = setup_backend(Token=IBM_TOKEN, **backend_config)\nrun_config = config["run"]\n```\n\nThis allows us to load the device parameters, which represent the noise of the quantum hardware. \n```python\nqubits_layout = run_config["qubits_layout"]\ndevice_param = DeviceParameters(qubits_layout)\ndevice_param.load_from_backend(backend)\ndevice_param_lookup = device_param.__dict__()\n```\n\nLast, we perform the simulation ... \n```python\nsim = MrAndersonSimulator(gates=standard_gates, CircuitClass=EfficientCircuit)\n\nt_circ = transpile(\n circ,\n backend,\n scheduling_method=\'asap\',\n initial_layout=qubits_layout,\n seed_transpiler=42\n)\n\nprobs = sim.run(\n t_qiskit_circ=t_circ, \n qubits_layout=qubits_layout, \n psi0=np.array(run_config["psi0"]), \n shots=run_config["shots"], \n device_param=device_param_lookup,\n nqubit=2)\n\ncounts_ng = {format(i, \'b\').zfill(2): probs[i] for i in range(0, 4)}\n```\n... and analyse the result. \n\n```python\nplot_histogram(counts_ng, bar_labels=False, legend=[\'Noisy Gates simulation\'])\n```\n\n\n# Usage\nWe recommend to read the [overview](https://quantum-gates.readthedocs.io/en/latest/index.html) of the documentation as a 2-minute preparation. \n\n\n## Imports\nThere are two ways of importing the package. 1) If you installed the code with pip, then the imports are simply of the form seen in the [Quickstart](<#quickstart>). \n\n```python\nfrom quantum_gates.simulators import MrAndersonSimulator\nfrom quantum_gates.gates import standard_gates\nfrom quantum_gates.circuits import EfficientCircuit\nfrom quantum_gates.utilities import DeviceParameters, setup_backend\n```\n\n2) If you use the source code directly and develop within the repository, then the imports become\n\n```python\nfrom src.quantum_gates._simulation.simulator import MrAndersonSimulator\nfrom src.quantum_gates._gates.gates import standard_gates\nfrom src.quantum_gates._simulation.circuit import EfficientCircuit\nfrom src.quantum_gates._utility.device_parameters import (\n DeviceParameters, \n setup_backend\n)\n``` \n\n\n# Functionality\nThe main components are the [gates](https://quantum-gates.readthedocs.io/en/latest/gates.html), \nand the [simulator](https://quantum-gates.readthedocs.io/en/latest/simulators.html). \nOne can configure the gates with different [pulse shapes](https://quantum-gates.readthedocs.io/en/latest/pulses.html>), \nand the simulator with different [circuit classes](https://quantum-gates.readthedocs.io/en/latest/circuits.html>) and \n[backends](https://quantum-gates.readthedocs.io/en/latest/backends.html). The circuit classes use a specific \nbackend for the statevector simulation. \nThe [EfficientBackend](https://quantum-gates.readthedocs.io/en/latest/backends.html) has the same functionality as \nthe [StandardBackend](https://quantum-gates.readthedocs.io/en/latest/backends.html), but is much more performant \nthanks to optimized tensor contraction algorithms. We also provide various\n[quantum algorithms](https://quantum-gates.readthedocs.io/en/latest/quantum_algorithms.html) as circuits, and \nscripts to run the circuits with the simulator, the IBM simulator, and a real IBM backend. Last, all functionality is \nunit tested and one can get sample code from the unit tests.\n\n\n# How to contribute\nContributions are welcomed and should apply the usual git-flow: fork this repo, create a local branch named \n\'feature-...\'. Commit often to ensure that each commit is easy to understand. Name your commits \n\'[feature-...] Commit message.\', such that it possible to differentiate the commits of different features in the \nmain line. Request a merge to the mainline often. Please remember to follow the \n[PEP 8 style guide](https://peps.python.org/pep-0008/), and add comments whenever it helps. The corresponding \n[authors](<#authors>) are happy to support you. \n\n\n## Build \nYou may also want to create your own distribution and test it. Navigate to the repository in your CLI of choice. \nBuild the wheel with the command `python3 -m build --sdist --wheel .` and navigate to the distribution with `cd dist`. \nUse `ls` to display the name of the wheel, and run `pip install .whl` with the correct filename. \nNow you can use your version of the library. \n\n\n# Credits\nPlease cite the work using the following Bibtex entry:\n```text\n@misc{dibartolomeo2023novel,\n title={A novel approach to noisy gates for simulating quantum computers}, \n author={Giovanni Di Bartolomeo and Michele Vischi and Francesco Cesa and Roman Wixinger and Michele Grossi and Sandro Donadi and Angelo Bassi},\n year={2023},\n eprint={2301.04173},\n archivePrefix={arXiv},\n primaryClass={quant-ph}\n}\n```\n\n\n# Authors\nThis project has been developed thanks to the effort of the following people:\n\n* Giovanni Di Bartolomeo (dibartolomeo.giov@gmail.com)\n* Michele Vischi (vischimichele@gmail.com)\n* Francesco Cesa\n* Michele Grossi (michele.grossi@cern.ch) \n* Sandro Donadi\n* Angelo Bassi \n* Roman Wixinger (roman.wixinger@gmail.com)\n'`
2023-03-29T13:37:43,493 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:43,494 consider this value unless 'readme' is listed as `dynamic`.
2023-03-29T13:37:43,495 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:43,496 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:43,497 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:43,497 follow strictly the standard.
2023-03-29T13:37:43,498 To prevent this warning, you can list 'readme' under `dynamic` or alternatively
2023-03-29T13:37:43,499 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:43,500 configuration.
2023-03-29T13:37:43,502 !!
2023-03-29T13:37:43,503 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:43,503 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'requires-python' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:43,503 !!
2023-03-29T13:37:43,503 ##########################################################################
2023-03-29T13:37:43,504 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:43,504 ##########################################################################
2023-03-29T13:37:43,504 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:43,504 `requires-python = '>=3.9'`
2023-03-29T13:37:43,505 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:43,505 consider this value unless 'requires-python' is listed as `dynamic`.
2023-03-29T13:37:43,505 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:43,506 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:43,506 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:43,506 follow strictly the standard.
2023-03-29T13:37:43,506 To prevent this warning, you can list 'requires-python' under `dynamic` or alternatively
2023-03-29T13:37:43,507 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:43,507 configuration.
2023-03-29T13:37:43,507 !!
2023-03-29T13:37:43,507 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:43,508 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'license' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:43,508 !!
2023-03-29T13:37:43,508 ##########################################################################
2023-03-29T13:37:43,508 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:43,509 ##########################################################################
2023-03-29T13:37:43,509 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:43,509 `license = 'MIT'`
2023-03-29T13:37:43,510 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:43,510 consider this value unless 'license' is listed as `dynamic`.
2023-03-29T13:37:43,510 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:43,510 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:43,510 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:43,511 follow strictly the standard.
2023-03-29T13:37:43,511 To prevent this warning, you can list 'license' under `dynamic` or alternatively
2023-03-29T13:37:43,511 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:43,511 configuration.
2023-03-29T13:37:43,512 !!
2023-03-29T13:37:43,512 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:43,512 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'classifiers' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:43,513 !!
2023-03-29T13:37:43,513 ##########################################################################
2023-03-29T13:37:43,513 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:43,514 ##########################################################################
2023-03-29T13:37:43,514 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:43,515 `classifiers = ['Programming Language :: Python :: 3', 'License :: OSI Approved :: MIT License', 'Operating System :: Unix', 'Topic :: Scientific/Engineering :: Mathematics']`
2023-03-29T13:37:43,515 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:43,515 consider this value unless 'classifiers' is listed as `dynamic`.
2023-03-29T13:37:43,516 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:43,516 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:43,516 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:43,516 follow strictly the standard.
2023-03-29T13:37:43,517 To prevent this warning, you can list 'classifiers' under `dynamic` or alternatively
2023-03-29T13:37:43,517 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:43,517 configuration.
2023-03-29T13:37:43,517 !!
2023-03-29T13:37:43,518 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:43,862 running dist_info
2023-03-29T13:37:43,878 creating /tmp/pip-modern-metadata-lnczvd3x/quantum_gates.egg-info
2023-03-29T13:37:43,892 writing /tmp/pip-modern-metadata-lnczvd3x/quantum_gates.egg-info/PKG-INFO
2023-03-29T13:37:43,896 writing dependency_links to /tmp/pip-modern-metadata-lnczvd3x/quantum_gates.egg-info/dependency_links.txt
2023-03-29T13:37:43,898 writing requirements to /tmp/pip-modern-metadata-lnczvd3x/quantum_gates.egg-info/requires.txt
2023-03-29T13:37:43,900 writing top-level names to /tmp/pip-modern-metadata-lnczvd3x/quantum_gates.egg-info/top_level.txt
2023-03-29T13:37:43,901 writing manifest file '/tmp/pip-modern-metadata-lnczvd3x/quantum_gates.egg-info/SOURCES.txt'
2023-03-29T13:37:43,922 reading manifest file '/tmp/pip-modern-metadata-lnczvd3x/quantum_gates.egg-info/SOURCES.txt'
2023-03-29T13:37:43,924 reading manifest template 'MANIFEST.in'
2023-03-29T13:37:43,977 adding license file 'LICENSE'
2023-03-29T13:37:43,984 writing manifest file '/tmp/pip-modern-metadata-lnczvd3x/quantum_gates.egg-info/SOURCES.txt'
2023-03-29T13:37:43,986 creating '/tmp/pip-modern-metadata-lnczvd3x/quantum_gates-1.0.4.dist-info'
2023-03-29T13:37:44,156 Preparing metadata (pyproject.toml): finished with status 'done'
2023-03-29T13:37:44,164 Source in /tmp/pip-wheel-ie4nwkhq/quantum-gates_9c2c3e1e18584dc197ed4f4e3b42e981 has version 1.0.4, which satisfies requirement quantum-gates==1.0.4 from https://files.pythonhosted.org/packages/f7/ca/6db5444a3fa8f5803e2a584c7a4646ccf57c3f5aca5421b0adebc8fc4311/quantum-gates-1.0.4.tar.gz
2023-03-29T13:37:44,165 Removed quantum-gates==1.0.4 from https://files.pythonhosted.org/packages/f7/ca/6db5444a3fa8f5803e2a584c7a4646ccf57c3f5aca5421b0adebc8fc4311/quantum-gates-1.0.4.tar.gz from build tracker '/tmp/pip-build-tracker-t7kk_0md'
2023-03-29T13:37:44,173 Created temporary directory: /tmp/pip-unpack-nn5ltqbk
2023-03-29T13:37:44,173 Building wheels for collected packages: quantum-gates
2023-03-29T13:37:44,178 Created temporary directory: /tmp/pip-wheel-oq9b9p2t
2023-03-29T13:37:44,179 Destination directory: /tmp/pip-wheel-oq9b9p2t
2023-03-29T13:37:44,181 Building wheel for quantum-gates (pyproject.toml): started
2023-03-29T13:37:44,182 Running command Building wheel for quantum-gates (pyproject.toml)
2023-03-29T13:37:44,831 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'readme' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:44,832 !!
2023-03-29T13:37:44,833 ##########################################################################
2023-03-29T13:37:44,833 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:44,833 ##########################################################################
2023-03-29T13:37:44,833 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:44,834 `readme = '# Noisy Quantum Gates [![Made at QMTS!](https://img.shields.io/badge/University%20of%20Trieste-Bassi%20Group-brightgreen)](http://www.qmts.it/) [![Made at CERN!](https://img.shields.io/badge/CERN-CERN%20openlab-brightgreen)](https://openlab.cern/) [![Made at CERN!](https://img.shields.io/badge/CERN-Open%20Source-%232980b9.svg)](https://home.cern) [![Made at CERN!](https://img.shields.io/badge/CERN-QTI-blue)](https://quantum.cern/our-governance)\n\nImplementation of the Noisy Quantum Gates model, which is soon to be published. It is a novel method to simulate the noisy behaviour of quantum devices by incorporating the noise directly in the gates, which become stochastic matrices. \n\n\n## Documentations\nThe documentation for Noisy Quantum Gates can be accessed on the website \n Read the Docs.\n\n\n## How to install\n### Requirements\nThe Python version should be 3.9 or later. Find your Python version by typing `python` or `python3` in the CLI. \nWe recommend using the repo together with an [IBM Quantum Lab](https://quantum-computing.ibm.com/lab) account, \nas it necessary for circuit compilation with Qiskit in many cases. \n\n\n### Installation as a user\nThe library is available on the Python Package Index (PyPI) with `pip install quantum-gates`. \n\n\n### Installation as a contributor\nFor users who want to have control over the source code, we recommend the following installation. Clone the repository \nfrom [Github](https://github.com/CERN-IT-INNOVATION/quantum-gates), create a new virtual environment, and activate the \nenvironment. Then you can build the wheel and install it with the package manager of your choice as described in the \nsection [How to contribute](#how-to-contribute). This will install all dependencies in your virtual environment, \nand install a working version of the library.\n\n\n## Quickstart\nExecute the following code in a script or notebook. Add your IBM token to by defining it as the variable \nIBM_TOKEN = "your_token". \n\n```python\n# Standard libraries\nimport numpy as np\nimport json\n\n# Qiskit\nfrom qiskit import QuantumCircuit, transpile\nfrom qiskit.visualization import plot_histogram\n\n# Own library\nfrom quantum_gates.simulators import MrAndersonSimulator\nfrom quantum_gates.gates import standard_gates\nfrom quantum_gates.circuits import EfficientCircuit\nfrom quantum_gates.utilities import DeviceParameters\nfrom quantum_gates.utilities import setup_backend\nIBM_TOKEN = ""\n```\nWe create a quantum circuit with Qiskit. \n\n```python\ncirc = QuantumCircuit(2,2)\ncirc.h(0)\ncirc.cx(0,1)\ncirc.barrier(range(2))\ncirc.measure(range(2),range(2))\ncirc.draw(\'mpl\')\n```\n\nWe load the configuration from a json file or from code with\n```python\nconfig = {\n "backend": {\n "hub": "ibm-q",\n "group": "open",\n "project": "main",\n "device_name": "ibmq_manila"\n },\n "run": {\n "shots": 1000,\n "qubits_layout": [0, 1],\n "psi0": [1, 0, 0, 0]\n }\n}\n```\n... and setup the Qiskit backend used for the circuit transpilation.\n\n```python\nbackend_config = config["backend"]\nbackend = setup_backend(Token=IBM_TOKEN, **backend_config)\nrun_config = config["run"]\n```\n\nThis allows us to load the device parameters, which represent the noise of the quantum hardware. \n```python\nqubits_layout = run_config["qubits_layout"]\ndevice_param = DeviceParameters(qubits_layout)\ndevice_param.load_from_backend(backend)\ndevice_param_lookup = device_param.__dict__()\n```\n\nLast, we perform the simulation ... \n```python\nsim = MrAndersonSimulator(gates=standard_gates, CircuitClass=EfficientCircuit)\n\nt_circ = transpile(\n circ,\n backend,\n scheduling_method=\'asap\',\n initial_layout=qubits_layout,\n seed_transpiler=42\n)\n\nprobs = sim.run(\n t_qiskit_circ=t_circ, \n qubits_layout=qubits_layout, \n psi0=np.array(run_config["psi0"]), \n shots=run_config["shots"], \n device_param=device_param_lookup,\n nqubit=2)\n\ncounts_ng = {format(i, \'b\').zfill(2): probs[i] for i in range(0, 4)}\n```\n... and analyse the result. \n\n```python\nplot_histogram(counts_ng, bar_labels=False, legend=[\'Noisy Gates simulation\'])\n```\n\n\n# Usage\nWe recommend to read the [overview](https://quantum-gates.readthedocs.io/en/latest/index.html) of the documentation as a 2-minute preparation. \n\n\n## Imports\nThere are two ways of importing the package. 1) If you installed the code with pip, then the imports are simply of the form seen in the [Quickstart](<#quickstart>). \n\n```python\nfrom quantum_gates.simulators import MrAndersonSimulator\nfrom quantum_gates.gates import standard_gates\nfrom quantum_gates.circuits import EfficientCircuit\nfrom quantum_gates.utilities import DeviceParameters, setup_backend\n```\n\n2) If you use the source code directly and develop within the repository, then the imports become\n\n```python\nfrom src.quantum_gates._simulation.simulator import MrAndersonSimulator\nfrom src.quantum_gates._gates.gates import standard_gates\nfrom src.quantum_gates._simulation.circuit import EfficientCircuit\nfrom src.quantum_gates._utility.device_parameters import (\n DeviceParameters, \n setup_backend\n)\n``` \n\n\n# Functionality\nThe main components are the [gates](https://quantum-gates.readthedocs.io/en/latest/gates.html), \nand the [simulator](https://quantum-gates.readthedocs.io/en/latest/simulators.html). \nOne can configure the gates with different [pulse shapes](https://quantum-gates.readthedocs.io/en/latest/pulses.html>), \nand the simulator with different [circuit classes](https://quantum-gates.readthedocs.io/en/latest/circuits.html>) and \n[backends](https://quantum-gates.readthedocs.io/en/latest/backends.html). The circuit classes use a specific \nbackend for the statevector simulation. \nThe [EfficientBackend](https://quantum-gates.readthedocs.io/en/latest/backends.html) has the same functionality as \nthe [StandardBackend](https://quantum-gates.readthedocs.io/en/latest/backends.html), but is much more performant \nthanks to optimized tensor contraction algorithms. We also provide various\n[quantum algorithms](https://quantum-gates.readthedocs.io/en/latest/quantum_algorithms.html) as circuits, and \nscripts to run the circuits with the simulator, the IBM simulator, and a real IBM backend. Last, all functionality is \nunit tested and one can get sample code from the unit tests.\n\n\n# How to contribute\nContributions are welcomed and should apply the usual git-flow: fork this repo, create a local branch named \n\'feature-...\'. Commit often to ensure that each commit is easy to understand. Name your commits \n\'[feature-...] Commit message.\', such that it possible to differentiate the commits of different features in the \nmain line. Request a merge to the mainline often. Please remember to follow the \n[PEP 8 style guide](https://peps.python.org/pep-0008/), and add comments whenever it helps. The corresponding \n[authors](<#authors>) are happy to support you. \n\n\n## Build \nYou may also want to create your own distribution and test it. Navigate to the repository in your CLI of choice. \nBuild the wheel with the command `python3 -m build --sdist --wheel .` and navigate to the distribution with `cd dist`. \nUse `ls` to display the name of the wheel, and run `pip install .whl` with the correct filename. \nNow you can use your version of the library. \n\n\n# Credits\nPlease cite the work using the following Bibtex entry:\n```text\n@misc{dibartolomeo2023novel,\n title={A novel approach to noisy gates for simulating quantum computers}, \n author={Giovanni Di Bartolomeo and Michele Vischi and Francesco Cesa and Roman Wixinger and Michele Grossi and Sandro Donadi and Angelo Bassi},\n year={2023},\n eprint={2301.04173},\n archivePrefix={arXiv},\n primaryClass={quant-ph}\n}\n```\n\n\n# Authors\nThis project has been developed thanks to the effort of the following people:\n\n* Giovanni Di Bartolomeo (dibartolomeo.giov@gmail.com)\n* Michele Vischi (vischimichele@gmail.com)\n* Francesco Cesa\n* Michele Grossi (michele.grossi@cern.ch) \n* Sandro Donadi\n* Angelo Bassi \n* Roman Wixinger (roman.wixinger@gmail.com)\n'`
2023-03-29T13:37:44,835 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:44,835 consider this value unless 'readme' is listed as `dynamic`.
2023-03-29T13:37:44,835 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:44,836 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:44,836 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:44,836 follow strictly the standard.
2023-03-29T13:37:44,836 To prevent this warning, you can list 'readme' under `dynamic` or alternatively
2023-03-29T13:37:44,837 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:44,837 configuration.
2023-03-29T13:37:44,837 !!
2023-03-29T13:37:44,838 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:44,838 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'requires-python' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:44,838 !!
2023-03-29T13:37:44,838 ##########################################################################
2023-03-29T13:37:44,838 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:44,839 ##########################################################################
2023-03-29T13:37:44,839 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:44,839 `requires-python = '>=3.9'`
2023-03-29T13:37:44,840 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:44,840 consider this value unless 'requires-python' is listed as `dynamic`.
2023-03-29T13:37:44,841 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:44,841 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:44,841 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:44,841 follow strictly the standard.
2023-03-29T13:37:44,842 To prevent this warning, you can list 'requires-python' under `dynamic` or alternatively
2023-03-29T13:37:44,842 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:44,842 configuration.
2023-03-29T13:37:44,843 !!
2023-03-29T13:37:44,843 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:44,843 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'license' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:44,843 !!
2023-03-29T13:37:44,844 ##########################################################################
2023-03-29T13:37:44,844 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:44,844 ##########################################################################
2023-03-29T13:37:44,845 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:44,845 `license = 'MIT'`
2023-03-29T13:37:44,845 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:44,846 consider this value unless 'license' is listed as `dynamic`.
2023-03-29T13:37:44,846 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:44,846 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:44,846 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:44,847 follow strictly the standard.
2023-03-29T13:37:44,847 To prevent this warning, you can list 'license' under `dynamic` or alternatively
2023-03-29T13:37:44,847 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:44,847 configuration.
2023-03-29T13:37:44,848 !!
2023-03-29T13:37:44,848 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:44,849 /tmp/pip-build-env-8sdkmktu/overlay/lib/python3.9/site-packages/setuptools/config/_apply_pyprojecttoml.py:103: _WouldIgnoreField: 'classifiers' defined outside of `pyproject.toml` would be ignored.
2023-03-29T13:37:44,849 !!
2023-03-29T13:37:44,849 ##########################################################################
2023-03-29T13:37:44,850 # configuration would be ignored/result in error due to `pyproject.toml` #
2023-03-29T13:37:44,850 ##########################################################################
2023-03-29T13:37:44,851 The following seems to be defined outside of `pyproject.toml`:
2023-03-29T13:37:44,851 `classifiers = ['Programming Language :: Python :: 3', 'License :: OSI Approved :: MIT License', 'Operating System :: Unix', 'Topic :: Scientific/Engineering :: Mathematics']`
2023-03-29T13:37:44,852 According to the spec (see the link below), however, setuptools CANNOT
2023-03-29T13:37:44,852 consider this value unless 'classifiers' is listed as `dynamic`.
2023-03-29T13:37:44,853 https://packaging.python.org/en/latest/specifications/declaring-project-metadata/
2023-03-29T13:37:44,853 For the time being, `setuptools` will still consider the given value (as a
2023-03-29T13:37:44,853 **transitional** measure), but please note that future releases of setuptools will
2023-03-29T13:37:44,853 follow strictly the standard.
2023-03-29T13:37:44,854 To prevent this warning, you can list 'classifiers' under `dynamic` or alternatively
2023-03-29T13:37:44,854 remove the `[project]` table from your file and rely entirely on other means of
2023-03-29T13:37:44,854 configuration.
2023-03-29T13:37:44,855 !!
2023-03-29T13:37:44,855 warnings.warn(msg, _WouldIgnoreField)
2023-03-29T13:37:45,200 running bdist_wheel
2023-03-29T13:37:45,217 running build
2023-03-29T13:37:45,218 running build_py
2023-03-29T13:37:45,228 creating build
2023-03-29T13:37:45,229 creating build/lib
2023-03-29T13:37:45,231 creating build/lib/quantum_gates
2023-03-29T13:37:45,235 copying src/quantum_gates/factories.py -> build/lib/quantum_gates
2023-03-29T13:37:45,240 copying src/quantum_gates/metrics.py -> build/lib/quantum_gates
2023-03-29T13:37:45,242 copying src/quantum_gates/gates.py -> build/lib/quantum_gates
2023-03-29T13:37:45,244 copying src/quantum_gates/circuits.py -> build/lib/quantum_gates
2023-03-29T13:37:45,246 copying src/quantum_gates/utilities.py -> build/lib/quantum_gates
2023-03-29T13:37:45,248 copying src/quantum_gates/pulses.py -> build/lib/quantum_gates
2023-03-29T13:37:45,250 copying src/quantum_gates/backends.py -> build/lib/quantum_gates
2023-03-29T13:37:45,252 copying src/quantum_gates/integrators.py -> build/lib/quantum_gates
2023-03-29T13:37:45,254 copying src/quantum_gates/__init__.py -> build/lib/quantum_gates
2023-03-29T13:37:45,256 copying src/quantum_gates/simulators.py -> build/lib/quantum_gates
2023-03-29T13:37:45,258 copying src/quantum_gates/quantum_algorithms.py -> build/lib/quantum_gates
2023-03-29T13:37:45,261 creating build/lib/quantum_gates/_gates
2023-03-29T13:37:45,262 copying src/quantum_gates/_gates/factories.py -> build/lib/quantum_gates/_gates
2023-03-29T13:37:45,266 copying src/quantum_gates/_gates/gates.py -> build/lib/quantum_gates/_gates
2023-03-29T13:37:45,269 copying src/quantum_gates/_gates/integrator.py -> build/lib/quantum_gates/_gates
2023-03-29T13:37:45,271 copying src/quantum_gates/_gates/__init__.py -> build/lib/quantum_gates/_gates
2023-03-29T13:37:45,273 copying src/quantum_gates/_gates/pulse.py -> build/lib/quantum_gates/_gates
2023-03-29T13:37:45,276 creating build/lib/quantum_gates/_legacy
2023-03-29T13:37:45,277 copying src/quantum_gates/_legacy/simulator.py -> build/lib/quantum_gates/_legacy
2023-03-29T13:37:45,280 copying src/quantum_gates/_legacy/gates.py -> build/lib/quantum_gates/_legacy
2023-03-29T13:37:45,283 copying src/quantum_gates/_legacy/circuit.py -> build/lib/quantum_gates/_legacy
2023-03-29T13:37:45,286 copying src/quantum_gates/_legacy/__init__.py -> build/lib/quantum_gates/_legacy
2023-03-29T13:37:45,289 creating build/lib/quantum_gates/_simulation
2023-03-29T13:37:45,290 copying src/quantum_gates/_simulation/simulator.py -> build/lib/quantum_gates/_simulation
2023-03-29T13:37:45,293 copying src/quantum_gates/_simulation/circuit.py -> build/lib/quantum_gates/_simulation
2023-03-29T13:37:45,296 copying src/quantum_gates/_simulation/backend.py -> build/lib/quantum_gates/_simulation
2023-03-29T13:37:45,299 copying src/quantum_gates/_simulation/__init__.py -> build/lib/quantum_gates/_simulation
2023-03-29T13:37:45,301 creating build/lib/quantum_gates/_utility
2023-03-29T13:37:45,302 copying src/quantum_gates/_utility/simulations_utility.py -> build/lib/quantum_gates/_utility
2023-03-29T13:37:45,305 copying src/quantum_gates/_utility/__init__.py -> build/lib/quantum_gates/_utility
2023-03-29T13:37:45,307 copying src/quantum_gates/_utility/quantum_algorithms.py -> build/lib/quantum_gates/_utility
2023-03-29T13:37:45,309 copying src/quantum_gates/_utility/device_parameters.py -> build/lib/quantum_gates/_utility
2023-03-29T13:37:45,312 running egg_info
2023-03-29T13:37:45,321 writing src/quantum_gates.egg-info/PKG-INFO
2023-03-29T13:37:45,323 writing dependency_links to src/quantum_gates.egg-info/dependency_links.txt
2023-03-29T13:37:45,325 writing requirements to src/quantum_gates.egg-info/requires.txt
2023-03-29T13:37:45,326 writing top-level names to src/quantum_gates.egg-info/top_level.txt
2023-03-29T13:37:45,338 reading manifest file 'src/quantum_gates.egg-info/SOURCES.txt'
2023-03-29T13:37:45,344 reading manifest template 'MANIFEST.in'
2023-03-29T13:37:45,400 adding license file 'LICENSE'
2023-03-29T13:37:45,410 writing manifest file 'src/quantum_gates.egg-info/SOURCES.txt'
2023-03-29T13:37:45,432 installing to build/bdist.linux-armv7l/wheel
2023-03-29T13:37:45,433 running install
2023-03-29T13:37:45,461 running install_lib
2023-03-29T13:37:45,467 creating build/bdist.linux-armv7l
2023-03-29T13:37:45,467 creating build/bdist.linux-armv7l/wheel
2023-03-29T13:37:45,470 creating build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,471 copying build/lib/quantum_gates/factories.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,474 copying build/lib/quantum_gates/metrics.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,476 copying build/lib/quantum_gates/gates.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,479 creating build/bdist.linux-armv7l/wheel/quantum_gates/_simulation
2023-03-29T13:37:45,481 copying build/lib/quantum_gates/_simulation/simulator.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_simulation
2023-03-29T13:37:45,484 copying build/lib/quantum_gates/_simulation/circuit.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_simulation
2023-03-29T13:37:45,487 copying build/lib/quantum_gates/_simulation/backend.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_simulation
2023-03-29T13:37:45,491 copying build/lib/quantum_gates/_simulation/__init__.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_simulation
2023-03-29T13:37:45,493 copying build/lib/quantum_gates/circuits.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,496 creating build/bdist.linux-armv7l/wheel/quantum_gates/_legacy
2023-03-29T13:37:45,497 copying build/lib/quantum_gates/_legacy/simulator.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_legacy
2023-03-29T13:37:45,500 copying build/lib/quantum_gates/_legacy/gates.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_legacy
2023-03-29T13:37:45,503 copying build/lib/quantum_gates/_legacy/circuit.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_legacy
2023-03-29T13:37:45,507 copying build/lib/quantum_gates/_legacy/__init__.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_legacy
2023-03-29T13:37:45,509 copying build/lib/quantum_gates/utilities.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,511 copying build/lib/quantum_gates/pulses.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,514 copying build/lib/quantum_gates/backends.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,516 copying build/lib/quantum_gates/integrators.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,518 copying build/lib/quantum_gates/__init__.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,521 copying build/lib/quantum_gates/simulators.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,524 creating build/bdist.linux-armv7l/wheel/quantum_gates/_gates
2023-03-29T13:37:45,526 copying build/lib/quantum_gates/_gates/factories.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_gates
2023-03-29T13:37:45,529 copying build/lib/quantum_gates/_gates/gates.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_gates
2023-03-29T13:37:45,533 copying build/lib/quantum_gates/_gates/integrator.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_gates
2023-03-29T13:37:45,535 copying build/lib/quantum_gates/_gates/__init__.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_gates
2023-03-29T13:37:45,537 copying build/lib/quantum_gates/_gates/pulse.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_gates
2023-03-29T13:37:45,540 copying build/lib/quantum_gates/quantum_algorithms.py -> build/bdist.linux-armv7l/wheel/quantum_gates
2023-03-29T13:37:45,543 creating build/bdist.linux-armv7l/wheel/quantum_gates/_utility
2023-03-29T13:37:45,545 copying build/lib/quantum_gates/_utility/simulations_utility.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_utility
2023-03-29T13:37:45,548 copying build/lib/quantum_gates/_utility/__init__.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_utility
2023-03-29T13:37:45,550 copying build/lib/quantum_gates/_utility/quantum_algorithms.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_utility
2023-03-29T13:37:45,553 copying build/lib/quantum_gates/_utility/device_parameters.py -> build/bdist.linux-armv7l/wheel/quantum_gates/_utility
2023-03-29T13:37:45,556 running install_egg_info
2023-03-29T13:37:45,561 Copying src/quantum_gates.egg-info to build/bdist.linux-armv7l/wheel/quantum_gates-1.0.4-py3.9.egg-info
2023-03-29T13:37:45,578 running install_scripts
2023-03-29T13:37:45,608 creating build/bdist.linux-armv7l/wheel/quantum_gates-1.0.4.dist-info/WHEEL
2023-03-29T13:37:45,617 creating '/tmp/pip-wheel-oq9b9p2t/.tmp-vy79q41c/quantum_gates-1.0.4-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it
2023-03-29T13:37:45,624 adding 'quantum_gates/__init__.py'
2023-03-29T13:37:45,626 adding 'quantum_gates/backends.py'
2023-03-29T13:37:45,627 adding 'quantum_gates/circuits.py'
2023-03-29T13:37:45,629 adding 'quantum_gates/factories.py'
2023-03-29T13:37:45,630 adding 'quantum_gates/gates.py'
2023-03-29T13:37:45,631 adding 'quantum_gates/integrators.py'
2023-03-29T13:37:45,633 adding 'quantum_gates/metrics.py'
2023-03-29T13:37:45,634 adding 'quantum_gates/pulses.py'
2023-03-29T13:37:45,636 adding 'quantum_gates/quantum_algorithms.py'
2023-03-29T13:37:45,637 adding 'quantum_gates/simulators.py'
2023-03-29T13:37:45,639 adding 'quantum_gates/utilities.py'
2023-03-29T13:37:45,641 adding 'quantum_gates/_gates/__init__.py'
2023-03-29T13:37:45,644 adding 'quantum_gates/_gates/factories.py'
2023-03-29T13:37:45,646 adding 'quantum_gates/_gates/gates.py'
2023-03-29T13:37:45,648 adding 'quantum_gates/_gates/integrator.py'
2023-03-29T13:37:45,650 adding 'quantum_gates/_gates/pulse.py'
2023-03-29T13:37:45,652 adding 'quantum_gates/_legacy/__init__.py'
2023-03-29T13:37:45,654 adding 'quantum_gates/_legacy/circuit.py'
2023-03-29T13:37:45,657 adding 'quantum_gates/_legacy/gates.py'
2023-03-29T13:37:45,659 adding 'quantum_gates/_legacy/simulator.py'
2023-03-29T13:37:45,661 adding 'quantum_gates/_simulation/__init__.py'
2023-03-29T13:37:45,664 adding 'quantum_gates/_simulation/backend.py'
2023-03-29T13:37:45,666 adding 'quantum_gates/_simulation/circuit.py'
2023-03-29T13:37:45,669 adding 'quantum_gates/_simulation/simulator.py'
2023-03-29T13:37:45,671 adding 'quantum_gates/_utility/__init__.py'
2023-03-29T13:37:45,673 adding 'quantum_gates/_utility/device_parameters.py'
2023-03-29T13:37:45,675 adding 'quantum_gates/_utility/quantum_algorithms.py'
2023-03-29T13:37:45,677 adding 'quantum_gates/_utility/simulations_utility.py'
2023-03-29T13:37:45,680 adding 'quantum_gates-1.0.4.dist-info/LICENSE'
2023-03-29T13:37:45,682 adding 'quantum_gates-1.0.4.dist-info/METADATA'
2023-03-29T13:37:45,683 adding 'quantum_gates-1.0.4.dist-info/WHEEL'
2023-03-29T13:37:45,684 adding 'quantum_gates-1.0.4.dist-info/top_level.txt'
2023-03-29T13:37:45,685 adding 'quantum_gates-1.0.4.dist-info/RECORD'
2023-03-29T13:37:45,688 removing build/bdist.linux-armv7l/wheel
2023-03-29T13:37:45,826 Building wheel for quantum-gates (pyproject.toml): finished with status 'done'
2023-03-29T13:37:45,834 Created wheel for quantum-gates: filename=quantum_gates-1.0.4-py3-none-any.whl size=50164 sha256=650dc092149f7e8dfeb0cb19cd0a0710749267f8767a05e39ae3b6ca54bbe013
2023-03-29T13:37:45,835 Stored in directory: /tmp/pip-ephem-wheel-cache-ndi4s9mq/wheels/ef/1d/be/a286f1b39a34f92897073a94dd656b6c3921ca2aae10e45478
2023-03-29T13:37:45,850 Successfully built quantum-gates
2023-03-29T13:37:45,856 Removed build tracker: '/tmp/pip-build-tracker-t7kk_0md'