qiskit 1.0.2__cp38-abi3-win32.whl → 1.1.0__cp38-abi3-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qiskit/VERSION.txt +1 -1
- qiskit/__init__.py +27 -16
- qiskit/_accelerate.pyd +0 -0
- qiskit/_numpy_compat.py +73 -0
- qiskit/assembler/__init__.py +5 -10
- qiskit/assembler/disassemble.py +5 -6
- qiskit/circuit/__init__.py +1061 -232
- qiskit/circuit/_classical_resource_map.py +10 -6
- qiskit/circuit/_utils.py +18 -8
- qiskit/circuit/annotated_operation.py +21 -0
- qiskit/circuit/barrier.py +10 -13
- qiskit/circuit/bit.py +0 -1
- qiskit/circuit/classical/__init__.py +2 -2
- qiskit/circuit/classical/expr/__init__.py +39 -5
- qiskit/circuit/classical/expr/constructors.py +84 -1
- qiskit/circuit/classical/expr/expr.py +83 -13
- qiskit/circuit/classical/expr/visitors.py +83 -0
- qiskit/circuit/classical/types/__init__.py +5 -4
- qiskit/circuit/classicalfunction/__init__.py +1 -0
- qiskit/circuit/commutation_checker.py +86 -51
- qiskit/circuit/controlflow/_builder_utils.py +9 -1
- qiskit/circuit/controlflow/break_loop.py +8 -22
- qiskit/circuit/controlflow/builder.py +116 -1
- qiskit/circuit/controlflow/continue_loop.py +8 -22
- qiskit/circuit/controlflow/control_flow.py +47 -8
- qiskit/circuit/controlflow/for_loop.py +8 -23
- qiskit/circuit/controlflow/if_else.py +13 -27
- qiskit/circuit/controlflow/switch_case.py +14 -21
- qiskit/circuit/controlflow/while_loop.py +9 -23
- qiskit/circuit/controlledgate.py +2 -2
- qiskit/circuit/delay.py +7 -5
- qiskit/circuit/gate.py +20 -7
- qiskit/circuit/instruction.py +31 -30
- qiskit/circuit/instructionset.py +9 -22
- qiskit/circuit/library/__init__.py +3 -13
- qiskit/circuit/library/arithmetic/integer_comparator.py +2 -2
- qiskit/circuit/library/arithmetic/quadratic_form.py +3 -2
- qiskit/circuit/library/blueprintcircuit.py +29 -7
- qiskit/circuit/library/data_preparation/state_preparation.py +6 -5
- qiskit/circuit/library/generalized_gates/diagonal.py +5 -4
- qiskit/circuit/library/generalized_gates/isometry.py +51 -254
- qiskit/circuit/library/generalized_gates/pauli.py +2 -2
- qiskit/circuit/library/generalized_gates/permutation.py +4 -1
- qiskit/circuit/library/generalized_gates/rv.py +15 -11
- qiskit/circuit/library/generalized_gates/uc.py +2 -98
- qiskit/circuit/library/generalized_gates/unitary.py +9 -4
- qiskit/circuit/library/hamiltonian_gate.py +11 -5
- qiskit/circuit/library/n_local/efficient_su2.py +5 -5
- qiskit/circuit/library/n_local/n_local.py +100 -49
- qiskit/circuit/library/n_local/two_local.py +3 -59
- qiskit/circuit/library/overlap.py +3 -3
- qiskit/circuit/library/phase_oracle.py +1 -1
- qiskit/circuit/library/quantum_volume.py +39 -38
- qiskit/circuit/library/standard_gates/equivalence_library.py +50 -0
- qiskit/circuit/library/standard_gates/global_phase.py +4 -2
- qiskit/circuit/library/standard_gates/i.py +1 -2
- qiskit/circuit/library/standard_gates/iswap.py +1 -2
- qiskit/circuit/library/standard_gates/multi_control_rotation_gates.py +11 -5
- qiskit/circuit/library/standard_gates/p.py +31 -15
- qiskit/circuit/library/standard_gates/r.py +4 -3
- qiskit/circuit/library/standard_gates/rx.py +7 -4
- qiskit/circuit/library/standard_gates/rxx.py +4 -3
- qiskit/circuit/library/standard_gates/ry.py +7 -4
- qiskit/circuit/library/standard_gates/ryy.py +4 -3
- qiskit/circuit/library/standard_gates/rz.py +7 -4
- qiskit/circuit/library/standard_gates/rzx.py +4 -3
- qiskit/circuit/library/standard_gates/rzz.py +4 -3
- qiskit/circuit/library/standard_gates/s.py +4 -8
- qiskit/circuit/library/standard_gates/t.py +2 -4
- qiskit/circuit/library/standard_gates/u.py +16 -11
- qiskit/circuit/library/standard_gates/u1.py +6 -2
- qiskit/circuit/library/standard_gates/u2.py +4 -2
- qiskit/circuit/library/standard_gates/u3.py +9 -5
- qiskit/circuit/library/standard_gates/x.py +22 -11
- qiskit/circuit/library/standard_gates/xx_minus_yy.py +4 -3
- qiskit/circuit/library/standard_gates/xx_plus_yy.py +7 -5
- qiskit/circuit/library/standard_gates/z.py +1 -2
- qiskit/circuit/measure.py +4 -1
- qiskit/circuit/operation.py +13 -8
- qiskit/circuit/parameter.py +11 -6
- qiskit/circuit/quantumcircuit.py +1910 -260
- qiskit/circuit/quantumcircuitdata.py +2 -2
- qiskit/circuit/reset.py +5 -2
- qiskit/circuit/store.py +95 -0
- qiskit/compiler/assembler.py +22 -22
- qiskit/compiler/transpiler.py +63 -112
- qiskit/converters/__init__.py +17 -2
- qiskit/converters/circuit_to_dag.py +7 -0
- qiskit/converters/circuit_to_dagdependency_v2.py +47 -0
- qiskit/converters/circuit_to_gate.py +2 -0
- qiskit/converters/circuit_to_instruction.py +22 -0
- qiskit/converters/dag_to_circuit.py +4 -0
- qiskit/converters/dag_to_dagdependency_v2.py +44 -0
- qiskit/dagcircuit/collect_blocks.py +15 -10
- qiskit/dagcircuit/dagcircuit.py +434 -124
- qiskit/dagcircuit/dagdependency.py +19 -12
- qiskit/dagcircuit/dagdependency_v2.py +641 -0
- qiskit/dagcircuit/dagdepnode.py +19 -16
- qiskit/dagcircuit/dagnode.py +14 -4
- qiskit/passmanager/passmanager.py +11 -11
- qiskit/primitives/__init__.py +22 -12
- qiskit/primitives/backend_estimator.py +3 -5
- qiskit/primitives/backend_estimator_v2.py +410 -0
- qiskit/primitives/backend_sampler_v2.py +287 -0
- qiskit/primitives/base/base_estimator.py +4 -9
- qiskit/primitives/base/base_sampler.py +2 -2
- qiskit/primitives/containers/__init__.py +6 -4
- qiskit/primitives/containers/bit_array.py +293 -2
- qiskit/primitives/containers/data_bin.py +123 -50
- qiskit/primitives/containers/estimator_pub.py +10 -3
- qiskit/primitives/containers/observables_array.py +2 -2
- qiskit/primitives/containers/pub_result.py +1 -1
- qiskit/primitives/containers/sampler_pub.py +19 -3
- qiskit/primitives/containers/sampler_pub_result.py +74 -0
- qiskit/primitives/containers/shape.py +4 -4
- qiskit/primitives/statevector_estimator.py +4 -4
- qiskit/primitives/statevector_sampler.py +7 -12
- qiskit/providers/__init__.py +65 -34
- qiskit/providers/backend.py +2 -2
- qiskit/providers/backend_compat.py +8 -10
- qiskit/providers/basic_provider/__init__.py +2 -23
- qiskit/providers/basic_provider/basic_provider_tools.py +67 -31
- qiskit/providers/basic_provider/basic_simulator.py +81 -21
- qiskit/providers/fake_provider/__init__.py +1 -1
- qiskit/providers/fake_provider/fake_1q.py +1 -1
- qiskit/providers/fake_provider/fake_backend.py +3 -408
- qiskit/providers/fake_provider/generic_backend_v2.py +26 -14
- qiskit/providers/models/__init__.py +2 -2
- qiskit/providers/provider.py +16 -0
- qiskit/pulse/builder.py +4 -1
- qiskit/pulse/parameter_manager.py +60 -4
- qiskit/pulse/schedule.py +29 -13
- qiskit/pulse/utils.py +61 -20
- qiskit/qasm2/__init__.py +1 -5
- qiskit/qasm2/parse.py +1 -4
- qiskit/qasm3/__init__.py +42 -5
- qiskit/qasm3/ast.py +19 -0
- qiskit/qasm3/exporter.py +178 -106
- qiskit/qasm3/printer.py +27 -5
- qiskit/qobj/converters/pulse_instruction.py +6 -6
- qiskit/qpy/__init__.py +299 -67
- qiskit/qpy/binary_io/circuits.py +216 -47
- qiskit/qpy/binary_io/schedules.py +42 -36
- qiskit/qpy/binary_io/value.py +201 -22
- qiskit/qpy/common.py +1 -1
- qiskit/qpy/exceptions.py +20 -0
- qiskit/qpy/formats.py +29 -0
- qiskit/qpy/type_keys.py +21 -0
- qiskit/quantum_info/analysis/distance.py +3 -3
- qiskit/quantum_info/analysis/make_observable.py +2 -1
- qiskit/quantum_info/analysis/z2_symmetries.py +2 -1
- qiskit/quantum_info/operators/channel/chi.py +9 -8
- qiskit/quantum_info/operators/channel/choi.py +10 -9
- qiskit/quantum_info/operators/channel/kraus.py +2 -1
- qiskit/quantum_info/operators/channel/ptm.py +10 -9
- qiskit/quantum_info/operators/channel/quantum_channel.py +2 -1
- qiskit/quantum_info/operators/channel/stinespring.py +2 -1
- qiskit/quantum_info/operators/channel/superop.py +12 -11
- qiskit/quantum_info/operators/channel/transformations.py +12 -11
- qiskit/quantum_info/operators/dihedral/dihedral.py +5 -4
- qiskit/quantum_info/operators/operator.py +43 -30
- qiskit/quantum_info/operators/scalar_op.py +10 -9
- qiskit/quantum_info/operators/symplectic/base_pauli.py +70 -59
- qiskit/quantum_info/operators/symplectic/clifford.py +36 -9
- qiskit/quantum_info/operators/symplectic/pauli.py +53 -6
- qiskit/quantum_info/operators/symplectic/pauli_list.py +36 -14
- qiskit/quantum_info/operators/symplectic/random.py +3 -2
- qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py +61 -36
- qiskit/quantum_info/states/densitymatrix.py +13 -13
- qiskit/quantum_info/states/stabilizerstate.py +3 -3
- qiskit/quantum_info/states/statevector.py +14 -13
- qiskit/quantum_info/states/utils.py +5 -3
- qiskit/result/__init__.py +6 -0
- qiskit/result/mitigation/correlated_readout_mitigator.py +3 -2
- qiskit/result/mitigation/local_readout_mitigator.py +2 -1
- qiskit/result/mitigation/utils.py +3 -2
- qiskit/scheduler/__init__.py +10 -1
- qiskit/scheduler/methods/__init__.py +1 -8
- qiskit/synthesis/__init__.py +3 -6
- qiskit/synthesis/discrete_basis/commutator_decompose.py +2 -2
- qiskit/synthesis/evolution/lie_trotter.py +7 -14
- qiskit/synthesis/evolution/qdrift.py +3 -4
- qiskit/synthesis/linear/cnot_synth.py +1 -3
- qiskit/synthesis/linear/linear_circuits_utils.py +1 -1
- qiskit/synthesis/linear_phase/cz_depth_lnn.py +4 -18
- qiskit/synthesis/permutation/__init__.py +1 -0
- qiskit/synthesis/permutation/permutation_reverse_lnn.py +90 -0
- qiskit/synthesis/qft/qft_decompose_lnn.py +2 -6
- qiskit/synthesis/two_qubit/two_qubit_decompose.py +165 -954
- qiskit/synthesis/two_qubit/xx_decompose/circuits.py +13 -12
- qiskit/synthesis/two_qubit/xx_decompose/decomposer.py +7 -1
- qiskit/synthesis/unitary/aqc/__init__.py +1 -1
- qiskit/synthesis/unitary/aqc/cnot_structures.py +2 -1
- qiskit/synthesis/unitary/aqc/fast_gradient/fast_gradient.py +2 -1
- qiskit/synthesis/unitary/qsd.py +3 -2
- qiskit/transpiler/__init__.py +7 -3
- qiskit/transpiler/layout.py +140 -61
- qiskit/transpiler/passes/__init__.py +10 -2
- qiskit/transpiler/passes/basis/basis_translator.py +9 -4
- qiskit/transpiler/passes/basis/unroll_3q_or_more.py +1 -1
- qiskit/transpiler/passes/basis/unroll_custom_definitions.py +1 -1
- qiskit/transpiler/passes/calibration/rzx_builder.py +2 -1
- qiskit/transpiler/passes/layout/apply_layout.py +8 -3
- qiskit/transpiler/passes/layout/sabre_layout.py +15 -3
- qiskit/transpiler/passes/layout/set_layout.py +1 -1
- qiskit/transpiler/passes/optimization/__init__.py +2 -0
- qiskit/transpiler/passes/optimization/commutation_analysis.py +2 -2
- qiskit/transpiler/passes/optimization/commutative_cancellation.py +1 -1
- qiskit/transpiler/passes/optimization/consolidate_blocks.py +1 -1
- qiskit/transpiler/passes/optimization/cx_cancellation.py +10 -0
- qiskit/transpiler/passes/optimization/elide_permutations.py +114 -0
- qiskit/transpiler/passes/optimization/optimize_1q_decomposition.py +9 -3
- qiskit/transpiler/passes/optimization/optimize_annotated.py +248 -12
- qiskit/transpiler/passes/optimization/remove_final_reset.py +37 -0
- qiskit/transpiler/passes/optimization/template_matching/forward_match.py +1 -3
- qiskit/transpiler/passes/routing/__init__.py +1 -0
- qiskit/transpiler/passes/routing/basic_swap.py +13 -2
- qiskit/transpiler/passes/routing/commuting_2q_gate_routing/commuting_2q_gate_router.py +8 -1
- qiskit/transpiler/passes/routing/lookahead_swap.py +7 -1
- qiskit/transpiler/passes/routing/sabre_swap.py +10 -6
- qiskit/transpiler/passes/routing/star_prerouting.py +417 -0
- qiskit/transpiler/passes/routing/stochastic_swap.py +24 -8
- qiskit/transpiler/passes/scheduling/__init__.py +1 -1
- qiskit/transpiler/passes/scheduling/alap.py +1 -2
- qiskit/transpiler/passes/scheduling/alignments/align_measures.py +1 -2
- qiskit/transpiler/passes/scheduling/alignments/check_durations.py +9 -6
- qiskit/transpiler/passes/scheduling/alignments/pulse_gate_validation.py +8 -0
- qiskit/transpiler/passes/scheduling/alignments/reschedule.py +13 -4
- qiskit/transpiler/passes/scheduling/asap.py +1 -2
- qiskit/transpiler/passes/scheduling/base_scheduler.py +21 -2
- qiskit/transpiler/passes/scheduling/dynamical_decoupling.py +26 -4
- qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py +24 -2
- qiskit/transpiler/passes/scheduling/time_unit_conversion.py +28 -4
- qiskit/transpiler/passes/synthesis/aqc_plugin.py +2 -2
- qiskit/transpiler/passes/synthesis/high_level_synthesis.py +120 -13
- qiskit/transpiler/passes/synthesis/unitary_synthesis.py +162 -55
- qiskit/transpiler/passes/utils/gates_basis.py +3 -3
- qiskit/transpiler/passmanager.py +44 -1
- qiskit/transpiler/preset_passmanagers/__init__.py +3 -3
- qiskit/transpiler/preset_passmanagers/builtin_plugins.py +34 -16
- qiskit/transpiler/preset_passmanagers/common.py +4 -6
- qiskit/transpiler/preset_passmanagers/plugin.py +9 -1
- qiskit/utils/__init__.py +3 -2
- qiskit/utils/optionals.py +6 -2
- qiskit/utils/parallel.py +24 -15
- qiskit/visualization/array.py +1 -1
- qiskit/visualization/bloch.py +2 -3
- qiskit/visualization/circuit/matplotlib.py +44 -14
- qiskit/visualization/circuit/text.py +38 -18
- qiskit/visualization/counts_visualization.py +3 -6
- qiskit/visualization/dag_visualization.py +6 -7
- qiskit/visualization/gate_map.py +9 -1
- qiskit/visualization/pulse_v2/interface.py +8 -3
- qiskit/visualization/state_visualization.py +3 -2
- qiskit/visualization/timeline/interface.py +18 -8
- {qiskit-1.0.2.dist-info → qiskit-1.1.0.dist-info}/METADATA +12 -8
- {qiskit-1.0.2.dist-info → qiskit-1.1.0.dist-info}/RECORD +261 -251
- {qiskit-1.0.2.dist-info → qiskit-1.1.0.dist-info}/WHEEL +1 -1
- qiskit/_qasm2.pyd +0 -0
- qiskit/_qasm3.pyd +0 -0
- {qiskit-1.0.2.dist-info → qiskit-1.1.0.dist-info}/LICENSE.txt +0 -0
- {qiskit-1.0.2.dist-info → qiskit-1.1.0.dist-info}/entry_points.txt +0 -0
- {qiskit-1.0.2.dist-info → qiskit-1.1.0.dist-info}/top_level.txt +0 -0
qiskit/providers/__init__.py
CHANGED
@@ -17,13 +17,13 @@ Providers Interface (:mod:`qiskit.providers`)
|
|
17
17
|
|
18
18
|
.. currentmodule:: qiskit.providers
|
19
19
|
|
20
|
-
This module contains the classes used to build external providers for
|
21
|
-
provider is anything that provides an external service to
|
20
|
+
This module contains the classes used to build external providers for Qiskit. A
|
21
|
+
provider is anything that provides an external service to Qiskit. The typical
|
22
22
|
example of this is a Backend provider which provides
|
23
23
|
:class:`~qiskit.providers.Backend` objects which can be used for executing
|
24
24
|
:class:`~qiskit.circuit.QuantumCircuit` and/or :class:`~qiskit.pulse.Schedule`
|
25
25
|
objects. This module contains the abstract classes which are used to define the
|
26
|
-
interface between a provider and
|
26
|
+
interface between a provider and Qiskit.
|
27
27
|
|
28
28
|
Version Support
|
29
29
|
===============
|
@@ -36,17 +36,17 @@ backwards compatible between versions.
|
|
36
36
|
Version Changes
|
37
37
|
----------------
|
38
38
|
|
39
|
-
Each minor version release of qiskit
|
40
|
-
|
39
|
+
Each minor version release of ``qiskit`` **may** increment the version of any
|
40
|
+
backend interface a single version number. It will be an aggregate of all
|
41
41
|
the interface changes for that release on that interface.
|
42
42
|
|
43
43
|
Version Support Policy
|
44
44
|
----------------------
|
45
45
|
|
46
46
|
To enable providers to have time to adjust to changes in this interface
|
47
|
-
|
47
|
+
Qiskit will support multiple versions of each class at once. Given the
|
48
48
|
nature of one version per release the version deprecation policy is a bit
|
49
|
-
more conservative than the standard deprecation policy.
|
49
|
+
more conservative than the standard deprecation policy. Qiskit will support a
|
50
50
|
provider interface version for a minimum of 3 minor releases or the first
|
51
51
|
release after 6 months from the release that introduced a version, whichever is
|
52
52
|
longer, prior to a potential deprecation. After that the standard deprecation
|
@@ -57,17 +57,17 @@ the release of 0.19.0 we release 0.20.0, 0.21.0, and 0.22.0, then 7 months after
|
|
57
57
|
0.19.0 we release 0.23.0. In 0.23.0 we can deprecate BackendV2, and it needs to
|
58
58
|
still be supported and can't be removed until the deprecation policy completes.
|
59
59
|
|
60
|
-
It's worth pointing out that
|
60
|
+
It's worth pointing out that Qiskit's version support policy doesn't mean
|
61
61
|
providers themselves will have the same support story, they can (and arguably
|
62
62
|
should) update to newer versions as soon as they can, the support window is
|
63
|
-
just for
|
63
|
+
just for Qiskit's supported versions. Part of this lengthy window prior to
|
64
64
|
deprecation is to give providers enough time to do their own deprecation of a
|
65
65
|
potential end user impacting change in a user facing part of the interface
|
66
66
|
prior to bumping their version. For example, let's say we changed the signature
|
67
67
|
to ``Backend.run()`` in ``BackendV34`` in a backwards incompatible way. Before
|
68
68
|
Aer could update its :class:`~qiskit_aer.AerSimulator` class
|
69
69
|
to be based on version 34 they'd need to deprecate the old signature prior to switching
|
70
|
-
over. The changeover for Aer is not guaranteed to be lockstep with
|
70
|
+
over. The changeover for Aer is not guaranteed to be lockstep with Qiskit, so we
|
71
71
|
need to ensure there is a sufficient amount of time for Aer to complete its
|
72
72
|
deprecation cycle prior to removing version 33 (ie making version 34
|
73
73
|
mandatory/the minimum version).
|
@@ -131,12 +131,12 @@ Exceptions
|
|
131
131
|
.. autoexception:: JobTimeoutError
|
132
132
|
.. autoexception:: BackendConfigurationError
|
133
133
|
|
134
|
-
|
135
|
-
|
136
|
-
======================
|
134
|
+
Writing a New Backend
|
135
|
+
=====================
|
137
136
|
|
138
137
|
If you have a quantum device or simulator that you would like to integrate with
|
139
|
-
Qiskit you will need to write a
|
138
|
+
Qiskit you will need to write a backend. A provider is a collection of backends
|
139
|
+
and will provide Qiskit with a
|
140
140
|
method to get available :class:`~qiskit.providers.BackendV2` objects. The
|
141
141
|
:class:`~qiskit.providers.BackendV2` object provides both information describing
|
142
142
|
a backend and its operation for the :mod:`~qiskit.transpiler` so that circuits
|
@@ -149,8 +149,7 @@ executing circuits on devices in a standard
|
|
149
149
|
fashion regardless of how the backend is implemented. At a high level the basic
|
150
150
|
steps for writing a provider are:
|
151
151
|
|
152
|
-
* Implement a
|
153
|
-
access to the backend(s).
|
152
|
+
* Implement a ``Provider`` class that handles access to the backend(s).
|
154
153
|
* Implement a :class:`~qiskit.providers.BackendV2` subclass and its
|
155
154
|
:meth:`~qiskit.providers.BackendV2.run` method.
|
156
155
|
|
@@ -164,7 +163,7 @@ For a simple example of a provider, see the
|
|
164
163
|
`qiskit-aqt-provider <https://github.com/Qiskit-Partners/qiskit-aqt-provider>`__
|
165
164
|
|
166
165
|
Provider
|
167
|
-
|
166
|
+
--------
|
168
167
|
|
169
168
|
A provider class serves a single purpose: to get backend objects that enable
|
170
169
|
executing circuits on a device or simulator. The expectation is that any
|
@@ -173,12 +172,11 @@ of a provider object. The provider object will then provide a list of backends,
|
|
173
172
|
and methods to filter and acquire backends (using the provided credentials if
|
174
173
|
required). An example provider class looks like::
|
175
174
|
|
176
|
-
from qiskit.providers import ProviderV1 as Provider
|
177
175
|
from qiskit.providers.providerutils import filter_backends
|
178
176
|
|
179
177
|
from .backend import MyBackend
|
180
178
|
|
181
|
-
class MyProvider
|
179
|
+
class MyProvider:
|
182
180
|
|
183
181
|
def __init__(self, token=None):
|
184
182
|
super().__init__()
|
@@ -196,7 +194,7 @@ authentication (if required) are present in the class and that the backends
|
|
196
194
|
method matches the required interface. The rest is up to the specific provider on how to implement.
|
197
195
|
|
198
196
|
Backend
|
199
|
-
|
197
|
+
-------
|
200
198
|
|
201
199
|
The backend classes are the core to the provider. These classes are what
|
202
200
|
provide the interface between Qiskit and the hardware or simulator that will
|
@@ -277,8 +275,8 @@ example would be something like::
|
|
277
275
|
return MyJob(self. job_handle, job_json, circuit)
|
278
276
|
|
279
277
|
|
280
|
-
Transpiler Interface
|
281
|
-
|
278
|
+
Backend's Transpiler Interface
|
279
|
+
------------------------------
|
282
280
|
|
283
281
|
The key piece of the :class:`~qiskit.providers.Backend` object is how it describes itself to the
|
284
282
|
compiler. This is handled with the :class:`~qiskit.transpiler.Target` class which defines
|
@@ -454,8 +452,45 @@ This way if these two compilation steps are **required** for running or providin
|
|
454
452
|
efficient output on ``Mybackend`` the transpiler will be able to perform these
|
455
453
|
custom steps without any manual user input.
|
456
454
|
|
457
|
-
|
458
|
-
|
455
|
+
.. _providers-guide-real-time-variables:
|
456
|
+
|
457
|
+
Real-time variables
|
458
|
+
^^^^^^^^^^^^^^^^^^^
|
459
|
+
|
460
|
+
The transpiler will automatically handle real-time typed classical variables (see
|
461
|
+
:mod:`qiskit.circuit.classical`) and treat the :class:`.Store` instruction as a built-in
|
462
|
+
"directive", similar to :class:`.Barrier`. No special handling from backends is necessary to permit
|
463
|
+
this.
|
464
|
+
|
465
|
+
If your backend is *unable* to handle classical variables and storage, we recommend that you comment
|
466
|
+
on this in your documentation, and insert a check into your :meth:`~.BackendV2.run` method (see
|
467
|
+
:ref:`providers-guide-backend-run`) to eagerly reject circuits containing them. You can examine
|
468
|
+
:attr:`.QuantumCircuit.num_vars` for the presence of variables at the top level. If you accept
|
469
|
+
:ref:`control-flow operations <circuit-control-flow-repr>`, you might need to recursively search the
|
470
|
+
internal :attr:`~.ControlFlowOp.blocks` of each for scope-local variables with
|
471
|
+
:attr:`.QuantumCircuit.num_declared_vars`.
|
472
|
+
|
473
|
+
For example, a function to check for the presence of any manual storage locations, or manual stores
|
474
|
+
to memory::
|
475
|
+
|
476
|
+
from qiskit.circuit import Store, ControlFlowOp, QuantumCircuit
|
477
|
+
|
478
|
+
def has_realtime_logic(circuit: QuantumCircuit) -> bool:
|
479
|
+
if circuit.num_vars:
|
480
|
+
return True
|
481
|
+
for instruction in circuit.data:
|
482
|
+
if isinstance(instruction.operation, Store):
|
483
|
+
return True
|
484
|
+
elif isinstance(instruction.operation, ControlFlowOp):
|
485
|
+
for block in instruction.operation.blocks:
|
486
|
+
if has_realtime_logic(block):
|
487
|
+
return True
|
488
|
+
return False
|
489
|
+
|
490
|
+
.. _providers-guide-backend-run:
|
491
|
+
|
492
|
+
Backend.run Method
|
493
|
+
------------------
|
459
494
|
|
460
495
|
Of key importance is the :meth:`~qiskit.providers.BackendV2.run` method, which
|
461
496
|
is used to actually submit circuits to a device or simulator. The run method
|
@@ -485,8 +520,8 @@ An example run method would be something like::
|
|
485
520
|
job_handle = submit_to_backend(job_jsonb)
|
486
521
|
return MyJob(self. job_handle, job_json, circuit)
|
487
522
|
|
488
|
-
Options
|
489
|
-
|
523
|
+
Backend Options
|
524
|
+
---------------
|
490
525
|
|
491
526
|
There are often several options for a backend that control how a circuit is run.
|
492
527
|
The typical example of this is something like the number of ``shots`` which is
|
@@ -516,7 +551,7 @@ for a full list of validation options.
|
|
516
551
|
|
517
552
|
|
518
553
|
Job
|
519
|
-
|
554
|
+
---
|
520
555
|
|
521
556
|
The output from the :obj:`~qiskit.providers.BackendV2.run` method is a :class:`~qiskit.providers.JobV1`
|
522
557
|
object. Each provider is expected to implement a custom job subclass that
|
@@ -613,7 +648,7 @@ and for a sync job::
|
|
613
648
|
return JobStatus.DONE
|
614
649
|
|
615
650
|
Primitives
|
616
|
-
|
651
|
+
----------
|
617
652
|
|
618
653
|
While not directly part of the provider interface, the :mod:`qiskit.primitives`
|
619
654
|
module is tightly coupled with providers. Specifically the primitive
|
@@ -641,12 +676,8 @@ implementations. Also the built-in implementations: :class:`~.Sampler`,
|
|
641
676
|
:class:`~.Estimator`, :class:`~.BackendSampler`, and :class:`~.BackendEstimator`
|
642
677
|
can serve as references/models on how to implement these as well.
|
643
678
|
|
644
|
-
|
645
|
-
|
646
|
-
======================================
|
647
|
-
|
648
|
-
BackendV1 -> BackendV2
|
649
|
-
======================
|
679
|
+
Migrating from BackendV1 to BackendV2
|
680
|
+
=====================================
|
650
681
|
|
651
682
|
The :obj:`~BackendV2` class re-defined user access for most properties of a
|
652
683
|
backend to make them work with native Qiskit data structures and have flatter
|
qiskit/providers/backend.py
CHANGED
@@ -40,8 +40,8 @@ class Backend:
|
|
40
40
|
class BackendV1(Backend, ABC):
|
41
41
|
"""Abstract class for Backends
|
42
42
|
|
43
|
-
This abstract class is to be used for
|
44
|
-
|
43
|
+
This abstract class is to be used for Backend objects.
|
44
|
+
There are several classes of information contained in a Backend.
|
45
45
|
The first are the attributes of the class itself. These should be used to
|
46
46
|
defined the immutable characteristics of the backend. The ``options``
|
47
47
|
attribute of the backend is used to contain the dynamic user configurable
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# This code is part of Qiskit.
|
2
2
|
#
|
3
|
-
# (C) Copyright IBM 2020.
|
3
|
+
# (C) Copyright IBM 2020, 2024.
|
4
4
|
#
|
5
5
|
# This code is licensed under the Apache License, Version 2.0. You may
|
6
6
|
# obtain a copy of this license in the LICENSE.txt file in the root directory
|
@@ -57,7 +57,7 @@ def convert_to_target(
|
|
57
57
|
A ``Target`` instance.
|
58
58
|
"""
|
59
59
|
|
60
|
-
# importing
|
60
|
+
# importing packages where they are needed, to avoid cyclic-import.
|
61
61
|
# pylint: disable=cyclic-import
|
62
62
|
from qiskit.transpiler.target import (
|
63
63
|
Target,
|
@@ -82,7 +82,7 @@ def convert_to_target(
|
|
82
82
|
"switch_case": SwitchCaseOp,
|
83
83
|
}
|
84
84
|
|
85
|
-
in_data = {"num_qubits": configuration.
|
85
|
+
in_data = {"num_qubits": configuration.num_qubits}
|
86
86
|
|
87
87
|
# Parse global configuration properties
|
88
88
|
if hasattr(configuration, "dt"):
|
@@ -97,7 +97,6 @@ def convert_to_target(
|
|
97
97
|
all_instructions = set.union(
|
98
98
|
basis_gates, set(required), supported_instructions.intersection(CONTROL_FLOW_OP_NAMES)
|
99
99
|
)
|
100
|
-
|
101
100
|
inst_name_map = {} # type: Dict[str, Instruction]
|
102
101
|
|
103
102
|
faulty_ops = set()
|
@@ -244,10 +243,8 @@ def convert_to_target(
|
|
244
243
|
|
245
244
|
for name in inst_sched_map.instructions:
|
246
245
|
for qubits in inst_sched_map.qubits_with_instruction(name):
|
247
|
-
|
248
246
|
if not isinstance(qubits, tuple):
|
249
247
|
qubits = (qubits,)
|
250
|
-
|
251
248
|
if (
|
252
249
|
name not in all_instructions
|
253
250
|
or name not in prop_name_map
|
@@ -267,17 +264,18 @@ def convert_to_target(
|
|
267
264
|
continue
|
268
265
|
|
269
266
|
entry = inst_sched_map._get_calibration_entry(name, qubits)
|
270
|
-
|
271
267
|
try:
|
272
268
|
prop_name_map[name][qubits].calibration = entry
|
273
269
|
except AttributeError:
|
270
|
+
# if instruction properties are "None", add entry
|
271
|
+
prop_name_map[name].update({qubits: InstructionProperties(None, None, entry)})
|
274
272
|
logger.info(
|
275
273
|
"The PulseDefaults payload received contains an instruction %s on "
|
276
|
-
"qubits %s which is not present in the configuration or properties payload."
|
274
|
+
"qubits %s which is not present in the configuration or properties payload."
|
275
|
+
"A new properties entry will be added to include the new calibration data.",
|
277
276
|
name,
|
278
277
|
qubits,
|
279
278
|
)
|
280
|
-
|
281
279
|
# Add parsed properties to target
|
282
280
|
target = Target(**in_data)
|
283
281
|
for inst_name in all_instructions:
|
@@ -384,7 +382,7 @@ class BackendV2Converter(BackendV2):
|
|
384
382
|
super().__init__(
|
385
383
|
provider=backend.provider,
|
386
384
|
name=backend.name(),
|
387
|
-
description=self._config
|
385
|
+
description=getattr(self._config, "description", None),
|
388
386
|
online_date=getattr(self._config, "online_date", None),
|
389
387
|
backend_version=self._config.backend_version,
|
390
388
|
)
|
@@ -27,36 +27,15 @@ via the `BasicProvider` provider, e.g.:
|
|
27
27
|
backend = BasicProvider().get_backend('basic_simulator')
|
28
28
|
|
29
29
|
|
30
|
-
|
31
|
-
|
30
|
+
Classes
|
31
|
+
=======
|
32
32
|
|
33
33
|
.. autosummary::
|
34
34
|
:toctree: ../stubs/
|
35
35
|
|
36
36
|
BasicSimulator
|
37
|
-
|
38
|
-
Provider
|
39
|
-
========
|
40
|
-
|
41
|
-
.. autosummary::
|
42
|
-
:toctree: ../stubs/
|
43
|
-
|
44
37
|
BasicProvider
|
45
|
-
|
46
|
-
Job Class
|
47
|
-
=========
|
48
|
-
|
49
|
-
.. autosummary::
|
50
|
-
:toctree: ../stubs/
|
51
|
-
|
52
38
|
BasicProviderJob
|
53
|
-
|
54
|
-
Exceptions
|
55
|
-
==========
|
56
|
-
|
57
|
-
.. autosummary::
|
58
|
-
:toctree: ../stubs/
|
59
|
-
|
60
39
|
BasicProviderError
|
61
40
|
"""
|
62
41
|
|
@@ -23,7 +23,30 @@ import qiskit.circuit.library.standard_gates as gates
|
|
23
23
|
from qiskit.exceptions import QiskitError
|
24
24
|
|
25
25
|
# Single qubit gates supported by ``single_gate_params``.
|
26
|
-
SINGLE_QUBIT_GATES =
|
26
|
+
SINGLE_QUBIT_GATES = {
|
27
|
+
"U": gates.UGate,
|
28
|
+
"u": gates.UGate,
|
29
|
+
"u1": gates.U1Gate,
|
30
|
+
"u2": gates.U2Gate,
|
31
|
+
"u3": gates.U3Gate,
|
32
|
+
"h": gates.HGate,
|
33
|
+
"p": gates.PhaseGate,
|
34
|
+
"s": gates.SGate,
|
35
|
+
"sdg": gates.SdgGate,
|
36
|
+
"sx": gates.SXGate,
|
37
|
+
"sxdg": gates.SXdgGate,
|
38
|
+
"t": gates.TGate,
|
39
|
+
"tdg": gates.TdgGate,
|
40
|
+
"x": gates.XGate,
|
41
|
+
"y": gates.YGate,
|
42
|
+
"z": gates.ZGate,
|
43
|
+
"id": gates.IGate,
|
44
|
+
"i": gates.IGate,
|
45
|
+
"r": gates.RGate,
|
46
|
+
"rx": gates.RXGate,
|
47
|
+
"ry": gates.RYGate,
|
48
|
+
"rz": gates.RZGate,
|
49
|
+
}
|
27
50
|
|
28
51
|
|
29
52
|
def single_gate_matrix(gate: str, params: list[float] | None = None) -> np.ndarray:
|
@@ -40,42 +63,55 @@ def single_gate_matrix(gate: str, params: list[float] | None = None) -> np.ndarr
|
|
40
63
|
"""
|
41
64
|
if params is None:
|
42
65
|
params = []
|
43
|
-
|
44
|
-
|
45
|
-
gc = gates.UGate
|
46
|
-
elif gate == "u3":
|
47
|
-
gc = gates.U3Gate
|
48
|
-
elif gate == "h":
|
49
|
-
gc = gates.HGate
|
50
|
-
elif gate == "u":
|
51
|
-
gc = gates.UGate
|
52
|
-
elif gate == "p":
|
53
|
-
gc = gates.PhaseGate
|
54
|
-
elif gate == "u2":
|
55
|
-
gc = gates.U2Gate
|
56
|
-
elif gate == "u1":
|
57
|
-
gc = gates.U1Gate
|
58
|
-
elif gate == "rz":
|
59
|
-
gc = gates.RZGate
|
60
|
-
elif gate == "id":
|
61
|
-
gc = gates.IGate
|
62
|
-
elif gate == "sx":
|
63
|
-
gc = gates.SXGate
|
64
|
-
elif gate == "x":
|
65
|
-
gc = gates.XGate
|
66
|
+
if gate in SINGLE_QUBIT_GATES:
|
67
|
+
gc = SINGLE_QUBIT_GATES[gate]
|
66
68
|
else:
|
67
69
|
raise QiskitError("Gate is not a valid basis gate for this simulator: %s" % gate)
|
68
70
|
|
69
71
|
return gc(*params).to_matrix()
|
70
72
|
|
71
73
|
|
72
|
-
#
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
""
|
78
|
-
|
74
|
+
# Two qubit gates WITHOUT parameters: name -> matrix
|
75
|
+
TWO_QUBIT_GATES = {
|
76
|
+
"CX": gates.CXGate().to_matrix(),
|
77
|
+
"cx": gates.CXGate().to_matrix(),
|
78
|
+
"ecr": gates.ECRGate().to_matrix(),
|
79
|
+
"cy": gates.CYGate().to_matrix(),
|
80
|
+
"cz": gates.CZGate().to_matrix(),
|
81
|
+
"swap": gates.SwapGate().to_matrix(),
|
82
|
+
"iswap": gates.iSwapGate().to_matrix(),
|
83
|
+
"ch": gates.CHGate().to_matrix(),
|
84
|
+
"cs": gates.CSGate().to_matrix(),
|
85
|
+
"csdg": gates.CSdgGate().to_matrix(),
|
86
|
+
"csx": gates.CSXGate().to_matrix(),
|
87
|
+
"dcx": gates.DCXGate().to_matrix(),
|
88
|
+
}
|
89
|
+
|
90
|
+
# Two qubit gates WITH parameters: name -> class
|
91
|
+
TWO_QUBIT_GATES_WITH_PARAMETERS = {
|
92
|
+
"cp": gates.CPhaseGate,
|
93
|
+
"crx": gates.CRXGate,
|
94
|
+
"cry": gates.CRYGate,
|
95
|
+
"crz": gates.CRZGate,
|
96
|
+
"cu": gates.CUGate,
|
97
|
+
"cu1": gates.CU1Gate,
|
98
|
+
"cu3": gates.CU3Gate,
|
99
|
+
"rxx": gates.RXXGate,
|
100
|
+
"ryy": gates.RYYGate,
|
101
|
+
"rzz": gates.RZZGate,
|
102
|
+
"rzx": gates.RZXGate,
|
103
|
+
"xx_minus_yy": gates.XXMinusYYGate,
|
104
|
+
"xx_plus_yy": gates.XXPlusYYGate,
|
105
|
+
}
|
106
|
+
|
107
|
+
|
108
|
+
# Three qubit gates: name -> matrix
|
109
|
+
THREE_QUBIT_GATES = {
|
110
|
+
"ccx": gates.CCXGate().to_matrix(),
|
111
|
+
"ccz": gates.CCZGate().to_matrix(),
|
112
|
+
"rccx": gates.RCCXGate().to_matrix(),
|
113
|
+
"cswap": gates.CSwapGate().to_matrix(),
|
114
|
+
}
|
79
115
|
|
80
116
|
|
81
117
|
def einsum_matmul_index(gate_indices: list[int], number_of_qubits: int) -> str:
|
@@ -29,6 +29,7 @@ field, which is a result of measurements for each shot.
|
|
29
29
|
|
30
30
|
from __future__ import annotations
|
31
31
|
|
32
|
+
import math
|
32
33
|
import uuid
|
33
34
|
import time
|
34
35
|
import logging
|
@@ -39,7 +40,7 @@ import numpy as np
|
|
39
40
|
|
40
41
|
from qiskit.circuit import QuantumCircuit
|
41
42
|
from qiskit.circuit.library import UnitaryGate
|
42
|
-
from qiskit.circuit.library.standard_gates import get_standard_gate_name_mapping
|
43
|
+
from qiskit.circuit.library.standard_gates import get_standard_gate_name_mapping, GlobalPhaseGate
|
43
44
|
from qiskit.providers import Provider
|
44
45
|
from qiskit.providers.backend import BackendV2
|
45
46
|
from qiskit.providers.models import BackendConfiguration
|
@@ -50,8 +51,12 @@ from qiskit.transpiler import Target
|
|
50
51
|
|
51
52
|
from .basic_provider_job import BasicProviderJob
|
52
53
|
from .basic_provider_tools import single_gate_matrix
|
53
|
-
from .basic_provider_tools import
|
54
|
-
|
54
|
+
from .basic_provider_tools import (
|
55
|
+
SINGLE_QUBIT_GATES,
|
56
|
+
TWO_QUBIT_GATES,
|
57
|
+
TWO_QUBIT_GATES_WITH_PARAMETERS,
|
58
|
+
THREE_QUBIT_GATES,
|
59
|
+
)
|
55
60
|
from .basic_provider_tools import einsum_vecmul_index
|
56
61
|
from .exceptions import BasicProviderError
|
57
62
|
|
@@ -137,21 +142,59 @@ class BasicSimulator(BackendV2):
|
|
137
142
|
num_qubits=None,
|
138
143
|
)
|
139
144
|
basis_gates = [
|
145
|
+
"ccx",
|
146
|
+
"ccz",
|
147
|
+
"ch",
|
148
|
+
"cp",
|
149
|
+
"crx",
|
150
|
+
"cry",
|
151
|
+
"crz",
|
152
|
+
"cs",
|
153
|
+
"csdg",
|
154
|
+
"cswap",
|
155
|
+
"csx",
|
156
|
+
"cu",
|
157
|
+
"cu1",
|
158
|
+
"cu3",
|
159
|
+
"cx",
|
160
|
+
"cy",
|
161
|
+
"cz",
|
162
|
+
"dcx",
|
163
|
+
"delay",
|
164
|
+
"ecr",
|
165
|
+
"global_phase",
|
140
166
|
"h",
|
141
|
-
"
|
167
|
+
"id",
|
168
|
+
"iswap",
|
169
|
+
"measure",
|
142
170
|
"p",
|
171
|
+
"r",
|
172
|
+
"rccx",
|
173
|
+
"reset",
|
174
|
+
"rx",
|
175
|
+
"rxx",
|
176
|
+
"ry",
|
177
|
+
"ryy",
|
178
|
+
"rz",
|
179
|
+
"rzx",
|
180
|
+
"rzz",
|
181
|
+
"s",
|
182
|
+
"sdg",
|
183
|
+
"swap",
|
184
|
+
"sx",
|
185
|
+
"sxdg",
|
186
|
+
"t",
|
187
|
+
"tdg",
|
188
|
+
"u",
|
143
189
|
"u1",
|
144
190
|
"u2",
|
145
191
|
"u3",
|
146
|
-
"rz",
|
147
|
-
"sx",
|
148
|
-
"x",
|
149
|
-
"cx",
|
150
|
-
"id",
|
151
192
|
"unitary",
|
152
|
-
"
|
153
|
-
"
|
154
|
-
"
|
193
|
+
"x",
|
194
|
+
"xx_minus_yy",
|
195
|
+
"xx_plus_yy",
|
196
|
+
"y",
|
197
|
+
"z",
|
155
198
|
]
|
156
199
|
inst_mapping = get_standard_gate_name_mapping()
|
157
200
|
for name in basis_gates:
|
@@ -331,9 +374,9 @@ class BasicSimulator(BackendV2):
|
|
331
374
|
|
332
375
|
# update quantum state
|
333
376
|
if outcome == "0":
|
334
|
-
update_diag = [[1 /
|
377
|
+
update_diag = [[1 / math.sqrt(probability), 0], [0, 0]]
|
335
378
|
else:
|
336
|
-
update_diag = [[0, 0], [0, 1 /
|
379
|
+
update_diag = [[0, 0], [0, 1 / math.sqrt(probability)]]
|
337
380
|
# update classical state
|
338
381
|
self._add_unitary(update_diag, [qubit])
|
339
382
|
|
@@ -351,10 +394,10 @@ class BasicSimulator(BackendV2):
|
|
351
394
|
outcome, probability = self._get_measure_outcome(qubit)
|
352
395
|
# update quantum state
|
353
396
|
if outcome == "0":
|
354
|
-
update = [[1 /
|
397
|
+
update = [[1 / math.sqrt(probability), 0], [0, 0]]
|
355
398
|
self._add_unitary(update, [qubit])
|
356
399
|
else:
|
357
|
-
update = [[0, 1 /
|
400
|
+
update = [[0, 1 / math.sqrt(probability)], [0, 0]]
|
358
401
|
self._add_unitary(update, [qubit])
|
359
402
|
|
360
403
|
def _validate_initial_statevector(self) -> None:
|
@@ -478,7 +521,7 @@ class BasicSimulator(BackendV2):
|
|
478
521
|
Example::
|
479
522
|
|
480
523
|
backend_options = {
|
481
|
-
"initial_statevector": np.array([1, 0, 0, 1j]) /
|
524
|
+
"initial_statevector": np.array([1, 0, 0, 1j]) / math.sqrt(2),
|
482
525
|
}
|
483
526
|
"""
|
484
527
|
# TODO: replace assemble with new run flow
|
@@ -616,24 +659,41 @@ class BasicSimulator(BackendV2):
|
|
616
659
|
value >>= 1
|
617
660
|
if value != int(operation.conditional.val, 16):
|
618
661
|
continue
|
619
|
-
# Check if single gate
|
620
662
|
if operation.name == "unitary":
|
621
663
|
qubits = operation.qubits
|
622
664
|
gate = operation.params[0]
|
623
665
|
self._add_unitary(gate, qubits)
|
666
|
+
elif operation.name in ("id", "u0", "delay"):
|
667
|
+
pass
|
668
|
+
elif operation.name == "global_phase":
|
669
|
+
params = getattr(operation, "params", None)
|
670
|
+
gate = GlobalPhaseGate(*params).to_matrix()
|
671
|
+
self._add_unitary(gate, [])
|
672
|
+
# Check if single qubit gate
|
624
673
|
elif operation.name in SINGLE_QUBIT_GATES:
|
625
674
|
params = getattr(operation, "params", None)
|
626
675
|
qubit = operation.qubits[0]
|
627
676
|
gate = single_gate_matrix(operation.name, params)
|
628
677
|
self._add_unitary(gate, [qubit])
|
629
|
-
|
678
|
+
elif operation.name in TWO_QUBIT_GATES_WITH_PARAMETERS:
|
679
|
+
params = getattr(operation, "params", None)
|
680
|
+
qubit0 = operation.qubits[0]
|
681
|
+
qubit1 = operation.qubits[1]
|
682
|
+
gate = TWO_QUBIT_GATES_WITH_PARAMETERS[operation.name](*params).to_matrix()
|
683
|
+
self._add_unitary(gate, [qubit0, qubit1])
|
630
684
|
elif operation.name in ("id", "u0"):
|
631
685
|
pass
|
632
|
-
elif operation.name in
|
686
|
+
elif operation.name in TWO_QUBIT_GATES:
|
633
687
|
qubit0 = operation.qubits[0]
|
634
688
|
qubit1 = operation.qubits[1]
|
635
|
-
gate =
|
689
|
+
gate = TWO_QUBIT_GATES[operation.name]
|
636
690
|
self._add_unitary(gate, [qubit0, qubit1])
|
691
|
+
elif operation.name in THREE_QUBIT_GATES:
|
692
|
+
qubit0 = operation.qubits[0]
|
693
|
+
qubit1 = operation.qubits[1]
|
694
|
+
qubit2 = operation.qubits[2]
|
695
|
+
gate = THREE_QUBIT_GATES[operation.name]
|
696
|
+
self._add_unitary(gate, [qubit0, qubit1, qubit2])
|
637
697
|
# Check if reset
|
638
698
|
elif operation.name == "reset":
|
639
699
|
qubit = operation.qubits[0]
|
@@ -24,7 +24,7 @@ The fake provider module in Qiskit contains fake (simulated) backend classes
|
|
24
24
|
useful for testing the transpiler and other backend-facing functionality.
|
25
25
|
|
26
26
|
Example Usage
|
27
|
-
|
27
|
+
-------------
|
28
28
|
|
29
29
|
Here is an example of using a simulated backend for transpilation and running.
|
30
30
|
|