Skip to content

Commit 9276211

Browse files
authored
Merge pull request #85 from CQCL/release/1.13.0
Release/1.13.0
2 parents c4f1477 + f253440 commit 9276211

File tree

9 files changed

+366
-353
lines changed

9 files changed

+366
-353
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sphinx ~= 4.3.2
2-
sphinx_book_theme
2+
sphinx_book_theme ~= 0.3.3
33
sphinx-copybutton

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ build
44
dist
55
*.pyc
66
.vscode
7+
.idea
78
.venv
89
.mypy_cache
910
.hypothesis

_metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__extension_version__ = "0.36.0"
1+
__extension_version__ = "0.37.0"
22
__extension_name__ = "pytket-qiskit"

docs/changelog.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
~~~~~~~~~
33

4+
0.37.0 (March 2023)
5+
-------------------
6+
7+
* Fix faulty information in ``AerBackend().backend_info``
8+
* Updated pytket version requirement to 1.13.
9+
410
0.36.0 (February 2023)
511
----------------------
612

docs/intro.txt

+38-15
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,36 @@ Windows. To install, run:
1616

1717
pip install pytket-qiskit
1818

19-
This will install `pytket` if it isn't already installed, and add new classes
20-
and methods into the `pytket.extensions` namespace.
19+
This will install ``pytket`` if it isn't already installed, and add new classes
20+
and methods into the ``pytket.extensions`` namespace.
21+
22+
An example using the shots-based :py:class:`AerBackend` simulator is shown below.
23+
24+
::
25+
26+
from pytket.extensions.qiskit import AerBackend
27+
28+
backend = AerBackend()
29+
circ = Circuit(2).H(0).CX(0, 1).measure_all()
30+
31+
# Compilation not needed here as both H and CX are supported gates
32+
result = backend.run_circuit(circ, n_shots=1000)
33+
34+
This simulator supports a large set of gates and by default has no architectural constraints or quantum noise. However the user can pass in a noise model or custom architecture to more closely model a real quantum device.
35+
36+
The :py:class:`AerBackend` also supports GPU simulation which can be configured as follows.
37+
38+
::
39+
40+
from pytket.extensions.qiskit import AerBackend
41+
42+
backend = AerBackend()
43+
backend._backend.set_option("device", "GPU")
2144

2245
Access and Credentials
2346
======================
2447

25-
Accessing devices and simulators through the pytket-qiskit extension requires an IBMQ account. An account can be set up here -> https://quantum-computing.ibm.com/login.
48+
With the exception of the Aer simulators, accessing devices and simulators through the ``pytket-qiskit`` extension requires an IBMQ account. An account can be set up here: https://quantum-computing.ibm.com/login.
2649

2750
Once you have created an account you can obtain an API token which you can use to configure your credentials locally.
2851

@@ -32,7 +55,7 @@ Once you have created an account you can obtain an API token which you can use t
3255

3356
set_ibmq_config(ibmq_api_token=ibm_token)
3457

35-
This will save your IBMQ credentials locally. After saving your credentials you can access pytket-qiskit backend repeatedly without having to re-initialise your credentials.
58+
This will save your IBMQ credentials locally. After saving your credentials you can access ``pytket-qiskit`` backend repeatedly without having to re-initialise your credentials.
3659

3760
If you are a member of an IBM hub then you can add this information to ``set_ibmq_config`` as well.
3861

@@ -53,7 +76,7 @@ locally without saving the token in pytket config:
5376
IBMQ.save_account(token=ibm_token)
5477
QiskitRuntimeService.save_account(channel="ibm_quantum", token=ibm_token)
5578

56-
To see which devices you can access you can use the ``available_devices`` method on the ``IBMQBackend`` or ``IBMQEmulatorBackend``. Note that it is possible to pass ``hub``, ``group`` and ``project`` parameters to this method. This allows you to see which devices are accessible through your IBM hub.
79+
To see which devices you can access you can use the ``available_devices`` method on the :py:class:`IBMQBackend` or :py:class:`IBMQEmulatorBackend`. Note that it is possible to pass ``hub``, ``group`` and ``project`` parameters to this method. This allows you to see which devices are accessible through your IBM hub.
5780

5881
::
5982

@@ -66,7 +89,7 @@ To see which devices you can access you can use the ``available_devices`` method
6689
Backends Available Through pytket-qiskit
6790
========================================
6891

69-
The ``pytket-qiskit`` extension has several types of available ``Backend``. These are the ``IBMQBackend``
92+
The ``pytket-qiskit`` extension has several types of available :py:class:`Backend`. These are the :py:class:`IBMQBackend`
7093
and several types of simulator.
7194

7295
.. list-table::
@@ -86,13 +109,13 @@ and several types of simulator.
86109
* - `AerUnitaryBackend <https://cqcl.github.io/pytket-qiskit/api/api.html#pytket.extensions.qiskit.AerUnitaryBackend>`_
87110
- Unitary simulator
88111

