diff --git a/examples/README.md b/examples/README.md index 6e22f8d..8a2373b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,15 +1,12 @@ ## Examples -**Running examples without building Rasqal:** Install [poetry](https://python-poetry.org/) and do `poetry install` in `rasqal/examples` or pip install the dependencies listed in the .toml file. +**Running examples without building Rasqal:** Install [poetry](https://python-poetry.org/) and do `poetry install` in `rasqal/examples` which will set up the venv for you. You can then run `run python examples.py` to just run the script or use your favourite IDE to debug. If you've already built Rasqal via its build script its venv will have all the dependencies necessary so re-use that. Note: all our examples are built using the old Q# compiler as Rasqal can exploit its fully interwoven classical LLVM instructions. -**Examples.py** holds runnable examples - - -runnable examples of many of Rasqals internal test projects showing how you set up and run things, including backend and argument definition. Shows the Q# that the QIR was generated from for each example, along with tertiary information. -Source for most examples can be found in `src/tests/qsharp` and can be modified from there and re-built. +**Examples.py** holds runnable examples of Rasqal including returned value, arguments, and custom backends. +Source for most examples can be found in `src/tests/qsharp`. **Sandbox.py** runs the sandbox Q# project in `qsharp/src`. This uses the new Q# compiler so instruction set is limited. \ No newline at end of file diff --git a/examples/examples.py b/examples/examples.py index e2328f6..1379afc 100644 --- a/examples/examples.py +++ b/examples/examples.py @@ -131,7 +131,6 @@ def basic_loops(): } """ print(f"Running basic-loops.") - # TODO: Check execution path, something slightly wrong here. runner = fetch_runner(4) results = runner.run_ll(read_qir_file("basic-loops.ll"), [5]) print(f"Returned {results}") @@ -201,9 +200,9 @@ def qaoa(): runner.run_ll(read_qir_file("qaoa.ll")) -base_profile_bell() -full_bell() -basic_branching() +# base_profile_bell() +# full_bell() +# basic_branching() basic_loops() -nested_calls() -qaoa() +# nested_calls() +# qaoa() diff --git a/examples/poetry.lock b/examples/poetry.lock new file mode 100644 index 0000000..4ceeb01 --- /dev/null +++ b/examples/poetry.lock @@ -0,0 +1,796 @@ +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. + +[[package]] +name = "dill" +version = "0.3.9" +description = "serialize all of Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a"}, + {file = "dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c"}, +] + +[package.extras] +graph = ["objgraph (>=1.7.2)"] +profile = ["gprof2dot (>=2022.7.29)"] + +[[package]] +name = "docplex" +version = "2.28.240" +description = "The IBM Decision Optimization CPLEX Modeling for Python" +optional = false +python-versions = "*" +files = [ + {file = "docplex-2.28.240.tar.gz", hash = "sha256:c0de407e33f8709bb4cd91b6efeb96fd88bfecbdce2caec51afb79253bde6ff5"}, +] + +[package.dependencies] +six = "*" + +[[package]] +name = "graphviz" +version = "0.20.3" +description = "Simple Python interface for Graphviz" +optional = false +python-versions = ">=3.8" +files = [ + {file = "graphviz-0.20.3-py3-none-any.whl", hash = "sha256:81f848f2904515d8cd359cc611faba817598d2feaac4027b266aa3eda7b3dde5"}, + {file = "graphviz-0.20.3.zip", hash = "sha256:09d6bc81e6a9fa392e7ba52135a9d49f1ed62526f96499325930e87ca1b5925d"}, +] + +[package.extras] +dev = ["flake8", "pep8-naming", "tox (>=3)", "twine", "wheel"] +docs = ["sphinx (>=5,<7)", "sphinx-autodoc-typehints", "sphinx-rtd-theme"] +test = ["coverage", "pytest (>=7,<8.1)", "pytest-cov", "pytest-mock (>=3)"] + +[[package]] +name = "jinja2" +version = "3.1.4" +description = "A very fast and expressive template engine." +optional = false +python-versions = ">=3.7" +files = [ + {file = "jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d"}, + {file = "jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"}, +] + +[package.dependencies] +MarkupSafe = ">=2.0" + +[package.extras] +i18n = ["Babel (>=2.7)"] + +[[package]] +name = "lark" +version = "1.2.2" +description = "a modern parsing library" +optional = false +python-versions = ">=3.8" +files = [ + {file = "lark-1.2.2-py3-none-any.whl", hash = "sha256:c2276486b02f0f1b90be155f2c8ba4a8e194d42775786db622faccd652d8e80c"}, + {file = "lark-1.2.2.tar.gz", hash = "sha256:ca807d0162cd16cef15a8feecb862d7319e7a09bdb13aef927968e45040fed80"}, +] + +[package.extras] +atomic-cache = ["atomicwrites"] +interegular = ["interegular (>=0.3.1,<0.4.0)"] +nearley = ["js2py"] +regex = ["regex"] + +[[package]] +name = "markupsafe" +version = "2.1.5" +description = "Safely add untrusted strings to HTML/XML markup." +optional = false +python-versions = ">=3.7" +files = [ + {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-win32.whl", hash = "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl", hash = "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-win32.whl", hash = "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-win_amd64.whl", hash = "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-win32.whl", hash = "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl", hash = "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-win32.whl", hash = "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-win_amd64.whl", hash = "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-win32.whl", hash = "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-win_amd64.whl", hash = "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-win32.whl", hash = "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-win_amd64.whl", hash = "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5"}, + {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, +] + +[[package]] +name = "mpmath" +version = "1.3.0" +description = "Python library for arbitrary-precision floating-point arithmetic" +optional = false +python-versions = "*" +files = [ + {file = "mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c"}, + {file = "mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f"}, +] + +[package.extras] +develop = ["codecov", "pycodestyle", "pytest (>=4.6)", "pytest-cov", "wheel"] +docs = ["sphinx"] +gmpy = ["gmpy2 (>=2.1.0a4)"] +tests = ["pytest (>=4.6)"] + +[[package]] +name = "networkx" +version = "3.3" +description = "Python package for creating and manipulating graphs and networks" +optional = false +python-versions = ">=3.10" +files = [ + {file = "networkx-3.3-py3-none-any.whl", hash = "sha256:28575580c6ebdaf4505b22c6256a2b9de86b316dc63ba9e93abde3d78dfdbcf2"}, + {file = "networkx-3.3.tar.gz", hash = "sha256:0c127d8b2f4865f59ae9cb8aafcd60b5c70f3241ebd66f7defad7c4ab90126c9"}, +] + +[package.extras] +default = ["matplotlib (>=3.6)", "numpy (>=1.23)", "pandas (>=1.4)", "scipy (>=1.9,!=1.11.0,!=1.11.1)"] +developer = ["changelist (==0.5)", "mypy (>=1.1)", "pre-commit (>=3.2)", "rtoml"] +doc = ["myst-nb (>=1.0)", "numpydoc (>=1.7)", "pillow (>=9.4)", "pydata-sphinx-theme (>=0.14)", "sphinx (>=7)", "sphinx-gallery (>=0.14)", "texext (>=0.6.7)"] +extra = ["lxml (>=4.6)", "pydot (>=2.0)", "pygraphviz (>=1.12)", "sympy (>=1.10)"] +test = ["pytest (>=7.2)", "pytest-cov (>=4.0)"] + +[[package]] +name = "numpy" +version = "1.26.4" +description = "Fundamental package for array computing in Python" +optional = false +python-versions = ">=3.9" +files = [ + {file = "numpy-1.26.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9ff0f4f29c51e2803569d7a51c2304de5554655a60c5d776e35b4a41413830d0"}, + {file = "numpy-1.26.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2e4ee3380d6de9c9ec04745830fd9e2eccb3e6cf790d39d7b98ffd19b0dd754a"}, + {file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d209d8969599b27ad20994c8e41936ee0964e6da07478d6c35016bc386b66ad4"}, + {file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f"}, + {file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:62b8e4b1e28009ef2846b4c7852046736bab361f7aeadeb6a5b89ebec3c7055a"}, + {file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a4abb4f9001ad2858e7ac189089c42178fcce737e4169dc61321660f1a96c7d2"}, + {file = "numpy-1.26.4-cp310-cp310-win32.whl", hash = "sha256:bfe25acf8b437eb2a8b2d49d443800a5f18508cd811fea3181723922a8a82b07"}, + {file = "numpy-1.26.4-cp310-cp310-win_amd64.whl", hash = "sha256:b97fe8060236edf3662adfc2c633f56a08ae30560c56310562cb4f95500022d5"}, + {file = "numpy-1.26.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c66707fabe114439db9068ee468c26bbdf909cac0fb58686a42a24de1760c71"}, + {file = "numpy-1.26.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef"}, + {file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ab55401287bfec946ced39700c053796e7cc0e3acbef09993a9ad2adba6ca6e"}, + {file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:666dbfb6ec68962c033a450943ded891bed2d54e6755e35e5835d63f4f6931d5"}, + {file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:96ff0b2ad353d8f990b63294c8986f1ec3cb19d749234014f4e7eb0112ceba5a"}, + {file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:60dedbb91afcbfdc9bc0b1f3f402804070deed7392c23eb7a7f07fa857868e8a"}, + {file = "numpy-1.26.4-cp311-cp311-win32.whl", hash = "sha256:1af303d6b2210eb850fcf03064d364652b7120803a0b872f5211f5234b399f20"}, + {file = "numpy-1.26.4-cp311-cp311-win_amd64.whl", hash = "sha256:cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2"}, + {file = "numpy-1.26.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218"}, + {file = "numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:03a8c78d01d9781b28a6989f6fa1bb2c4f2d51201cf99d3dd875df6fbd96b23b"}, + {file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9fad7dcb1aac3c7f0584a5a8133e3a43eeb2fe127f47e3632d43d677c66c102b"}, + {file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:675d61ffbfa78604709862923189bad94014bef562cc35cf61d3a07bba02a7ed"}, + {file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ab47dbe5cc8210f55aa58e4805fe224dac469cde56b9f731a4c098b91917159a"}, + {file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:1dda2e7b4ec9dd512f84935c5f126c8bd8b9f2fc001e9f54af255e8c5f16b0e0"}, + {file = "numpy-1.26.4-cp312-cp312-win32.whl", hash = "sha256:50193e430acfc1346175fcbdaa28ffec49947a06918b7b92130744e81e640110"}, + {file = "numpy-1.26.4-cp312-cp312-win_amd64.whl", hash = "sha256:08beddf13648eb95f8d867350f6a018a4be2e5ad54c8d8caed89ebca558b2818"}, + {file = "numpy-1.26.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7349ab0fa0c429c82442a27a9673fc802ffdb7c7775fad780226cb234965e53c"}, + {file = "numpy-1.26.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:52b8b60467cd7dd1e9ed082188b4e6bb35aa5cdd01777621a1658910745b90be"}, + {file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d5241e0a80d808d70546c697135da2c613f30e28251ff8307eb72ba696945764"}, + {file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3"}, + {file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:679b0076f67ecc0138fd2ede3a8fd196dddc2ad3254069bcb9faf9a79b1cebcd"}, + {file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:47711010ad8555514b434df65f7d7b076bb8261df1ca9bb78f53d3b2db02e95c"}, + {file = "numpy-1.26.4-cp39-cp39-win32.whl", hash = "sha256:a354325ee03388678242a4d7ebcd08b5c727033fcff3b2f536aea978e15ee9e6"}, + {file = "numpy-1.26.4-cp39-cp39-win_amd64.whl", hash = "sha256:3373d5d70a5fe74a2c1bb6d2cfd9609ecf686d47a2d7b1d37a8f3b6bf6003aea"}, + {file = "numpy-1.26.4-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:afedb719a9dcfc7eaf2287b839d8198e06dcd4cb5d276a3df279231138e83d30"}, + {file = "numpy-1.26.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95a7476c59002f2f6c590b9b7b998306fba6a5aa646b1e22ddfeaf8f78c3a29c"}, + {file = "numpy-1.26.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7e50d0a0cc3189f9cb0aeb3a6a6af18c16f59f004b866cd2be1c14b36134a4a0"}, + {file = "numpy-1.26.4.tar.gz", hash = "sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010"}, +] + +[[package]] +name = "pbr" +version = "6.1.0" +description = "Python Build Reasonableness" +optional = false +python-versions = ">=2.6" +files = [ + {file = "pbr-6.1.0-py2.py3-none-any.whl", hash = "sha256:a776ae228892d8013649c0aeccbb3d5f99ee15e005a4cbb7e61d55a067b28a2a"}, + {file = "pbr-6.1.0.tar.gz", hash = "sha256:788183e382e3d1d7707db08978239965e8b9e4e5ed42669bf4758186734d5f24"}, +] + +[[package]] +name = "ply" +version = "3.11" +description = "Python Lex & Yacc" +optional = false +python-versions = "*" +files = [ + {file = "ply-3.11-py2.py3-none-any.whl", hash = "sha256:096f9b8350b65ebd2fd1346b12452efe5b9607f7482813ffca50c22722a807ce"}, + {file = "ply-3.11.tar.gz", hash = "sha256:00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3"}, +] + +[[package]] +name = "psutil" +version = "6.0.0" +description = "Cross-platform lib for process and system monitoring in Python." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +files = [ + {file = "psutil-6.0.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a021da3e881cd935e64a3d0a20983bda0bb4cf80e4f74fa9bfcb1bc5785360c6"}, + {file = "psutil-6.0.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:1287c2b95f1c0a364d23bc6f2ea2365a8d4d9b726a3be7294296ff7ba97c17f0"}, + {file = "psutil-6.0.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:a9a3dbfb4de4f18174528d87cc352d1f788b7496991cca33c6996f40c9e3c92c"}, + {file = "psutil-6.0.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:6ec7588fb3ddaec7344a825afe298db83fe01bfaaab39155fa84cf1c0d6b13c3"}, + {file = "psutil-6.0.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:1e7c870afcb7d91fdea2b37c24aeb08f98b6d67257a5cb0a8bc3ac68d0f1a68c"}, + {file = "psutil-6.0.0-cp27-none-win32.whl", hash = "sha256:02b69001f44cc73c1c5279d02b30a817e339ceb258ad75997325e0e6169d8b35"}, + {file = "psutil-6.0.0-cp27-none-win_amd64.whl", hash = "sha256:21f1fb635deccd510f69f485b87433460a603919b45e2a324ad65b0cc74f8fb1"}, + {file = "psutil-6.0.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:c588a7e9b1173b6e866756dde596fd4cad94f9399daf99ad8c3258b3cb2b47a0"}, + {file = "psutil-6.0.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ed2440ada7ef7d0d608f20ad89a04ec47d2d3ab7190896cd62ca5fc4fe08bf0"}, + {file = "psutil-6.0.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fd9a97c8e94059b0ef54a7d4baf13b405011176c3b6ff257c247cae0d560ecd"}, + {file = "psutil-6.0.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e2e8d0054fc88153ca0544f5c4d554d42e33df2e009c4ff42284ac9ebdef4132"}, + {file = "psutil-6.0.0-cp36-cp36m-win32.whl", hash = "sha256:fc8c9510cde0146432bbdb433322861ee8c3efbf8589865c8bf8d21cb30c4d14"}, + {file = "psutil-6.0.0-cp36-cp36m-win_amd64.whl", hash = "sha256:34859b8d8f423b86e4385ff3665d3f4d94be3cdf48221fbe476e883514fdb71c"}, + {file = "psutil-6.0.0-cp37-abi3-win32.whl", hash = "sha256:a495580d6bae27291324fe60cea0b5a7c23fa36a7cd35035a16d93bdcf076b9d"}, + {file = "psutil-6.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:33ea5e1c975250a720b3a6609c490db40dae5d83a4eb315170c4fe0d8b1f34b3"}, + {file = "psutil-6.0.0-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:ffe7fc9b6b36beadc8c322f84e1caff51e8703b88eee1da46d1e3a6ae11b4fd0"}, + {file = "psutil-6.0.0.tar.gz", hash = "sha256:8faae4f310b6d969fa26ca0545338b21f73c6b15db7c4a8d934a5482faa818f2"}, +] + +[package.extras] +test = ["enum34", "ipaddress", "mock", "pywin32", "wmi"] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "pytket" +version = "1.32.0" +description = "Quantum computing toolkit and interface to the TKET compiler" +optional = false +python-versions = ">=3.10" +files = [ + {file = "pytket-1.32.0-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:3e15f0569c955fecf220b04ab882be1db43c8e29dd214681faf65e76c8f7c7ff"}, + {file = "pytket-1.32.0-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:8eecb0987e4abb4c48c8fbb708dba38ddab88e9103b9400194aefdb2efe91579"}, + {file = "pytket-1.32.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0cfbdb4abf96900962fdedab4d6299f7908aa70c50b02be59a710aa569377bf7"}, + {file = "pytket-1.32.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9f0a6c3d539eafd6c56ad313a522d7601dae6690d0188b36d6ad9c7a6ddd2e14"}, + {file = "pytket-1.32.0-cp310-cp310-win_amd64.whl", hash = "sha256:b02a0c74f2c7dad60a4ddbbf9f75ece3331438e59a1df6c8d1b557084f75f757"}, + {file = "pytket-1.32.0-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:a0d57132b8f1e47c4b3229e23c0494ad6319ced3eb6ae0b868c8b7906c7402ad"}, + {file = "pytket-1.32.0-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:fc007c6df26e3654190f7e680bccad492672d940ff570ae8c672ac2f25498033"}, + {file = "pytket-1.32.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1a9f3a9e6409603b3df634889e7fbd100594eebce5a168e7ae18aa5a1298e55b"}, + {file = "pytket-1.32.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fad351335df546d53b19fbfa9b439b6206a88d0ea4a780e09a9fc7efa7a6e5d7"}, + {file = "pytket-1.32.0-cp311-cp311-win_amd64.whl", hash = "sha256:1050c64eea69b381f24a1624db52dac91d09080b0ae64f37ee4fbe8467264a27"}, + {file = "pytket-1.32.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:f18e623fca0bbbe7235ab03f93122c7d4143e270ece4c4e98d43407c23d28dab"}, + {file = "pytket-1.32.0-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:2f7b4efb66da70c4ba07bca3fab0dc1e864dc9d2f6b72997f352e32bc6c16423"}, + {file = "pytket-1.32.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:479798006542809686b91e2bf148317c2b2a0f2994c5710465deb0cf958fe505"}, + {file = "pytket-1.32.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:51c67d92e16a4f49f0a5ee3b3b4688086b83ef64c201341092cfcb7b52ef87d5"}, + {file = "pytket-1.32.0-cp312-cp312-win_amd64.whl", hash = "sha256:a4654cd9de73292f6733c51cf8338088d56ee09f0cb28a2b1e270c909afcd3bf"}, +] + +[package.dependencies] +graphviz = ">=0.20.3" +jinja2 = ">=3.1.4" +lark = ">=1.1.9" +networkx = ">=2.8.8" +numpy = ">=1.26.4" +qwasm = ">=1.0.1" +scipy = ">=1.13.1" +sympy = ">=1.12.1" +typing-extensions = ">=4.12.2" + +[package.extras] +zx = ["autoray (>=0.6.12)", "numba (>=0.60.0)", "quimb (>=1.8.2)"] + +[[package]] +name = "qiskit" +version = "0.45.3" +description = "Software for developing quantum computing programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "qiskit-0.45.3-py3-none-any.whl", hash = "sha256:37ad2b627ca27cc1f8db600e0ca36b4a610a67f68b7fd2a4156477cc643b597d"}, + {file = "qiskit-0.45.3.tar.gz", hash = "sha256:5ce758114f1025fd7e289eecdef58704faefc57c3b220793b1b49b75db7980ad"}, +] + +[package.dependencies] +qiskit-terra = "0.45.3" + +[package.extras] +all = ["qiskit-terra[all]"] +crosstalk-pass = ["qiskit-terra[crosstalk-pass]"] +csp-layout-pass = ["qiskit-terra[csp-layout-pass]"] +qasm3-import = ["qiskit-terra[qasm3-import]"] +visualization = ["qiskit-terra[visualization]"] + +[[package]] +name = "qiskit-aer" +version = "0.14.2" +description = "Aer - High performance simulators for Qiskit" +optional = false +python-versions = ">=3.7" +files = [ + {file = "qiskit-aer-0.14.2.tar.gz", hash = "sha256:9918916dc25071f4e2ddbe5f5c6114de18738cdb05bc12dc97823a556b3df9c2"}, + {file = "qiskit_aer-0.14.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b9385add7fbc0ae790583657c0dc0b564ec95d3285c22fa7d7332a8452f31c5"}, + {file = "qiskit_aer-0.14.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7e63523705d27d527d048da9b70bdf398faf728867aa728099f753ea2bea13cd"}, + {file = "qiskit_aer-0.14.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c51e85ce3a55d6527f74e1133b045ef7ca23bb11519639ca321249a89fe755b6"}, + {file = "qiskit_aer-0.14.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3691dd8e3afa749822474de355fe813559fb78ab0c7c5ac08f060b8f82bfaeb9"}, + {file = "qiskit_aer-0.14.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3dd095832c12b6defbadb8123a5d76302126908348c00441e4b351720cef80e1"}, + {file = "qiskit_aer-0.14.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8b4490ce94d740d6f833776be37b31bf7bb94dc38e8789ab2c27421449cabad2"}, + {file = "qiskit_aer-0.14.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f5f42e6f016bb027079fef73597a3b35b76e2ac398138d83651833e93dc964d"}, + {file = "qiskit_aer-0.14.2-cp310-cp310-win32.whl", hash = "sha256:0bfa5c289f973f081a0874bf79a1087c9d70a052c16f8bbc8ab2ff3e796859c4"}, + {file = "qiskit_aer-0.14.2-cp310-cp310-win_amd64.whl", hash = "sha256:9398730784ded8cdd046596683de7e5fd540f5173c9a3a4e4ccf72d79e47ff58"}, + {file = "qiskit_aer-0.14.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b3ec6c470b0ba493703ebc514c1eff2c1cbc204b0795de2f5f2a3bc497edd423"}, + {file = "qiskit_aer-0.14.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8dbb6a0ec4ae193cb3649f4400178592ea4ad9714b070bf86222d370bfcb9e15"}, + {file = "qiskit_aer-0.14.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c11a3fd727d3075fb4d4ad00cf6670fa944d2df7f4b1b5b109f45bd9156d603"}, + {file = "qiskit_aer-0.14.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:246175da975a80e3999c8b1a375dc7248f59b165b8fcabc3be4dde8d07224ffe"}, + {file = "qiskit_aer-0.14.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3f20f5d9cba0e71e5d34fd432e59dae3617e355ffdc0d77e41eca2459005896e"}, + {file = "qiskit_aer-0.14.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7d1526359547c006a7c9ce35441c2a2207ceeb78fc05ac29866d700cf4da175"}, + {file = "qiskit_aer-0.14.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05e3bd6a6bc68a8705f3f37e0597c5de91b2ce051b72743028f4a306c3483bd0"}, + {file = "qiskit_aer-0.14.2-cp311-cp311-win32.whl", hash = "sha256:7f2320ea40f0118059acb2345aed03039a453693adc47f8adec079e1d163e3c6"}, + {file = "qiskit_aer-0.14.2-cp311-cp311-win_amd64.whl", hash = "sha256:7b5e91625563a16e2e237d1e0b79996937045c15cd086d2ea265e7b952bea9de"}, + {file = "qiskit_aer-0.14.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:215bc8ad213b8541cbe85b423bfd4ca7464294678a76e65820329f3b92a33478"}, + {file = "qiskit_aer-0.14.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4302a11317a46490b06c91d8b70fd1d5895692904a0624c7974d669454ef0876"}, + {file = "qiskit_aer-0.14.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e26e59e021376445a0f1673f9da816273d3987fd2270634bcfa6e3c9281b127"}, + {file = "qiskit_aer-0.14.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:57d3df63142b17e753f6fbe8ab01038ae45057ba6d897e53f94e78c80960e4f2"}, + {file = "qiskit_aer-0.14.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7833ce242ded53bd72fffec2745c17832c0807b4455fd66ed8b0e71b4e07aa67"}, + {file = "qiskit_aer-0.14.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e734d3afa26919a511085d474b6cfc1fcc44e4c692227e65cd8e09be521a0881"}, + {file = "qiskit_aer-0.14.2-cp312-cp312-win32.whl", hash = "sha256:329e3b8c8ccf6cdfb251ef6cc99249ca424a4193a1b2c6df54d7b66bcdac9566"}, + {file = "qiskit_aer-0.14.2-cp312-cp312-win_amd64.whl", hash = "sha256:4085fdc0a805eddbda12fbcdfde0c69e724c56b50168655778388a95b73c9c12"}, + {file = "qiskit_aer-0.14.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cddf30ee84eb5923c7a9d68074f2ce388790cab10346ad76876d91c6d0a4873c"}, + {file = "qiskit_aer-0.14.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:451699ca80b3fef59a7bebac245b3988740dd6095c1fa2959bc474b1fac51187"}, + {file = "qiskit_aer-0.14.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d1ba57424a4649288c3c63685b3a2deaf9447e55e4f04d54af623ef981a4853f"}, + {file = "qiskit_aer-0.14.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:777a34b578375b670d706788559d04c50fa4637b8cb99753dc34be96768b318d"}, + {file = "qiskit_aer-0.14.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:16ef5ea5fb05c8d66a6911934e3640b0d56ad4842bca41ebf3328387d079c4bd"}, + {file = "qiskit_aer-0.14.2-cp38-cp38-win32.whl", hash = "sha256:c412d866ef50d2813fbefcc093bcb507fcdc1d97d652ea9407e86d13fb25e5df"}, + {file = "qiskit_aer-0.14.2-cp38-cp38-win_amd64.whl", hash = "sha256:7c3cca5a15bd11cc0ff3562a7e39cc99c9069159c609c9633766e0be4ad7789c"}, + {file = "qiskit_aer-0.14.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0aff9888269095fe1fdb4b8a870cf66a9a63c00eaf0296e955e122d8b61e2f3f"}, + {file = "qiskit_aer-0.14.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:05c826eba94952f0c43e52baefea0801e4eccf9a4886aca484fcfa1381dd5bf3"}, + {file = "qiskit_aer-0.14.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:05d19db49fdecd4f71f3a35525c9fcdc32c80e90e502f872536af1e0ffa1f618"}, + {file = "qiskit_aer-0.14.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:60fb8c071ffd558342cb8e66ad960f0d2cc73944c31b024a0e0798aab0b7a8d5"}, + {file = "qiskit_aer-0.14.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73a48105df9e1df9284b64ba983cdb6b23eae41090db8c80ff956e78ad91bdac"}, + {file = "qiskit_aer-0.14.2-cp39-cp39-win32.whl", hash = "sha256:8d2fffd42974ed0d2b1c89323c5405aa6cad71316c8e3994aad341e9fb3b3c92"}, + {file = "qiskit_aer-0.14.2-cp39-cp39-win_amd64.whl", hash = "sha256:30ffebbd00860691e7e8802b9aaef2640e691680c3ac2a5b9a454e3b9d336eee"}, +] + +[package.dependencies] +numpy = ">=1.16.3" +psutil = ">=5" +qiskit = ">=0.45.2" +scipy = ">=1.0" + +[package.extras] +dask = ["dask", "distributed"] + +[[package]] +name = "qiskit-algorithms" +version = "0.3.0" +description = "Qiskit Algorithms: A library of quantum computing algorithms" +optional = false +python-versions = ">=3.8" +files = [ + {file = "qiskit-algorithms-0.3.0.tar.gz", hash = "sha256:02eedcbb079c6da371421a50cb296ff1dc6ce4a1c478ec521ff6e62c9bc53e10"}, + {file = "qiskit_algorithms-0.3.0-py3-none-any.whl", hash = "sha256:8ae1aa8aafc32864890a31c06d19f100a79df6412350f1f4b8c124cd17b3f731"}, +] + +[package.dependencies] +numpy = ">=1.17" +qiskit = ">=0.44" +scipy = ">=1.4" + +[[package]] +name = "qiskit-ignis" +version = "0.7.1" +description = "Qiskit tools for quantum information science" +optional = false +python-versions = ">=3.6" +files = [ + {file = "qiskit-ignis-0.7.1.tar.gz", hash = "sha256:71efb17933717c0b8161a291ebd4f8d4fe8d7dfd1fdc66fa23a0b6d14fd10cf3"}, + {file = "qiskit_ignis-0.7.1-py3-none-any.whl", hash = "sha256:b9d57f1241194361db492c37a63860fe76bfdcc0aa30759190e3166ed8ff8ef1"}, +] + +[package.dependencies] +numpy = ">=1.13" +qiskit-terra = ">=0.15.1" +retworkx = ">=0.8.0" +scipy = ">=0.19,<0.19.1 || >0.19.1" +setuptools = ">=40.1.0" + +[package.extras] +cvx = ["cvxpy (>=1.0.15)"] +iq = ["scikit-learn (>=0.17)"] +jit = ["numba"] +visualization = ["matplotlib (>=2.1)"] + +[[package]] +name = "qiskit-optimization" +version = "0.6.1" +description = "Qiskit Optimization: A library for optimization applications using quantum computing" +optional = false +python-versions = ">=3.8" +files = [ + {file = "qiskit-optimization-0.6.1.tar.gz", hash = "sha256:0ad8c2bc83fe80657c788b5f282ce4055d0ec005c4876789e5069499ee3c00c0"}, + {file = "qiskit_optimization-0.6.1-py3-none-any.whl", hash = "sha256:3f09f31289dfef66bbbb03b782a94d88a4ba5681c728b4b8e96884de5fc83879"}, +] + +[package.dependencies] +docplex = ">=2.21.207,<2.24.231 || >2.24.231" +networkx = ">=2.6.3" +numpy = ">=1.17" +qiskit = ">=0.44" +qiskit-algorithms = ">=0.2.0" +scipy = ">=1.9.0" +setuptools = ">=40.1.0" + +[package.extras] +cplex = ["cplex"] +cvx = ["cvxpy"] +gurobi = ["gurobipy"] +matplotlib = ["matplotlib"] + +[[package]] +name = "qiskit-terra" +version = "0.45.3" +description = "Software for developing quantum computing programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "qiskit-terra-0.45.3.tar.gz", hash = "sha256:fa3c5d9f54abd5f38fa79c1b1490ff984358377a2d6ed3c17ad2f06fd94243f8"}, + {file = "qiskit_terra-0.45.3-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:8ed12a6a5876cf180576575422d4e21908d647af8ed29d8a188da00e1ee5fe7e"}, + {file = "qiskit_terra-0.45.3-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:8b3c8a4c09549fb26f91b513170df5f5ba931b2e34cf5f9b0a9ba3a419c503ff"}, + {file = "qiskit_terra-0.45.3-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:18bd72613aa61f1e1a5879f0b4eb4f13cf7e06471a4e1004e156ada65b5004aa"}, + {file = "qiskit_terra-0.45.3-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ff897082aaf9fbd0ad323ae3bc0e06f479e87e485954ee65952b095c378591f7"}, + {file = "qiskit_terra-0.45.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b4ba1245f103eebcbb9e37955ee67798f7a081c9417132727e34495f671583be"}, + {file = "qiskit_terra-0.45.3-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4a323fd342afe0d14ba4ec23db2279fa23c93b4570a4bf9f042d5ca792a722b5"}, + {file = "qiskit_terra-0.45.3-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aa817ec00756fa45cfac82945db43e0882db18bb678f5282481aca13713e3bbd"}, + {file = "qiskit_terra-0.45.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3fea3f2deda4a4561f5c20ff914824b09825235e5972508e47bb974f2adf7e14"}, + {file = "qiskit_terra-0.45.3-cp38-abi3-win32.whl", hash = "sha256:4a98f7f614978020512eae946e229769fc038707a98920700ff2dde233b3575f"}, + {file = "qiskit_terra-0.45.3-cp38-abi3-win_amd64.whl", hash = "sha256:2a127bb6773ced4c0a7d491d5a1dcbe57cc3328b5923f0ef41fa65b904b138b7"}, +] + +[package.dependencies] +dill = ">=0.3" +numpy = ">=1.17,<2" +ply = ">=3.10" +psutil = ">=5" +python-dateutil = ">=2.8.0" +rustworkx = ">=0.13.0" +scipy = ">=1.5" +stevedore = ">=3.0.0" +symengine = {version = ">=0.9,<0.10.0 || >0.10.0", markers = "platform_machine == \"x86_64\" or platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"amd64\" or platform_machine == \"arm64\""} +sympy = ">=1.3" +typing-extensions = {version = "*", markers = "python_version < \"3.11\""} + +[package.extras] +all = ["ipywidgets (>=7.3.0)", "matplotlib (>=3.3)", "pillow (>=4.2.1)", "pydot", "pygments (>=2.4)", "pylatexenc (>=1.4)", "python-constraint (>=1.4)", "qiskit-qasm3-import (>=0.1.0)", "seaborn (>=0.9.0)", "z3-solver (>=4.7)"] +crosstalk-pass = ["z3-solver (>=4.7)"] +csp-layout-pass = ["python-constraint (>=1.4)"] +qasm3-import = ["qiskit-qasm3-import (>=0.1.0)"] +visualization = ["ipywidgets (>=7.3.0)", "matplotlib (>=3.3)", "pillow (>=4.2.1)", "pydot", "pygments (>=2.4)", "pylatexenc (>=1.4)", "seaborn (>=0.9.0)"] + +[[package]] +name = "qsharp" +version = "1.9.0" +description = "Q# Python Bindings" +optional = false +python-versions = ">=3.8" +files = [ + {file = "qsharp-1.9.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:fa9f4b7dc5aa3ceca64387c411a7d9d80e8cd72f6e269d356374364e8b6ad6a2"}, + {file = "qsharp-1.9.0-cp38-abi3-manylinux_2_31_aarch64.whl", hash = "sha256:c5f77340c52a70d1a0f712086ce3fa7f88d089253cf72c3ddddd3aed9680e467"}, + {file = "qsharp-1.9.0-cp38-abi3-manylinux_2_31_x86_64.whl", hash = "sha256:49bcb2f14a44da010db7f36b92e85113f98c3d7669f3420af6236e8bb4c15b3b"}, + {file = "qsharp-1.9.0-cp38-abi3-win_amd64.whl", hash = "sha256:9dfd2c462a587665a8f760e461b644149fdebf30f7bbe2bd3a39f2dc3cbf6721"}, + {file = "qsharp-1.9.0-cp38-abi3-win_arm64.whl", hash = "sha256:e6b76ebcc44e14eedf4243ff6e8daacbd6b5e47211628a5a581459bd62ec33dc"}, +] + +[package.extras] +jupyterlab = ["qsharp-jupyterlab"] +qiskit = ["qiskit (>=1.2.2,<2.0.0)"] +widgets = ["qsharp-widgets"] + +[[package]] +name = "qwasm" +version = "1.0.1" +description = "WebAssembly decoder & disassembler" +optional = false +python-versions = "*" +files = [ + {file = "qwasm-1.0.1-py3-none-any.whl", hash = "sha256:c4c82a3f962d29314634868e06375f0cb4676c3d5266fbe137f6cd67321b0ef1"}, + {file = "qwasm-1.0.1.tar.gz", hash = "sha256:01f5dfe27159b7fdd9d02cd299833225d528fa383d1278268e5e1526357950fb"}, +] + +[package.dependencies] +setuptools = "*" + +[[package]] +name = "rasqal" +version = "0.1.6" +description = "A hybrid quantum-classical analysis/solving runtime." +optional = false +python-versions = ">=3.10" +files = [ + {file = "rasqal-0.1.6-cp310-cp310-manylinux_2_31_x86_64.whl", hash = "sha256:879a1956c38b922dae92ea2709522c97662aad8d05b93c70a531696752de5061"}, + {file = "rasqal-0.1.6-cp310-none-win_amd64.whl", hash = "sha256:8d4c92ede1f062cf729913481d10e6fdab2f0c395aeaf375415db0467edffe35"}, + {file = "rasqal-0.1.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0b5625a12b357f8542eb32bbe79d5dc4ef8f10455f5bd2aafb276a8a953790ff"}, +] + +[package.dependencies] +pytket = ">=1.31.0" +qiskit = "==0.45.*" +qiskit-aer = ">=0.13.0" +qiskit-ignis = ">=0.7.0" +qiskit-optimization = ">=0.4.0" + +[[package]] +name = "retworkx" +version = "0.15.1" +description = "A python graph library implemented in Rust" +optional = false +python-versions = ">=3.8" +files = [ + {file = "retworkx-0.15.1-py3-none-any.whl", hash = "sha256:1e9f106b915215d57eb209076df3a07a6e34a258c98efe48bdae69bbd0e07282"}, +] + +[package.dependencies] +numpy = ">=1.16.0,<3" +rustworkx = "0.15.1" + +[package.extras] +all = ["matplotlib (>=3.0)", "pillow (>=5.4)"] +graphviz = ["pillow (>=5.4)"] +mpl = ["matplotlib (>=3.0)"] + +[[package]] +name = "rustworkx" +version = "0.15.1" +description = "A python graph library implemented in Rust" +optional = false +python-versions = ">=3.8" +files = [ + {file = "rustworkx-0.15.1-cp38-abi3-macosx_10_12_x86_64.whl", hash = "sha256:6cd4496d3298cd3205c03545e48cc37d21e0455d57752af801d3fb250452d590"}, + {file = "rustworkx-0.15.1-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:cb518f5649e62d753e29ca1e57290c8f58adbebcd154dc3159f4a36ebfa1e2b7"}, + {file = "rustworkx-0.15.1-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac68ae2515ece22ba3ef56f3d16ad6bf707955f650d623190b2e7d706c6dc92"}, + {file = "rustworkx-0.15.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8b903edec1d803704b499959f9d6f6119cdda63b9b64194a4b4307e506b112f0"}, + {file = "rustworkx-0.15.1-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a2c97a56ff8a0f6c273a83e26e627c72207442b4252aa550acad0bff42caac40"}, + {file = "rustworkx-0.15.1-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:241c502532e348ba89200823326dba30de4df4b886cb2fd5a140b359ff124bb3"}, + {file = "rustworkx-0.15.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e5f4156f46fa03177c9b0580450eab87786063495d48b457762a5bdd20c55e2"}, + {file = "rustworkx-0.15.1-cp38-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:7834ab34748db6214ec3b3836b996b23882dc83184234e6d346d6bb85fd58ae5"}, + {file = "rustworkx-0.15.1-cp38-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ce53f173fed16e1d51d9df9f23475a16c981b03bf1a412d991c75a70db6b1dc1"}, + {file = "rustworkx-0.15.1-cp38-abi3-win32.whl", hash = "sha256:308bc76a01bcae9af4602d8b9ed58021df37dd0bb5a7b2e3831ae53c5e234ff0"}, + {file = "rustworkx-0.15.1-cp38-abi3-win_amd64.whl", hash = "sha256:89077382633e918d2392772f53b9d6d30eee51eb536f8d38ee195c212b2f0427"}, + {file = "rustworkx-0.15.1.tar.gz", hash = "sha256:0e0cc86599f979285b2ab9c357276f3272f3fcb3b2df5651a6bf9704c570d4c1"}, +] + +[package.dependencies] +numpy = ">=1.16.0,<3" + +[package.extras] +all = ["matplotlib (>=3.0)", "pillow (>=5.4)"] +graphviz = ["pillow (>=5.4)"] +mpl = ["matplotlib (>=3.0)"] + +[[package]] +name = "scipy" +version = "1.14.1" +description = "Fundamental algorithms for scientific computing in Python" +optional = false +python-versions = ">=3.10" +files = [ + {file = "scipy-1.14.1-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:b28d2ca4add7ac16ae8bb6632a3c86e4b9e4d52d3e34267f6e1b0c1f8d87e389"}, + {file = "scipy-1.14.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:d0d2821003174de06b69e58cef2316a6622b60ee613121199cb2852a873f8cf3"}, + {file = "scipy-1.14.1-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:8bddf15838ba768bb5f5083c1ea012d64c9a444e16192762bd858f1e126196d0"}, + {file = "scipy-1.14.1-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:97c5dddd5932bd2a1a31c927ba5e1463a53b87ca96b5c9bdf5dfd6096e27efc3"}, + {file = "scipy-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ff0a7e01e422c15739ecd64432743cf7aae2b03f3084288f399affcefe5222d"}, + {file = "scipy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e32dced201274bf96899e6491d9ba3e9a5f6b336708656466ad0522d8528f69"}, + {file = "scipy-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:8426251ad1e4ad903a4514712d2fa8fdd5382c978010d1c6f5f37ef286a713ad"}, + {file = "scipy-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:a49f6ed96f83966f576b33a44257d869756df6cf1ef4934f59dd58b25e0327e5"}, + {file = "scipy-1.14.1-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:2da0469a4ef0ecd3693761acbdc20f2fdeafb69e6819cc081308cc978153c675"}, + {file = "scipy-1.14.1-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:c0ee987efa6737242745f347835da2cc5bb9f1b42996a4d97d5c7ff7928cb6f2"}, + {file = "scipy-1.14.1-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:3a1b111fac6baec1c1d92f27e76511c9e7218f1695d61b59e05e0fe04dc59617"}, + {file = "scipy-1.14.1-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:8475230e55549ab3f207bff11ebfc91c805dc3463ef62eda3ccf593254524ce8"}, + {file = "scipy-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:278266012eb69f4a720827bdd2dc54b2271c97d84255b2faaa8f161a158c3b37"}, + {file = "scipy-1.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fef8c87f8abfb884dac04e97824b61299880c43f4ce675dd2cbeadd3c9b466d2"}, + {file = "scipy-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b05d43735bb2f07d689f56f7b474788a13ed8adc484a85aa65c0fd931cf9ccd2"}, + {file = "scipy-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:716e389b694c4bb564b4fc0c51bc84d381735e0d39d3f26ec1af2556ec6aad94"}, + {file = "scipy-1.14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:631f07b3734d34aced009aaf6fedfd0eb3498a97e581c3b1e5f14a04164a456d"}, + {file = "scipy-1.14.1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:af29a935803cc707ab2ed7791c44288a682f9c8107bc00f0eccc4f92c08d6e07"}, + {file = "scipy-1.14.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:2843f2d527d9eebec9a43e6b406fb7266f3af25a751aa91d62ff416f54170bc5"}, + {file = "scipy-1.14.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:eb58ca0abd96911932f688528977858681a59d61a7ce908ffd355957f7025cfc"}, + {file = "scipy-1.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30ac8812c1d2aab7131a79ba62933a2a76f582d5dbbc695192453dae67ad6310"}, + {file = "scipy-1.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f9ea80f2e65bdaa0b7627fb00cbeb2daf163caa015e59b7516395fe3bd1e066"}, + {file = "scipy-1.14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:edaf02b82cd7639db00dbff629995ef185c8df4c3ffa71a5562a595765a06ce1"}, + {file = "scipy-1.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:2ff38e22128e6c03ff73b6bb0f85f897d2362f8c052e3b8ad00532198fbdae3f"}, + {file = "scipy-1.14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1729560c906963fc8389f6aac023739ff3983e727b1a4d87696b7bf108316a79"}, + {file = "scipy-1.14.1-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:4079b90df244709e675cdc8b93bfd8a395d59af40b72e339c2287c91860deb8e"}, + {file = "scipy-1.14.1-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:e0cf28db0f24a38b2a0ca33a85a54852586e43cf6fd876365c86e0657cfe7d73"}, + {file = "scipy-1.14.1-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:0c2f95de3b04e26f5f3ad5bb05e74ba7f68b837133a4492414b3afd79dfe540e"}, + {file = "scipy-1.14.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b99722ea48b7ea25e8e015e8341ae74624f72e5f21fc2abd45f3a93266de4c5d"}, + {file = "scipy-1.14.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5149e3fd2d686e42144a093b206aef01932a0059c2a33ddfa67f5f035bdfe13e"}, + {file = "scipy-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e4f5a7c49323533f9103d4dacf4e4f07078f360743dec7f7596949149efeec06"}, + {file = "scipy-1.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:baff393942b550823bfce952bb62270ee17504d02a1801d7fd0719534dfb9c84"}, + {file = "scipy-1.14.1.tar.gz", hash = "sha256:5a275584e726026a5699459aa72f828a610821006228e841b94275c4a7c08417"}, +] + +[package.dependencies] +numpy = ">=1.23.5,<2.3" + +[package.extras] +dev = ["cython-lint (>=0.12.2)", "doit (>=0.36.0)", "mypy (==1.10.0)", "pycodestyle", "pydevtool", "rich-click", "ruff (>=0.0.292)", "types-psutil", "typing_extensions"] +doc = ["jupyterlite-pyodide-kernel", "jupyterlite-sphinx (>=0.13.1)", "jupytext", "matplotlib (>=3.5)", "myst-nb", "numpydoc", "pooch", "pydata-sphinx-theme (>=0.15.2)", "sphinx (>=5.0.0,<=7.3.7)", "sphinx-design (>=0.4.0)"] +test = ["Cython", "array-api-strict (>=2.0)", "asv", "gmpy2", "hypothesis (>=6.30)", "meson", "mpmath", "ninja", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] + +[[package]] +name = "setuptools" +version = "75.1.0" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "setuptools-75.1.0-py3-none-any.whl", hash = "sha256:35ab7fd3bcd95e6b7fd704e4a1539513edad446c097797f2985e0e4b960772f2"}, + {file = "setuptools-75.1.0.tar.gz", hash = "sha256:d59a21b17a275fb872a9c3dae73963160ae079f1049ed956880cd7c09b120538"}, +] + +[package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.5.2)"] +core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.collections", "jaraco.functools", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +cover = ["pytest-cov"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.11.*)", "pytest-mypy"] + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "stevedore" +version = "5.3.0" +description = "Manage dynamic plugins for Python applications" +optional = false +python-versions = ">=3.8" +files = [ + {file = "stevedore-5.3.0-py3-none-any.whl", hash = "sha256:1efd34ca08f474dad08d9b19e934a22c68bb6fe416926479ba29e5013bcc8f78"}, + {file = "stevedore-5.3.0.tar.gz", hash = "sha256:9a64265f4060312828151c204efbe9b7a9852a0d9228756344dbc7e4023e375a"}, +] + +[package.dependencies] +pbr = ">=2.0.0" + +[[package]] +name = "symengine" +version = "0.13.0" +description = "Python library providing wrappers to SymEngine" +optional = false +python-versions = "<4,>=3.8" +files = [ + {file = "symengine-0.13.0-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:259fd4111c7a70c72bdff5686de1949e8132baeb612eacdaf8837720c6fe449b"}, + {file = "symengine-0.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:44f2eb28a1e36db0bbd6679435412f79da9743bf9c1cb3eff25e0c343b7ddd48"}, + {file = "symengine-0.13.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d141712fa14d9138bd19e64b10392f850c68d88cd7db29f1bda33e32d1095559"}, + {file = "symengine-0.13.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:830226d933bfcdb93546e4062541627d9a3bc7a178a63fb16c002eb5c5221938"}, + {file = "symengine-0.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a08090163819a0bbfa97d64bd2d8dac2c5268147ed9c242799d7f7e8728a6f4e"}, + {file = "symengine-0.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:1e435dcd8ed25e4c7c21ab1c0376be910efc7f35da76d532367df27b359f0358"}, + {file = "symengine-0.13.0-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:da0eba7e106095cdce88eb275c8a9d7c4586ad88f229394c53e1184155c00745"}, + {file = "symengine-0.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b0c175f4f895a73a925508af03faf7efd6cad8593256bbdb5346bd996d3ec5c8"}, + {file = "symengine-0.13.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e58d1e2abd08381aa0cf24c88c0e8b7f592df92619b51e32d36835fbd2dd6ae8"}, + {file = "symengine-0.13.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1db745f2c7a3c5e83510cf4decb43201f43552dfb05ad8af9787c89708be9ede"}, + {file = "symengine-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2572c98b09ac284db6ecff63f6170461194dc94c4209afd34c092ec67873d85"}, + {file = "symengine-0.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:12727f02a2919f005aee48e68e0cbb70cf857b19385857b4d985d1c9b075f620"}, + {file = "symengine-0.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:cf91d24f1bfd6d53228593c7804dd106b71b19674d5afc4fa322d516e1793bdd"}, + {file = "symengine-0.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c5615b7eb68890917abd390ebb10434a949165f6064741c1a8cc345fee14e855"}, + {file = "symengine-0.13.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb92bdf0890de264abaeacbfbdbd4dd7444b94057bd47958d913b662e549ad8a"}, + {file = "symengine-0.13.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7b3bce486fbc0b87970ed1b10ca9d5cafb1fd6b66382fe631261d83592851d7e"}, + {file = "symengine-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f7e6bae9cfcdde2775d92fbb0abe3ef04e32f65ebc4c2d164ca33f4da202d4a7"}, + {file = "symengine-0.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:bced0a1dbdb94737c299384c85ddbad6944ce8dadc334f7bb8dbbd8f6c965807"}, + {file = "symengine-0.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5d34df77971538e4c29f2d8e5ef7f459c2179465e6cdb7dfd48b79b87ecd8f4d"}, + {file = "symengine-0.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:ab2661d9b18867e7c6edbfa7a74b8b0a2a694bd24aa08003dc3214f77cb9d6f2"}, + {file = "symengine-0.13.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53f27b9013878ee4419d8e853664d8ae4b68419e3f4b9b5b7f503d32bf904755"}, + {file = "symengine-0.13.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:27987f75ce08c64f453e2b9b74fec6ffc5ca418c4deca0b75580979d4a4e242a"}, + {file = "symengine-0.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e9ea9410330ea15ed4137d7a0a3c43caccacb71490e18036ce5182d08c93baf8"}, + {file = "symengine-0.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:5031eb7a5c6675d5195bb57f93cc7d9ac5a7a9a826d4ad6f6b2927746ed7e6e6"}, + {file = "symengine-0.13.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:ce0e5dfb19943bcf3e44a4485bcac4c5533ba3705c63083494eed0b3bf246076"}, + {file = "symengine-0.13.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:c3b77dc54bf1181f6bd3b3338c4e6e5973a8b0fa20a189d15563ef5626e57b04"}, + {file = "symengine-0.13.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca7c3f6c168f6f5b06b421833c3d3baae56067a94b671bdffbe09b8e4fefd9be"}, + {file = "symengine-0.13.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:847523de682416811bacb3ad11507e663b3522fbb35cd27184757e9956d0eaf0"}, + {file = "symengine-0.13.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec2fc1b7d96426463f0c9011e9fb88459d906477c1baa8a996dde6fb2bfa99d4"}, + {file = "symengine-0.13.0-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:6e371bb2da3867085779c1c21bbb1c85f9634c76c8a76c08562ea113e3dfcd85"}, + {file = "symengine-0.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cf7c62478b19683d54e4d93faa5b89303beae25db0c503a105a70d266dc99fa9"}, + {file = "symengine-0.13.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fdb21158cf3e2ba87e441f21ecc7724f108b8db17c0fd1880f9f531602bab1f3"}, + {file = "symengine-0.13.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1848d366b359ff69ef5dac148b30ca04c7339a7d3bcab28419d411e68c0cc011"}, + {file = "symengine-0.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:242f817e890a0a50d52ed6b2bfd1aad19636a58db700c7995bbe1ceeaebd9d08"}, + {file = "symengine-0.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:af79cf2b9645fb55216850185987b2e9347db71e42e87b6402e4bbd41710b316"}, + {file = "symengine-0.13.0-cp39-cp39-macosx_10_13_x86_64.whl", hash = "sha256:17ae9d1c781a60ac48d07fa30f39a2d237f9da95e9e81f6a24b1c16908e9cad2"}, + {file = "symengine-0.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5264157a95f6d09dd044cee6abcbc176e649c487638b7f32199f387f37ad82a5"}, + {file = "symengine-0.13.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f01a6d0829b4881d5f831ae7848eb0d82b80d8b46b5689f1bf27069672370f75"}, + {file = "symengine-0.13.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:35ec68b11c2df2be1a236d0c028edb5b331909b16666d7a9fe99a4a5810afec7"}, + {file = "symengine-0.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b4357fed87083e8719fcffd8bd0e7ddd16172e319343362512f681e472ac5668"}, + {file = "symengine-0.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a41be31816e5e51e9063bf26de07faf3751de7a133dbbec149632de702a28e18"}, + {file = "symengine-0.13.0.tar.gz", hash = "sha256:ab83a08897ebf12579702c2b71ba73d4732fb706cc4291d810aedf39c690c14c"}, +] + +[[package]] +name = "sympy" +version = "1.13.3" +description = "Computer algebra system (CAS) in Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "sympy-1.13.3-py3-none-any.whl", hash = "sha256:54612cf55a62755ee71824ce692986f23c88ffa77207b30c1368eda4a7060f73"}, + {file = "sympy-1.13.3.tar.gz", hash = "sha256:b27fd2c6530e0ab39e275fc9b683895367e51d5da91baa8d3d64db2565fec4d9"}, +] + +[package.dependencies] +mpmath = ">=1.1.0,<1.4" + +[package.extras] +dev = ["hypothesis (>=6.70.0)", "pytest (>=7.1.0)"] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, +] + +[metadata] +lock-version = "2.0" +python-versions = "~=3.10" +content-hash = "715e7cf20df1a9a6938e0d0664829bbe9b576a9eb3fbc51707012fadf598529e" diff --git a/examples/pyproject.toml b/examples/pyproject.toml index 0ef753a..c4686e6 100644 --- a/examples/pyproject.toml +++ b/examples/pyproject.toml @@ -1,14 +1,14 @@ -[project] -name = "rasqal_examples" +[tool.poetry] +name = "rasqal-examples" version = "0.0.1" -requires-python = ">=3.10" -description = "A hybrid quantum-classical analysis/solving runtime." +description = "Code examples for Rasqal." authors = [] -dependencies = [ - "rasqal>=1.6" -] +[tool.poetry.dependencies] +python = "~=3.10" +rasqal = "~=0.1.6" +qsharp = "~=1.9.0" -[project.urls] -Repository = "https://github.com/oqc-community/rasqal.git" -Issues = "https://github.com/oqc-community/rasqal/issues" +[[tool.poetry.source]] +name = "PyPI" +priority = "primary" diff --git a/examples/qir/basic-loops.ll b/examples/qir/basic-loops.ll index d8ac69b..2da47fd 100644 --- a/examples/qir/basic-loops.ll +++ b/examples/qir/basic-loops.ll @@ -1,169 +1,159 @@ %Tuple = type opaque -%Qubit = type opaque %Array = type opaque %Callable = type opaque +%Qubit = type opaque %Result = type opaque %Range = type { i64, i64, i64 } %String = type opaque @Microsoft__Quantum__Intrinsic__H__FunctionTable = internal constant [4 x void (%Tuple*, %Tuple*, %Tuple*)*] [void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__H__body__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__H__adj__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__H__ctl__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__H__ctladj__wrapper] -@Microsoft__Quantum__Intrinsic__M__FunctionTable = internal constant [4 x void (%Tuple*, %Tuple*, %Tuple*)*] [void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__M__body__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null] @Microsoft__Quantum__Convert__ResultAsBool__FunctionTable = internal constant [4 x void (%Tuple*, %Tuple*, %Tuple*)*] [void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Convert__ResultAsBool__body__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null] +@Microsoft__Quantum__Intrinsic__M__FunctionTable = internal constant [4 x void (%Tuple*, %Tuple*, %Tuple*)*] [void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__M__body__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null] define internal i64 @Examples__BasicLoops__Run__body(i64 %numSegments) { entry: %appending = alloca i64, align 8 %incrementing_result = alloca i64, align 8 - %a = call %Qubit* @__quantum__rt__qubit_allocate() - %b = call %Qubit* @__quantum__rt__qubit_allocate() - %c = call %Qubit* @__quantum__rt__qubit_allocate() - %reg = call %Array* @__quantum__rt__qubit_allocate_array(i64 3) - call void @__quantum__rt__array_update_alias_count(%Array* %reg, i32 1) - %0 = call %Callable* @__quantum__rt__callable_create([4 x void (%Tuple*, %Tuple*, %Tuple*)*]* @Microsoft__Quantum__Intrinsic__H__FunctionTable, [2 x void (%Tuple*, i32)*]* null, %Tuple* null) - call void @Microsoft__Quantum__Canon___3dd88321d66a42e4af012b2c51d64eed_ApplyToEach__body(%Callable* %0, %Array* %reg) store i64 0, i64* %incrementing_result, align 4 br label %header__1 header__1: ; preds = %exiting__1, %entry - %index = phi i64 [ 0, %entry ], [ %34, %exiting__1 ] - %1 = icmp sle i64 %index, %numSegments - br i1 %1, label %body__1, label %exit__1 + %index = phi i64 [ 0, %entry ], [ %33, %exiting__1 ] + %0 = icmp sle i64 %index, %numSegments + br i1 %0, label %body__1, label %exit__1 body__1: ; preds = %header__1 - %2 = call %Callable* @__quantum__rt__callable_create([4 x void (%Tuple*, %Tuple*, %Tuple*)*]* @Microsoft__Quantum__Intrinsic__H__FunctionTable, [2 x void (%Tuple*, i32)*]* null, %Tuple* null) - call void @Microsoft__Quantum__Canon___3dd88321d66a42e4af012b2c51d64eed_ApplyToEach__body(%Callable* %2, %Array* %reg) - %3 = icmp eq i64 %index, 2 - br i1 %3, label %condContinue__1, label %condFalse__1 + %reg = call %Array* @__quantum__rt__qubit_allocate_array(i64 3) + call void @__quantum__rt__array_update_alias_count(%Array* %reg, i32 1) + %1 = call %Callable* @__quantum__rt__callable_create([4 x void (%Tuple*, %Tuple*, %Tuple*)*]* @Microsoft__Quantum__Intrinsic__H__FunctionTable, [2 x void (%Tuple*, i32)*]* null, %Tuple* null) + call void @Microsoft__Quantum__Canon___93452e454207446782c14ad0d94b32fd_ApplyToEach__body(%Callable* %1, %Array* %reg) + %2 = icmp eq i64 %index, 2 + br i1 %2, label %condContinue__1, label %condFalse__1 condFalse__1: ; preds = %body__1 - %4 = icmp eq i64 %index, 4 + %3 = icmp eq i64 %index, 4 br label %condContinue__1 condContinue__1: ; preds = %condFalse__1, %body__1 - %5 = phi i1 [ %3, %body__1 ], [ %4, %condFalse__1 ] - br i1 %5, label %condContinue__2, label %condFalse__2 + %4 = phi i1 [ %2, %body__1 ], [ %3, %condFalse__1 ] + br i1 %4, label %condContinue__2, label %condFalse__2 condFalse__2: ; preds = %condContinue__1 - %6 = icmp eq i64 %index, 6 + %5 = icmp eq i64 %index, 6 br label %condContinue__2 condContinue__2: ; preds = %condFalse__2, %condContinue__1 - %7 = phi i1 [ %5, %condContinue__1 ], [ %6, %condFalse__2 ] - br i1 %7, label %condContinue__3, label %condFalse__3 + %6 = phi i1 [ %4, %condContinue__1 ], [ %5, %condFalse__2 ] + br i1 %6, label %condContinue__3, label %condFalse__3 condFalse__3: ; preds = %condContinue__2 - %8 = icmp eq i64 %index, 8 + %7 = icmp eq i64 %index, 8 br label %condContinue__3 condContinue__3: ; preds = %condFalse__3, %condContinue__2 - %9 = phi i1 [ %7, %condContinue__2 ], [ %8, %condFalse__3 ] - br i1 %9, label %condContinue__4, label %condFalse__4 + %8 = phi i1 [ %6, %condContinue__2 ], [ %7, %condFalse__3 ] + br i1 %8, label %condContinue__4, label %condFalse__4 condFalse__4: ; preds = %condContinue__3 - %10 = icmp eq i64 %index, 10 + %9 = icmp eq i64 %index, 10 br label %condContinue__4 condContinue__4: ; preds = %condFalse__4, %condContinue__3 - %is_even = phi i1 [ %9, %condContinue__3 ], [ %10, %condFalse__4 ] + %is_even = phi i1 [ %8, %condContinue__3 ], [ %9, %condFalse__4 ] br i1 %is_even, label %then0__1, label %continue__1 then0__1: ; preds = %condContinue__4 - %11 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %reg, i64 0) - %12 = bitcast i8* %11 to %Qubit** - %qubit = load %Qubit*, %Qubit** %12, align 8 + %10 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %reg, i64 0) + %11 = bitcast i8* %10 to %Qubit** + %qubit = load %Qubit*, %Qubit** %11, align 8 call void @__quantum__qis__h__body(%Qubit* %qubit) - %13 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %reg, i64 2) - %14 = bitcast i8* %13 to %Qubit** - %qubit__1 = load %Qubit*, %Qubit** %14, align 8 + %12 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %reg, i64 2) + %13 = bitcast i8* %12 to %Qubit** + %qubit__1 = load %Qubit*, %Qubit** %13, align 8 call void @__quantum__qis__h__body(%Qubit* %qubit__1) br label %continue__1 continue__1: ; preds = %then0__1, %condContinue__4 - %15 = call %Array* @Microsoft__Quantum__Measurement__MultiM__body(%Array* %reg) - %result = call %Array* @Microsoft__Quantum__Convert__ResultArrayAsBoolArray__body(%Array* %15) + %14 = call %Array* @Microsoft__Quantum__Measurement__MultiM__body(%Array* %reg) + %result = call %Array* @Microsoft__Quantum__Convert__ResultArrayAsBoolArray__body(%Array* %14) call void @__quantum__rt__array_update_alias_count(%Array* %result, i32 1) store i64 0, i64* %appending, align 4 - %16 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 0) - %17 = bitcast i8* %16 to i1* - %18 = load i1, i1* %17, align 1 - br i1 %18, label %then0__2, label %continue__2 + %15 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 0) + %16 = bitcast i8* %15 to i1* + %17 = load i1, i1* %16, align 1 + br i1 %17, label %then0__2, label %continue__2 then0__2: ; preds = %continue__1 store i64 1, i64* %appending, align 4 br label %continue__2 continue__2: ; preds = %then0__2, %continue__1 - %19 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 1) - %20 = bitcast i8* %19 to i1* - %21 = load i1, i1* %20, align 1 - br i1 %21, label %then0__3, label %continue__3 + %18 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 1) + %19 = bitcast i8* %18 to i1* + %20 = load i1, i1* %19, align 1 + br i1 %20, label %then0__3, label %continue__3 then0__3: ; preds = %continue__2 - %22 = load i64, i64* %appending, align 4 - %23 = add i64 %22, 1 - store i64 %23, i64* %appending, align 4 + %21 = load i64, i64* %appending, align 4 + %22 = add i64 %21, 1 + store i64 %22, i64* %appending, align 4 br label %continue__3 continue__3: ; preds = %then0__3, %continue__2 - %24 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 2) - %25 = bitcast i8* %24 to i1* - %26 = load i1, i1* %25, align 1 - br i1 %26, label %then0__4, label %continue__4 + %23 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 2) + %24 = bitcast i8* %23 to i1* + %25 = load i1, i1* %24, align 1 + br i1 %25, label %then0__4, label %continue__4 then0__4: ; preds = %continue__3 - %27 = load i64, i64* %appending, align 4 - %28 = add i64 %27, 1 - store i64 %28, i64* %appending, align 4 + %26 = load i64, i64* %appending, align 4 + %27 = add i64 %26, 1 + store i64 %27, i64* %appending, align 4 br label %continue__4 continue__4: ; preds = %then0__4, %continue__3 - %29 = load i64, i64* %incrementing_result, align 4 - %30 = load i64, i64* %appending, align 4 - %31 = add i64 %29, %30 - store i64 %31, i64* %incrementing_result, align 4 + %28 = load i64, i64* %incrementing_result, align 4 + %29 = load i64, i64* %appending, align 4 + %30 = add i64 %28, %29 + store i64 %30, i64* %incrementing_result, align 4 + call void @__quantum__rt__array_update_alias_count(%Array* %reg, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %result, i32 -1) - call void @__quantum__rt__capture_update_reference_count(%Callable* %2, i32 -1) - call void @__quantum__rt__callable_update_reference_count(%Callable* %2, i32 -1) - %32 = call i64 @__quantum__rt__array_get_size_1d(%Array* %15) - %33 = sub i64 %32, 1 + call void @__quantum__rt__capture_update_reference_count(%Callable* %1, i32 -1) + call void @__quantum__rt__callable_update_reference_count(%Callable* %1, i32 -1) + %31 = call i64 @__quantum__rt__array_get_size_1d(%Array* %14) + %32 = sub i64 %31, 1 br label %header__2 exiting__1: ; preds = %exit__2 - %34 = add i64 %index, 1 + %33 = add i64 %index, 1 br label %header__1 exit__1: ; preds = %header__1 - %35 = load i64, i64* %incrementing_result, align 4 - %36 = mul i64 %35, 5 - call void @__quantum__rt__array_update_alias_count(%Array* %reg, i32 -1) - call void @__quantum__rt__capture_update_reference_count(%Callable* %0, i32 -1) - call void @__quantum__rt__callable_update_reference_count(%Callable* %0, i32 -1) - call void @__quantum__rt__qubit_release_array(%Array* %reg) - call void @__quantum__rt__qubit_release(%Qubit* %a) - call void @__quantum__rt__qubit_release(%Qubit* %b) - call void @__quantum__rt__qubit_release(%Qubit* %c) - ret i64 %36 + %34 = load i64, i64* %incrementing_result, align 4 + %35 = mul i64 %34, 5 + ret i64 %35 header__2: ; preds = %exiting__2, %continue__4 - %37 = phi i64 [ 0, %continue__4 ], [ %42, %exiting__2 ] - %38 = icmp sle i64 %37, %33 - br i1 %38, label %body__2, label %exit__2 + %36 = phi i64 [ 0, %continue__4 ], [ %41, %exiting__2 ] + %37 = icmp sle i64 %36, %32 + br i1 %37, label %body__2, label %exit__2 body__2: ; preds = %header__2 - %39 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %15, i64 %37) - %40 = bitcast i8* %39 to %Result** - %41 = load %Result*, %Result** %40, align 8 - call void @__quantum__rt__result_update_reference_count(%Result* %41, i32 -1) + %38 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %14, i64 %36) + %39 = bitcast i8* %38 to %Result** + %40 = load %Result*, %Result** %39, align 8 + call void @__quantum__rt__result_update_reference_count(%Result* %40, i32 -1) br label %exiting__2 exiting__2: ; preds = %body__2 - %42 = add i64 %37, 1 + %41 = add i64 %36, 1 br label %header__2 exit__2: ; preds = %header__2 - call void @__quantum__rt__array_update_reference_count(%Array* %15, i32 -1) + call void @__quantum__rt__array_update_reference_count(%Array* %14, i32 -1) call void @__quantum__rt__array_update_reference_count(%Array* %result, i32 -1) + call void @__quantum__rt__qubit_release_array(%Array* %reg) br label %exiting__1 } @@ -171,18 +161,16 @@ declare %Qubit* @__quantum__rt__qubit_allocate() declare %Array* @__quantum__rt__qubit_allocate_array(i64) -declare void @__quantum__rt__qubit_release(%Qubit*) - declare void @__quantum__rt__qubit_release_array(%Array*) declare void @__quantum__rt__array_update_alias_count(%Array*, i32) -define internal void @Microsoft__Quantum__Canon___3dd88321d66a42e4af012b2c51d64eed_ApplyToEach__body(%Callable* %singleElementOperation, %Array* %register) { +define internal void @Microsoft__Quantum__Canon___93452e454207446782c14ad0d94b32fd_ApplyToEach__body(%Callable* %singleElementOperation, %Array* %register) { entry: call void @__quantum__rt__capture_update_alias_count(%Callable* %singleElementOperation, i32 1) call void @__quantum__rt__callable_update_alias_count(%Callable* %singleElementOperation, i32 1) call void @__quantum__rt__array_update_alias_count(%Array* %register, i32 1) - %0 = call %Range @Microsoft__Quantum__Arrays___6cddddb708184fd08d2d023713587fa6_IndexRange__body(%Array* %register) + %0 = call %Range @Microsoft__Quantum__Arrays___8109ab526e0848138e988a00cdebe512_IndexRange__body(%Array* %register) %1 = extractvalue %Range %0, 0 %2 = extractvalue %Range %0, 1 %3 = extractvalue %Range %0, 2 @@ -272,7 +260,7 @@ define internal %Array* @Microsoft__Quantum__Convert__ResultArrayAsBoolArray__bo entry: call void @__quantum__rt__array_update_alias_count(%Array* %input, i32 1) %0 = call %Callable* @__quantum__rt__callable_create([4 x void (%Tuple*, %Tuple*, %Tuple*)*]* @Microsoft__Quantum__Convert__ResultAsBool__FunctionTable, [2 x void (%Tuple*, i32)*]* null, %Tuple* null) - %1 = call %Array* @Microsoft__Quantum__Arrays___3d60c572cb664ed58855b31248ae48d6_Mapped__body(%Callable* %0, %Array* %input) + %1 = call %Array* @Microsoft__Quantum__Arrays___59f70b880fa6443ba1a100cd9c4d33ee_Mapped__body(%Callable* %0, %Array* %input) call void @__quantum__rt__array_update_alias_count(%Array* %input, i32 -1) call void @__quantum__rt__capture_update_reference_count(%Callable* %0, i32 -1) call void @__quantum__rt__callable_update_reference_count(%Callable* %0, i32 -1) @@ -283,7 +271,7 @@ define internal %Array* @Microsoft__Quantum__Measurement__MultiM__body(%Array* % entry: call void @__quantum__rt__array_update_alias_count(%Array* %targets, i32 1) %0 = call %Callable* @__quantum__rt__callable_create([4 x void (%Tuple*, %Tuple*, %Tuple*)*]* @Microsoft__Quantum__Intrinsic__M__FunctionTable, [2 x void (%Tuple*, i32)*]* null, %Tuple* null) - %1 = call %Array* @Microsoft__Quantum__Arrays___9a05042c8d364249b4cdc8ff4d323f59_ForEach__body(%Callable* %0, %Array* %targets) + %1 = call %Array* @Microsoft__Quantum__Arrays___eb42932e0de64033a3d8cf387a2b35c7_ForEach__body(%Callable* %0, %Array* %targets) call void @__quantum__rt__array_update_alias_count(%Array* %targets, i32 -1) call void @__quantum__rt__capture_update_reference_count(%Callable* %0, i32 -1) call void @__quantum__rt__callable_update_reference_count(%Callable* %0, i32 -1) @@ -328,73 +316,37 @@ entry: ret void } -declare void @__quantum__qis__h__ctl(%Array*, %Qubit*) - -define internal %Result* @Microsoft__Quantum__Intrinsic__M__body(%Qubit* %qubit) { -entry: - %bases = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 1) - %0 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %bases, i64 0) - %1 = bitcast i8* %0 to i2* - store i2 -2, i2* %1, align 1 - call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 1) - %qubits = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 1) - %2 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %qubits, i64 0) - %3 = bitcast i8* %2 to %Qubit** - store %Qubit* %qubit, %Qubit** %3, align 8 - call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 1) - %4 = call %Result* @__quantum__qis__measure__body(%Array* %bases, %Array* %qubits) - call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 -1) - call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 -1) - call void @__quantum__rt__array_update_reference_count(%Array* %bases, i32 -1) - call void @__quantum__rt__array_update_reference_count(%Array* %qubits, i32 -1) - ret %Result* %4 -} - -declare %Array* @__quantum__rt__array_create_1d(i32, i64) - -declare %Result* @__quantum__qis__measure__body(%Array*, %Array*) - -define internal %Result* @Microsoft__Quantum__Intrinsic__Measure__body(%Array* %bases, %Array* %qubits) { -entry: - call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 1) - call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 1) - %0 = call %Result* @__quantum__qis__measure__body(%Array* %bases, %Array* %qubits) - call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 -1) - call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 -1) - ret %Result* %0 -} - -define internal %Array* @Microsoft__Quantum__Arrays___9a05042c8d364249b4cdc8ff4d323f59_ForEach__body(%Callable* %action, %Array* %array) { +define internal %Array* @Microsoft__Quantum__Arrays___59f70b880fa6443ba1a100cd9c4d33ee_Mapped__body(%Callable* %mapper, %Array* %array) { entry: %retval = alloca %Array*, align 8 - call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 1) + call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 1) %length = call i64 @__quantum__rt__array_get_size_1d(%Array* %array) %0 = icmp eq i64 %length, 0 br i1 %0, label %then0__1, label %continue__1 then0__1: ; preds = %entry - %1 = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 0) - call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 -1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 -1) + %1 = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 0) + call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 -1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) ret %Array* %1 continue__1: ; preds = %entry %2 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %array, i64 0) - %3 = bitcast i8* %2 to %Qubit** - %4 = load %Qubit*, %Qubit** %3, align 8 - %5 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Qubit* }* getelementptr ({ %Qubit* }, { %Qubit* }* null, i32 1) to i64)) - %6 = bitcast %Tuple* %5 to { %Qubit* }* - %7 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %6, i32 0, i32 0 - store %Qubit* %4, %Qubit** %7, align 8 - %8 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) - call void @__quantum__rt__callable_invoke(%Callable* %action, %Tuple* %5, %Tuple* %8) - %9 = bitcast %Tuple* %8 to { %Result* }* - %10 = getelementptr inbounds { %Result* }, { %Result* }* %9, i32 0, i32 0 - %first = load %Result*, %Result** %10, align 8 - %11 = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 %length) + %3 = bitcast i8* %2 to %Result** + %4 = load %Result*, %Result** %3, align 8 + %5 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) + %6 = bitcast %Tuple* %5 to { %Result* }* + %7 = getelementptr inbounds { %Result* }, { %Result* }* %6, i32 0, i32 0 + store %Result* %4, %Result** %7, align 8 + %8 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ i1 }* getelementptr ({ i1 }, { i1 }* null, i32 1) to i64)) + call void @__quantum__rt__callable_invoke(%Callable* %mapper, %Tuple* %5, %Tuple* %8) + %9 = bitcast %Tuple* %8 to { i1 }* + %10 = getelementptr inbounds { i1 }, { i1 }* %9, i32 0, i32 0 + %first = load i1, i1* %10, align 1 + %11 = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 %length) %12 = sub i64 %length, 1 br label %header__1 @@ -405,9 +357,8 @@ header__1: ; preds = %exiting__1, %contin body__1: ; preds = %header__1 %15 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %11, i64 %13) - %16 = bitcast i8* %15 to %Result** - store %Result* %first, %Result** %16, align 8 - call void @__quantum__rt__result_update_reference_count(%Result* %first, i32 1) + %16 = bitcast i8* %15 to i1* + store i1 %first, i1* %16, align 1 br label %exiting__1 exiting__1: ; preds = %body__1 @@ -430,28 +381,25 @@ body__2: ; preds = %header__2 call void @__quantum__rt__array_update_alias_count(%Array* %20, i32 -1) %21 = call %Array* @__quantum__rt__array_copy(%Array* %20, i1 false) %22 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %array, i64 %idx) - %23 = bitcast i8* %22 to %Qubit** - %24 = load %Qubit*, %Qubit** %23, align 8 - %25 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Qubit* }* getelementptr ({ %Qubit* }, { %Qubit* }* null, i32 1) to i64)) - %26 = bitcast %Tuple* %25 to { %Qubit* }* - %27 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %26, i32 0, i32 0 - store %Qubit* %24, %Qubit** %27, align 8 - %28 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) - call void @__quantum__rt__callable_invoke(%Callable* %action, %Tuple* %25, %Tuple* %28) - %29 = bitcast %Tuple* %28 to { %Result* }* - %30 = getelementptr inbounds { %Result* }, { %Result* }* %29, i32 0, i32 0 - %31 = load %Result*, %Result** %30, align 8 + %23 = bitcast i8* %22 to %Result** + %24 = load %Result*, %Result** %23, align 8 + %25 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) + %26 = bitcast %Tuple* %25 to { %Result* }* + %27 = getelementptr inbounds { %Result* }, { %Result* }* %26, i32 0, i32 0 + store %Result* %24, %Result** %27, align 8 + %28 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ i1 }* getelementptr ({ i1 }, { i1 }* null, i32 1) to i64)) + call void @__quantum__rt__callable_invoke(%Callable* %mapper, %Tuple* %25, %Tuple* %28) + %29 = bitcast %Tuple* %28 to { i1 }* + %30 = getelementptr inbounds { i1 }, { i1 }* %29, i32 0, i32 0 + %31 = load i1, i1* %30, align 1 %32 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %21, i64 %idx) - %33 = bitcast i8* %32 to %Result** - call void @__quantum__rt__result_update_reference_count(%Result* %31, i32 1) - %34 = load %Result*, %Result** %33, align 8 - call void @__quantum__rt__result_update_reference_count(%Result* %34, i32 -1) - store %Result* %31, %Result** %33, align 8 + %33 = bitcast i8* %32 to i1* + %34 = load i1, i1* %33, align 1 + store i1 %31, i1* %33, align 1 call void @__quantum__rt__array_update_alias_count(%Array* %21, i32 1) store %Array* %21, %Array** %retval, align 8 call void @__quantum__rt__array_update_reference_count(%Array* %20, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %25, i32 -1) - call void @__quantum__rt__result_update_reference_count(%Result* %31, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %28, i32 -1) br label %exiting__2 @@ -461,59 +409,90 @@ exiting__2: ; preds = %body__2 exit__2: ; preds = %header__2 %36 = load %Array*, %Array** %retval, align 8 - call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 -1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 -1) + call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 -1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %36, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %5, i32 -1) - call void @__quantum__rt__result_update_reference_count(%Result* %first, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %8, i32 -1) ret %Array* %36 } -define internal void @Microsoft__Quantum__Intrinsic__M__body__wrapper(%Tuple* %capture-tuple, %Tuple* %arg-tuple, %Tuple* %result-tuple) { +define internal void @Microsoft__Quantum__Convert__ResultAsBool__body__wrapper(%Tuple* %capture-tuple, %Tuple* %arg-tuple, %Tuple* %result-tuple) { entry: - %0 = bitcast %Tuple* %arg-tuple to { %Qubit* }* - %1 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %0, i32 0, i32 0 - %2 = load %Qubit*, %Qubit** %1, align 8 - %3 = call %Result* @Microsoft__Quantum__Intrinsic__M__body(%Qubit* %2) - %4 = bitcast %Tuple* %result-tuple to { %Result* }* - %5 = getelementptr inbounds { %Result* }, { %Result* }* %4, i32 0, i32 0 - store %Result* %3, %Result** %5, align 8 + %0 = bitcast %Tuple* %arg-tuple to { %Result* }* + %1 = getelementptr inbounds { %Result* }, { %Result* }* %0, i32 0, i32 0 + %2 = load %Result*, %Result** %1, align 8 + %3 = call i1 @Microsoft__Quantum__Convert__ResultAsBool__body(%Result* %2) + %4 = bitcast %Tuple* %result-tuple to { i1 }* + %5 = getelementptr inbounds { i1 }, { i1 }* %4, i32 0, i32 0 + store i1 %3, i1* %5, align 1 ret void } -define internal %Array* @Microsoft__Quantum__Arrays___3d60c572cb664ed58855b31248ae48d6_Mapped__body(%Callable* %mapper, %Array* %array) { +define internal i1 @Microsoft__Quantum__Convert__ResultAsBool__body(%Result* %input) { +entry: + %0 = call %Result* @__quantum__rt__result_get_zero() + %1 = call i1 @__quantum__rt__result_equal(%Result* %input, %Result* %0) + %2 = select i1 %1, i1 false, i1 true + ret i1 %2 +} + +declare %Result* @__quantum__rt__result_get_zero() + +declare i1 @__quantum__rt__result_equal(%Result*, %Result*) + +declare void @__quantum__rt__capture_update_alias_count(%Callable*, i32) + +declare void @__quantum__rt__callable_update_alias_count(%Callable*, i32) + +define internal %Range @Microsoft__Quantum__Arrays___8109ab526e0848138e988a00cdebe512_IndexRange__body(%Array* %array) { +entry: + call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 1) + %0 = call i64 @__quantum__rt__array_get_size_1d(%Array* %array) + %1 = sub i64 %0, 1 + %2 = insertvalue %Range { i64 0, i64 1, i64 0 }, i64 %1, 2 + call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) + ret %Range %2 +} + +declare void @__quantum__rt__callable_invoke(%Callable*, %Tuple*, %Tuple*) + +declare %Tuple* @__quantum__rt__tuple_create(i64) + +declare void @__quantum__rt__tuple_update_reference_count(%Tuple*, i32) + +define internal %Array* @Microsoft__Quantum__Arrays___eb42932e0de64033a3d8cf387a2b35c7_ForEach__body(%Callable* %action, %Array* %array) { entry: %retval = alloca %Array*, align 8 - call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 1) + call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 1) %length = call i64 @__quantum__rt__array_get_size_1d(%Array* %array) %0 = icmp eq i64 %length, 0 br i1 %0, label %then0__1, label %continue__1 then0__1: ; preds = %entry - %1 = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 0) - call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 -1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 -1) + %1 = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 0) + call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 -1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) ret %Array* %1 continue__1: ; preds = %entry %2 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %array, i64 0) - %3 = bitcast i8* %2 to %Result** - %4 = load %Result*, %Result** %3, align 8 - %5 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) - %6 = bitcast %Tuple* %5 to { %Result* }* - %7 = getelementptr inbounds { %Result* }, { %Result* }* %6, i32 0, i32 0 - store %Result* %4, %Result** %7, align 8 - %8 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ i1 }* getelementptr ({ i1 }, { i1 }* null, i32 1) to i64)) - call void @__quantum__rt__callable_invoke(%Callable* %mapper, %Tuple* %5, %Tuple* %8) - %9 = bitcast %Tuple* %8 to { i1 }* - %10 = getelementptr inbounds { i1 }, { i1 }* %9, i32 0, i32 0 - %first = load i1, i1* %10, align 1 - %11 = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 %length) + %3 = bitcast i8* %2 to %Qubit** + %4 = load %Qubit*, %Qubit** %3, align 8 + %5 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Qubit* }* getelementptr ({ %Qubit* }, { %Qubit* }* null, i32 1) to i64)) + %6 = bitcast %Tuple* %5 to { %Qubit* }* + %7 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %6, i32 0, i32 0 + store %Qubit* %4, %Qubit** %7, align 8 + %8 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) + call void @__quantum__rt__callable_invoke(%Callable* %action, %Tuple* %5, %Tuple* %8) + %9 = bitcast %Tuple* %8 to { %Result* }* + %10 = getelementptr inbounds { %Result* }, { %Result* }* %9, i32 0, i32 0 + %first = load %Result*, %Result** %10, align 8 + %11 = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 %length) %12 = sub i64 %length, 1 br label %header__1 @@ -524,8 +503,9 @@ header__1: ; preds = %exiting__1, %contin body__1: ; preds = %header__1 %15 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %11, i64 %13) - %16 = bitcast i8* %15 to i1* - store i1 %first, i1* %16, align 1 + %16 = bitcast i8* %15 to %Result** + store %Result* %first, %Result** %16, align 8 + call void @__quantum__rt__result_update_reference_count(%Result* %first, i32 1) br label %exiting__1 exiting__1: ; preds = %body__1 @@ -548,25 +528,28 @@ body__2: ; preds = %header__2 call void @__quantum__rt__array_update_alias_count(%Array* %20, i32 -1) %21 = call %Array* @__quantum__rt__array_copy(%Array* %20, i1 false) %22 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %array, i64 %idx) - %23 = bitcast i8* %22 to %Result** - %24 = load %Result*, %Result** %23, align 8 - %25 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) - %26 = bitcast %Tuple* %25 to { %Result* }* - %27 = getelementptr inbounds { %Result* }, { %Result* }* %26, i32 0, i32 0 - store %Result* %24, %Result** %27, align 8 - %28 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ i1 }* getelementptr ({ i1 }, { i1 }* null, i32 1) to i64)) - call void @__quantum__rt__callable_invoke(%Callable* %mapper, %Tuple* %25, %Tuple* %28) - %29 = bitcast %Tuple* %28 to { i1 }* - %30 = getelementptr inbounds { i1 }, { i1 }* %29, i32 0, i32 0 - %31 = load i1, i1* %30, align 1 + %23 = bitcast i8* %22 to %Qubit** + %24 = load %Qubit*, %Qubit** %23, align 8 + %25 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Qubit* }* getelementptr ({ %Qubit* }, { %Qubit* }* null, i32 1) to i64)) + %26 = bitcast %Tuple* %25 to { %Qubit* }* + %27 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %26, i32 0, i32 0 + store %Qubit* %24, %Qubit** %27, align 8 + %28 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) + call void @__quantum__rt__callable_invoke(%Callable* %action, %Tuple* %25, %Tuple* %28) + %29 = bitcast %Tuple* %28 to { %Result* }* + %30 = getelementptr inbounds { %Result* }, { %Result* }* %29, i32 0, i32 0 + %31 = load %Result*, %Result** %30, align 8 %32 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %21, i64 %idx) - %33 = bitcast i8* %32 to i1* - %34 = load i1, i1* %33, align 1 - store i1 %31, i1* %33, align 1 + %33 = bitcast i8* %32 to %Result** + call void @__quantum__rt__result_update_reference_count(%Result* %31, i32 1) + %34 = load %Result*, %Result** %33, align 8 + call void @__quantum__rt__result_update_reference_count(%Result* %34, i32 -1) + store %Result* %31, %Result** %33, align 8 call void @__quantum__rt__array_update_alias_count(%Array* %21, i32 1) store %Array* %21, %Array** %retval, align 8 call void @__quantum__rt__array_update_reference_count(%Array* %20, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %25, i32 -1) + call void @__quantum__rt__result_update_reference_count(%Result* %31, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %28, i32 -1) br label %exiting__2 @@ -576,59 +559,64 @@ exiting__2: ; preds = %body__2 exit__2: ; preds = %header__2 %36 = load %Array*, %Array** %retval, align 8 - call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 -1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 -1) + call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 -1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %36, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %5, i32 -1) + call void @__quantum__rt__result_update_reference_count(%Result* %first, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %8, i32 -1) ret %Array* %36 } -define internal void @Microsoft__Quantum__Convert__ResultAsBool__body__wrapper(%Tuple* %capture-tuple, %Tuple* %arg-tuple, %Tuple* %result-tuple) { +declare %Array* @__quantum__rt__array_create_1d(i32, i64) + +declare %Array* @__quantum__rt__array_copy(%Array*, i1) + +define internal void @Microsoft__Quantum__Intrinsic__M__body__wrapper(%Tuple* %capture-tuple, %Tuple* %arg-tuple, %Tuple* %result-tuple) { entry: - %0 = bitcast %Tuple* %arg-tuple to { %Result* }* - %1 = getelementptr inbounds { %Result* }, { %Result* }* %0, i32 0, i32 0 - %2 = load %Result*, %Result** %1, align 8 - %3 = call i1 @Microsoft__Quantum__Convert__ResultAsBool__body(%Result* %2) - %4 = bitcast %Tuple* %result-tuple to { i1 }* - %5 = getelementptr inbounds { i1 }, { i1 }* %4, i32 0, i32 0 - store i1 %3, i1* %5, align 1 + %0 = bitcast %Tuple* %arg-tuple to { %Qubit* }* + %1 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %0, i32 0, i32 0 + %2 = load %Qubit*, %Qubit** %1, align 8 + %3 = call %Result* @Microsoft__Quantum__Intrinsic__M__body(%Qubit* %2) + %4 = bitcast %Tuple* %result-tuple to { %Result* }* + %5 = getelementptr inbounds { %Result* }, { %Result* }* %4, i32 0, i32 0 + store %Result* %3, %Result** %5, align 8 ret void } -define internal i1 @Microsoft__Quantum__Convert__ResultAsBool__body(%Result* %input) { +define internal %Result* @Microsoft__Quantum__Intrinsic__M__body(%Qubit* %qubit) { entry: - %0 = call %Result* @__quantum__rt__result_get_zero() - %1 = call i1 @__quantum__rt__result_equal(%Result* %input, %Result* %0) - %2 = select i1 %1, i1 false, i1 true - ret i1 %2 + %bases = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 1) + %0 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %bases, i64 0) + %1 = bitcast i8* %0 to i2* + store i2 -2, i2* %1, align 1 + call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 1) + %qubits = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 1) + %2 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %qubits, i64 0) + %3 = bitcast i8* %2 to %Qubit** + store %Qubit* %qubit, %Qubit** %3, align 8 + call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 1) + %4 = call %Result* @__quantum__qis__measure__body(%Array* %bases, %Array* %qubits) + call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 -1) + call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 -1) + call void @__quantum__rt__array_update_reference_count(%Array* %bases, i32 -1) + call void @__quantum__rt__array_update_reference_count(%Array* %qubits, i32 -1) + ret %Result* %4 } -declare %Result* @__quantum__rt__result_get_zero() - -declare i1 @__quantum__rt__result_equal(%Result*, %Result*) - -declare void @__quantum__rt__capture_update_alias_count(%Callable*, i32) - -declare void @__quantum__rt__callable_update_alias_count(%Callable*, i32) - -declare void @__quantum__rt__callable_invoke(%Callable*, %Tuple*, %Tuple*) - -declare %Tuple* @__quantum__rt__tuple_create(i64) - -declare %Array* @__quantum__rt__array_copy(%Array*, i1) +declare void @__quantum__qis__h__ctl(%Array*, %Qubit*) -declare void @__quantum__rt__tuple_update_reference_count(%Tuple*, i32) +declare %Result* @__quantum__qis__measure__body(%Array*, %Array*) -define internal %Range @Microsoft__Quantum__Arrays___6cddddb708184fd08d2d023713587fa6_IndexRange__body(%Array* %array) { +define internal %Result* @Microsoft__Quantum__Intrinsic__Measure__body(%Array* %bases, %Array* %qubits) { entry: - call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 1) - %0 = call i64 @__quantum__rt__array_get_size_1d(%Array* %array) - %1 = sub i64 %0, 1 - %2 = insertvalue %Range { i64 0, i64 1, i64 0 }, i64 %1, 2 - call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) - ret %Range %2 + call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 1) + call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 1) + %0 = call %Result* @__quantum__qis__measure__body(%Array* %bases, %Array* %qubits) + call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 -1) + call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 -1) + ret %Result* %0 } define i64 @Examples__BasicLoops__Run(i64 %numSegments) #1 { diff --git a/examples/sandbox.py b/examples/sandbox.py index e787197..e0698dc 100644 --- a/examples/sandbox.py +++ b/examples/sandbox.py @@ -18,9 +18,7 @@ def run_sandbox(): # So Namespace.EntryMethod(...) will then generate the QIR you want. sandbox = qsharp.compile("Sandbox.Main()") - runtime = TracingRuntime() - - runner = RasqalRunner(runtime) + runner = RasqalRunner(TracingRuntime()) results = runner.run_ll(str(sandbox)) print(f"Sandbox results: {results}") diff --git a/src/scripts/psakefile.ps1 b/src/scripts/psakefile.ps1 index ba246c2..6aeaf5b 100644 --- a/src/scripts/psakefile.ps1 +++ b/src/scripts/psakefile.ps1 @@ -24,9 +24,6 @@ task check -depends check-licenses task format -depends format-rust, format-python task pypi-build -depends build, audit-rasqal, check -# Task should not be invoked if you're building and installing Rasqal locally. -task initialize-examples -depends install-rasqal-from-pypi, setup-examples, run-examples - task format-python { Invoke-LoggedCommand -workingDirectory $Root { pip install ruff @@ -89,13 +86,6 @@ task test-rasqal -depends build-rasqal { } } -# Used to install and run the examples without building Rasqal fully. -task install-rasqal-from-pypi -depends check-environment { - Invoke-LoggedCommand -workingDirectory $Root { - pip install rasqal - } -} - task setup-examples -depends check-environment { # Install required dependencies. Invoke-LoggedCommand -workingDirectory $Root { diff --git a/src/tests/qsharp/basic-loops/Library.qs b/src/tests/qsharp/basic-loops/Library.qs index 590a8d7..54a61b9 100644 --- a/src/tests/qsharp/basic-loops/Library.qs +++ b/src/tests/qsharp/basic-loops/Library.qs @@ -9,27 +9,26 @@ @EntryPoint() operation Run(numSegments: Int) : Int { - use reg = Qubit[3]; - ApplyToEach(H, reg); - mutable incrementing_result = 0; for index in 0..numSegments { - ApplyToEach(H, reg); + use reg = Qubit[3] { + ApplyToEach(H, reg); - // Would use modulo here but need to add it to allowed instructions. - let is_even = index == 2 || index == 4 || index == 6 || index == 8 || index == 10; - if is_even { - H(reg[0]); - H(reg[2]); - } + // Would use modulo here but need to add it to allowed instructions. + let is_even = index == 2 || index == 4 || index == 6 || index == 8 || index == 10; + if is_even { + H(reg[0]); + H(reg[2]); + } - let result = ResultArrayAsBoolArray(MultiM(reg)); - mutable appending = 0; - if result[0] { set appending = appending + 1; } - if result[1] { set appending = appending + 1; } - if result[2] { set appending = appending + 1; } + let result = ResultArrayAsBoolArray(MultiM(reg)); + mutable appending = 0; + if result[0] { set appending = appending + 1; } + if result[1] { set appending = appending + 1; } + if result[2] { set appending = appending + 1; } - set incrementing_result = incrementing_result + appending; + set incrementing_result = incrementing_result + appending; + } } return incrementing_result * 5; diff --git a/src/tests/qsharp/basic-loops/qir/basic-loops.ll b/src/tests/qsharp/basic-loops/qir/basic-loops.ll index 8310ac3..faa5c15 100644 --- a/src/tests/qsharp/basic-loops/qir/basic-loops.ll +++ b/src/tests/qsharp/basic-loops/qir/basic-loops.ll @@ -1,169 +1,159 @@ %Tuple = type opaque -%Qubit = type opaque %Array = type opaque %Callable = type opaque +%Qubit = type opaque %Result = type opaque %Range = type { i64, i64, i64 } %String = type opaque @Microsoft__Quantum__Intrinsic__H__FunctionTable = internal constant [4 x void (%Tuple*, %Tuple*, %Tuple*)*] [void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__H__body__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__H__adj__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__H__ctl__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__H__ctladj__wrapper] -@Microsoft__Quantum__Intrinsic__M__FunctionTable = internal constant [4 x void (%Tuple*, %Tuple*, %Tuple*)*] [void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__M__body__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null] @Microsoft__Quantum__Convert__ResultAsBool__FunctionTable = internal constant [4 x void (%Tuple*, %Tuple*, %Tuple*)*] [void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Convert__ResultAsBool__body__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null] +@Microsoft__Quantum__Intrinsic__M__FunctionTable = internal constant [4 x void (%Tuple*, %Tuple*, %Tuple*)*] [void (%Tuple*, %Tuple*, %Tuple*)* @Microsoft__Quantum__Intrinsic__M__body__wrapper, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null, void (%Tuple*, %Tuple*, %Tuple*)* null] define internal i64 @Examples__BasicLoops__Run__body(i64 %numSegments) { entry: %appending = alloca i64, align 8 %incrementing_result = alloca i64, align 8 - %a = call %Qubit* @__quantum__rt__qubit_allocate() - %b = call %Qubit* @__quantum__rt__qubit_allocate() - %c = call %Qubit* @__quantum__rt__qubit_allocate() - %reg = call %Array* @__quantum__rt__qubit_allocate_array(i64 3) - call void @__quantum__rt__array_update_alias_count(%Array* %reg, i32 1) - %0 = call %Callable* @__quantum__rt__callable_create([4 x void (%Tuple*, %Tuple*, %Tuple*)*]* @Microsoft__Quantum__Intrinsic__H__FunctionTable, [2 x void (%Tuple*, i32)*]* null, %Tuple* null) - call void @Microsoft__Quantum__Canon___3dd88321d66a42e4af012b2c51d64eed_ApplyToEach__body(%Callable* %0, %Array* %reg) store i64 0, i64* %incrementing_result, align 4 br label %header__1 header__1: ; preds = %exiting__1, %entry - %index = phi i64 [ 0, %entry ], [ %34, %exiting__1 ] - %1 = icmp sle i64 %index, %numSegments - br i1 %1, label %body__1, label %exit__1 + %index = phi i64 [ 0, %entry ], [ %33, %exiting__1 ] + %0 = icmp sle i64 %index, %numSegments + br i1 %0, label %body__1, label %exit__1 body__1: ; preds = %header__1 - %2 = call %Callable* @__quantum__rt__callable_create([4 x void (%Tuple*, %Tuple*, %Tuple*)*]* @Microsoft__Quantum__Intrinsic__H__FunctionTable, [2 x void (%Tuple*, i32)*]* null, %Tuple* null) - call void @Microsoft__Quantum__Canon___3dd88321d66a42e4af012b2c51d64eed_ApplyToEach__body(%Callable* %2, %Array* %reg) - %3 = icmp eq i64 %index, 2 - br i1 %3, label %condContinue__1, label %condFalse__1 + %reg = call %Array* @__quantum__rt__qubit_allocate_array(i64 3) + call void @__quantum__rt__array_update_alias_count(%Array* %reg, i32 1) + %1 = call %Callable* @__quantum__rt__callable_create([4 x void (%Tuple*, %Tuple*, %Tuple*)*]* @Microsoft__Quantum__Intrinsic__H__FunctionTable, [2 x void (%Tuple*, i32)*]* null, %Tuple* null) + call void @Microsoft__Quantum__Canon___93452e454207446782c14ad0d94b32fd_ApplyToEach__body(%Callable* %1, %Array* %reg) + %2 = icmp eq i64 %index, 2 + br i1 %2, label %condContinue__1, label %condFalse__1 condFalse__1: ; preds = %body__1 - %4 = icmp eq i64 %index, 4 + %3 = icmp eq i64 %index, 4 br label %condContinue__1 condContinue__1: ; preds = %condFalse__1, %body__1 - %5 = phi i1 [ %3, %body__1 ], [ %4, %condFalse__1 ] - br i1 %5, label %condContinue__2, label %condFalse__2 + %4 = phi i1 [ %2, %body__1 ], [ %3, %condFalse__1 ] + br i1 %4, label %condContinue__2, label %condFalse__2 condFalse__2: ; preds = %condContinue__1 - %6 = icmp eq i64 %index, 6 + %5 = icmp eq i64 %index, 6 br label %condContinue__2 condContinue__2: ; preds = %condFalse__2, %condContinue__1 - %7 = phi i1 [ %5, %condContinue__1 ], [ %6, %condFalse__2 ] - br i1 %7, label %condContinue__3, label %condFalse__3 + %6 = phi i1 [ %4, %condContinue__1 ], [ %5, %condFalse__2 ] + br i1 %6, label %condContinue__3, label %condFalse__3 condFalse__3: ; preds = %condContinue__2 - %8 = icmp eq i64 %index, 8 + %7 = icmp eq i64 %index, 8 br label %condContinue__3 condContinue__3: ; preds = %condFalse__3, %condContinue__2 - %9 = phi i1 [ %7, %condContinue__2 ], [ %8, %condFalse__3 ] - br i1 %9, label %condContinue__4, label %condFalse__4 + %8 = phi i1 [ %6, %condContinue__2 ], [ %7, %condFalse__3 ] + br i1 %8, label %condContinue__4, label %condFalse__4 condFalse__4: ; preds = %condContinue__3 - %10 = icmp eq i64 %index, 10 + %9 = icmp eq i64 %index, 10 br label %condContinue__4 condContinue__4: ; preds = %condFalse__4, %condContinue__3 - %is_even = phi i1 [ %9, %condContinue__3 ], [ %10, %condFalse__4 ] + %is_even = phi i1 [ %8, %condContinue__3 ], [ %9, %condFalse__4 ] br i1 %is_even, label %then0__1, label %continue__1 then0__1: ; preds = %condContinue__4 - %11 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %reg, i64 0) - %12 = bitcast i8* %11 to %Qubit** - %qubit = load %Qubit*, %Qubit** %12, align 8 + %10 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %reg, i64 0) + %11 = bitcast i8* %10 to %Qubit** + %qubit = load %Qubit*, %Qubit** %11, align 8 call void @__quantum__qis__h__body(%Qubit* %qubit) - %13 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %reg, i64 2) - %14 = bitcast i8* %13 to %Qubit** - %qubit__1 = load %Qubit*, %Qubit** %14, align 8 + %12 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %reg, i64 2) + %13 = bitcast i8* %12 to %Qubit** + %qubit__1 = load %Qubit*, %Qubit** %13, align 8 call void @__quantum__qis__h__body(%Qubit* %qubit__1) br label %continue__1 continue__1: ; preds = %then0__1, %condContinue__4 - %15 = call %Array* @Microsoft__Quantum__Measurement__MultiM__body(%Array* %reg) - %result = call %Array* @Microsoft__Quantum__Convert__ResultArrayAsBoolArray__body(%Array* %15) + %14 = call %Array* @Microsoft__Quantum__Measurement__MultiM__body(%Array* %reg) + %result = call %Array* @Microsoft__Quantum__Convert__ResultArrayAsBoolArray__body(%Array* %14) call void @__quantum__rt__array_update_alias_count(%Array* %result, i32 1) store i64 0, i64* %appending, align 4 - %16 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 0) - %17 = bitcast i8* %16 to i1* - %18 = load i1, i1* %17, align 1 - br i1 %18, label %then0__2, label %continue__2 + %15 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 0) + %16 = bitcast i8* %15 to i1* + %17 = load i1, i1* %16, align 1 + br i1 %17, label %then0__2, label %continue__2 then0__2: ; preds = %continue__1 store i64 1, i64* %appending, align 4 br label %continue__2 continue__2: ; preds = %then0__2, %continue__1 - %19 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 1) - %20 = bitcast i8* %19 to i1* - %21 = load i1, i1* %20, align 1 - br i1 %21, label %then0__3, label %continue__3 + %18 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 1) + %19 = bitcast i8* %18 to i1* + %20 = load i1, i1* %19, align 1 + br i1 %20, label %then0__3, label %continue__3 then0__3: ; preds = %continue__2 - %22 = load i64, i64* %appending, align 4 - %23 = add i64 %22, 1 - store i64 %23, i64* %appending, align 4 + %21 = load i64, i64* %appending, align 4 + %22 = add i64 %21, 1 + store i64 %22, i64* %appending, align 4 br label %continue__3 continue__3: ; preds = %then0__3, %continue__2 - %24 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 2) - %25 = bitcast i8* %24 to i1* - %26 = load i1, i1* %25, align 1 - br i1 %26, label %then0__4, label %continue__4 + %23 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %result, i64 2) + %24 = bitcast i8* %23 to i1* + %25 = load i1, i1* %24, align 1 + br i1 %25, label %then0__4, label %continue__4 then0__4: ; preds = %continue__3 - %27 = load i64, i64* %appending, align 4 - %28 = add i64 %27, 1 - store i64 %28, i64* %appending, align 4 + %26 = load i64, i64* %appending, align 4 + %27 = add i64 %26, 1 + store i64 %27, i64* %appending, align 4 br label %continue__4 continue__4: ; preds = %then0__4, %continue__3 - %29 = load i64, i64* %incrementing_result, align 4 - %30 = load i64, i64* %appending, align 4 - %31 = add i64 %29, %30 - store i64 %31, i64* %incrementing_result, align 4 + %28 = load i64, i64* %incrementing_result, align 4 + %29 = load i64, i64* %appending, align 4 + %30 = add i64 %28, %29 + store i64 %30, i64* %incrementing_result, align 4 + call void @__quantum__rt__array_update_alias_count(%Array* %reg, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %result, i32 -1) - call void @__quantum__rt__capture_update_reference_count(%Callable* %2, i32 -1) - call void @__quantum__rt__callable_update_reference_count(%Callable* %2, i32 -1) - %32 = call i64 @__quantum__rt__array_get_size_1d(%Array* %15) - %33 = sub i64 %32, 1 + call void @__quantum__rt__capture_update_reference_count(%Callable* %1, i32 -1) + call void @__quantum__rt__callable_update_reference_count(%Callable* %1, i32 -1) + %31 = call i64 @__quantum__rt__array_get_size_1d(%Array* %14) + %32 = sub i64 %31, 1 br label %header__2 exiting__1: ; preds = %exit__2 - %34 = add i64 %index, 1 + %33 = add i64 %index, 1 br label %header__1 exit__1: ; preds = %header__1 - %35 = load i64, i64* %incrementing_result, align 4 - %36 = mul i64 %35, 5 - call void @__quantum__rt__array_update_alias_count(%Array* %reg, i32 -1) - call void @__quantum__rt__capture_update_reference_count(%Callable* %0, i32 -1) - call void @__quantum__rt__callable_update_reference_count(%Callable* %0, i32 -1) - call void @__quantum__rt__qubit_release_array(%Array* %reg) - call void @__quantum__rt__qubit_release(%Qubit* %a) - call void @__quantum__rt__qubit_release(%Qubit* %b) - call void @__quantum__rt__qubit_release(%Qubit* %c) - ret i64 %36 + %34 = load i64, i64* %incrementing_result, align 4 + %35 = mul i64 %34, 5 + ret i64 %35 header__2: ; preds = %exiting__2, %continue__4 - %37 = phi i64 [ 0, %continue__4 ], [ %42, %exiting__2 ] - %38 = icmp sle i64 %37, %33 - br i1 %38, label %body__2, label %exit__2 + %36 = phi i64 [ 0, %continue__4 ], [ %41, %exiting__2 ] + %37 = icmp sle i64 %36, %32 + br i1 %37, label %body__2, label %exit__2 body__2: ; preds = %header__2 - %39 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %15, i64 %37) - %40 = bitcast i8* %39 to %Result** - %41 = load %Result*, %Result** %40, align 8 - call void @__quantum__rt__result_update_reference_count(%Result* %41, i32 -1) + %38 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %14, i64 %36) + %39 = bitcast i8* %38 to %Result** + %40 = load %Result*, %Result** %39, align 8 + call void @__quantum__rt__result_update_reference_count(%Result* %40, i32 -1) br label %exiting__2 exiting__2: ; preds = %body__2 - %42 = add i64 %37, 1 + %41 = add i64 %36, 1 br label %header__2 exit__2: ; preds = %header__2 - call void @__quantum__rt__array_update_reference_count(%Array* %15, i32 -1) + call void @__quantum__rt__array_update_reference_count(%Array* %14, i32 -1) call void @__quantum__rt__array_update_reference_count(%Array* %result, i32 -1) + call void @__quantum__rt__qubit_release_array(%Array* %reg) br label %exiting__1 } @@ -171,18 +161,16 @@ declare %Qubit* @__quantum__rt__qubit_allocate() declare %Array* @__quantum__rt__qubit_allocate_array(i64) -declare void @__quantum__rt__qubit_release(%Qubit*) - declare void @__quantum__rt__qubit_release_array(%Array*) declare void @__quantum__rt__array_update_alias_count(%Array*, i32) -define internal void @Microsoft__Quantum__Canon___3dd88321d66a42e4af012b2c51d64eed_ApplyToEach__body(%Callable* %singleElementOperation, %Array* %register) { +define internal void @Microsoft__Quantum__Canon___93452e454207446782c14ad0d94b32fd_ApplyToEach__body(%Callable* %singleElementOperation, %Array* %register) { entry: call void @__quantum__rt__capture_update_alias_count(%Callable* %singleElementOperation, i32 1) call void @__quantum__rt__callable_update_alias_count(%Callable* %singleElementOperation, i32 1) call void @__quantum__rt__array_update_alias_count(%Array* %register, i32 1) - %0 = call %Range @Microsoft__Quantum__Arrays___6cddddb708184fd08d2d023713587fa6_IndexRange__body(%Array* %register) + %0 = call %Range @Microsoft__Quantum__Arrays___8109ab526e0848138e988a00cdebe512_IndexRange__body(%Array* %register) %1 = extractvalue %Range %0, 0 %2 = extractvalue %Range %0, 1 %3 = extractvalue %Range %0, 2 @@ -272,7 +260,7 @@ define internal %Array* @Microsoft__Quantum__Convert__ResultArrayAsBoolArray__bo entry: call void @__quantum__rt__array_update_alias_count(%Array* %input, i32 1) %0 = call %Callable* @__quantum__rt__callable_create([4 x void (%Tuple*, %Tuple*, %Tuple*)*]* @Microsoft__Quantum__Convert__ResultAsBool__FunctionTable, [2 x void (%Tuple*, i32)*]* null, %Tuple* null) - %1 = call %Array* @Microsoft__Quantum__Arrays___3d60c572cb664ed58855b31248ae48d6_Mapped__body(%Callable* %0, %Array* %input) + %1 = call %Array* @Microsoft__Quantum__Arrays___59f70b880fa6443ba1a100cd9c4d33ee_Mapped__body(%Callable* %0, %Array* %input) call void @__quantum__rt__array_update_alias_count(%Array* %input, i32 -1) call void @__quantum__rt__capture_update_reference_count(%Callable* %0, i32 -1) call void @__quantum__rt__callable_update_reference_count(%Callable* %0, i32 -1) @@ -283,7 +271,7 @@ define internal %Array* @Microsoft__Quantum__Measurement__MultiM__body(%Array* % entry: call void @__quantum__rt__array_update_alias_count(%Array* %targets, i32 1) %0 = call %Callable* @__quantum__rt__callable_create([4 x void (%Tuple*, %Tuple*, %Tuple*)*]* @Microsoft__Quantum__Intrinsic__M__FunctionTable, [2 x void (%Tuple*, i32)*]* null, %Tuple* null) - %1 = call %Array* @Microsoft__Quantum__Arrays___9a05042c8d364249b4cdc8ff4d323f59_ForEach__body(%Callable* %0, %Array* %targets) + %1 = call %Array* @Microsoft__Quantum__Arrays___eb42932e0de64033a3d8cf387a2b35c7_ForEach__body(%Callable* %0, %Array* %targets) call void @__quantum__rt__array_update_alias_count(%Array* %targets, i32 -1) call void @__quantum__rt__capture_update_reference_count(%Callable* %0, i32 -1) call void @__quantum__rt__callable_update_reference_count(%Callable* %0, i32 -1) @@ -328,73 +316,37 @@ entry: ret void } -declare void @__quantum__qis__h__ctl(%Array*, %Qubit*) - -define internal %Result* @Microsoft__Quantum__Intrinsic__M__body(%Qubit* %qubit) { -entry: - %bases = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 1) - %0 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %bases, i64 0) - %1 = bitcast i8* %0 to i2* - store i2 -2, i2* %1, align 1 - call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 1) - %qubits = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 1) - %2 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %qubits, i64 0) - %3 = bitcast i8* %2 to %Qubit** - store %Qubit* %qubit, %Qubit** %3, align 8 - call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 1) - %4 = call %Result* @__quantum__qis__measure__body(%Array* %bases, %Array* %qubits) - call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 -1) - call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 -1) - call void @__quantum__rt__array_update_reference_count(%Array* %bases, i32 -1) - call void @__quantum__rt__array_update_reference_count(%Array* %qubits, i32 -1) - ret %Result* %4 -} - -declare %Array* @__quantum__rt__array_create_1d(i32, i64) - -declare %Result* @__quantum__qis__measure__body(%Array*, %Array*) - -define internal %Result* @Microsoft__Quantum__Intrinsic__Measure__body(%Array* %bases, %Array* %qubits) { -entry: - call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 1) - call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 1) - %0 = call %Result* @__quantum__qis__measure__body(%Array* %bases, %Array* %qubits) - call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 -1) - call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 -1) - ret %Result* %0 -} - -define internal %Array* @Microsoft__Quantum__Arrays___9a05042c8d364249b4cdc8ff4d323f59_ForEach__body(%Callable* %action, %Array* %array) { +define internal %Array* @Microsoft__Quantum__Arrays___59f70b880fa6443ba1a100cd9c4d33ee_Mapped__body(%Callable* %mapper, %Array* %array) { entry: %retval = alloca %Array*, align 8 - call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 1) + call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 1) %length = call i64 @__quantum__rt__array_get_size_1d(%Array* %array) %0 = icmp eq i64 %length, 0 br i1 %0, label %then0__1, label %continue__1 then0__1: ; preds = %entry - %1 = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 0) - call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 -1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 -1) + %1 = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 0) + call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 -1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) ret %Array* %1 continue__1: ; preds = %entry %2 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %array, i64 0) - %3 = bitcast i8* %2 to %Qubit** - %4 = load %Qubit*, %Qubit** %3, align 8 - %5 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Qubit* }* getelementptr ({ %Qubit* }, { %Qubit* }* null, i32 1) to i64)) - %6 = bitcast %Tuple* %5 to { %Qubit* }* - %7 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %6, i32 0, i32 0 - store %Qubit* %4, %Qubit** %7, align 8 - %8 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) - call void @__quantum__rt__callable_invoke(%Callable* %action, %Tuple* %5, %Tuple* %8) - %9 = bitcast %Tuple* %8 to { %Result* }* - %10 = getelementptr inbounds { %Result* }, { %Result* }* %9, i32 0, i32 0 - %first = load %Result*, %Result** %10, align 8 - %11 = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 %length) + %3 = bitcast i8* %2 to %Result** + %4 = load %Result*, %Result** %3, align 8 + %5 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) + %6 = bitcast %Tuple* %5 to { %Result* }* + %7 = getelementptr inbounds { %Result* }, { %Result* }* %6, i32 0, i32 0 + store %Result* %4, %Result** %7, align 8 + %8 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ i1 }* getelementptr ({ i1 }, { i1 }* null, i32 1) to i64)) + call void @__quantum__rt__callable_invoke(%Callable* %mapper, %Tuple* %5, %Tuple* %8) + %9 = bitcast %Tuple* %8 to { i1 }* + %10 = getelementptr inbounds { i1 }, { i1 }* %9, i32 0, i32 0 + %first = load i1, i1* %10, align 1 + %11 = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 %length) %12 = sub i64 %length, 1 br label %header__1 @@ -405,9 +357,8 @@ header__1: ; preds = %exiting__1, %contin body__1: ; preds = %header__1 %15 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %11, i64 %13) - %16 = bitcast i8* %15 to %Result** - store %Result* %first, %Result** %16, align 8 - call void @__quantum__rt__result_update_reference_count(%Result* %first, i32 1) + %16 = bitcast i8* %15 to i1* + store i1 %first, i1* %16, align 1 br label %exiting__1 exiting__1: ; preds = %body__1 @@ -430,28 +381,25 @@ body__2: ; preds = %header__2 call void @__quantum__rt__array_update_alias_count(%Array* %20, i32 -1) %21 = call %Array* @__quantum__rt__array_copy(%Array* %20, i1 false) %22 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %array, i64 %idx) - %23 = bitcast i8* %22 to %Qubit** - %24 = load %Qubit*, %Qubit** %23, align 8 - %25 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Qubit* }* getelementptr ({ %Qubit* }, { %Qubit* }* null, i32 1) to i64)) - %26 = bitcast %Tuple* %25 to { %Qubit* }* - %27 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %26, i32 0, i32 0 - store %Qubit* %24, %Qubit** %27, align 8 - %28 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) - call void @__quantum__rt__callable_invoke(%Callable* %action, %Tuple* %25, %Tuple* %28) - %29 = bitcast %Tuple* %28 to { %Result* }* - %30 = getelementptr inbounds { %Result* }, { %Result* }* %29, i32 0, i32 0 - %31 = load %Result*, %Result** %30, align 8 + %23 = bitcast i8* %22 to %Result** + %24 = load %Result*, %Result** %23, align 8 + %25 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) + %26 = bitcast %Tuple* %25 to { %Result* }* + %27 = getelementptr inbounds { %Result* }, { %Result* }* %26, i32 0, i32 0 + store %Result* %24, %Result** %27, align 8 + %28 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ i1 }* getelementptr ({ i1 }, { i1 }* null, i32 1) to i64)) + call void @__quantum__rt__callable_invoke(%Callable* %mapper, %Tuple* %25, %Tuple* %28) + %29 = bitcast %Tuple* %28 to { i1 }* + %30 = getelementptr inbounds { i1 }, { i1 }* %29, i32 0, i32 0 + %31 = load i1, i1* %30, align 1 %32 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %21, i64 %idx) - %33 = bitcast i8* %32 to %Result** - call void @__quantum__rt__result_update_reference_count(%Result* %31, i32 1) - %34 = load %Result*, %Result** %33, align 8 - call void @__quantum__rt__result_update_reference_count(%Result* %34, i32 -1) - store %Result* %31, %Result** %33, align 8 + %33 = bitcast i8* %32 to i1* + %34 = load i1, i1* %33, align 1 + store i1 %31, i1* %33, align 1 call void @__quantum__rt__array_update_alias_count(%Array* %21, i32 1) store %Array* %21, %Array** %retval, align 8 call void @__quantum__rt__array_update_reference_count(%Array* %20, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %25, i32 -1) - call void @__quantum__rt__result_update_reference_count(%Result* %31, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %28, i32 -1) br label %exiting__2 @@ -461,59 +409,90 @@ exiting__2: ; preds = %body__2 exit__2: ; preds = %header__2 %36 = load %Array*, %Array** %retval, align 8 - call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 -1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 -1) + call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 -1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %36, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %5, i32 -1) - call void @__quantum__rt__result_update_reference_count(%Result* %first, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %8, i32 -1) ret %Array* %36 } -define internal void @Microsoft__Quantum__Intrinsic__M__body__wrapper(%Tuple* %capture-tuple, %Tuple* %arg-tuple, %Tuple* %result-tuple) { +define internal void @Microsoft__Quantum__Convert__ResultAsBool__body__wrapper(%Tuple* %capture-tuple, %Tuple* %arg-tuple, %Tuple* %result-tuple) { entry: - %0 = bitcast %Tuple* %arg-tuple to { %Qubit* }* - %1 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %0, i32 0, i32 0 - %2 = load %Qubit*, %Qubit** %1, align 8 - %3 = call %Result* @Microsoft__Quantum__Intrinsic__M__body(%Qubit* %2) - %4 = bitcast %Tuple* %result-tuple to { %Result* }* - %5 = getelementptr inbounds { %Result* }, { %Result* }* %4, i32 0, i32 0 - store %Result* %3, %Result** %5, align 8 + %0 = bitcast %Tuple* %arg-tuple to { %Result* }* + %1 = getelementptr inbounds { %Result* }, { %Result* }* %0, i32 0, i32 0 + %2 = load %Result*, %Result** %1, align 8 + %3 = call i1 @Microsoft__Quantum__Convert__ResultAsBool__body(%Result* %2) + %4 = bitcast %Tuple* %result-tuple to { i1 }* + %5 = getelementptr inbounds { i1 }, { i1 }* %4, i32 0, i32 0 + store i1 %3, i1* %5, align 1 ret void } -define internal %Array* @Microsoft__Quantum__Arrays___3d60c572cb664ed58855b31248ae48d6_Mapped__body(%Callable* %mapper, %Array* %array) { +define internal i1 @Microsoft__Quantum__Convert__ResultAsBool__body(%Result* %input) { +entry: + %0 = call %Result* @__quantum__rt__result_get_zero() + %1 = call i1 @__quantum__rt__result_equal(%Result* %input, %Result* %0) + %2 = select i1 %1, i1 false, i1 true + ret i1 %2 +} + +declare %Result* @__quantum__rt__result_get_zero() + +declare i1 @__quantum__rt__result_equal(%Result*, %Result*) + +declare void @__quantum__rt__capture_update_alias_count(%Callable*, i32) + +declare void @__quantum__rt__callable_update_alias_count(%Callable*, i32) + +define internal %Range @Microsoft__Quantum__Arrays___8109ab526e0848138e988a00cdebe512_IndexRange__body(%Array* %array) { +entry: + call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 1) + %0 = call i64 @__quantum__rt__array_get_size_1d(%Array* %array) + %1 = sub i64 %0, 1 + %2 = insertvalue %Range { i64 0, i64 1, i64 0 }, i64 %1, 2 + call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) + ret %Range %2 +} + +declare void @__quantum__rt__callable_invoke(%Callable*, %Tuple*, %Tuple*) + +declare %Tuple* @__quantum__rt__tuple_create(i64) + +declare void @__quantum__rt__tuple_update_reference_count(%Tuple*, i32) + +define internal %Array* @Microsoft__Quantum__Arrays___eb42932e0de64033a3d8cf387a2b35c7_ForEach__body(%Callable* %action, %Array* %array) { entry: %retval = alloca %Array*, align 8 - call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 1) + call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 1) %length = call i64 @__quantum__rt__array_get_size_1d(%Array* %array) %0 = icmp eq i64 %length, 0 br i1 %0, label %then0__1, label %continue__1 then0__1: ; preds = %entry - %1 = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 0) - call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 -1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 -1) + %1 = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 0) + call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 -1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) ret %Array* %1 continue__1: ; preds = %entry %2 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %array, i64 0) - %3 = bitcast i8* %2 to %Result** - %4 = load %Result*, %Result** %3, align 8 - %5 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) - %6 = bitcast %Tuple* %5 to { %Result* }* - %7 = getelementptr inbounds { %Result* }, { %Result* }* %6, i32 0, i32 0 - store %Result* %4, %Result** %7, align 8 - %8 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ i1 }* getelementptr ({ i1 }, { i1 }* null, i32 1) to i64)) - call void @__quantum__rt__callable_invoke(%Callable* %mapper, %Tuple* %5, %Tuple* %8) - %9 = bitcast %Tuple* %8 to { i1 }* - %10 = getelementptr inbounds { i1 }, { i1 }* %9, i32 0, i32 0 - %first = load i1, i1* %10, align 1 - %11 = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 %length) + %3 = bitcast i8* %2 to %Qubit** + %4 = load %Qubit*, %Qubit** %3, align 8 + %5 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Qubit* }* getelementptr ({ %Qubit* }, { %Qubit* }* null, i32 1) to i64)) + %6 = bitcast %Tuple* %5 to { %Qubit* }* + %7 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %6, i32 0, i32 0 + store %Qubit* %4, %Qubit** %7, align 8 + %8 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) + call void @__quantum__rt__callable_invoke(%Callable* %action, %Tuple* %5, %Tuple* %8) + %9 = bitcast %Tuple* %8 to { %Result* }* + %10 = getelementptr inbounds { %Result* }, { %Result* }* %9, i32 0, i32 0 + %first = load %Result*, %Result** %10, align 8 + %11 = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 %length) %12 = sub i64 %length, 1 br label %header__1 @@ -524,8 +503,9 @@ header__1: ; preds = %exiting__1, %contin body__1: ; preds = %header__1 %15 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %11, i64 %13) - %16 = bitcast i8* %15 to i1* - store i1 %first, i1* %16, align 1 + %16 = bitcast i8* %15 to %Result** + store %Result* %first, %Result** %16, align 8 + call void @__quantum__rt__result_update_reference_count(%Result* %first, i32 1) br label %exiting__1 exiting__1: ; preds = %body__1 @@ -548,25 +528,28 @@ body__2: ; preds = %header__2 call void @__quantum__rt__array_update_alias_count(%Array* %20, i32 -1) %21 = call %Array* @__quantum__rt__array_copy(%Array* %20, i1 false) %22 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %array, i64 %idx) - %23 = bitcast i8* %22 to %Result** - %24 = load %Result*, %Result** %23, align 8 - %25 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) - %26 = bitcast %Tuple* %25 to { %Result* }* - %27 = getelementptr inbounds { %Result* }, { %Result* }* %26, i32 0, i32 0 - store %Result* %24, %Result** %27, align 8 - %28 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ i1 }* getelementptr ({ i1 }, { i1 }* null, i32 1) to i64)) - call void @__quantum__rt__callable_invoke(%Callable* %mapper, %Tuple* %25, %Tuple* %28) - %29 = bitcast %Tuple* %28 to { i1 }* - %30 = getelementptr inbounds { i1 }, { i1 }* %29, i32 0, i32 0 - %31 = load i1, i1* %30, align 1 + %23 = bitcast i8* %22 to %Qubit** + %24 = load %Qubit*, %Qubit** %23, align 8 + %25 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Qubit* }* getelementptr ({ %Qubit* }, { %Qubit* }* null, i32 1) to i64)) + %26 = bitcast %Tuple* %25 to { %Qubit* }* + %27 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %26, i32 0, i32 0 + store %Qubit* %24, %Qubit** %27, align 8 + %28 = call %Tuple* @__quantum__rt__tuple_create(i64 ptrtoint ({ %Result* }* getelementptr ({ %Result* }, { %Result* }* null, i32 1) to i64)) + call void @__quantum__rt__callable_invoke(%Callable* %action, %Tuple* %25, %Tuple* %28) + %29 = bitcast %Tuple* %28 to { %Result* }* + %30 = getelementptr inbounds { %Result* }, { %Result* }* %29, i32 0, i32 0 + %31 = load %Result*, %Result** %30, align 8 %32 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %21, i64 %idx) - %33 = bitcast i8* %32 to i1* - %34 = load i1, i1* %33, align 1 - store i1 %31, i1* %33, align 1 + %33 = bitcast i8* %32 to %Result** + call void @__quantum__rt__result_update_reference_count(%Result* %31, i32 1) + %34 = load %Result*, %Result** %33, align 8 + call void @__quantum__rt__result_update_reference_count(%Result* %34, i32 -1) + store %Result* %31, %Result** %33, align 8 call void @__quantum__rt__array_update_alias_count(%Array* %21, i32 1) store %Array* %21, %Array** %retval, align 8 call void @__quantum__rt__array_update_reference_count(%Array* %20, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %25, i32 -1) + call void @__quantum__rt__result_update_reference_count(%Result* %31, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %28, i32 -1) br label %exiting__2 @@ -576,59 +559,64 @@ exiting__2: ; preds = %body__2 exit__2: ; preds = %header__2 %36 = load %Array*, %Array** %retval, align 8 - call void @__quantum__rt__capture_update_alias_count(%Callable* %mapper, i32 -1) - call void @__quantum__rt__callable_update_alias_count(%Callable* %mapper, i32 -1) + call void @__quantum__rt__capture_update_alias_count(%Callable* %action, i32 -1) + call void @__quantum__rt__callable_update_alias_count(%Callable* %action, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) call void @__quantum__rt__array_update_alias_count(%Array* %36, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %5, i32 -1) + call void @__quantum__rt__result_update_reference_count(%Result* %first, i32 -1) call void @__quantum__rt__tuple_update_reference_count(%Tuple* %8, i32 -1) ret %Array* %36 } -define internal void @Microsoft__Quantum__Convert__ResultAsBool__body__wrapper(%Tuple* %capture-tuple, %Tuple* %arg-tuple, %Tuple* %result-tuple) { +declare %Array* @__quantum__rt__array_create_1d(i32, i64) + +declare %Array* @__quantum__rt__array_copy(%Array*, i1) + +define internal void @Microsoft__Quantum__Intrinsic__M__body__wrapper(%Tuple* %capture-tuple, %Tuple* %arg-tuple, %Tuple* %result-tuple) { entry: - %0 = bitcast %Tuple* %arg-tuple to { %Result* }* - %1 = getelementptr inbounds { %Result* }, { %Result* }* %0, i32 0, i32 0 - %2 = load %Result*, %Result** %1, align 8 - %3 = call i1 @Microsoft__Quantum__Convert__ResultAsBool__body(%Result* %2) - %4 = bitcast %Tuple* %result-tuple to { i1 }* - %5 = getelementptr inbounds { i1 }, { i1 }* %4, i32 0, i32 0 - store i1 %3, i1* %5, align 1 + %0 = bitcast %Tuple* %arg-tuple to { %Qubit* }* + %1 = getelementptr inbounds { %Qubit* }, { %Qubit* }* %0, i32 0, i32 0 + %2 = load %Qubit*, %Qubit** %1, align 8 + %3 = call %Result* @Microsoft__Quantum__Intrinsic__M__body(%Qubit* %2) + %4 = bitcast %Tuple* %result-tuple to { %Result* }* + %5 = getelementptr inbounds { %Result* }, { %Result* }* %4, i32 0, i32 0 + store %Result* %3, %Result** %5, align 8 ret void } -define internal i1 @Microsoft__Quantum__Convert__ResultAsBool__body(%Result* %input) { +define internal %Result* @Microsoft__Quantum__Intrinsic__M__body(%Qubit* %qubit) { entry: - %0 = call %Result* @__quantum__rt__result_get_zero() - %1 = call i1 @__quantum__rt__result_equal(%Result* %input, %Result* %0) - %2 = select i1 %1, i1 false, i1 true - ret i1 %2 + %bases = call %Array* @__quantum__rt__array_create_1d(i32 1, i64 1) + %0 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %bases, i64 0) + %1 = bitcast i8* %0 to i2* + store i2 -2, i2* %1, align 1 + call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 1) + %qubits = call %Array* @__quantum__rt__array_create_1d(i32 8, i64 1) + %2 = call i8* @__quantum__rt__array_get_element_ptr_1d(%Array* %qubits, i64 0) + %3 = bitcast i8* %2 to %Qubit** + store %Qubit* %qubit, %Qubit** %3, align 8 + call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 1) + %4 = call %Result* @__quantum__qis__measure__body(%Array* %bases, %Array* %qubits) + call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 -1) + call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 -1) + call void @__quantum__rt__array_update_reference_count(%Array* %bases, i32 -1) + call void @__quantum__rt__array_update_reference_count(%Array* %qubits, i32 -1) + ret %Result* %4 } -declare %Result* @__quantum__rt__result_get_zero() - -declare i1 @__quantum__rt__result_equal(%Result*, %Result*) - -declare void @__quantum__rt__capture_update_alias_count(%Callable*, i32) - -declare void @__quantum__rt__callable_update_alias_count(%Callable*, i32) - -declare void @__quantum__rt__callable_invoke(%Callable*, %Tuple*, %Tuple*) - -declare %Tuple* @__quantum__rt__tuple_create(i64) - -declare %Array* @__quantum__rt__array_copy(%Array*, i1) +declare void @__quantum__qis__h__ctl(%Array*, %Qubit*) -declare void @__quantum__rt__tuple_update_reference_count(%Tuple*, i32) +declare %Result* @__quantum__qis__measure__body(%Array*, %Array*) -define internal %Range @Microsoft__Quantum__Arrays___6cddddb708184fd08d2d023713587fa6_IndexRange__body(%Array* %array) { +define internal %Result* @Microsoft__Quantum__Intrinsic__Measure__body(%Array* %bases, %Array* %qubits) { entry: - call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 1) - %0 = call i64 @__quantum__rt__array_get_size_1d(%Array* %array) - %1 = sub i64 %0, 1 - %2 = insertvalue %Range { i64 0, i64 1, i64 0 }, i64 %1, 2 - call void @__quantum__rt__array_update_alias_count(%Array* %array, i32 -1) - ret %Range %2 + call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 1) + call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 1) + %0 = call %Result* @__quantum__qis__measure__body(%Array* %bases, %Array* %qubits) + call void @__quantum__rt__array_update_alias_count(%Array* %bases, i32 -1) + call void @__quantum__rt__array_update_alias_count(%Array* %qubits, i32 -1) + ret %Result* %0 } define i64 @Examples__BasicLoops__Run__Interop(i64 %numSegments) #0 {