Skip to content

Commit

Permalink
Merge branch 'main' into py313
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison committed Sep 30, 2024
2 parents 0db1ad4 + 2aa5ab7 commit 023feca
Show file tree
Hide file tree
Showing 106 changed files with 895 additions and 589 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
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,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
4 changes: 2 additions & 2 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 Down
6 changes: 3 additions & 3 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 Down
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
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>`.
36 changes: 17 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<!-- SHIELDS -->
<div align="left">

[![Stability](https://img.shields.io/badge/Stability-alpha-f4d03f.svg)](https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/releases)
[![Release](https://img.shields.io/pypi/v/circuit-knitting-toolbox.svg?label=Release)](https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/releases)
[![Release](https://img.shields.io/pypi/v/qiskit-addon-cutting.svg?label=Release)](https://github.com/Qiskit/qiskit-addon-cutting/releases)
![Platform](https://img.shields.io/badge/%F0%9F%92%BB%20Platform-Linux%20%7C%20macOS%20%7C%20Windows-informational)
[![Python](https://img.shields.io/pypi/pyversions/circuit-knitting-toolbox?label=Python&logo=python)](https://www.python.org/)
[![Python](https://img.shields.io/pypi/pyversions/qiskit-addon-cutting?label=Python&logo=python)](https://www.python.org/)
[![Qiskit](https://img.shields.io/badge/Qiskit%20-%20%3E%3D1.1%20-%20%236133BD?logo=Qiskit)](https://github.com/Qiskit/qiskit)
<br />
[![Docs (stable)](https://img.shields.io/badge/%F0%9F%93%84%20Docs-stable-blue.svg)](https://qiskit-extensions.github.io/circuit-knitting-toolbox/)
[![Docs (stable)](https://img.shields.io/badge/%F0%9F%93%84%20Docs-stable-blue.svg)](https://qiskit.github.io/qiskit-addon-cutting/)
[![DOI](https://zenodo.org/badge/543181258.svg)](https://zenodo.org/badge/latestdoi/543181258)
[![License](https://img.shields.io/github/license/Qiskit-Extensions/circuit-knitting-toolbox?label=License)](LICENSE.txt)
[![Downloads](https://img.shields.io/pypi/dm/circuit-knitting-toolbox.svg?label=Downloads)](https://pypi.org/project/circuit-knitting-toolbox/)
[![Tests](https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/actions/workflows/test_latest_versions.yml/badge.svg)](https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/actions/workflows/test_latest_versions.yml)
[![Coverage](https://coveralls.io/repos/github/Qiskit-Extensions/circuit-knitting-toolbox/badge.svg?branch=main)](https://coveralls.io/github/Qiskit-Extensions/circuit-knitting-toolbox?branch=main)
[![License](https://img.shields.io/github/license/Qiskit/qiskit-addon-cutting?label=License)](LICENSE.txt)
[![Downloads](https://img.shields.io/pypi/dm/qiskit-addon-cutting.svg?label=Downloads)](https://pypi.org/project/qiskit-addon-cutting/)
[![Tests](https://github.com/Qiskit/qiskit-addon-cutting/actions/workflows/test_latest_versions.yml/badge.svg)](https://github.com/Qiskit/qiskit-addon-cutting/actions/workflows/test_latest_versions.yml)
[![Coverage](https://coveralls.io/repos/github/Qiskit/qiskit-addon-cutting/badge.svg?branch=main)](https://coveralls.io/github/Qiskit/qiskit-addon-cutting?branch=main)

# Circuit Knitting Toolbox
# Qiskit addon: circuit cutting

### Table of Contents

Expand All @@ -29,36 +28,35 @@

### About

Circuit Knitting is the process of decomposing a larger quantum circuit into many smaller circuits, executing those circuits on a quantum processor(s), and then knitting their results into a reconstruction of the original circuit's outcome.
[Qiskit addons](https://docs.quantum.ibm.com/guides/addons) are a collection of modular tools for building utility-scale workloads powered by Qiskit.

The toolbox currently contains the following tools:
- Circuit Cutting [[1-5]](#references)

For a more detailed discussion on circuit cutting, check out our [technical guide](https://qiskit-extensions.github.io/circuit-knitting-toolbox/circuit_cutting/explanation/index.html#overview-of-circuit-cutting).
This package implements circuit cutting. In this technique, a handful of gates and/or wires are cut, resulting in smaller circuits that are better suited for execution on hardware. The result of the original circuit can then be reconstructed; however, the trade-off is that the overall number of shots must be increased by a factor exponential in the number of cuts.

For a more detailed discussion on circuit cutting, check out our [technical guide](https://qiskit.github.io/qiskit-addon-cutting/explanation/index.html#overview-of-circuit-cutting).

----------------------------------------------------------------------------------------------------

### Documentation

All CKT documentation is available at https://qiskit-extensions.github.io/circuit-knitting-toolbox/.
All documentation is available at https://qiskit.github.io/qiskit-addon-cutting/.

----------------------------------------------------------------------------------------------------

### Installation

We encourage installing CKT via ``pip``, when possible.
We encourage installing this package via ``pip``, when possible.

```bash
pip install 'circuit-knitting-toolbox'
pip install 'qiskit-addon-cutting'
```

For information on installing from source, running CKT in a container, and platform support, refer to the [installation instructions](https://qiskit-extensions.github.io/circuit-knitting-toolbox/install.html) in the CKT documentation.
For information on installing from source, running in a container, and platform support, refer to the [installation instructions](https://qiskit.github.io/qiskit-addon-cutting/install.html) in the documentation.

----------------------------------------------------------------------------------------------------

### Deprecation Policy

This project is meant to evolve rapidly and, as such, does not follow [Qiskit's deprecation policy](https://github.com/Qiskit/qiskit/blob/main/DEPRECATION.md). We may occasionally make breaking changes in order to improve the user experience. When possible, we will keep old interfaces and mark them as deprecated, as long as they can co-exist with the new ones. Each substantial improvement, breaking change, or deprecation will be documented in the [release notes](https://qiskit-extensions.github.io/circuit-knitting-toolbox/release-notes.html).
We follow [semantic versioning](https://semver.org/) and are guided by the principles in [Qiskit's deprecation policy](https://github.com/Qiskit/qiskit/blob/main/DEPRECATION.md). We may occasionally make breaking changes in order to improve the user experience. When possible, we will keep old interfaces and mark them as deprecated, as long as they can co-exist with the new ones. Each substantial improvement, breaking change, or deprecation will be documented in the [release notes](https://qiskit.github.io/qiskit-addon-cutting/release-notes.html).

----------------------------------------------------------------------------------------------------

Expand Down
7 changes: 3 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

## Supported Versions

The Circuit Knitting Toolbox supports one minor version release at a time, both for bug and
security fixes. For example, if the most recent release is 0.2.1, then the 0.2.x
release series is currently supported.
The package supports one minor version release at a time, both for bug and security fixes.
For example, if the most recent release is 0.2.1, then the 0.2.x release series is currently supported.

## Reporting a Vulnerability

To report vulnerabilities, you can privately report a potential security issue
via the GitHub security vulnerabilities feature. This can be done here:

https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/security/advisories
https://github.com/Qiskit/qiskit-addon-cutting/security/advisories

Please do **not** open a public issue about a potential security vulnerability.

Expand Down
Loading

0 comments on commit 023feca

Please sign in to comment.