Skip to content

Commit

Permalink
Merge pull request #105 from CQCL/release/1-11-0
Browse files Browse the repository at this point in the history
Release/1 11 0
  • Loading branch information
cqc-melf authored Jan 18, 2023
2 parents 47c9cdc + 25fbe07 commit 8cb5206
Show file tree
Hide file tree
Showing 41 changed files with 155 additions and 93 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,40 @@ 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.8
- name: Set up Python 3.9
if: github.event_name == 'push' || github.event_name == 'schedule'
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Build and test (3.8)
python-version: '3.9'
- name: Build and test (3.9)
if: github.event_name == 'push' || github.event_name == 'schedule'
shell: bash
run: |
./.github/workflows/build-test nomypy
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Build and test including remote checks (3.9) mypy
python-version: '3.10'
- name: Build and test including remote checks (3.10) mypy
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: |
./.github/workflows/build-test mypy
env:
PYTKET_RUN_REMOTE_TESTS: 1
- name: Build and test including remote checks (3.9) nomypy
- name: Build and test including remote checks (3.10) nomypy
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')
shell: bash
run: |
./.github/workflows/build-test nomypy
env:
PYTKET_RUN_REMOTE_TESTS: 1
- 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 == 'schedule'
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build and test (3.10)
python-version: '3.11'
- name: Build and test (3.11)
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule'
shell: bash
run: |
Expand Down Expand Up @@ -118,10 +118,10 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.10'
- name: Download all wheels
uses: actions/download-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'
- name: Upgrade pip and install wheel
run: pip install --upgrade pip wheel
- name: Install pytket quantinuum
run: |
pip install .
run: pip install .
- name: Install docs dependencies
run: |
pip install -r .github/workflows/docs/requirements.txt
Expand Down
File renamed without changes
4 changes: 2 additions & 2 deletions .github/workflows/docs/build-docs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def build_module_docs():
mod_docs = MODULES_DIR / "docs"
mod_build = mod_docs / "build"
conf_copy = mod_docs / "conf.py"
logo_copy = mod_docs / "Quantinuum_logo2.png"
logo_copy = mod_docs / "Quantinuum_logo.png"
shutil.copy(DOCS_DIR / "conf.py", conf_copy)
shutil.copy(DOCS_DIR / "Quantinuum_logo2.png", logo_copy)
shutil.copy(DOCS_DIR / "Quantinuum_logo.png", logo_copy)
remove_dir(mod_build)
index_rst = mod_docs / "index.rst"
with open(mod_docs / "intro.txt", "r") as f:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.mathjax",
"sphinx_copybutton",
]

pygments_style = "pastie"
pygments_style = "borland"

html_theme = "sphinx_book_theme"

Expand All @@ -26,7 +27,7 @@

html_css_files = ["custom.css"]

html_logo = "Quantinuum_logo2.png"
html_logo = "Quantinuum_logo.png"

# -- Extension configuration -------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
sphinx ~= 4.3.2
sphinx_book_theme
sphinx-copybutton
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
build
dist
*.pyc
.venv
.vscode
.mypy_cache
.hypothesis
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ be executed on Quantinuum's quantum devices.

## Getting started

`pytket-quantinuum` is available for Python 3.8, 3.9 and 3.10, on Linux, MacOS
`pytket-quantinuum` is available for Python 3.9, 3.10 and 3.11, on Linux, MacOS
and Windows. To install, run:

```pip install pytket-quantinuum```
Expand Down
2 changes: 1 addition & 1 deletion _metadata.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__extension_version__ = "0.12.0"
__extension_version__ = "0.13.0"
__extension_name__ = "pytket-quantinuum"
2 changes: 1 addition & 1 deletion docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ a:visited,
.sig-param,
.std.std-ref,
a {
color: #2563EB;
color: #544d4d;
}

