From 51a89081d0a9a52bc96710f7d9ad451867daca83 Mon Sep 17 00:00:00 2001 From: cqc-melf <70640934+cqc-melf@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:09:19 +0000 Subject: [PATCH 01/36] Docs/update menu links (#45) * update links in documentation * update readme --- .github/workflows/docs/build-docs | 14 ++++++++++---- README.md | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs/build-docs b/.github/workflows/docs/build-docs index 5a2a4080..6166e0bd 100755 --- a/.github/workflows/docs/build-docs +++ b/.github/workflows/docs/build-docs @@ -10,8 +10,11 @@ import sys DOCS_DIR = Path(sys.argv[0]).absolute().parent MODULES_DIR = DOCS_DIR.parent.parent.parent -PYTKET_DOCS_LINK = "https://cqcl.github.io/tket/pytket/api/index.html" -PYTKET_EX_DOCS_LINK = "https://cqcl.github.io/pytket-extensions/api/index.html" +TKET_EXAMPLES_LINK = "https://tket.quantinuum.com/examples/" +TKET_MANUAL_LINK = "https://tket.quantinuum.com/user-manual/" +TKET_WEBSITE_LINK = "https://tket.quantinuum.com/" +PYTKET_DOCS_LINK = "https://tket.quantinuum.com/api-docs/" +PYTKET_EX_DOCS_LINK = "https://tket.quantinuum.com/api-docs/extensions.html" PYTKET_QULACS_PYPI_LINK = "https://pypi.org/project/pytket-cutensornet/" PYTKET_QULACS_GITHUB = "https://github.com/CQCL/pytket-cutensornet" MODULE = "cutensornet" @@ -49,10 +52,13 @@ def build_module_docs(): with open(mod_docs / "intro.txt", "r") as f: content = f.readlines() content.append( - "\n.. toctree::\n\t:caption: More documentation:\n\t:maxdepth: 1\n\n" + "\n.. toctree::\n\t:caption: pytket documentation:\n\t:maxdepth: 1\n\n" ) - content.append(f"\tpytket <{PYTKET_DOCS_LINK}>\n") + content.append(f"\tpytket API docs <{PYTKET_DOCS_LINK}>\n") content.append(f"\tpytket extensions <{PYTKET_EX_DOCS_LINK}>\n") + content.append(f"\tManual <{TKET_MANUAL_LINK}>\n") + content.append(f"\tExample notebooks <{TKET_EXAMPLES_LINK}>\n") + content.append(f"\tTKET website <{TKET_WEBSITE_LINK}>\n") content.append( "\n.. toctree::\n\t:caption: Links:\n\t:maxdepth: 1\n\n" ) diff --git a/README.md b/README.md index 1c8fec4f..3f3ca200 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,9 @@ or `Hopper` GPU and first install `cuQuantum Python` following their installatio This will include the necessary dependencies such as CUDA toolkit. Then, to install `pytket-cutensornet`, run: -```pip install pytket-cutensornet``` +```shell +pip install pytket-cutensornet +``` ## Bugs, support and feature requests From 439f3752aa0ab9354d7f41d3b205f271cc57a493 Mon Sep 17 00:00:00 2001 From: cqc-melf <70640934+cqc-melf@users.noreply.github.com> Date: Thu, 23 Nov 2023 07:45:56 +0000 Subject: [PATCH 02/36] update dependebot and clean up links (#46) --- .github/dependabot.yml | 16 ++++++++++++++++ .github/workflows/docs/conf.py | 2 +- README.md | 9 ++------- examples/mps_tutorial.ipynb | 2 +- setup.py | 2 +- 5 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f384d36a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: pip + directory: "/" + schedule: + interval: "daily" + groups: + python-packages: + patterns: + - "*" diff --git a/.github/workflows/docs/conf.py b/.github/workflows/docs/conf.py index 6623061b..748ab387 100644 --- a/.github/workflows/docs/conf.py +++ b/.github/workflows/docs/conf.py @@ -45,7 +45,7 @@ # -- Extension configuration ------------------------------------------------- -pytketdoc_base = "https://cqcl.github.io/tket/pytket/api/" +pytketdoc_base = "https://tket.quantinuum.com/api-docs/" intersphinx_mapping = { "python": ("https://docs.python.org/3/", None), diff --git a/README.md b/README.md index 3f3ca200..d41ed39f 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,7 @@ -# Pytket Extensions - -This repository contains the pytket-cutensornet extension, using Quantinuum's -[pytket](https://cqcl.github.io/tket/pytket/api/index.html) quantum SDK. - # pytket-cutensornet -[Pytket](https://cqcl.github.io/tket/pytket/api/index.html) is a python module for interfacing -with tket, a quantum computing toolkit and optimisation compiler developed by Quantinuum. +[Pytket](https://tket.quantinuum.com/api-docs/index.html) is a python module for interfacing +with tket, a quantum computing toolkit and optimising compiler developed by Quantinuum. [cuTensorNet](https://docs.nvidia.com/cuda/cuquantum/cutensornet/index.html) is a diff --git a/examples/mps_tutorial.ipynb b/examples/mps_tutorial.ipynb index 237504e7..ed8bf238 100644 --- a/examples/mps_tutorial.ipynb +++ b/examples/mps_tutorial.ipynb @@ -34,7 +34,7 @@ "source": [ "# Introduction\n", "\n", - "This notebook provides examples of the usage of the MPS functionalities of `pytket_cutensornet`. For more information, see the docs at https://cqcl.github.io/pytket-cutensornet/api/index.html.\n", + "This notebook provides examples of the usage of the MPS functionalities of `pytket_cutensornet`. For more information, see the docs at https://tket.quantinuum.com/extensions/pytket-cutensornet/api/index.html.\n", "\n", "A Matrix Product State (MPS) represents a state on `n` qubits as a list of `n` tensors connected in a line as show below:\n", "\n", diff --git a/setup.py b/setup.py index 592d71f8..38582feb 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ author_email="tket-support@cambridgequantum.com", python_requires=">=3.9", project_urls={ - "Documentation": "https://cqcl.github.io/pytket-cutensornet/api/index.html", + "Documentation": "https://tket.quantinuum.com/extensions/pytket-cutensornet/api/index.html", "Source": "https://github.com/CQCL/pytket-cutensornet", "Tracker": "https://github.com/CQCL/pytket-cutensornet/issues", }, From 7b5944898d6f4b1accd482534a823edc3a317169 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:47:06 +0000 Subject: [PATCH 03/36] Bump actions/upload-pages-artifact from 1 to 2 (#47) Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 1 to 2. - [Release notes](https://github.com/actions/upload-pages-artifact/releases) - [Commits](https://github.com/actions/upload-pages-artifact/compare/v1...v2) --- updated-dependencies: - dependency-name: actions/upload-pages-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index cf742cf8..22f23ee4 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -119,7 +119,7 @@ jobs: mkdir extensions ./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions/api - name: Upload docs as artefact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v2 with: path: .github/workflows/docs/extensions From d76394a6ddf86a98cf4755f8ce92e9dbda325f64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:47:51 +0000 Subject: [PATCH 04/36] Bump actions/checkout from 3 to 4 (#48) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build_and_test.yml | 4 ++-- .github/workflows/docs.yml | 2 +- .github/workflows/lint.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 22f23ee4..6c0eddb9 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -26,7 +26,7 @@ jobs: os: ['ubuntu-22.04', 'macos-12'] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: '0' - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/* @@ -94,7 +94,7 @@ jobs: needs: publish_to_pypi runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: '0' - name: Set up Python 3.10 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8afea444..8e82be55 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: name: build docs runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.10 uses: actions/setup-python@v4 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 74edd9b5..87c083f8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.x uses: actions/setup-python@v4 with: From 49566086dfb4d873828cdf4913d53b5ac192f418 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Nov 2023 09:48:22 +0000 Subject: [PATCH 05/36] Bump the python-packages group with 2 updates (#49) Updates the requirements on [black](https://github.com/psf/black) and [pylint](https://github.com/pylint-dev/pylint) to permit the latest version. Updates `black` to 23.11.0 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/22.3.0...23.11.0) Updates `pylint` to 3.0.2 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v2.13.0...v3.0.2) --- updated-dependencies: - dependency-name: black dependency-type: direct:production dependency-group: python-packages - dependency-name: pylint dependency-type: direct:production dependency-group: python-packages ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- lint-requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lint-requirements.txt b/lint-requirements.txt index 1e43bf10..865cefa9 100644 --- a/lint-requirements.txt +++ b/lint-requirements.txt @@ -1,2 +1,2 @@ -black~=22.3 -pylint~=2.13,!=2.13.6 \ No newline at end of file +black~=23.11 +pylint~=3.0 \ No newline at end of file From 406961563bd72a0da6f9305a85ca88d70de6f34e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 00:39:57 +0000 Subject: [PATCH 06/36] Bump actions/deploy-pages from 2 to 3 Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 2 to 3. - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](https://github.com/actions/deploy-pages/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/deploy-pages dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 6c0eddb9..98dc1236 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -137,4 +137,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@v3 \ No newline at end of file From 19a563b7aab5b55b7f2d90cb4f3b5ea6f1006885 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 00:50:21 +0000 Subject: [PATCH 07/36] Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build_and_test.yml | 6 +++--- .github/workflows/docs.yml | 2 +- .github/workflows/lint.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 6c0eddb9..16a7ea71 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -31,7 +31,7 @@ jobs: fetch-depth: '0' - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/* - name: Set up Python 3.9 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.9' - name: Build and mypy (3.9) @@ -42,7 +42,7 @@ jobs: ./.github/workflows/build-test mypy - name: Set up Python 3.10 if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'release' || github.event_name == 'schedule' - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' - name: Build (3.10) @@ -98,7 +98,7 @@ jobs: with: fetch-depth: '0' - name: Set up Python 3.10 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' - name: Download all wheels diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8e82be55..26e08a12 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python 3.10 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' - name: Upgrade pip and install wheel diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 87c083f8..2356b943 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python 3.x - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Update pip From 0e744ed4d2aa44a3c7130b7af1c953e4f5996b90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:06:00 +0000 Subject: [PATCH 08/36] Bump the python-packages group with 1 update Updates the requirements on [black](https://github.com/psf/black) to permit the latest version. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.11.0...23.12.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:production dependency-group: python-packages ... Signed-off-by: dependabot[bot] --- lint-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint-requirements.txt b/lint-requirements.txt index 865cefa9..3d9b6a8e 100644 --- a/lint-requirements.txt +++ b/lint-requirements.txt @@ -1,2 +1,2 @@ -black~=23.11 +black~=23.12 pylint~=3.0 \ No newline at end of file From ed538df942d13ea20c4de5c4006b0b1ee8f34507 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 01:01:21 +0000 Subject: [PATCH 09/36] Bump actions/download-artifact from 3 to 4 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build_and_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index c96c2d12..c0abc49a 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -74,7 +74,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Download all wheels - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: wheelhouse - name: Put them all in the dist folder @@ -102,7 +102,7 @@ jobs: with: python-version: '3.10' - name: Download all wheels - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: wheelhouse - name: Install pip, wheel From 8a9e26ad725af66f60bb668caa28807debce295d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 01:01:25 +0000 Subject: [PATCH 10/36] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build_and_test.yml | 2 +- .github/workflows/docs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index c96c2d12..886df000 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -51,7 +51,7 @@ jobs: run: | chmod +x ./.github/workflows/build-test ./.github/workflows/build-test nomypy - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: github.event_name == 'release' || contains(github.ref, 'refs/heads/wheel') with: name: artefacts diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 26e08a12..1f624bb6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -30,7 +30,7 @@ jobs: cd .github/workflows/docs mkdir extensions ./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: pytket-extension-docs path: .github/workflows/docs/extensions/ \ No newline at end of file From 6ad3a15d9dbbd66ed59a550758ec78d258dde0e0 Mon Sep 17 00:00:00 2001 From: Melf Date: Fri, 15 Dec 2023 13:51:59 +0000 Subject: [PATCH 11/36] update github actions --- .github/workflows/build_and_test.yml | 6 +++--- .github/workflows/docs.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index c96c2d12..19a7c3c1 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -51,7 +51,7 @@ jobs: run: | chmod +x ./.github/workflows/build-test ./.github/workflows/build-test nomypy - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: github.event_name == 'release' || contains(github.ref, 'refs/heads/wheel') with: name: artefacts @@ -74,7 +74,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Download all wheels - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: wheelhouse - name: Put them all in the dist folder @@ -102,7 +102,7 @@ jobs: with: python-version: '3.10' - name: Download all wheels - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: wheelhouse - name: Install pip, wheel diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 26e08a12..1f624bb6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -30,7 +30,7 @@ jobs: cd .github/workflows/docs mkdir extensions ./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: pytket-extension-docs path: .github/workflows/docs/extensions/ \ No newline at end of file From 8ba4d316ffed239d95ee2a3af70cb87d8a818eea Mon Sep 17 00:00:00 2001 From: Melf Date: Fri, 15 Dec 2023 13:54:21 +0000 Subject: [PATCH 12/36] add PR template --- .github/pull_request_template.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..558b0333 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,15 @@ +# Description + +Please summarise the changes. + +# Related issues + +Please mention any github issues addressed by this PR. + +# Checklist + +- [ ] I have performed a self-review of my code. +- [ ] I have commented hard-to-understand parts of my code. +- [ ] I have made corresponding changes to the public API documentation. +- [ ] I have added tests that prove my fix is effective or that my feature works. +- [ ] I have updated the changelog with any user-facing changes. From 20463e2d04fb7dc192d22df6e54364298eb8effd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 00:42:38 +0000 Subject: [PATCH 13/36] Bump actions/deploy-pages from 3 to 4 Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 3 to 4. - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](https://github.com/actions/deploy-pages/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/deploy-pages dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 19a7c3c1..68a4b472 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -137,4 +137,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v3 \ No newline at end of file + uses: actions/deploy-pages@v4 \ No newline at end of file From 4aa00b04333a8ae85f11e97cb0307d7afa03d90e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 00:42:41 +0000 Subject: [PATCH 14/36] Bump actions/upload-pages-artifact from 2 to 3 Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 2 to 3. - [Release notes](https://github.com/actions/upload-pages-artifact/releases) - [Commits](https://github.com/actions/upload-pages-artifact/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/upload-pages-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 19a7c3c1..8b999e3f 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -119,7 +119,7 @@ jobs: mkdir extensions ./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions/api - name: Upload docs as artefact - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 with: path: .github/workflows/docs/extensions From 32a930a530ab5b1418af104ccde3f71219628bd7 Mon Sep 17 00:00:00 2001 From: Pablo Andres-Martinez <104848389+PabloAndresCQ@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:45:39 +0000 Subject: [PATCH 15/36] Refactor/discarded weight cutoff (#42) * Now using discarded_weight_cutoff --- pytket/extensions/cutensornet/mps/mps_gate.py | 164 +++++------------- 1 file changed, 40 insertions(+), 124 deletions(-) diff --git a/pytket/extensions/cutensornet/mps/mps_gate.py b/pytket/extensions/cutensornet/mps/mps_gate.py index 93961bf2..a5e322da 100644 --- a/pytket/extensions/cutensornet/mps/mps_gate.py +++ b/pytket/extensions/cutensornet/mps/mps_gate.py @@ -15,8 +15,6 @@ import warnings import logging -import numpy as np # type: ignore - try: import cupy as cp # type: ignore except ImportError: @@ -93,6 +91,8 @@ def _apply_2q_gate(self, positions: tuple[int, int], gate: Op) -> MPSxGate: Returns: ``self``, to allow for method chaining. """ + options = {"handle": self._lib.handle, "device_id": self._lib.device_id} + l_pos = min(positions) r_pos = max(positions) @@ -147,142 +147,39 @@ def _apply_2q_gate(self, positions: tuple[int, int], gate: Op) -> MPSxGate: gate_tensor, self.tensors[l_pos], self.tensors[r_pos], - options={"handle": self._lib.handle, "device_id": self._lib.device_id}, + options=options, optimize={"path": [(0, 1), (0, 1)]}, ) self._logger.debug(f"Intermediate tensor of size (MiB)={T.nbytes / 2**20}") # Get the template of the MPS tensors involved L = self.tensors[l_pos] - l_shape = list(L.shape) R = self.tensors[r_pos] - r_shape = list(R.shape) if self._cfg.truncation_fidelity < 1: - # Carry out SVD decomposition first with NO truncation - # to figure out where to apply the dimension cutoff. - # Then, apply S normalisation and contraction of S and L manually. - # - # TODO: As soon as cuQuantum 23.09 is released, replace this - # unintuitive code with a simple update to SVDConfig so that it - # uses REL_SUM2_CUTOFF. Then the code in the `else` block should - # be run; i.e. use standard cuTensorNet API to do the SVD - # including normalisation and contraction of S with L. + # Apply SVD decomposition to truncate as much as possible before exceeding + # a `discarded_weight_cutoff` of `1 - self._cfg.truncation_fidelity`. self._logger.debug( f"Truncating to target fidelity={self._cfg.truncation_fidelity}" ) - options = {"handle": self._lib.handle, "device_id": self._lib.device_id} - svd_method = tensor.SVDMethod(abs_cutoff=self._cfg.zero) - L, S, R = tensor.decompose( - "acLR->asL,scR", T, method=svd_method, options=options - ) - - # Use the fact that the entries of S are sorted in decreasing - # order and calculate the number of singular values `new_dim` to - # keep so that - # sum([s**2 for s in S']) - # truncation_fidelity <= ------------------------- - # sum([s**2 for s in S]) - # - # where S is the list of original singular values and S' is the set of - # singular values that remain after truncation (before normalisation). - denom = float(sum(cp.square(S))) # Element-wise squaring - numer = 0.0 - old_dim = new_dim - new_dim = 0 - - # Take singular values until we surpass the target fidelity - while self._cfg.truncation_fidelity > numer / denom: - numer += float(S[new_dim] ** 2) - new_dim += 1 - this_fidelity = numer / denom - - # Reshape tensors down to `new_dim` for the virtual bond - # No data is copied or moved around, we're changing the ndarray bounds - l_shape[-2] = new_dim - # pylint: disable = unexpected-keyword-arg # Disable pylint for next line - L = cp.ndarray( - l_shape, - dtype=self._cfg._complex_t, - memptr=L.data, - strides=L.strides, - ) - r_shape[0] = new_dim - # pylint: disable = unexpected-keyword-arg # Disable pylint for next line - R = cp.ndarray( - r_shape, - dtype=self._cfg._complex_t, - memptr=R.data, - strides=R.strides, - ) - # pylint: disable = unexpected-keyword-arg # Disable pylint for next line - S = cp.ndarray(new_dim, dtype=self._cfg._real_t, memptr=S.data) - - # Normalise - S *= np.sqrt(1 / this_fidelity) - - # Contract S into L - S = S.astype(dtype=self._cfg._complex_t, copy=False) - # Use some einsum index magic: since the virtual bond "s" appears in the - # list of bonds of the output, it is not summed over. - # This causes S to act as the intended diagonal matrix. - L = cq.contract( - "asL,s->asL", - L, - S, - options={"handle": self._lib.handle, "device_id": self._lib.device_id}, - optimize={"path": [(0, 1)]}, - ) - - # We multiply the fidelity of the current step to the overall fidelity - # to keep track of a lower bound for the fidelity. - self.fidelity *= this_fidelity - - # Report to logger - self._logger.debug(f"Truncation done. Truncation fidelity={this_fidelity}") - self._logger.debug( - f"Reduced virtual bond dimension from {old_dim} to {new_dim}." + svd_method = tensor.SVDMethod( + abs_cutoff=self._cfg.zero, + discarded_weight_cutoff=1 - self._cfg.truncation_fidelity, + partition="U", # Contract S directly into U (named L in our case) + normalization="L2", # Sum of squares singular values must equal 1 ) elif new_dim > self._cfg.chi: # Apply SVD decomposition and truncate up to a `max_extent` (for the shared - # bond) of `self._cfg.chi`. Ask cuTensorNet to contract S directly into the - # L tensor and normalise the singular values so that the sum of its squares - # is equal to one (i.e. the MPS is a normalised state after truncation). + # bond) of `self._cfg.chi`. self._logger.debug(f"Truncating to (or below) chosen chi={self._cfg.chi}") - options = {"handle": self._lib.handle, "device_id": self._lib.device_id} svd_method = tensor.SVDMethod( abs_cutoff=self._cfg.zero, max_extent=self._cfg.chi, partition="U", # Contract S directly into U (named L in our case) - normalization="L2", # Sum of squares equal 1 - ) - - L, S, R, svd_info = tensor.decompose( - "acLR->asL,scR", T, method=svd_method, options=options, return_info=True - ) - assert S is None # Due to "partition" option in SVDMethod - - # discarded_weight is calculated within cuTensorNet as: - # sum([s**2 for s in S']) - # discarded_weight = 1 - ------------------------- - # sum([s**2 for s in S]) - # where S is the list of original singular values and S' is the set of - # singular values that remain after truncation (before normalisation). - # It can be shown that the fidelity ||^2 (for |phi> and |psi> - # unit vectors before and after truncation) is equal to 1 - disc_weight. - # - # We multiply the fidelity of the current step to the overall fidelity - # to keep track of a lower bound for the fidelity. - this_fidelity = 1.0 - svd_info.discarded_weight - self.fidelity *= this_fidelity - - # Report to logger - self._logger.debug(f"Truncation done. Truncation fidelity={this_fidelity}") - self._logger.debug( - f"Reduced virtual bond dimension from {new_dim} to {R.shape[0]}." + normalization="L2", # Sum of squares singular values must equal 1 ) else: @@ -299,22 +196,41 @@ def _apply_2q_gate(self, positions: tuple[int, int], gate: Op) -> MPSxGate: # since canonicalisation is just meant to detect the optimal singular values # to truncate, but if we find values that are essentially zero, we are safe # to remove them. - options = {"handle": self._lib.handle, "device_id": self._lib.device_id} svd_method = tensor.SVDMethod( abs_cutoff=self._cfg.zero, partition="U", # Contract S directly into U (named L in our case) normalization=None, # Without canonicalisation we must not normalise ) - L, S, R = tensor.decompose( - "acLR->asL,scR", T, method=svd_method, options=options - ) - assert S is None # Due to "partition" option in SVDMethod - # Report to logger + # Apply the SVD decomposition using the configuration defined above + L, S, R, svd_info = tensor.decompose( + "acLR->asL,scR", T, method=svd_method, options=options, return_info=True + ) + assert S is None # Due to "partition" option in SVDMethod + + # Update fidelity if there was some truncation (of non-zero singular values) + if new_dim > self._cfg.chi or self._cfg.truncation_fidelity < 1: + # discarded_weight is calculated within cuTensorNet as: + # sum([s**2 for s in S']) + # discarded_weight = 1 - ------------------------- + # sum([s**2 for s in S]) + # where S is the list of original singular values and S' is the set of + # singular values that remain after truncation (before normalisation). + # It can be shown that the fidelity ||^2 (for |phi> and |psi> + # unit vectors before and after truncation) is equal to 1 - disc_weight. + # + # We multiply the fidelity of the current step to the overall fidelity + # to keep track of a lower bound for the fidelity. + this_fidelity = 1.0 - svd_info.discarded_weight + self.fidelity *= this_fidelity + self._logger.debug(f"Truncation done. Truncation fidelity={this_fidelity}") + + else: self._logger.debug(f"Truncation done. Fidelity estimate unchanged.") - self._logger.debug( - f"Reduced virtual bond dimension from {new_dim} to {R.shape[0]}." - ) + + self._logger.debug( + f"Reduced virtual bond dimension from {new_dim} to {R.shape[0]}." + ) self.tensors[l_pos] = L self.tensors[r_pos] = R From 89ac6d09d5d764d4a4d705c7c88624be75861626 Mon Sep 17 00:00:00 2001 From: Pablo Andres-Martinez <104848389+PabloAndresCQ@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:46:07 +0000 Subject: [PATCH 16/36] Update README to fix broken links (#43) * Updated broken links and added compute capability --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d41ed39f..cca55e5b 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ with tket, a quantum computing toolkit and optimising compiler developed by Quantinuum. -[cuTensorNet](https://docs.nvidia.com/cuda/cuquantum/cutensornet/index.html) is a +[cuTensorNet](https://docs.nvidia.com/cuda/cuquantum/latest/cutensornet/index.html) is a high-performance library for tensor network computations, developed by NVIDIA. -It is part of the [cuQuantum](https://docs.nvidia.com/cuda/cuquantum/index.html) SDK - +It is part of the [cuQuantum](https://docs.nvidia.com/cuda/cuquantum/latest/index.html) SDK - a high-performance library aimed at quantum circuit simulations on the NVIDIA GPU chips, consisting of two major components: - `cuStateVec`: a high-performance library for state vector computations. @@ -16,7 +16,7 @@ Both components have both C and Python API. `pytket-cutensornet` is an extension to `pytket` that allows `pytket` circuits and expectation values to be simulated using `cuTensorNet` via an interface to -[cuQuantum Python](https://docs.nvidia.com/cuda/cuquantum/python/index.html). +[cuQuantum Python](https://docs.nvidia.com/cuda/cuquantum/latest/cutensornet/index.html). Currently, only single-GPU calculations are supported, but a multi-GPU execution will be implemented in the due course using `mpi4py` library. @@ -24,9 +24,10 @@ implemented in the due course using `mpi4py` library. ## Getting started `pytket-cutensornet` is available for Python 3.9, 3.10 and 3.11 on Linux. -In order to use it, you need access to a Linux machine with either `Volta`, `Ampere` -or `Hopper` GPU and first install `cuQuantum Python` following their installation -[instructions](https://docs.nvidia.com/cuda/cuquantum/python/README.html#installation). +In order to use it, you need access to a Linux machine with an NVIDIA GPU of +Compute Capability +7.0 (check it [here](https://developer.nvidia.com/cuda-gpus)) and first +install `cuQuantum Python` following their installation +[instructions](https://docs.nvidia.com/cuda/cuquantum/latest/python/README.html#installation). This will include the necessary dependencies such as CUDA toolkit. Then, to install `pytket-cutensornet`, run: From 46e6b3ba0c7d6af16977eab642271ea86fe50e29 Mon Sep 17 00:00:00 2001 From: PabloAndresCQ Date: Wed, 20 Dec 2023 11:47:00 +0000 Subject: [PATCH 17/36] Updating pytket requirement to 1.22 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 38582feb..e849b2c4 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ license="Apache 2", packages=find_namespace_packages(include=["pytket.*"]), include_package_data=True, - install_requires=["pytket ~= 1.11"], + install_requires=["pytket ~= 1.22"], classifiers=[ "Environment :: Console", "Programming Language :: Python :: 3.9", From 82da3013c6edc38f554a2dd41710ee596274e19a Mon Sep 17 00:00:00 2001 From: PabloAndresCQ Date: Wed, 20 Dec 2023 12:07:31 +0000 Subject: [PATCH 18/36] Updated metadata to 0.5.0 and changelog --- _metadata.py | 2 +- docs/changelog.rst | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/_metadata.py b/_metadata.py index 9669f116..500ed3c5 100644 --- a/_metadata.py +++ b/_metadata.py @@ -1,2 +1,2 @@ -__extension_version__ = "0.4.0" +__extension_version__ = "0.5.0" __extension_name__ = "pytket-cutensornet" diff --git a/docs/changelog.rst b/docs/changelog.rst index 892af085..3f4f6046 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,11 @@ Changelog ~~~~~~~~~ +0.5.0 (December 2023) +--------------------- + +* ``MPS`` simulation with fixed ``truncation_fidelity`` now uses the corresponding truncation primitive from cuQuantum (v23.10). + 0.4.0 (October 2023) -------------------- From 3e8bb5c26c126e47b8cfd92b5f0ff9754e04d99b Mon Sep 17 00:00:00 2001 From: Melf Date: Wed, 20 Dec 2023 15:43:21 +0000 Subject: [PATCH 19/36] fix workflow --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index e4661dc1..f103e89d 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -54,7 +54,7 @@ jobs: - uses: actions/upload-artifact@v4 if: github.event_name == 'release' || contains(github.ref, 'refs/heads/wheel') with: - name: artefacts + name: artefacts-${{ matrix.os }} path: wheelhouse/ - name: Install docs dependencies if: (matrix.os == 'ubuntu-22.04') && (github.event_name == 'pull_request' || github.event_name == 'schedule' ) From 2ab5e820375833f9d7114b471a3f12997441da82 Mon Sep 17 00:00:00 2001 From: Melf Date: Wed, 20 Dec 2023 15:45:55 +0000 Subject: [PATCH 20/36] update version and changelog --- docs/changelog.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 3f4f6046..dfc4196f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,11 +1,12 @@ Changelog ~~~~~~~~~ -0.5.0 (December 2023) +0.5.1 (December 2023) --------------------- * ``MPS`` simulation with fixed ``truncation_fidelity`` now uses the corresponding truncation primitive from cuQuantum (v23.10). + 0.4.0 (October 2023) -------------------- From e3eeb03a152665fbb258b0a5aa154c1c09d90dcd Mon Sep 17 00:00:00 2001 From: Melf Date: Wed, 20 Dec 2023 15:47:14 +0000 Subject: [PATCH 21/36] add pytket to changelog --- docs/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index dfc4196f..965bd432 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,7 +5,7 @@ Changelog --------------------- * ``MPS`` simulation with fixed ``truncation_fidelity`` now uses the corresponding truncation primitive from cuQuantum (v23.10). - +* Updated pytket version requirement to 1.22. 0.4.0 (October 2023) -------------------- From 1db3eb85d90e2beb998caf5788e872dd84c1686f Mon Sep 17 00:00:00 2001 From: Melf Date: Wed, 20 Dec 2023 15:49:42 +0000 Subject: [PATCH 22/36] update version in metadata --- _metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_metadata.py b/_metadata.py index 500ed3c5..b3592a75 100644 --- a/_metadata.py +++ b/_metadata.py @@ -1,2 +1,2 @@ -__extension_version__ = "0.5.0" +__extension_version__ = "0.5.1" __extension_name__ = "pytket-cutensornet" From fb2243e66e3c50cb7883a67153457d7227a8addc Mon Sep 17 00:00:00 2001 From: PabloAndresCQ Date: Wed, 20 Dec 2023 16:04:15 +0000 Subject: [PATCH 23/36] Updated metadata and changelog --- _metadata.py | 2 +- docs/changelog.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_metadata.py b/_metadata.py index b3592a75..ddd08248 100644 --- a/_metadata.py +++ b/_metadata.py @@ -1,2 +1,2 @@ -__extension_version__ = "0.5.1" +__extension_version__ = "0.5.2" __extension_name__ = "pytket-cutensornet" diff --git a/docs/changelog.rst b/docs/changelog.rst index 965bd432..736b1b81 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,7 +1,7 @@ Changelog ~~~~~~~~~ -0.5.1 (December 2023) +0.5.2 (December 2023) --------------------- * ``MPS`` simulation with fixed ``truncation_fidelity`` now uses the corresponding truncation primitive from cuQuantum (v23.10). From 20b46a11b402b41548b208021b7e83ff0c15a92f Mon Sep 17 00:00:00 2001 From: Alec Edgington Date: Thu, 4 Jan 2024 13:10:47 +0000 Subject: [PATCH 24/36] Correct URL for documentation. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 38582feb..ddf24302 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ author_email="tket-support@cambridgequantum.com", python_requires=">=3.9", project_urls={ - "Documentation": "https://tket.quantinuum.com/extensions/pytket-cutensornet/api/index.html", + "Documentation": "https://tket.quantinuum.com/extensions/pytket-cutensornet/index.html", "Source": "https://github.com/CQCL/pytket-cutensornet", "Tracker": "https://github.com/CQCL/pytket-cutensornet/issues", }, From fa7bf4480ea41da8d3f9bbb477257614eac002ef Mon Sep 17 00:00:00 2001 From: cqc-melf <70640934+cqc-melf@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:01:09 +0000 Subject: [PATCH 25/36] Fix/workflow 2023 (#64) * fix artifact name related to update of actions/upload-artifact@v4 * split download in three options * update download of wheels --------- Co-authored-by: PabloAndresCQ --- .github/workflows/build_and_test.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index f103e89d..c00131f7 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -54,7 +54,7 @@ jobs: - uses: actions/upload-artifact@v4 if: github.event_name == 'release' || contains(github.ref, 'refs/heads/wheel') with: - name: artefacts-${{ matrix.os }} + name: artefact-${{ matrix.os }} path: wheelhouse/ - name: Install docs dependencies if: (matrix.os == 'ubuntu-22.04') && (github.event_name == 'pull_request' || github.event_name == 'schedule' ) @@ -74,9 +74,13 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Download all wheels + # downloading all three files into the wheelhouse + # all files are identical, so there will only be one file uses: actions/download-artifact@v4 with: path: wheelhouse + pattern: artefact-* + merge-multiple: true - name: Put them all in the dist folder run: | mkdir dist @@ -137,4 +141,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: actions/deploy-pages@v4 From e5fb71bae1fd76f7fa5213c2ce6d65e15a79c817 Mon Sep 17 00:00:00 2001 From: Melf Date: Wed, 10 Jan 2024 14:52:59 +0000 Subject: [PATCH 26/36] update pytket version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 013bae22..8e7360ca 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ license="Apache 2", packages=find_namespace_packages(include=["pytket.*"]), include_package_data=True, - install_requires=["pytket ~= 1.22"], + install_requires=["pytket ~= 1.23"], classifiers=[ "Environment :: Console", "Programming Language :: Python :: 3.9", From fb46d0a3965f29017bb3f4a39d49d30a71ec9e8f Mon Sep 17 00:00:00 2001 From: Melf Date: Wed, 10 Jan 2024 16:08:27 +0000 Subject: [PATCH 27/36] update version --- _metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_metadata.py b/_metadata.py index ddd08248..d229c3ec 100644 --- a/_metadata.py +++ b/_metadata.py @@ -1,2 +1,2 @@ -__extension_version__ = "0.5.2" +__extension_version__ = "0.5.3" __extension_name__ = "pytket-cutensornet" From 297c3c563e5e8b59f06f7203b35ee2924f785fd4 Mon Sep 17 00:00:00 2001 From: Melf Date: Wed, 10 Jan 2024 16:16:45 +0000 Subject: [PATCH 28/36] update changelog --- docs/changelog.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 736b1b81..c3a21edf 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,11 @@ Changelog ~~~~~~~~~ +0.5.3 (January 2024) +-------------------- + +* Updated pytket version requirement to 1.23. + 0.5.2 (December 2023) --------------------- From 58427f335400f63a35eb2150349680d46534a43f Mon Sep 17 00:00:00 2001 From: Melf Date: Wed, 10 Jan 2024 16:32:40 +0000 Subject: [PATCH 29/36] update deploy-pages@4.0.1 --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index c00131f7..662d0964 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -141,4 +141,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v4.0.1 From 1159157264f82161964708228f87f0718fa8ea67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 00:28:31 +0000 Subject: [PATCH 30/36] Bump actions/deploy-pages from 4.0.1 to 4.0.2 Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](https://github.com/actions/deploy-pages/compare/v4.0.1...v4.0.2) --- updated-dependencies: - dependency-name: actions/deploy-pages dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 662d0964..8968711f 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -141,4 +141,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4.0.1 + uses: actions/deploy-pages@v4.0.2 From 7ffd1546a4a1c1a3bfb035bd0700a1d0640eca37 Mon Sep 17 00:00:00 2001 From: Melf Date: Thu, 11 Jan 2024 14:36:58 +0000 Subject: [PATCH 31/36] update copyright 2024 --- pytket/extensions/cutensornet/__init__.py | 2 +- pytket/extensions/cutensornet/backends/__init__.py | 2 +- pytket/extensions/cutensornet/backends/cutensornet_backend.py | 2 +- pytket/extensions/cutensornet/general.py | 2 +- pytket/extensions/cutensornet/mps/__init__.py | 2 +- pytket/extensions/cutensornet/mps/mps.py | 2 +- pytket/extensions/cutensornet/mps/mps_gate.py | 2 +- pytket/extensions/cutensornet/mps/mps_mpo.py | 2 +- pytket/extensions/cutensornet/mps/simulation.py | 2 +- pytket/extensions/cutensornet/tensor_network_convert.py | 2 +- setup.py | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pytket/extensions/cutensornet/__init__.py b/pytket/extensions/cutensornet/__init__.py index f716ff92..5d12f155 100644 --- a/pytket/extensions/cutensornet/__init__.py +++ b/pytket/extensions/cutensornet/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Quantinuum +# Copyright 2019-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pytket/extensions/cutensornet/backends/__init__.py b/pytket/extensions/cutensornet/backends/__init__.py index 2bdfd2f2..54ae3aa7 100644 --- a/pytket/extensions/cutensornet/backends/__init__.py +++ b/pytket/extensions/cutensornet/backends/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Quantinuum +# Copyright 2019-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pytket/extensions/cutensornet/backends/cutensornet_backend.py b/pytket/extensions/cutensornet/backends/cutensornet_backend.py index 31777037..b6e13757 100644 --- a/pytket/extensions/cutensornet/backends/cutensornet_backend.py +++ b/pytket/extensions/cutensornet/backends/cutensornet_backend.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Quantinuum +# Copyright 2019-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pytket/extensions/cutensornet/general.py b/pytket/extensions/cutensornet/general.py index efa80aa8..97abf081 100644 --- a/pytket/extensions/cutensornet/general.py +++ b/pytket/extensions/cutensornet/general.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Quantinuum +# Copyright 2019-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pytket/extensions/cutensornet/mps/__init__.py b/pytket/extensions/cutensornet/mps/__init__.py index e2c3ec81..ccc950c9 100644 --- a/pytket/extensions/cutensornet/mps/__init__.py +++ b/pytket/extensions/cutensornet/mps/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Quantinuum +# Copyright 2019-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pytket/extensions/cutensornet/mps/mps.py b/pytket/extensions/cutensornet/mps/mps.py index b7334d72..6f072241 100644 --- a/pytket/extensions/cutensornet/mps/mps.py +++ b/pytket/extensions/cutensornet/mps/mps.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Quantinuum +# Copyright 2019-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pytket/extensions/cutensornet/mps/mps_gate.py b/pytket/extensions/cutensornet/mps/mps_gate.py index a5e322da..06864530 100644 --- a/pytket/extensions/cutensornet/mps/mps_gate.py +++ b/pytket/extensions/cutensornet/mps/mps_gate.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Quantinuum +# Copyright 2019-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pytket/extensions/cutensornet/mps/mps_mpo.py b/pytket/extensions/cutensornet/mps/mps_mpo.py index 2cb4e27d..6e1fa49a 100644 --- a/pytket/extensions/cutensornet/mps/mps_mpo.py +++ b/pytket/extensions/cutensornet/mps/mps_mpo.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Quantinuum +# Copyright 2019-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pytket/extensions/cutensornet/mps/simulation.py b/pytket/extensions/cutensornet/mps/simulation.py index 1d330013..79604570 100644 --- a/pytket/extensions/cutensornet/mps/simulation.py +++ b/pytket/extensions/cutensornet/mps/simulation.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Quantinuum +# Copyright 2019-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/pytket/extensions/cutensornet/tensor_network_convert.py b/pytket/extensions/cutensornet/tensor_network_convert.py index 0d9aad71..62394edd 100644 --- a/pytket/extensions/cutensornet/tensor_network_convert.py +++ b/pytket/extensions/cutensornet/tensor_network_convert.py @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Quantinuum +# Copyright 2019-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/setup.py b/setup.py index 8e7360ca..f0bc7c83 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -# Copyright 2020-2023 Quantinuum +# Copyright 2020-2024 Quantinuum # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From f0145da6a3f576ddb77557a935a07dad904a0a94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jan 2024 00:26:01 +0000 Subject: [PATCH 32/36] Bump actions/deploy-pages from 4.0.2 to 4.0.3 Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4.0.2 to 4.0.3. - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](https://github.com/actions/deploy-pages/compare/v4.0.2...v4.0.3) --- updated-dependencies: - dependency-name: actions/deploy-pages dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 8968711f..af800d42 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -141,4 +141,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4.0.2 + uses: actions/deploy-pages@v4.0.3 From 71f026690ff5caf9be8f8f41f05c78ee66a6b1aa Mon Sep 17 00:00:00 2001 From: Silas Dilkes <36165522+sjdilkes@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:02:10 +0000 Subject: [PATCH 33/36] Update python support to 3.10, 3.11 and 3.12 (#73) * Update intro.txt * Update setup.py * Update README.md * Update mypy.ini * Update build_and_test.yml * Update setup.py * Update changelog.rst --- .github/workflows/build_and_test.yml | 23 +++++++++++++++++------ README.md | 2 +- docs/changelog.rst | 8 ++++++++ docs/intro.txt | 4 ++-- mypy.ini | 4 ++-- setup.py | 6 +++--- 6 files changed, 33 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index af800d42..9de996d7 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -30,22 +30,33 @@ jobs: with: fetch-depth: '0' - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/* - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: '3.9' - - name: Build and mypy (3.9) + python-version: '3.10' + - name: Build and mypy (3.10) shell: bash if: (matrix.os == 'macos-12') && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || github.event_name == 'release' || github.event_name == 'schedule' ) run: | chmod +x ./.github/workflows/build-test ./.github/workflows/build-test mypy - - name: Set up Python 3.10 + - name: Set up Python 3.11 if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'release' || github.event_name == 'schedule' uses: actions/setup-python@v5 with: - python-version: '3.10' - - name: Build (3.10) + python-version: '3.11' + - name: Build (3.11) + if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'release' || github.event_name == 'schedule' + shell: bash + run: | + chmod +x ./.github/workflows/build-test + ./.github/workflows/build-test nomypy + - name: Set up Python 3.12 + if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'release' || github.event_name == 'schedule' + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Build (3.12) if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'release' || github.event_name == 'schedule' shell: bash run: | diff --git a/README.md b/README.md index cca55e5b..893394ce 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ implemented in the due course using `mpi4py` library. ## Getting started -`pytket-cutensornet` is available for Python 3.9, 3.10 and 3.11 on Linux. +`pytket-cutensornet` is available for Python 3.10, 3.11 and 3.12 on Linux. In order to use it, you need access to a Linux machine with an NVIDIA GPU of Compute Capability +7.0 (check it [here](https://developer.nvidia.com/cuda-gpus)) and first install `cuQuantum Python` following their installation diff --git a/docs/changelog.rst b/docs/changelog.rst index c3a21edf..0e83ac56 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,14 @@ Changelog ~~~~~~~~~ +Unreleased +---------- + +General: + +* Python 3.12 support added, 3.9 dropped. +* Updated pytket version requirement to 1.24. + 0.5.3 (January 2024) -------------------- diff --git a/docs/intro.txt b/docs/intro.txt index 8641a6b4..e7876948 100644 --- a/docs/intro.txt +++ b/docs/intro.txt @@ -18,7 +18,7 @@ We provide two core functionalities: Currently, only single-GPU calculations are supported, but a multi-GPU execution will be implemented in the due course using ``mpi4py`` library. -``pytket-cutensornet`` is available for Python 3.9, 3.10 and 3.11 on Linux. +``pytket-cutensornet`` is available for Python 3.10, 3.11 and 3.12 on Linux. In order to use it, you need access to a Linux machine with an NVIDIA GPU of Compute Capability +7.0 (check it `here `_) and first install ``cuQuantum Python`` following their installation `instructions `_. This will include the necessary dependencies such as CUDA toolkit. Then, to install @@ -30,4 +30,4 @@ This will include the necessary dependencies such as CUDA toolkit. Then, to inst .. toctree:: api.rst - changelog.rst \ No newline at end of file + changelog.rst diff --git a/mypy.ini b/mypy.ini index 74c92e3f..485c9c7d 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,5 @@ [mypy] -python_version = 3.9 +python_version = 3.10 warn_unused_configs = True disallow_untyped_decorators = False @@ -25,4 +25,4 @@ ignore_errors = True [mypy-lark.*] ignore_missing_imports = True -ignore_errors = True \ No newline at end of file +ignore_errors = True diff --git a/setup.py b/setup.py index f0bc7c83..abc65423 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ version=metadata["__extension_version__"], author="TKET development team", author_email="tket-support@cambridgequantum.com", - python_requires=">=3.9", + python_requires=">=3.10", project_urls={ "Documentation": "https://tket.quantinuum.com/extensions/pytket-cutensornet/index.html", "Source": "https://github.com/CQCL/pytket-cutensornet", @@ -42,12 +42,12 @@ license="Apache 2", packages=find_namespace_packages(include=["pytket.*"]), include_package_data=True, - install_requires=["pytket ~= 1.23"], + install_requires=["pytket ~= 1.24"], classifiers=[ "Environment :: Console", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Intended Audience :: Developers", From ccc5993d7ace09da6a2f7fab526acf9400d3b237 Mon Sep 17 00:00:00 2001 From: Melf Date: Tue, 23 Jan 2024 11:31:03 +0000 Subject: [PATCH 34/36] update changelog --- docs/changelog.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 0e83ac56..ef4f76f2 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,13 +1,11 @@ Changelog ~~~~~~~~~ -Unreleased ----------- - -General: +0.5.4 (January 2024) +-------------------- -* Python 3.12 support added, 3.9 dropped. * Updated pytket version requirement to 1.24. +* Python 3.12 support added, 3.9 dropped. 0.5.3 (January 2024) -------------------- From 517cc8c5021c1a214ebd7854cc9e7bb744798160 Mon Sep 17 00:00:00 2001 From: Melf Date: Tue, 23 Jan 2024 11:40:14 +0000 Subject: [PATCH 35/36] update version number --- _metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_metadata.py b/_metadata.py index d229c3ec..92614389 100644 --- a/_metadata.py +++ b/_metadata.py @@ -1,2 +1,2 @@ -__extension_version__ = "0.5.3" +__extension_version__ = "0.5.4" __extension_name__ = "pytket-cutensornet" From dc1523b22776e4a5e59b7f0fd5e5725af80c49d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 00:36:32 +0000 Subject: [PATCH 36/36] Bump the python-packages group with 1 update Updates the requirements on [black](https://github.com/psf/black) to permit the latest version. Updates `black` to 24.1.1 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.0...24.1.1) --- updated-dependencies: - dependency-name: black dependency-type: direct:production dependency-group: python-packages ... Signed-off-by: dependabot[bot] --- lint-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint-requirements.txt b/lint-requirements.txt index 3d9b6a8e..ee15c9f5 100644 --- a/lint-requirements.txt +++ b/lint-requirements.txt @@ -1,2 +1,2 @@ -black~=23.12 +black~=24.1 pylint~=3.0 \ No newline at end of file