89-
* [1] ``AerBackend`` is noiseless by default and has no architecture. However it can accept a user defined ``NoiseModel`` and ``Architecture``.
90-
* In addition to the backends above the pytket-qiskit extension also has the ``TketBackend``. This allows a tket ``Backend`` to be used directly through qiskit. see the `notebook example <https://github.com/CQCL/pytket/blob/main/examples/qiskit_integration.ipynb>`_ on qiskit integration.
112+
* [1] :py:class`AerBackend` is noiseless by default and has no architecture. However it can accept a user defined :py:class:`NoiseModel` and :py:class:`Architecture`.
113+
* In addition to the backends above the ``pytket-qiskit`` extension also has the :py:class:`TketBackend`. This allows a tket :py:class:`Backend` to be used directly through qiskit. see the `notebook example <https://github.com/CQCL/pytket/blob/main/examples/qiskit_integration.ipynb>`_ on qiskit integration.
91114

92115
Default Compilation
93116
===================
94117

95-
Every ``Backend`` in pytket has its own ``default_compilation_pass`` method. This method applies a sequence of optimisations to a circuit depending on the value of an ``optimisation_level`` parameter. This default compilation will ensure that the circuit meets all the constraints required to run on the Backend. The passes applied by different levels of optimisation are specified in the table below.
118+
Every :py:class:`Backend` in pytket has its own ``default_compilation_pass`` method. This method applies a sequence of optimisations to a circuit depending on the value of an ``optimisation_level`` parameter. This default compilation will ensure that the circuit meets all the constraints required to run on the :py:class:`Backend`. The passes applied by different levels of optimisation are specified in the table below.
96119

97120
.. list-table:: **Default compilation pass for the IBMQBackend and IBMQEmulatorBackend**
98121
:widths: 25 25 25
@@ -134,24 +157,24 @@ Every ``Backend`` in pytket has its own ``default_compilation_pass`` method. Thi
134157

135158
* [1] If no value is specified then ``optimisation_level`` defaults to a value of 2.
136159
* [2] self.rebase_pass is a rebase to the gateset supported by the backend, For IBM quantum devices that is {X, SX, Rz, CX}.
137-
* [3] Here ``CXMappingPass`` maps program qubits to the architecture using a `NoiseAwarePlacement <https://cqcl.github.io/tket/pytket/api/placement.html#pytket.placement.NoiseAwarePlacement>`_
138-
* [4] ``SimplifyInitial`` has arguments ``allow_classical=False`` and ``create_all_qubits=True``.
160+
* [3] Here :py:class:`CXMappingPass` maps program qubits to the architecture using a `NoiseAwarePlacement <https://cqcl.github.io/tket/pytket/api/placement.html#pytket.placement.NoiseAwarePlacement>`_
161+
* [4] :py:class:`SimplifyInitial` has arguments ``allow_classical=False`` and ``create_all_qubits=True``.
139162

140163

141-
**Note:** The ``default_compilation_pass`` for ``AerBackend`` is the same as above except it doesn't use ``SimplifyInitial``.
164+
**Note:** The ``default_compilation_pass`` for :py:class:`AerBackend` is the same as above except it doesn't use :py:class:`SimplifyInitial`.
142165

143166

144167
Backend Predicates
145168
==================
146169

147170
Circuits must satisfy certain conditions before they can be processed on a device or simulator. In pytket these conditions are called predicates.
148171

149-
All pytket-qiskit backends have the following two predicates.
172+
All ``pytket-qiskit`` backends have the following two predicates.
150173

151-
* `GateSetPredicate <https://cqcl.github.io/tket/pytket/api/predicates.html#pytket.predicates.GateSetPredicate>`_ - The circuit must contain only operations supported by the ``Backend``. To view supported Ops run ``BACKENDNAME.backend_info.gate_set``.
174+
* `GateSetPredicate <https://cqcl.github.io/tket/pytket/api/predicates.html#pytket.predicates.GateSetPredicate>`_ - The circuit must contain only operations supported by the :py:class`Backend`. To view supported Ops run ``BACKENDNAME.backend_info.gate_set``.
152175
* `NoSymbolsPredicate <https://cqcl.github.io/tket/pytket/api/predicates.html#pytket.predicates.NoSymbolsPredicate>`_ - Parameterised gates must have numerical values when the circuit is executed.
153176

154-
The ``IBMQBackend`` and ``IBMQEmulatorBackend`` may also have the following predicates depending on the capabilities of the specified device.
177+
The :py:class:`IBMQBackend` and :py:class:`IBMQEmulatorBackend` may also have the following predicates depending on the capabilities of the specified device.
155178

156179
* `NoClassicalControlPredicate <https://cqcl.github.io/tket/pytket/api/predicates.html#pytket.predicates.NoClassicalControlPredicate>`_
157180
* `NoMidMeasurePredicate <https://cqcl.github.io/tket/pytket/api/predicates.html#pytket.predicates.NoMidMeasurePredicatePredicate>`_

0 commit comments

Comments
 (0)