Skip to content

Commit

Permalink
Merge pull request #391 from CQCL/release/1.26.0
Browse files Browse the repository at this point in the history
Release/1.26.0
  • Loading branch information
cqc-melf authored Mar 19, 2024
2 parents 1318996 + 98daff2 commit 338818b
Show file tree
Hide file tree
Showing 22 changed files with 2,179 additions and 252 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
- package-ecosystem: pip
directory: "/"
schedule:
Expand Down
34 changes: 29 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,37 @@ jobs:
run: python -m pip install -v -e .
- name: Install test requirements
run: python -m pip install --pre -r tests/test-requirements.txt
- name: Run tests with QA endpoint
- name: Run tests with QA and prod endpoint
env:
PYTKET_RUN_REMOTE_TESTS: 1
PYTKET_REMOTE_QUANTINUUM_API_URL: https://hqapi.quantinuum.com/
PYTKET_REMOTE_QUANTINUUM_GROUP: DEFAULT
PYTKET_REMOTE_QUANTINUUM_USERNAME: ${{ secrets.PYTKET_REMOTE_QUANTINUUM_USERNAME_QA }}
PYTKET_REMOTE_QUANTINUUM_PASSWORD: ${{ secrets.PYTKET_REMOTE_QUANTINUUM_PASSWORD_QA }}
PYTKET_REMOTE_QUANTINUUM_USERNAME_QA: ${{ secrets.PYTKET_REMOTE_QUANTINUUM_USERNAME_QA }}
PYTKET_REMOTE_QUANTINUUM_PASSWORD_QA: ${{ secrets.PYTKET_REMOTE_QUANTINUUM_PASSWORD_QA }}
PYTKET_REMOTE_QUANTINUUM_EMULATORS_ONLY: 1
working-directory: ./tests
run: pytest integration/

prod_checks:
name: Run backend tests with QA and prod endpoint
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || contains(github.ref_name, 'runci/prod/')
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install module
run: python -m pip install -v -e .
- name: Install test requirements
run: python -m pip install --pre -r tests/test-requirements.txt
- name: Run tests with QA and prod endpoint
env:
PYTKET_RUN_REMOTE_TESTS: 1
PYTKET_RUN_REMOTE_TESTS_PROD: 1
PYTKET_REMOTE_QUANTINUUM_USERNAME: ${{ secrets.PYTKET_REMOTE_QUANTINUUM_USERNAME }}
PYTKET_REMOTE_QUANTINUUM_PASSWORD: ${{ secrets.PYTKET_REMOTE_QUANTINUUM_PASSWORD }}
PYTKET_REMOTE_QUANTINUUM_USERNAME_QA: ${{ secrets.PYTKET_REMOTE_QUANTINUUM_USERNAME_QA }}
PYTKET_REMOTE_QUANTINUUM_PASSWORD_QA: ${{ secrets.PYTKET_REMOTE_QUANTINUUM_PASSWORD_QA }}
PYTKET_REMOTE_QUANTINUUM_EMULATORS_ONLY: 1
working-directory: ./tests
run: pytest integration/
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 @@ -24,7 +24,7 @@ jobs:
examples: ${{ steps.filter.outputs.examples }}
steps:
- uses: actions/checkout@v4
- uses: dorny/[email protected].1
- uses: dorny/[email protected].2
id: filter
with:
base: ${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Update pip
run: pip install --upgrade pip
- name: Install black and pylint
run: pip install "black[jupyter]"~=22.3 pylint~=2.13,!=2.13.6
run: pip install "black[jupyter]"~=22.3 pylint~=3.0
- name: Check files are formatted with black
run: |
black --check .
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.30.0"
__extension_version__ = "0.31.0"
__extension_name__ = "pytket-quantinuum"
9 changes: 9 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
~~~~~~~~~

0.31.0 (March 2024)
-------------------

* Updated pytket version requirement to 1.26.
* Add method to enable visibility of
Quantinuum H-Series operational calendar.
* Update pytket_pecos version requirement to 0.1.19.
* Support TK2 as native gate.

0.30.0 (February 2024)
----------------------

Expand Down
6 changes: 4 additions & 2 deletions docs/intro.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ The passes applied by different levels of optimisation are specified in the tabl
- `SynthesiseTket <https://tket.quantinuum.com/api-docs/passes.html#pytket.passes.SynthesiseTket>`_
- `FullPeepholeOptimise [3] <https://tket.quantinuum.com/api-docs/passes.html#pytket.passes.FullPeepholeOptimise>`_
* - `FlattenRelabelRegistersPass <https://tket.quantinuum.com/api-docs/passes.html#pytket.passes.FlattenRelabelRegistersPass>`_
- `NormaliseTK2 <https://tket.quantinuum.com/api-docs/passes.html#pytket.passes.NormaliseTK2>`_
- `NormaliseTK2 [5] <https://tket.quantinuum.com/api-docs/passes.html#pytket.passes.NormaliseTK2>`_
- `NormaliseTK2 <https://tket.quantinuum.com/api-docs/passes.html#pytket.passes.NormaliseTK2>`_
* -
- `DecomposeTK2 <https://tket.quantinuum.com/api-docs/passes.html#pytket.passes.DecomposeTK2>`_
- `DecomposeTK2 [5] <https://tket.quantinuum.com/api-docs/passes.html#pytket.passes.DecomposeTK2>`_
- `DecomposeTK2 <https://tket.quantinuum.com/api-docs/passes.html#pytket.passes.DecomposeTK2>`_
* -
- self.rebase_pass [2]
Expand Down Expand Up @@ -110,6 +110,8 @@ The passes applied by different levels of optimisation are specified in the tabl

* [4] ``auto_squash_pass`` has arguments ``auto_squash_pass({OpType.PhasedX, OpType.Rz})``

* [5] Omitted if the target two-qubit gate is ``OpType.TK2``.

.. note:: If ``optimisation_level = 0`` the device constraints are solved but no additional optimisation is applied. Setting ``optimisation_level = 1`` applies some light optimisations to the circuit. More intensive optimisation is applied by level 2 at the expense of increased runtime.
.. note:: The pass ``ZZPhaseToRz`` is left out of ``optimisation_level=2`` as the passes applied by ``FullPeepholeOptimise`` will already cover these optimisations.

Expand Down
2 changes: 1 addition & 1 deletion examples/Quantinuum_compile_without_api.ipynb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<div style=\"text-align: center;\"><br>\n", "<img src=\"https://assets-global.website-files.com/62b9d45fb3f64842a96c9686/62d84db4aeb2f6552f3a2f78_Quantinuum%20Logo__horizontal%20blue.svg\" width=\"200\" height=\"200\" /></div>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["# 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": ["### 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; 2024 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}
{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["<div style=\"text-align: center;\"><br>\n", "<img src=\"https://assets-global.website-files.com/62b9d45fb3f64842a96c9686/62d84db4aeb2f6552f3a2f78_Quantinuum%20Logo__horizontal%20blue.svg\" width=\"200\" height=\"200\" /></div>"]}, {"cell_type": "markdown", "metadata": {}, "source": ["# 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._ALL_GATES)"]}, {"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; 2024 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}
1,026 changes: 1,026 additions & 0 deletions examples/Quantinuum_hseries_queue_visibility.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 338818b

Please sign in to comment.