You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/intro.txt
+99-57
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
pytket-qiskit
2
-
==================================
2
+
#############
3
3
4
-
IBM's `Qiskit <https://qiskit.org>`_ is an open-source framework for quantum
4
+
IBM's `Qiskit <https://www.ibm.com/quantum/qiskit>`_ is an open-source framework for quantum
5
5
computation, ranging from high-level algorithms to low-level circuit
6
6
representations, simulation and access to the `IBMQ <https://www.research.ibm.com/ibm-q/>`_ Experience devices.
7
7
@@ -19,6 +19,22 @@ Windows. To install, run:
19
19
This will install ``pytket`` if it isn't already installed, and add new classes
20
20
and methods into the ``pytket.extensions`` namespace.
21
21
22
+
Available IBM Backends
23
+
======================
24
+
25
+
.. currentmodule:: pytket.extensions.qiskit
26
+
27
+
.. autosummary::
28
+
:nosignatures:
29
+
30
+
IBMQBackend
31
+
IBMQEmulatorBackend
32
+
IBMQLocalEmulatorBackend
33
+
AerBackend
34
+
AerStateBackend
35
+
AerUnitaryBackend
36
+
37
+
22
38
An example using the shots-based :py:class:`AerBackend` simulator is shown below.
23
39
24
40
::
@@ -65,28 +81,11 @@ In this section we are assuming that you have set the following variables with t
65
81
group = '<your_group_here>'
66
82
project = '<your_project_here>'
67
83
68
-
.. note:: The documentation below is correct as of pytket-qiskit version 0.40.0 and newer. In the 0.40.0 release pytket-qiskit moved to using the `qiskit-ibm-provider <https://qiskit.org/ecosystem/ibm-provider/tutorials/Migration_Guide_from_qiskit-ibmq-provider.html>`_. In pytket-qiskit versions 0.39.0 and older the parameters ``hub``, ``group`` and ``project`` were handled separately instead of a single ``instance`` string as in 0.40.0 and newer.
69
-
70
-
::
71
-
72
-
from pytket.extensions.qiskit import set_ibmq_config
73
-
74
-
set_ibmq_config(ibmq_api_token=ibm_token)
75
-
76
-
After saving your credentials you can access ``pytket-qiskit`` backend repeatedly without having to re-initialise your credentials.
77
-
78
-
If you are a member of an IBM hub then you can add this information to ``set_ibmq_config`` as well.
79
-
80
-
::
81
-
82
-
from pytket.extensions.qiskit import set_ibmq_config
Alternatively you can use the following qiskit commands to save your credentials
87
-
locally without saving the token in pytket config:
84
+
Method 1: Using :py:class:`IBMProvider`
85
+
---------------------------------------
88
86
89
-
.. note:: If using pytket-qiskit 0.39.0 or older you will have to use the deprecated :py:meth:`IBMQ.save_account` instead of :py:meth:`IBMProvider.save_account` in the code below.
87
+
You can use the following qiskit commands to save your IBM credentials
88
+
to disk:
90
89
91
90
::
92
91
@@ -106,42 +105,62 @@ To see which devices you can access you can use the ``available_devices`` method
106
105
my_instance=f"{hub}/{group}/{project}"
107
106
ibm_provider = IBMProvider(instance=my_instance)
108
107
backend = IBMQBackend("ibmq_nairobi") # Initialise backend for an IBM device
* [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`.
137
-
* 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.
138
157
139
158
Default Compilation
140
159
===================
141
160
142
161
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.
143
162
144
-
.. list-table:: **Default compilation pass for the IBMQBackendand IBMQEmulatorBackend**
163
+
.. list-table:: **Default compilation pass for the IBMQBackend, IBMQEmulatorBackend and IBMQLocalEmulatorBackend**
145
164
:widths: 25 25 25
146
165
:header-rows: 1
147
166
@@ -177,28 +196,51 @@ Every :py:class:`Backend` in pytket has its own ``default_compilation_pass`` met
* [1] If no value is specified then ``optimisation_level`` defaults to a value of 2.
180
-
* [2] self.rebase_pass is a rebase to the gateset supported by the backend, For IBM quantum devices that is {X, SX, Rz, CX}.
199
+
* [2] self.rebase_pass is a rebase to the gateset supported by the backend. For IBM quantum devices and emulators that is either {X, SX, Rz, CX} or {X, SX, Rz, ECR}. The more idealised Aer simulators have a much broader range of supported gates.
181
200
* [3] Here :py:class:`CXMappingPass` maps program qubits to the architecture using a `NoiseAwarePlacement <https://tket.quantinuum.com/api-docs/placement.html#pytket.placement.NoiseAwarePlacement>`_
182
201
183
202
184
203
**Note:** The ``default_compilation_pass`` for :py:class:`AerBackend` is the same as above.
* `GateSetPredicate <https://tket.quantinuum.com/api-docs/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``.
195
-
* `NoSymbolsPredicate <https://tket.quantinuum.com/api-docs/predicates.html#pytket.predicates.NoSymbolsPredicate>`_ - Parameterised gates must have numerical values when the circuit is executed.
239
+
.. autosummary::
240
+
:nosignatures:
196
241
197
-
The :py:class:`IBMQBackend` and :py:class:`IBMQEmulatorBackend` may also have the following predicates depending on the capabilities of the specified device.
0 commit comments