Skip to content

Commit

Permalink
Merge pull request #239 from CQCL/release/pytket-1-23
Browse files Browse the repository at this point in the history
Release 0.47.0
  • Loading branch information
cqc-melf authored Jan 10, 2024
2 parents 7f98cab + 11022f8 commit cfe5bcf
Show file tree
Hide file tree
Showing 16 changed files with 147 additions and 124 deletions.
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Description

Please summarise the changes.

# Related issues

Please mention any github issues addressed by this PR.

# Checklist

- [ ] I have performed a self-review of my code.
- [ ] I have commented hard-to-understand parts of my code.
- [ ] I have made corresponding changes to the public API documentation.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have updated the changelog with any user-facing changes.
24 changes: 14 additions & 10 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/*
- name: Set up Python 3.9
if: github.event_name == 'push' || github.event_name == 'schedule'
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Build and test (3.9)
Expand All @@ -44,7 +44,7 @@ jobs:
run: |
./.github/workflows/build-test nomypy
- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build and test including remote checks (3.10) mypy
Expand All @@ -61,18 +61,18 @@ jobs:
./.github/workflows/build-test nomypy
- 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
uses: actions/setup-python@v5
with:
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: |
./.github/workflows/build-test nomypy
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: github.event_name == 'release' || contains(github.ref, 'refs/heads/wheel')
with:
name: artefacts
name: artefact-${{ matrix.os }}
path: wheelhouse/
- name: Install docs dependencies
if: (matrix.os == 'ubuntu-22.04') && (github.event_name == 'pull_request' || github.event_name == 'schedule' )
Expand All @@ -92,9 +92,13 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Download all wheels
uses: actions/download-artifact@v3
# downloading all three files into the wheelhouse
# all files are identical, so there will only be one file
uses: actions/download-artifact@v4
with:
path: wheelhouse
pattern: artefact-*
merge-multiple: true
- name: Put them all in the dist folder
run: |
mkdir dist
Expand All @@ -116,11 +120,11 @@ jobs:
with:
fetch-depth: '0'
- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Download all wheels
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: wheelhouse
- name: Install pip, wheel
Expand All @@ -137,7 +141,7 @@ jobs:
mkdir extensions
./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions/api
- name: Upload docs as artefact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: .github/workflows/docs/extensions

Expand All @@ -155,4 +159,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4.0.1
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Upgrade pip and install wheel
Expand All @@ -31,7 +31,7 @@ jobs:
cd .github/workflows/docs
mkdir extensions
./build-docs -d ${GITHUB_WORKSPACE}/.github/workflows/docs/extensions
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pytket-extension-docs
path: .github/workflows/docs/extensions/
9 changes: 5 additions & 4 deletions .github/workflows/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

extensions = [
"sphinx.ext.autodoc",
"sphinx_autodoc_typehints",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
Expand Down Expand Up @@ -36,10 +37,10 @@
pytketdoc_base = "https://tket.quantinuum.com/api-docs/"

intersphinx_mapping = {
"https://docs.python.org/3/": None,
pytketdoc_base: None,
"https://qiskit.org/documentation/": None,
"http://docs.qulacs.org/en/latest/": None,
"python": ("https://docs.python.org/3/", None),
"pytket": (pytketdoc_base, None),
"qiskit": ("https://qiskit.org/documentation/", None),
"qulacs": ("http://docs.qulacs.org/en/latest/", None),
}

autodoc_member_order = "groupwise"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx >= 4.3.2, <6.2.0
sphinx ~= 6.2
sphinx_book_theme >= 1.0.1, <2.0
sphinx-copybutton
sphinx-autodoc-typehints
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Update pip
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.46.0"
__extension_version__ = "0.47.0"
__extension_name__ = "pytket-qiskit"
11 changes: 10 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,44 @@ API documentation
~~~~~~~~~~~~~~~~~

.. autoclass:: pytket.extensions.qiskit.IBMQBackend
:special-members:
:special-members: __init__
:show-inheritance:
:members:

.. autoclass:: pytket.extensions.qiskit.IBMQEmulatorBackend
:special-members: __init__
:show-inheritance:
:members:

.. autoclass:: pytket.extensions.qiskit.AerBackend
:special-members: __init__
:show-inheritance:
:inherited-members:
:members:

.. autoclass:: pytket.extensions.qiskit.AerStateBackend
:special-members: __init__
:inherited-members:
:show-inheritance:
:members:

.. autoclass:: pytket.extensions.qiskit.AerUnitaryBackend
:special-members: __init__
:show-inheritance:
:inherited-members:
:members:

.. automodule:: pytket.extensions.qiskit
:members: qiskit_to_tk, tk_to_qiskit, process_characterisation

.. automodule:: pytket.extensions.qiskit.tket_backend
:show-inheritance:
:members:
:special-members: __init__

.. automodule:: pytket.extensions.qiskit.backends.crosstalk_model
:members: CrosstalkParams


.. automodule:: pytket.extensions.qiskit.tket_pass
:special-members: __init__
Expand Down
9 changes: 8 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
~~~~~~~~~

0.47.0 (January 2024)
---------------------

* Update qiskit-ibm-runtime version to 0.17.0.
* Update qiskit-ibm-provider version to 0.8.0.
* Updated pytket version requirement to 1.23.

0.46.0 (November 2023)
----------------------

Expand Down Expand Up @@ -57,7 +64,7 @@ Changelog
0.40.0 (June 2023)
------------------

* IBM devices are now accessed using the `qiskit-ibm-provider <https://github.com/Qiskit/qiskit-ibm-provider>`_ instead of the deprecated :py:class:`IBMQ`. This allows the newest IBM devices and simulators to be accessed through ``pytket-qiskit``. See the updated documentation on `credentials <https://tket.quantinuum.com/extensions/pytket-qiskit/api/index.html#access-and-credentials>`_.
* IBM devices are now accessed using the `qiskit-ibm-provider <https://github.com/Qiskit/qiskit-ibm-provider>`_ instead of the deprecated :py:class:`IBMQ`. This allows the newest IBM devices and simulators to be accessed through ``pytket-qiskit``. See the updated documentation on `credentials <https://tket.quantinuum.com/extensions/pytket-qiskit/index.html#access-and-credentials>`_.
* The parameters ``hub``, ``group`` and ``project`` are no longer handled as separate arguments in :py:class:`IBMQBackend` and :py:meth:`IBMQBackend.available_devices`. Use ``"instance=f"{hub}/{group}/{project}"`` instead.
* Added support for the {X, SX, Rz, ECR} in the default compilation pass for :py:class:`IBMQBackend` and :py:class:`IBMQEmulatorBackend`. This is the set of gates used by some of the new IBM devices.
* Fix to the :py:meth:`tk_to_qiskit` converter to prevent cancellation of redundant gates when converting to qiskit.
Expand Down
11 changes: 2 additions & 9 deletions pytket/extensions/qiskit/backends/crosstalk_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
@dataclass
class FractionalUnitary:
"""
Wrapper for a fractional unitary gate
Wrapper for a fractional unitary gate.
:param cmd: the fractional UnitaryBox wrapped in a pytket Command
:param n_fractions: the number of fractional gates
used to compose the original unitary gate.
Expand Down Expand Up @@ -74,28 +75,20 @@ class CrosstalkParams:
Stores various parameters for modelling crosstalk noise
:param zz_crosstalks: symmetric crosstalks between qubit pairs
:type zz_crosstalks: `Dict[Tuple[Qubit, Qubit], float]`
:param single_q_phase_errors: dict specify the single qubit phase error
on each qubit
:type single_q_phase_errors: `Dict[Qubit, float]`
:param two_q_induced_phase_errors: keys of dictionary specify the control
and target qubit index, while the values are tuples with the spectator
qubit index and the amount of phase error to be applied.
:type two_q_induced_phase_errors: `Dict[Tuple[Qubit, Qubit], Tuple[Qubit, float]]`
:param non_markovian_noise: List storing the non-Markovian noise parameters.
Each tuple in the list contains the qubit index and the zx, zz noise parameters.
:type non_markovian_noise: `List[Tuple[Qubit, float, float]]`
:param virtual_z: If True, then don't break any single qubit Z gate into
unitary fractions, instead add the full unitary.
:type bool
:param N: hyperparameter specifies splices per second.
1/N must divide all gate times.
:type: float
:param gate_times: python dict to store the gate time information.
:type gate_times: `Dict[Tuple[OpType, Tuple[Qubit, ...]], float]`
:param phase_damping_error: dict specify amplitude phase damping error
on each qubit
:type phase_damping_error: `Dict[Qubit, float]`
:param amplitude_damping_error: dict pecify amplitude damping error
on each qubit
"""
Expand Down
18 changes: 11 additions & 7 deletions pytket/extensions/qiskit/backends/ibm.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def default_compilation_pass(
passlist = [DecomposeBoxes()]
# If you make changes to the default_compilation_pass,
# then please update this page accordingly
# https://tket.quantinuum.com/extensions/pytket-qiskit/api/index.html#default-compilation
# https://tket.quantinuum.com/extensions/pytket-qiskit/index.html#default-compilation
# Edit this docs source file -> pytket-qiskit/docs/intro.txt
if optimisation_level == 0:
if self._supports_rz:
Expand All @@ -389,6 +389,7 @@ def default_compilation_pass(
passlist.append(FullPeepholeOptimise())
mid_measure = self._backend_info.supports_midcircuit_measurement
arch = self._backend_info.architecture
assert arch is not None
if not isinstance(arch, FullyConnected):
if placement_options is not None:
noise_aware_placement = NoiseAwarePlacement(
Expand Down Expand Up @@ -448,12 +449,15 @@ def process_circuits(
"""
See :py:meth:`pytket.backends.Backend.process_circuits`.
Supported `kwargs`:
- `postprocess`: apply end-of-circuit simplifications and classical
postprocessing to improve fidelity of results (bool, default False)
- `simplify_initial`: apply the pytket ``SimplifyInitial`` pass to improve
fidelity of results assuming all qubits initialized to zero (bool, default
False)
:Keyword Arguments:
* `postprocess`:
apply end-of-circuit simplifications and classical
postprocessing to improve fidelity of results (bool, default False)
* `simplify_initial`:
apply the pytket ``SimplifyInitial`` pass to improve
fidelity of results assuming all qubits initialized to zero
(bool, default False)
"""
circuits = list(circuits)

Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
author_email="tket-support@cambridgequantum.com",
python_requires=">=3.9",
project_urls={
"Documentation": "https://tket.quantinuum.com/extensions/pytket-qiskit/api/index.html",
"Documentation": "https://tket.quantinuum.com/extensions/pytket-qiskit/index.html",
"Source": "https://github.com/CQCL/pytket-qiskit",
"Tracker": "https://github.com/CQCL/pytket-qiskit/issues",
},
Expand All @@ -44,12 +44,12 @@
packages=find_namespace_packages(include=["pytket.*"]),
include_package_data=True,
install_requires=[
"pytket ~= 1.22",
"pytket ~= 1.23",
"qiskit ~= 0.45.0",
"qiskit-algorithms ~= 0.2.1",
"qiskit-ibm-runtime ~= 0.15.1",
"qiskit-ibm-runtime ~= 0.17.0",
"qiskit-aer ~= 0.13.0",
"qiskit-ibm-provider ~= 0.7.2",
"qiskit-ibm-provider ~= 0.8.0",
"numpy",
],
classifiers=[
Expand Down
Loading

0 comments on commit cfe5bcf

Please sign in to comment.