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
garrison authored May 18, 2024
2 parents e709206 + c468735 commit 2047b7d
Show file tree
Hide file tree
Showing 160 changed files with 8,193 additions and 8,214 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eb78b0ba1b2f34fa72ea9de7a406dc10c102d423
8c8ccd429de2ef8da4849dce987a43cd69f11225
2 changes: 1 addition & 1 deletion .github/workflows/citation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
fi
- name: Upload PDF
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: preview.pdf
path: preview.pdf
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Docker notebook tests
on:
push:
branches: [ main ]
paths: ['Dockerfile', '.dockerignore', 'compose.yaml']
paths: ['Dockerfile', '.dockerignore', 'compose.yaml', '.github/workflows/docker.yml']
pull_request:
branches: [ main ]
paths: ['Dockerfile', '.dockerignore', 'compose.yaml']
paths: ['Dockerfile', '.dockerignore', 'compose.yaml', '.github/workflows/docker.yml']
schedule:
- cron: '0 20 * * 3'

Expand All @@ -20,4 +20,7 @@ jobs:
run: docker compose build
- name: Test notebooks
shell: bash
run: docker compose run notebook "bash" "-c" "pip install pytest nbmake && pytest --nbmake docs --ignore=docs/circuit-knitting-toolbox/entanglement_forging/tutorials/tutorial_2_forging_with_quantum_serverless.ipynb"
run: docker compose run notebook "bash" "-c" "pip install pytest nbmake && pytest --nbmake docs"
- name: Test that persistent-volume is writable
shell: bash
run: docker compose run notebook "bash" "-c" "touch persistent-volume/empty-notebook.ipynb"
18 changes: 12 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
Expand All @@ -37,15 +37,21 @@ jobs:
shell: bash
run: |
tox -edocs
- name: Prepare docs artifact
if: always()
shell: bash
run: |
mkdir artifact
cp -a docs/_build/html artifact/ckt_html_docs
- name: Upload docs artifact
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: html_docs
path: ./docs/_build/html
name: ckt_html_docs
path: ./artifact
- name: Deploy docs
if: ${{ github.ref == 'refs/heads/stable/0.4' }}
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/stable/0.7' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html/
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.10'
- name: Install tox
run: |
python -m pip install --upgrade pip
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test_development_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (development versions)
shell: bash
run: |
python -m pip install --upgrade pip tox
python -m pip install toml typer
python tools/extremal-python-dependencies.py add-dependency \
"qiskit-terra @ git+https://github.com/Qiskit/qiskit.git" \
--inplace
python tools/extremal-python-dependencies.py pin-dependencies \
"qiskit @ git+https://github.com/Qiskit/qiskit.git#subdirectory=qiskit_pkg" \
"qiskit @ git+https://github.com/Qiskit/qiskit.git" \
"qiskit-ibm-runtime @ git+https://github.com/Qiskit/qiskit-ibm-runtime.git" \
--inplace
- name: Modify tox.ini for more thorough check
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test_latest_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ jobs:
max-parallel: 4
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.11"]
python-version: ["3.8", "3.12"]
include:
- os: macos-latest
python-version: "3.8"
python-version: "3.12"
- os: windows-latest
python-version: "3.10"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -47,8 +47,8 @@ jobs:
pver=${{ matrix.python-version }}
tox -epy${pver/./} -- --run-slow
notebook_flags=""
if [ "$RUNNER_OS" = "Windows" ]; then
echo Skipping tutorials \& how-tos that require pyscf
notebook_flags="${notebook_flags} --ignore=docs/entanglement_forging --ignore=docs/_build/jupyter_execute/entanglement_forging/how-tos"
if [ "$pver" = "3.12" ]; then
echo Skipping tutorials that require cplex
notebook_flags="${notebook_flags} --ignore=docs/circuit_cutting/cutqc/tutorials/tutorial_1_automatic_cut_finding.ipynb"
fi
tox -epy${pver/./}-notebook -- ${notebook_flags}
2 changes: 1 addition & 1 deletion .github/workflows/test_minimum_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (minimum versions)
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.4
- stable/0.7
4 changes: 3 additions & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
target-version = "py38"

[lint]
ignore = [
"E501", # line too long
]