:root {
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
~~~~~~~~~

0.13.0 (January 2023)
---------------------

* Drop support for Python 3.8; add support for 3.11.
* The backend now works in threads other than the main.
* Updated pytket version requirement to 1.11.

0.12.0 (December 2022)
----------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pytket-quantinuum
``pytket-quantinuum`` is an extension to ``pytket`` that allows ``pytket`` circuits to
be executed on Quantinuum's quantum devices.

``pytket-quantinuum`` is available for Python 3.8, 3.9 and 3.10, on Linux, MacOS
``pytket-quantinuum`` is available for Python 3.9, 3.10 and 3.11, on Linux, MacOS
and Windows. To install, run:

::
Expand Down
2 changes: 1 addition & 1 deletion examples/Quantinuum_arbitrary_zz.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/Quantinuum_circuit_submissions.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/Quantinuum_compile_without_api.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["![Quantinuum_logo](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAABLCAMAAACLOq%2BzAAACx1BMVEUAAAAAAP%2BAgIBVqqqAgIBmmZmAgKptkpKAgJ9xjo6AgJl0i6JqgJV2iZ1tgJJ3iJlwgJ94h5ZxgJx5hpRzgJl5hp50gJdvhZt1gJVwhZl2gJ12gJtyhJV3gJlzhJx4gJd0g5txgJZ1g5lxgJx1g5hygJp2g5ZzgJl2g5tzgJh3gpp0gJdxgpl0gJtygph1gJpygpd1gJlzgpt2gJhzgpp2gJd0gplygJt0gphygJp1gpdzgJl1gptzgJh1gpp2gZl0gJtygZh0gJpzgZh1gJlzgZp1gJhzgZp1gJh0gZl0gZhygJp0gZhzgJl0gZpzgJh1gZpzgJh1gZl0gJp1gZh0gJp0gJlzgZp0gJhzgZp1gJhzgZl1gJp0gZh1gJp0gZhzgJl0gZpzgJlzgJh1gZlzgJp1gZl1gZh0gJl0gJlzgZl0gJhzgZl1gJp0gZl1gJl0gZh1gJl0gZpzgJl0gZlzgJ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ww%2FFYPfUxoOqZqN435lAeGf7fVQ0jIQx97NzNG%2BBKjbiKvyGK4%2BysE4vJYC7Y6H5lJgggbheF6JwJmXcFyvfOCVk6H7ziUAFa23ljdzeg2uFM2CG7QQxxSNA6ZrEiS3lOPYvwHm6EgyjZtx7TqCq69%2Bj3FkNTyp6iSP1gLpugvHMiUCp9bjSFEesPILRqkM7tFrlLbS8Bqu6%2FVHCP36n6EYmxv7QK9jenxKVu6J1sEYB8qAuTpxq68C18fVuOI0FePzYqBANalaDyRrHUbvmuO9gA%2FPxGE8rVFA0VHY4rsr7EBDAkUtHNiJK10ZwHy9lUD0cnmBmWq3FeNQGUaBarUV1%2FYqXP01DeNoMcYi1aoMY5MKI0neoRyMe31%2Fv5FeeS0fhQAlR2Fg8755WgirmnlWo%2FCLHRgKeFZIdY16Ixyu%2BrJy%2BDBHqW8IUF2G4xnpLVzvfYIrXtMxaopxPC%2BVY8T8ReePy1eI38xmX81%2FtedqjNVHgZfV9mUUrGok%2FvjpsXQ0svj90jSMG7zD8Yt%2BZiwwLwu%2FXG82rqzHcMV4R2AU%2FAa%2FGd7JOEImvv7e8mG0u3nJuxuzw3Fk5AP9vd7RwMQCGPQfHayoKClZ6R3FlRJV8MnJ2trG2trZXBH%2FA2RBOeTINIkQAAAAAElFTkSuQmCC)<br>\n", "# Compiling for Quantinuum Hardware without Querying Quantinuum API"]}, {"cell_type": "markdown", "metadata": {}, "source": ["This notebook contains an example of how to investigate circuits compiled for Quantinuum hardware without logging in or submitting to Quantinuum hardware. This may be useful if it is desired to explore circuit compilation in depth before submitting."]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Circuit Preparation <a class=\"anchor\" id=\"circuit-preparation\"></a>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Create your circuit."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from pytket.circuit import Circuit, OpType\n", "from pytket.circuit.display import render_circuit_jupyter"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["circuit = Circuit(2, name=\"Bell Test\")\n", "circuit.H(0)\n", "circuit.CX(0, 1)\n", "circuit.measure_all()"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["render_circuit_jupyter(circuit)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Set up Backend"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Set up a `QuantinuumBackend` object. The difference is the `machine_debug` option uses the default `pytket-quantinuum` options such as pytket's version of the Quantinuum native gate set rather than querying the Quantinuum API for this information."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["from pytket.extensions.quantinuum import QuantinuumBackend"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["machine = \"H1-1E\"\n", "backend = QuantinuumBackend(device_name=machine, machine_debug=True)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Investigate Native Gate Set"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Users can view the hard-coded native gate set for the Quantinuum backend using the following command."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["import pytket.extensions.quantinuum.backends.quantinuum as qtm"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["print(qtm._GATE_SET)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["It's possible that the hardcoded verion is not up to date with the latest native gate set as described in the [System Model H1 Product Data Sheet](https://www.quantinuum.com/hardware/h1). In this case, the Rzz gate, which is the `ZZPhase` gate in pytket, is missing. This can be added by running the following command."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["qtm._GATE_SET.add(OpType.ZZPhase)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Circuit Compilation <a class=\"anchor\" id=\"circuit-compilation\"></a>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Circuits can now be compiled with the `get_compiled_circuit` function without querying the Quantinuum API."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["compiled_circuit = backend.get_compiled_circuit(circuit, optimisation_level=2)"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["render_circuit_jupyter(compiled_circuit)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["<div align=\"center\"> &copy; 2022 by Quantinuum. All Rights Reserved. </div>"]}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.4"}}, "nbformat": 4, "nbformat_minor": 2}
2 changes: 1 addition & 1 deletion examples/Quantinuum_emulator.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 8cb5206

Please sign in to comment.