Skip to content

Commit

Permalink
Merge branch 'main' into reconstruct-distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
jpopesculian committed Oct 4, 2024
2 parents 38345a4 + 28210dc commit d00baf5
Show file tree
Hide file tree
Showing 111 changed files with 1,891 additions and 1,177 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/citation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 5 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Build Sphinx docs
on:
workflow_dispatch:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
branches:
- main
- 'stable/**'
Expand Down Expand Up @@ -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 }}
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions .github/workflows/test_development_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 3 additions & 3 deletions .github/workflows/test_latest_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions .github/workflows/test_minimum_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
2 changes: 1 addition & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pull_request_rules:
actions:
backport:
branches:
- stable/0.7
- stable/0.9
2 changes: 0 additions & 2 deletions .mypy.ini

This file was deleted.

15 changes: 0 additions & 15 deletions .ruff.toml

This file was deleted.

8 changes: 4 additions & 4 deletions CITATION.bib
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@misc{circuit-knitting-toolbox,
@misc{qiskit-addon-cutting,
author = {
Agata M. Bra\'{n}czyk
and Almudena {Carrera Vazquez}
Expand All @@ -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}
}
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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).

Expand All @@ -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/
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM jupyter/minimal-notebook:python-3.11
FROM quay.io/jupyter/minimal-notebook

LABEL maintainer="Jim Garrison <[email protected]>"

Expand All @@ -7,7 +7,7 @@ LABEL maintainer="Jim Garrison <[email protected]>"
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
Expand All @@ -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]'
34 changes: 17 additions & 17 deletions INSTALL.rst
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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 <https://docs.python.org/3.10/tutorial/venv.html>`__.

Expand All @@ -41,38 +41,38 @@ 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:

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 [email protected]:Qiskit-Extensions/circuit-knitting-toolbox.git
git clone [email protected]: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.

Expand All @@ -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::
Expand All @@ -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 <https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/blob/main/Dockerfile>`__, which can be used to
We have provided a `Dockerfile <https://github.com/Qiskit/qiskit-addon-cutting/blob/main/Dockerfile>`__, which can be used to
build a Docker image, as well as a
`compose.yaml <https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/blob/main/compose.yaml>`__ file, which allows one
`compose.yaml <https://github.com/Qiskit/qiskit-addon-cutting/blob/main/compose.yaml>`__ file, which allows one
to use the Docker image with just a few simple commands.

.. code:: sh
git clone [email protected]:Qiskit-Extensions/circuit-knitting-toolbox.git
cd circuit-knitting-toolbox
git clone [email protected]:Qiskit/qiskit-addon-cutting.git
cd qiskit-addon-cutting
docker compose build
docker compose up
Expand Down Expand Up @@ -148,4 +148,4 @@ Platform Support

We expect this package to work on `any platform supported by Qiskit <https://docs.quantum.ibm.com/start/install#operating-system-support>`__. If
you are experiencing issues running the software on your device, you
may consider :ref:`using the toolbox within Docker <Option 3>`.
may consider :ref:`using this package within Docker <Option 3>`.
Loading

0 comments on commit d00baf5

Please sign in to comment.