[per-file-ignores]
[lint.per-file-ignores]
"test/**.py" = [
"F405", # star import
"F403", # unable to detect undefined names due to star import
Expand Down
20 changes: 19 additions & 1 deletion CITATION.bib
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
@misc{circuit-knitting-toolbox,
author = {Luciano Bello and Agata M. Bra\'{n}czyk and Sergey Bravyi and Almudena {Carrera Vazquez} and Andrew Eddins and Daniel J. Egger and Bryce Fuller and Julien Gacon and James R. Garrison and Jennifer R. Glick and Tanvi P. Gujarati and Ikko Hamamura and Areeq I. Hasan and Takashi Imamichi and Caleb Johnson and Ieva Liepuoniute and Owen Lockwood and Mario Motta and C. D. Pemmaraju and Pedro Rivero and Max Rossmannek and Travis L. Scholten and Seetharami Seelam and Iskandar Sitdikov and Dharmashankar Subramanian and Wei Tang and Stefan Woerner},
author = {
Agata M. Bra\'{n}czyk
and Almudena {Carrera Vazquez}
and Daniel J. Egger
and Bryce Fuller
and Julien Gacon
and James R. Garrison
and Jennifer R. Glick
and Caleb Johnson
and Saasha Joshi
and Edwin Pednault
and C. D. Pemmaraju
and Pedro Rivero
and Seetharami Seelam
and Ibrahim Shehzad
and Dharmashankar Subramanian
and Wei Tang
and Stefan Woerner
},
title = {{Circuit Knitting Toolbox}},
howpublished = {\url{https://github.com/Qiskit-Extensions/circuit-knitting-toolbox}},
year = {2023},
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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://qiskit.org/documentation/contributing_to_qiskit.html) guide may serve as a useful starting point, as the toolbox builds on [Qiskit] and is part of the [Qiskit Ecosystem].
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].

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).

Expand All @@ -10,8 +10,8 @@ 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://qiskit.org/
[Qiskit Ecosystem]: https://qiskit.org/ecosystem/
[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
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ RUN rm -rf work && \

COPY . .src/circuit-knitting-toolbox

# Fix the permissions of ~/.src
# Fix the permissions of ~/.src and ~/persistent-volume
USER root
RUN fix-permissions .src
RUN fix-permissions .src && \
mkdir persistent-volume && fix-permissions persistent-volume
USER ${NB_UID}

# Consolidate the docs into the home directory
Expand Down
21 changes: 6 additions & 15 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ packages. There are three primary ways to do this:
- :ref:`Option 2`
- :ref:`Option 3`

CutQC and entanglement forging users should consult the
:ref:`Platform Support` section to determine which installation option
is appropriate for them. Users who wish to run within a
CutQC users should consult the :ref:`Platform Support` section to determine
which installation option is appropriate for them. Users who wish to run within a
containerized environment may skip the pre-installation and move straight
to :ref:`Option 3`.

Expand Down Expand Up @@ -62,15 +61,13 @@ Upgrade pip and install the CKT package.
pip install --upgrade pip
pip install circuit-knitting-toolbox
Users intending to use the entanglement forging tool should install the ``pyscf`` optional dependency.

Users intending to use the automatic cut finding functionality in the CutQC package should install the ``cplex`` optional dependency.

Adjust the options below to suit your needs.

.. code:: sh
pip install 'circuit-knitting-toolbox[pyscf,cplex]'
pip install 'circuit-knitting-toolbox[cplex]'
.. _Option 2:
Expand All @@ -97,15 +94,13 @@ The next step is to install CKT to the virtual environment. If you plan on runni
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.

Users intending to use the entanglement forging tool should install the ``pyscf`` optional dependency.

Users intending to use the automatic cut finding functionality in the CutQC package should install the ``cplex`` optional dependency.

Adjust the options below to suit your needs.

.. code:: sh
pip install tox notebook -e '.[notebook-dependencies,dev,pyscf,cplex]'
pip install tox notebook -e '.[notebook-dependencies,dev,cplex]'
If you installed the notebook dependencies, you can get started with CKT by running the notebooks in the docs.

Expand Down Expand Up @@ -182,8 +177,8 @@ take care when installing the toolbox, depending on which tools they
intend to use.

- The automatic wire cut search in the ``cutqc`` package depends
on CPLEX, which is only available on Intel chips.
- The entanglement forging tool requires PySCF, which does not support Windows.
on CPLEX, which is only available on Intel chips and is not yet available
for Python 3.12.

In each case, one method that is guaranteed to work is to :ref:`use
the toolbox within Docker <Option 3>`. Other methods include:
Expand All @@ -195,7 +190,3 @@ the toolbox within Docker <Option 3>`. Other methods include:
create a virtual environment that uses Python compiled for the x86
instruction set. No matter the installation method, there is a
performance cost due to emulation.
- Advanced Windows users may wish to attempt to install PySCF using
the `Windows Subsystem for Linux
<https://learn.microsoft.com/en-us/windows/wsl/install>`__. If
you have success using this method, please let us know.
Loading

0 comments on commit 2047b7d

Please sign in to comment.