diff --git a/.github/workflows/citation.yml b/.github/workflows/citation.yml index f8cab13b2..6a018f0ff 100644 --- a/.github/workflows/citation.yml +++ b/.github/workflows/citation.yml @@ -34,36 +34,35 @@ jobs: run: | if [ -f "CITATION.bib" ]; then arr=(${GITHUB_REPOSITORY//\// }) - REPO=${arr[1]} - export PROTOTYPE=${REPO#"prototype-"} - cat <<- EOF > preview.tex + export REPO=${arr[1]} + cat <<- EOF > citation-preview.tex \documentclass[preprint,aps,physrev,notitlepage]{revtex4-2} \usepackage{hyperref} \begin{document} - \title{\texttt{$PROTOTYPE} BibTeX test} + \title{\texttt{$REPO} BibTeX test} \maketitle \noindent - \texttt{$PROTOTYPE} - \cite{$PROTOTYPE} + \texttt{$REPO} + \cite{$REPO} \bibliography{CITATION} \end{document} EOF - pdflatex preview + pdflatex citation-preview fi - name: Run BibTeX run: | if [ -f "CITATION.bib" ]; then - bibtex preview + bibtex citation-preview fi - name: Re-run LaTeX run: | if [ -f "CITATION.bib" ]; then - pdflatex preview - pdflatex preview + pdflatex citation-preview + pdflatex citation-preview fi - name: Upload PDF if: always() uses: actions/upload-artifact@v4 with: - name: preview.pdf - path: preview.pdf + name: citation-preview.pdf + path: citation-preview.pdf diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index aed43f917..0ae818810 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,6 +3,8 @@ name: Build Sphinx docs on: workflow_dispatch: push: + tags: + - "[0-9]+.[0-9]+.[0-9]+*" branches: - main - 'stable/**' @@ -42,15 +44,15 @@ jobs: shell: bash run: | mkdir artifact - cp -a docs/_build/html artifact/ckt_html_docs + cp -a docs/_build/html artifact/qiskit-addon-cutting-htmldocs - name: Upload docs artifact if: always() uses: actions/upload-artifact@v4 with: - name: ckt_html_docs + name: qiskit-addon-cutting-htmldocs path: ./artifact - name: Deploy docs - if: ${{ github.ref == 'refs/heads/stable/0.7' }} + if: ${{ github.ref == 'refs/heads/stable/0.9' }} uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e9fb165da..80fde5991 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,22 +26,22 @@ jobs: name: pypi runs-on: ubuntu-latest needs: github + environment: + name: pypi + url: https://pypi.org/p/qiskit-addon-cutting + permissions: + id-token: write steps: - name: Checkout tag uses: actions/checkout@v4 with: ref: ${{ github.ref_name }} - - name: Install hatch + - name: Install `build` tool run: | python -m pip install --upgrade pip - pip install hatch - - name: Build using hatch + pip install build + - name: Build distribution run: | - hatch build - - name: Publish release - env: - HATCH_INDEX_REPO: https://upload.pypi.org/legacy/ - HATCH_INDEX_USER: __token__ - HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }} - run: | - hatch publish + python -m build + - name: Publish release to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/test_development_versions.yml b/.github/workflows/test_development_versions.yml index 4d0c58920..41aa68e2b 100644 --- a/.github/workflows/test_development_versions.yml +++ b/.github/workflows/test_development_versions.yml @@ -30,8 +30,8 @@ jobs: shell: bash run: | python -m pip install --upgrade pip tox - python -m pip install toml typer - python tools/extremal-python-dependencies.py pin-dependencies \ + python -m pip install extremal-python-dependencies==0.0.3 + extremal-python-dependencies pin-dependencies \ "qiskit @ git+https://github.com/Qiskit/qiskit.git" \ "qiskit-ibm-runtime @ git+https://github.com/Qiskit/qiskit-ibm-runtime.git" \ --inplace @@ -43,6 +43,6 @@ jobs: - name: Test using tox environment shell: bash run: | - pver=${{ matrix.python-version }} - tox -epy${pver/./} -- --run-slow - tox -epy${pver/./}-notebook + toxpyversion=$(echo ${{ matrix.python-version }} | sed -E 's/^([0-9]+)\.([0-9]+).*$/\1\2/') + tox -epy${toxpyversion} -- --run-slow + tox -epy${toxpyversion}-notebook diff --git a/.github/workflows/test_latest_versions.yml b/.github/workflows/test_latest_versions.yml index 03e079878..a53b1842c 100644 --- a/.github/workflows/test_latest_versions.yml +++ b/.github/workflows/test_latest_versions.yml @@ -44,6 +44,6 @@ jobs: - name: Test using tox environment shell: bash run: | - pver=${{ matrix.python-version }} - tox -epy${pver/./} -- --run-slow - tox -epy${pver/./}-notebook + toxpyversion=$(echo ${{ matrix.python-version }} | sed -E 's/^([0-9]+)\.([0-9]+).*$/\1\2/') + tox -epy${toxpyversion} -- --run-slow + tox -epy${toxpyversion}-notebook diff --git a/.github/workflows/test_minimum_versions.yml b/.github/workflows/test_minimum_versions.yml index f337a42f7..646766ee4 100644 --- a/.github/workflows/test_minimum_versions.yml +++ b/.github/workflows/test_minimum_versions.yml @@ -28,9 +28,9 @@ jobs: shell: bash run: | python -m pip install --upgrade pip - python -m pip install toml typer - pip install "tox==$(python tools/extremal-python-dependencies.py get-tox-minversion)" - python tools/extremal-python-dependencies.py pin-dependencies-to-minimum --inplace + python -m pip install extremal-python-dependencies==0.0.3 + pip install "tox==$(extremal-python-dependencies get-tox-minversion)" + extremal-python-dependencies pin-dependencies-to-minimum --inplace - name: Modify tox.ini for more thorough check shell: bash run: | @@ -39,6 +39,6 @@ jobs: - name: Test using tox environment shell: bash run: | - pver=${{ matrix.python-version }} - tox -epy${pver/./} -- --run-slow - tox -epy${pver/./}-notebook + toxpyversion=$(echo ${{ matrix.python-version }} | sed -E 's/^([0-9]+)\.([0-9]+).*$/\1\2/') + tox -epy${toxpyversion} -- --run-slow + tox -epy${toxpyversion}-notebook diff --git a/.mergify.yml b/.mergify.yml index 7eabeb009..a8fe0e995 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -5,4 +5,4 @@ pull_request_rules: actions: backport: branches: - - stable/0.7 + - stable/0.9 diff --git a/.mypy.ini b/.mypy.ini deleted file mode 100644 index 976ba0294..000000000 --- a/.mypy.ini +++ /dev/null @@ -1,2 +0,0 @@ -[mypy] -ignore_missing_imports = True diff --git a/.ruff.toml b/.ruff.toml deleted file mode 100644 index 81b0f2011..000000000 --- a/.ruff.toml +++ /dev/null @@ -1,15 +0,0 @@ -target-version = "py38" - -[lint] -ignore = [ - "E501", # line too long -] - -[lint.per-file-ignores] -"test/**.py" = [ - "F405", # star import - "F403", # unable to detect undefined names due to star import -] -"docs/**" = [ - "E402", # module level import not at top of file -] diff --git a/CITATION.bib b/CITATION.bib index 7f90b42a3..06b82f1f5 100644 --- a/CITATION.bib +++ b/CITATION.bib @@ -1,4 +1,4 @@ -@misc{circuit-knitting-toolbox, +@misc{qiskit-addon-cutting, author = { Agata M. Bra\'{n}czyk and Almudena {Carrera Vazquez} @@ -15,8 +15,8 @@ @misc{circuit-knitting-toolbox and Ibrahim Shehzad and Stefan Woerner }, - title = {{Circuit Knitting Toolbox}}, - howpublished = {\url{https://github.com/Qiskit-Extensions/circuit-knitting-toolbox}}, - year = {2023}, + title = {{Qiskit addon: circuit cutting}}, + howpublished = {\url{https://github.com/Qiskit/qiskit-addon-cutting}}, + year = {2024}, doi = {10.5281/zenodo.7987997} } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 19f3f18a3..8ce24fb67 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,8 @@ # Developer guide -Development of the Circuit Knitting Toolbox takes place [on GitHub](https://github.com/Qiskit-Extensions/circuit-knitting-toolbox). The [Contributing to Qiskit](https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md) guide may serve as a useful starting point, as the toolbox builds on [Qiskit] and is part of the [Qiskit Ecosystem]. +Development of the `qiskit-addon-cutting` package takes place [on GitHub](https://github.com/Qiskit/qiskit-addon-cutting). The [Contributing to Qiskit](https://github.com/Qiskit/qiskit/blob/main/CONTRIBUTING.md) guide may serve as a useful starting point, as this package builds on [Qiskit]. -The toolbox is written in [Python] and uses [tox] as a testing framework. A description of the available `tox` test environments is located at [`test/README.md`](test/README.md). These environments are used in the CI workflows, which are described at [`.github/workflows/README.md`](.github/workflows/README.md). +This package is written in [Python] and uses [tox] as a testing framework. A description of the available `tox` test environments is located at [`test/README.md`](test/README.md). These environments are used in the CI workflows, which are described at [`.github/workflows/README.md`](.github/workflows/README.md). Project configuration, including information about dependencies, is stored in [`pyproject.toml`](pyproject.toml). @@ -11,7 +11,6 @@ We use [Sphinx] for documentation and [reno] for release notes. We use [Google We require 100% coverage in all new code. In rare cases where it is not possible to test a code block, we mark it with ``# pragma: no cover`` so that the ``coverage`` tests will pass. [Qiskit]: https://www.ibm.com/quantum/qiskit -[Qiskit Ecosystem]: https://qiskit.github.io/ecosystem/ [Python]: https://www.python.org/ [tox]: https://github.com/tox-dev/tox [Sphinx]: https://www.sphinx-doc.org/ diff --git a/Dockerfile b/Dockerfile index 8a607a1dd..55806e286 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM jupyter/minimal-notebook:python-3.11 +FROM quay.io/jupyter/minimal-notebook LABEL maintainer="Jim Garrison " @@ -7,7 +7,7 @@ LABEL maintainer="Jim Garrison " RUN rm -rf work && \ mkdir .src -COPY . .src/circuit-knitting-toolbox +COPY . .src/qiskit-addon-cutting # Fix the permissions of ~/.src and ~/persistent-volume USER root @@ -17,7 +17,7 @@ USER ${NB_UID} # Consolidate the docs into the home directory RUN mkdir docs && \ - cp -a .src/circuit-knitting-toolbox/docs docs/circuit-knitting-toolbox + cp -a .src/qiskit-addon-cutting/docs docs/qiskit-addon-cutting # Pip install everything -RUN pip install -e '.src/circuit-knitting-toolbox[notebook-dependencies]' +RUN pip install -e '.src/qiskit-addon-cutting[notebook-dependencies]' diff --git a/INSTALL.rst b/INSTALL.rst index 0d84681b5..60b613f46 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -1,7 +1,7 @@ Installation Instructions ========================= -Let's see how to install the Circuit Knitting Toolbox (CKT). The first +Let's see how to install the Qiskit addon for circuit cutting. The first thing to do is choose how you're going to run and install the packages. There are three primary ways to do this: @@ -17,7 +17,7 @@ Pre-Installation Users who wish to install locally (using either :ref:`Option 1` or :ref:`Option 2`) are encouraged to follow a brief set of common instructions to prepare a Python environment for -installation of CKT: +installation: First, create a minimal environment with only Python installed in it. We recommend using `Python virtual environments `__. @@ -41,15 +41,15 @@ Note: If you are using Windows, use the following commands in PowerShell: .. _Option 1: -Option 1: Pip Installation -^^^^^^^^^^^^^^^^^^^^^^^^^^ +Option 1: Install from PyPI +^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Upgrade pip and install the CKT package. +The most straightforward way to install the ``qiskit-addon-cutting`` package is via PyPI. .. code:: sh pip install --upgrade pip - pip install circuit-knitting-toolbox + pip install qiskit-addon-cutting .. _Option 2: @@ -57,22 +57,22 @@ Upgrade pip and install the CKT package. Option 2: Install from Source ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Users who wish to develop in the repository or run the tutorials locally may want to install from source. +Users who wish to develop in the repository or run the notebooks locally may want to install from source. -In either case, the first step is to clone the CKT repository. +In either case, the first step is to clone the ``qiskit-addon-cutting`` repository. .. code:: sh - git clone git@github.com:Qiskit-Extensions/circuit-knitting-toolbox.git + git clone git@github.com:Qiskit/qiskit-addon-cutting.git Next, upgrade pip and enter the repository. .. code:: sh pip install --upgrade pip - cd circuit-knitting-toolbox + cd qiskit-addon-cutting -The next step is to install CKT to the virtual environment. If you plan on running the tutorials, install the +The next step is to install to the virtual environment. If you plan on running the notebooks, install the notebook dependencies in order to run all the visualizations in the notebooks. If you plan on developing in the repository, you may want to install the ``dev`` dependencies. @@ -82,7 +82,7 @@ Adjust the options below to suit your needs. pip install tox notebook -e '.[notebook-dependencies,dev]' -If you installed the notebook dependencies, you can get started with CKT by running the notebooks in the docs. +If you installed the notebook dependencies, you can get started with the addon by running the notebooks in the docs. .. code:: @@ -95,15 +95,15 @@ If you installed the notebook dependencies, you can get started with CKT by runn Option 3: Use within Docker ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -We have provided a `Dockerfile `__, which can be used to +We have provided a `Dockerfile `__, which can be used to build a Docker image, as well as a -`compose.yaml `__ file, which allows one +`compose.yaml `__ file, which allows one to use the Docker image with just a few simple commands. .. code:: sh - git clone git@github.com:Qiskit-Extensions/circuit-knitting-toolbox.git - cd circuit-knitting-toolbox + git clone git@github.com:Qiskit/qiskit-addon-cutting.git + cd qiskit-addon-cutting docker compose build docker compose up @@ -148,4 +148,4 @@ Platform Support We expect this package to work on `any platform supported by Qiskit `__. If you are experiencing issues running the software on your device, you -may consider :ref:`using the toolbox within Docker