azure-quantum 3.4.1.dev1__py3-none-any.whl → 3.5.0.dev0__py3-none-any.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.
- azure/quantum/_client/_version.py +1 -1
- azure/quantum/_client/models/_enums.py +10 -0
- azure/quantum/_client/models/_models.py +4 -4
- azure/quantum/cirq/targets/ionq.py +5 -0
- azure/quantum/job/job.py +5 -4
- azure/quantum/qiskit/backends/_qiskit_ionq.py +377 -0
- azure/quantum/qiskit/backends/backend.py +370 -138
- azure/quantum/qiskit/backends/ionq.py +27 -34
- azure/quantum/qiskit/backends/qci.py +12 -14
- azure/quantum/qiskit/backends/quantinuum.py +46 -44
- azure/quantum/qiskit/backends/rigetti.py +10 -14
- azure/quantum/qiskit/job.py +21 -14
- azure/quantum/qiskit/provider.py +12 -6
- azure/quantum/target/pasqal/result.py +1 -1
- azure/quantum/target/rigetti/result.py +1 -1
- azure/quantum/target/target.py +4 -56
- azure/quantum/version.py +1 -1
- {azure_quantum-3.4.1.dev1.dist-info → azure_quantum-3.5.0.dev0.dist-info}/METADATA +5 -13
- {azure_quantum-3.4.1.dev1.dist-info → azure_quantum-3.5.0.dev0.dist-info}/RECORD +21 -20
- {azure_quantum-3.4.1.dev1.dist-info → azure_quantum-3.5.0.dev0.dist-info}/WHEEL +0 -0
- {azure_quantum-3.4.1.dev1.dist-info → azure_quantum-3.5.0.dev0.dist-info}/top_level.txt +0 -0
|
@@ -11,15 +11,15 @@ from qsharp import TargetProfile
|
|
|
11
11
|
from qiskit import QuantumCircuit
|
|
12
12
|
|
|
13
13
|
from .backend import (
|
|
14
|
-
AzureBackend,
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
AzureBackend,
|
|
15
|
+
AzureBackendConfig,
|
|
16
|
+
AzureQirBackend,
|
|
17
|
+
_ensure_backend_config,
|
|
18
|
+
_get_shots_or_deprecated_count_input_param,
|
|
17
19
|
)
|
|
20
|
+
from qiskit.providers import Options
|
|
18
21
|
|
|
19
|
-
from
|
|
20
|
-
from qiskit.providers import Options, Provider
|
|
21
|
-
|
|
22
|
-
from qiskit_ionq.helpers import (
|
|
22
|
+
from ._qiskit_ionq import (
|
|
23
23
|
GATESET_MAP,
|
|
24
24
|
qiskit_circ_to_ionq_circ,
|
|
25
25
|
)
|
|
@@ -38,7 +38,6 @@ __all__ = [
|
|
|
38
38
|
"IonQSimulatorBackend",
|
|
39
39
|
"IonQAriaBackend",
|
|
40
40
|
"IonQForteBackend",
|
|
41
|
-
"IonQQirBackend",
|
|
42
41
|
"IonQSimulatorQirBackend",
|
|
43
42
|
"IonQSimulatorNativeBackend",
|
|
44
43
|
"IonQAriaQirBackend",
|
|
@@ -57,7 +56,7 @@ class IonQQirBackendBase(AzureQirBackend):
|
|
|
57
56
|
|
|
58
57
|
@abstractmethod
|
|
59
58
|
def __init__(
|
|
60
|
-
self, configuration:
|
|
59
|
+
self, configuration: AzureBackendConfig, provider: "AzureQuantumProvider" = None, **fields
|
|
61
60
|
):
|
|
62
61
|
super().__init__(configuration, provider, **fields)
|
|
63
62
|
|
|
@@ -104,7 +103,7 @@ class IonQSimulatorQirBackend(IonQQirBackendBase):
|
|
|
104
103
|
|
|
105
104
|
def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
|
|
106
105
|
"""Base class for interfacing with an IonQ QIR Simulator backend"""
|
|
107
|
-
default_config =
|
|
106
|
+
default_config = AzureBackendConfig.from_dict(
|
|
108
107
|
{
|
|
109
108
|
"backend_name": name,
|
|
110
109
|
"backend_version": __version__,
|
|
@@ -117,15 +116,14 @@ class IonQSimulatorQirBackend(IonQQirBackendBase):
|
|
|
117
116
|
"n_qubits": 29,
|
|
118
117
|
"conditional": False,
|
|
119
118
|
"max_shots": None,
|
|
120
|
-
"max_experiments": 1,
|
|
121
119
|
"open_pulse": False,
|
|
122
120
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
123
121
|
"azure": self._azure_config(),
|
|
124
122
|
}
|
|
125
123
|
)
|
|
126
124
|
logger.info("Initializing IonQSimulatorQirBackend")
|
|
127
|
-
configuration
|
|
128
|
-
"configuration", default_config
|
|
125
|
+
configuration = _ensure_backend_config(
|
|
126
|
+
kwargs.pop("configuration", default_config)
|
|
129
127
|
)
|
|
130
128
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
131
129
|
|
|
@@ -135,7 +133,7 @@ class IonQAriaQirBackend(IonQQirBackendBase):
|
|
|
135
133
|
|
|
136
134
|
def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
|
|
137
135
|
"""Base class for interfacing with an IonQ Aria QPU backend"""
|
|
138
|
-
default_config =
|
|
136
|
+
default_config = AzureBackendConfig.from_dict(
|
|
139
137
|
{
|
|
140
138
|
"backend_name": name,
|
|
141
139
|
"backend_version": __version__,
|
|
@@ -148,15 +146,14 @@ class IonQAriaQirBackend(IonQQirBackendBase):
|
|
|
148
146
|
"n_qubits": 25,
|
|
149
147
|
"conditional": False,
|
|
150
148
|
"max_shots": 10000,
|
|
151
|
-
"max_experiments": 1,
|
|
152
149
|
"open_pulse": False,
|
|
153
150
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
154
151
|
"azure": self._azure_config(),
|
|
155
152
|
}
|
|
156
153
|
)
|
|
157
154
|
logger.info("Initializing IonQAriaQirBackend")
|
|
158
|
-
configuration
|
|
159
|
-
"configuration", default_config
|
|
155
|
+
configuration = _ensure_backend_config(
|
|
156
|
+
kwargs.pop("configuration", default_config)
|
|
160
157
|
)
|
|
161
158
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
162
159
|
|
|
@@ -166,7 +163,7 @@ class IonQForteQirBackend(IonQQirBackendBase):
|
|
|
166
163
|
|
|
167
164
|
def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
|
|
168
165
|
"""Base class for interfacing with an IonQ Forte QPU backend"""
|
|
169
|
-
default_config =
|
|
166
|
+
default_config = AzureBackendConfig.from_dict(
|
|
170
167
|
{
|
|
171
168
|
"backend_name": name,
|
|
172
169
|
"backend_version": __version__,
|
|
@@ -179,15 +176,14 @@ class IonQForteQirBackend(IonQQirBackendBase):
|
|
|
179
176
|
"n_qubits": 35,
|
|
180
177
|
"conditional": False,
|
|
181
178
|
"max_shots": 10000,
|
|
182
|
-
"max_experiments": 1,
|
|
183
179
|
"open_pulse": False,
|
|
184
180
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
185
181
|
"azure": self._azure_config(),
|
|
186
182
|
}
|
|
187
183
|
)
|
|
188
184
|
logger.info("Initializing IonQForteQirBackend")
|
|
189
|
-
configuration
|
|
190
|
-
"configuration", default_config
|
|
185
|
+
configuration = _ensure_backend_config(
|
|
186
|
+
kwargs.pop("configuration", default_config)
|
|
191
187
|
)
|
|
192
188
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
193
189
|
|
|
@@ -201,7 +197,7 @@ class IonQBackend(AzureBackend):
|
|
|
201
197
|
|
|
202
198
|
@abstractmethod
|
|
203
199
|
def __init__(
|
|
204
|
-
self, configuration:
|
|
200
|
+
self, configuration: AzureBackendConfig, provider: "AzureQuantumProvider" = None, **fields
|
|
205
201
|
):
|
|
206
202
|
super().__init__(configuration, provider, **fields)
|
|
207
203
|
|
|
@@ -270,7 +266,7 @@ class IonQSimulatorBackend(IonQBackend):
|
|
|
270
266
|
def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
|
|
271
267
|
"""Base class for interfacing with an IonQ Simulator backend"""
|
|
272
268
|
gateset = kwargs.pop("gateset", "qis")
|
|
273
|
-
default_config =
|
|
269
|
+
default_config = AzureBackendConfig.from_dict(
|
|
274
270
|
{
|
|
275
271
|
"backend_name": name,
|
|
276
272
|
"backend_version": __version__,
|
|
@@ -283,7 +279,6 @@ class IonQSimulatorBackend(IonQBackend):
|
|
|
283
279
|
"n_qubits": 29,
|
|
284
280
|
"conditional": False,
|
|
285
281
|
"max_shots": None,
|
|
286
|
-
"max_experiments": 1,
|
|
287
282
|
"open_pulse": False,
|
|
288
283
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
289
284
|
"azure": self._azure_config(),
|
|
@@ -291,8 +286,8 @@ class IonQSimulatorBackend(IonQBackend):
|
|
|
291
286
|
}
|
|
292
287
|
)
|
|
293
288
|
logger.info("Initializing IonQSimulatorBackend")
|
|
294
|
-
configuration
|
|
295
|
-
"configuration", default_config
|
|
289
|
+
configuration = _ensure_backend_config(
|
|
290
|
+
kwargs.pop("configuration", default_config)
|
|
296
291
|
)
|
|
297
292
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
298
293
|
|
|
@@ -310,7 +305,7 @@ class IonQAriaBackend(IonQBackend):
|
|
|
310
305
|
def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
|
|
311
306
|
"""Base class for interfacing with an IonQ Aria QPU backend"""
|
|
312
307
|
gateset = kwargs.pop("gateset", "qis")
|
|
313
|
-
default_config =
|
|
308
|
+
default_config = AzureBackendConfig.from_dict(
|
|
314
309
|
{
|
|
315
310
|
"backend_name": name,
|
|
316
311
|
"backend_version": __version__,
|
|
@@ -323,7 +318,6 @@ class IonQAriaBackend(IonQBackend):
|
|
|
323
318
|
"n_qubits": 23,
|
|
324
319
|
"conditional": False,
|
|
325
320
|
"max_shots": 10000,
|
|
326
|
-
"max_experiments": 1,
|
|
327
321
|
"open_pulse": False,
|
|
328
322
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
329
323
|
"azure": self._azure_config(),
|
|
@@ -331,8 +325,8 @@ class IonQAriaBackend(IonQBackend):
|
|
|
331
325
|
}
|
|
332
326
|
)
|
|
333
327
|
logger.info("Initializing IonQAriaQPUBackend")
|
|
334
|
-
configuration
|
|
335
|
-
"configuration", default_config
|
|
328
|
+
configuration = _ensure_backend_config(
|
|
329
|
+
kwargs.pop("configuration", default_config)
|
|
336
330
|
)
|
|
337
331
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
338
332
|
|
|
@@ -343,7 +337,7 @@ class IonQForteBackend(IonQBackend):
|
|
|
343
337
|
def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
|
|
344
338
|
"""Base class for interfacing with an IonQ Forte QPU backend"""
|
|
345
339
|
gateset = kwargs.pop("gateset", "qis")
|
|
346
|
-
default_config =
|
|
340
|
+
default_config = AzureBackendConfig.from_dict(
|
|
347
341
|
{
|
|
348
342
|
"backend_name": name,
|
|
349
343
|
"backend_version": __version__,
|
|
@@ -356,7 +350,6 @@ class IonQForteBackend(IonQBackend):
|
|
|
356
350
|
"n_qubits": 35,
|
|
357
351
|
"conditional": False,
|
|
358
352
|
"max_shots": 10000,
|
|
359
|
-
"max_experiments": 1,
|
|
360
353
|
"open_pulse": False,
|
|
361
354
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
362
355
|
"azure": self._azure_config(),
|
|
@@ -364,8 +357,8 @@ class IonQForteBackend(IonQBackend):
|
|
|
364
357
|
}
|
|
365
358
|
)
|
|
366
359
|
logger.info("Initializing IonQForteBackend")
|
|
367
|
-
configuration
|
|
368
|
-
"configuration", default_config
|
|
360
|
+
configuration = _ensure_backend_config(
|
|
361
|
+
kwargs.pop("configuration", default_config)
|
|
369
362
|
)
|
|
370
363
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
371
364
|
|
|
@@ -8,12 +8,12 @@ from azure.quantum.version import __version__
|
|
|
8
8
|
from azure.quantum.qiskit.job import AzureQuantumJob
|
|
9
9
|
from abc import abstractmethod
|
|
10
10
|
from .backend import (
|
|
11
|
-
|
|
11
|
+
AzureBackendConfig,
|
|
12
|
+
AzureQirBackend,
|
|
13
|
+
_ensure_backend_config,
|
|
12
14
|
_get_shots_or_deprecated_count_input_param,
|
|
13
15
|
)
|
|
14
|
-
|
|
15
|
-
from qiskit.providers.models import BackendConfiguration
|
|
16
|
-
from qiskit.providers import Options, Provider
|
|
16
|
+
from qiskit.providers import Options
|
|
17
17
|
from qsharp import TargetProfile
|
|
18
18
|
|
|
19
19
|
|
|
@@ -24,7 +24,7 @@ import logging
|
|
|
24
24
|
|
|
25
25
|
logger = logging.getLogger(__name__)
|
|
26
26
|
|
|
27
|
-
__all__ = ["QCISimulatorBackend" "QCIQPUBackend"]
|
|
27
|
+
__all__ = ["QCISimulatorBackend", "QCIQPUBackend"]
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
_DEFAULT_SHOTS_COUNT = 500
|
|
@@ -35,7 +35,7 @@ class QCIBackend(AzureQirBackend):
|
|
|
35
35
|
|
|
36
36
|
@abstractmethod
|
|
37
37
|
def __init__(
|
|
38
|
-
self, configuration:
|
|
38
|
+
self, configuration: AzureBackendConfig, provider: "AzureQuantumProvider" = None, **fields
|
|
39
39
|
):
|
|
40
40
|
super().__init__(configuration, provider, **fields)
|
|
41
41
|
|
|
@@ -85,7 +85,7 @@ class QCISimulatorBackend(QCIBackend):
|
|
|
85
85
|
|
|
86
86
|
def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
|
|
87
87
|
"""Base class for interfacing with an QCI Simulator backend"""
|
|
88
|
-
default_config =
|
|
88
|
+
default_config = AzureBackendConfig.from_dict(
|
|
89
89
|
{
|
|
90
90
|
"backend_name": name,
|
|
91
91
|
"backend_version": __version__,
|
|
@@ -98,7 +98,6 @@ class QCISimulatorBackend(QCIBackend):
|
|
|
98
98
|
"n_qubits": 29,
|
|
99
99
|
"conditional": True,
|
|
100
100
|
"max_shots": 1e6,
|
|
101
|
-
"max_experiments": 1,
|
|
102
101
|
"open_pulse": False,
|
|
103
102
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
104
103
|
"azure": self._azure_config(),
|
|
@@ -106,8 +105,8 @@ class QCISimulatorBackend(QCIBackend):
|
|
|
106
105
|
}
|
|
107
106
|
)
|
|
108
107
|
logger.info("Initializing QCISimulatorBackend")
|
|
109
|
-
configuration
|
|
110
|
-
"configuration", default_config
|
|
108
|
+
configuration = _ensure_backend_config(
|
|
109
|
+
kwargs.pop("configuration", default_config)
|
|
111
110
|
)
|
|
112
111
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
113
112
|
|
|
@@ -117,7 +116,7 @@ class QCIQPUBackend(QCIBackend):
|
|
|
117
116
|
|
|
118
117
|
def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
|
|
119
118
|
"""Base class for interfacing with an QCI QPU backend"""
|
|
120
|
-
default_config =
|
|
119
|
+
default_config = AzureBackendConfig.from_dict(
|
|
121
120
|
{
|
|
122
121
|
"backend_name": name,
|
|
123
122
|
"backend_version": __version__,
|
|
@@ -130,7 +129,6 @@ class QCIQPUBackend(QCIBackend):
|
|
|
130
129
|
"n_qubits": 11,
|
|
131
130
|
"conditional": True,
|
|
132
131
|
"max_shots": 10000,
|
|
133
|
-
"max_experiments": 1,
|
|
134
132
|
"open_pulse": False,
|
|
135
133
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
136
134
|
"azure": self._azure_config(),
|
|
@@ -138,7 +136,7 @@ class QCIQPUBackend(QCIBackend):
|
|
|
138
136
|
}
|
|
139
137
|
)
|
|
140
138
|
logger.info("Initializing QCIQPUBackend")
|
|
141
|
-
configuration
|
|
142
|
-
"configuration", default_config
|
|
139
|
+
configuration = _ensure_backend_config(
|
|
140
|
+
kwargs.pop("configuration", default_config)
|
|
143
141
|
)
|
|
144
142
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
@@ -3,21 +3,25 @@
|
|
|
3
3
|
# Licensed under the MIT License.
|
|
4
4
|
##
|
|
5
5
|
|
|
6
|
-
from typing import
|
|
7
|
-
from azure.quantum.qiskit.job import AzureQuantumJob
|
|
6
|
+
from typing import TYPE_CHECKING, Dict
|
|
8
7
|
from azure.quantum.version import __version__
|
|
9
8
|
import warnings
|
|
10
9
|
|
|
11
|
-
from .backend import
|
|
10
|
+
from .backend import (
|
|
11
|
+
AzureBackend,
|
|
12
|
+
AzureBackendConfig,
|
|
13
|
+
AzureQirBackend,
|
|
14
|
+
_ensure_backend_config,
|
|
15
|
+
)
|
|
12
16
|
from abc import abstractmethod
|
|
13
|
-
from qiskit import QuantumCircuit
|
|
14
|
-
from qiskit.providers.models import BackendConfiguration
|
|
15
17
|
from qiskit.providers import Options
|
|
16
|
-
from qiskit.providers import Provider
|
|
17
18
|
from qiskit.qasm2 import dumps
|
|
18
19
|
from qsharp import TargetProfile
|
|
19
20
|
import logging
|
|
20
21
|
|
|
22
|
+
if TYPE_CHECKING:
|
|
23
|
+
from azure.quantum.qiskit import AzureQuantumProvider
|
|
24
|
+
|
|
21
25
|
logger = logging.getLogger(__name__)
|
|
22
26
|
|
|
23
27
|
__all__ = [
|
|
@@ -72,7 +76,7 @@ class QuantinuumQirBackendBase(AzureQirBackend):
|
|
|
72
76
|
|
|
73
77
|
@abstractmethod
|
|
74
78
|
def __init__(
|
|
75
|
-
self, configuration:
|
|
79
|
+
self, configuration: AzureBackendConfig, provider: "AzureQuantumProvider" = None, **fields
|
|
76
80
|
):
|
|
77
81
|
super().__init__(configuration, provider, **fields)
|
|
78
82
|
|
|
@@ -109,29 +113,30 @@ class QuantinuumSyntaxCheckerQirBackend(QuantinuumQirBackendBase):
|
|
|
109
113
|
self._provider_id = QUANTINUUM_PROVIDER_ID
|
|
110
114
|
self._provider_name = QUANTINUUM_PROVIDER_NAME
|
|
111
115
|
|
|
112
|
-
default_config =
|
|
116
|
+
default_config = AzureBackendConfig.from_dict(
|
|
113
117
|
{
|
|
114
118
|
"backend_name": name,
|
|
115
119
|
"backend_version": __version__,
|
|
116
120
|
"simulator": True,
|
|
117
121
|
"local": False,
|
|
118
122
|
"coupling_map": None,
|
|
119
|
-
"description":
|
|
123
|
+
"description": "Quantinuum Syntax Checker on Azure Quantum",
|
|
120
124
|
"basis_gates": self._basis_gates(),
|
|
121
125
|
"memory": True,
|
|
122
126
|
"n_qubits": self._get_n_qubits(name),
|
|
123
127
|
"conditional": False,
|
|
124
128
|
"max_shots": None,
|
|
125
|
-
"max_experiments": 1,
|
|
126
129
|
"open_pulse": False,
|
|
127
130
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
128
131
|
"azure": self._azure_config(),
|
|
129
132
|
}
|
|
130
133
|
)
|
|
131
|
-
configuration
|
|
132
|
-
"configuration", default_config
|
|
134
|
+
configuration = _ensure_backend_config(
|
|
135
|
+
kwargs.pop("configuration", default_config)
|
|
136
|
+
)
|
|
137
|
+
logger.info(
|
|
138
|
+
"Initializing %sSyntaxCheckerQirBackend", self._provider_name
|
|
133
139
|
)
|
|
134
|
-
logger.info(f"Initializing {self._provider_name}SyntaxCheckerQirBackend")
|
|
135
140
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
136
141
|
|
|
137
142
|
|
|
@@ -146,29 +151,30 @@ class QuantinuumEmulatorQirBackend(QuantinuumQirBackendBase):
|
|
|
146
151
|
self._provider_id = QUANTINUUM_PROVIDER_ID
|
|
147
152
|
self._provider_name = QUANTINUUM_PROVIDER_NAME
|
|
148
153
|
|
|
149
|
-
default_config =
|
|
154
|
+
default_config = AzureBackendConfig.from_dict(
|
|
150
155
|
{
|
|
151
156
|
"backend_name": name,
|
|
152
157
|
"backend_version": __version__,
|
|
153
158
|
"simulator": True,
|
|
154
159
|
"local": False,
|
|
155
160
|
"coupling_map": None,
|
|
156
|
-
"description":
|
|
161
|
+
"description": "Quantinuum emulator on Azure Quantum",
|
|
157
162
|
"basis_gates": self._basis_gates(),
|
|
158
163
|
"memory": True,
|
|
159
164
|
"n_qubits": self._get_n_qubits(name),
|
|
160
165
|
"conditional": False,
|
|
161
166
|
"max_shots": None,
|
|
162
|
-
"max_experiments": 1,
|
|
163
167
|
"open_pulse": False,
|
|
164
168
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
165
169
|
"azure": self._azure_config(),
|
|
166
170
|
}
|
|
167
171
|
)
|
|
168
|
-
configuration
|
|
169
|
-
"configuration", default_config
|
|
172
|
+
configuration = _ensure_backend_config(
|
|
173
|
+
kwargs.pop("configuration", default_config)
|
|
174
|
+
)
|
|
175
|
+
logger.info(
|
|
176
|
+
"Initializing %sEmulatorQirBackend", self._provider_name
|
|
170
177
|
)
|
|
171
|
-
logger.info(f"Initializing {self._provider_name}EmulatorQirBackend")
|
|
172
178
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
173
179
|
|
|
174
180
|
|
|
@@ -183,29 +189,28 @@ class QuantinuumQPUQirBackend(QuantinuumQirBackendBase):
|
|
|
183
189
|
self._provider_id = QUANTINUUM_PROVIDER_ID
|
|
184
190
|
self._provider_name = QUANTINUUM_PROVIDER_NAME
|
|
185
191
|
|
|
186
|
-
default_config =
|
|
192
|
+
default_config = AzureBackendConfig.from_dict(
|
|
187
193
|
{
|
|
188
194
|
"backend_name": name,
|
|
189
195
|
"backend_version": __version__,
|
|
190
196
|
"simulator": False,
|
|
191
197
|
"local": False,
|
|
192
198
|
"coupling_map": None,
|
|
193
|
-
"description":
|
|
199
|
+
"description": "Quantinuum QPU on Azure Quantum",
|
|
194
200
|
"basis_gates": self._basis_gates(),
|
|
195
201
|
"memory": True,
|
|
196
202
|
"n_qubits": self._get_n_qubits(name),
|
|
197
203
|
"conditional": False,
|
|
198
204
|
"max_shots": 10000,
|
|
199
|
-
"max_experiments": 1,
|
|
200
205
|
"open_pulse": False,
|
|
201
206
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
202
207
|
"azure": self._azure_config(),
|
|
203
208
|
}
|
|
204
209
|
)
|
|
205
|
-
configuration
|
|
206
|
-
"configuration", default_config
|
|
210
|
+
configuration = _ensure_backend_config(
|
|
211
|
+
kwargs.pop("configuration", default_config)
|
|
207
212
|
)
|
|
208
|
-
logger.info(
|
|
213
|
+
logger.info("Initializing %sQPUQirBackend", self._provider_name)
|
|
209
214
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
210
215
|
|
|
211
216
|
|
|
@@ -216,7 +221,7 @@ class QuantinuumBackend(AzureBackend):
|
|
|
216
221
|
|
|
217
222
|
@abstractmethod
|
|
218
223
|
def __init__(
|
|
219
|
-
self, configuration:
|
|
224
|
+
self, configuration: AzureBackendConfig, provider: "AzureQuantumProvider" = None, **fields
|
|
220
225
|
):
|
|
221
226
|
super().__init__(configuration, provider, **fields)
|
|
222
227
|
|
|
@@ -257,29 +262,28 @@ class QuantinuumSyntaxCheckerBackend(QuantinuumBackend):
|
|
|
257
262
|
self._provider_id = QUANTINUUM_PROVIDER_ID
|
|
258
263
|
self._provider_name = QUANTINUUM_PROVIDER_NAME
|
|
259
264
|
|
|
260
|
-
default_config =
|
|
265
|
+
default_config = AzureBackendConfig.from_dict(
|
|
261
266
|
{
|
|
262
267
|
"backend_name": name,
|
|
263
268
|
"backend_version": __version__,
|
|
264
269
|
"simulator": True,
|
|
265
270
|
"local": False,
|
|
266
271
|
"coupling_map": None,
|
|
267
|
-
"description":
|
|
272
|
+
"description": "Quantinuum Syntax Checker on Azure Quantum",
|
|
268
273
|
"basis_gates": QUANTINUUM_BASIS_GATES,
|
|
269
274
|
"memory": False,
|
|
270
275
|
"n_qubits": self._get_n_qubits(name),
|
|
271
276
|
"conditional": False,
|
|
272
277
|
"max_shots": None,
|
|
273
|
-
"max_experiments": 1,
|
|
274
278
|
"open_pulse": False,
|
|
275
279
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
276
280
|
"azure": self._azure_config(),
|
|
277
281
|
}
|
|
278
282
|
)
|
|
279
|
-
configuration
|
|
280
|
-
"configuration", default_config
|
|
283
|
+
configuration = _ensure_backend_config(
|
|
284
|
+
kwargs.pop("configuration", default_config)
|
|
281
285
|
)
|
|
282
|
-
logger.info(
|
|
286
|
+
logger.info("Initializing %sSyntaxCheckerBackend", self._provider_name)
|
|
283
287
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
284
288
|
|
|
285
289
|
|
|
@@ -294,29 +298,28 @@ class QuantinuumEmulatorBackend(QuantinuumBackend):
|
|
|
294
298
|
self._provider_id = QUANTINUUM_PROVIDER_ID
|
|
295
299
|
self._provider_name = QUANTINUUM_PROVIDER_NAME
|
|
296
300
|
|
|
297
|
-
default_config =
|
|
301
|
+
default_config = AzureBackendConfig.from_dict(
|
|
298
302
|
{
|
|
299
303
|
"backend_name": name,
|
|
300
304
|
"backend_version": __version__,
|
|
301
305
|
"simulator": True,
|
|
302
306
|
"local": False,
|
|
303
307
|
"coupling_map": None,
|
|
304
|
-
"description":
|
|
308
|
+
"description": "Quantinuum emulator on Azure Quantum",
|
|
305
309
|
"basis_gates": QUANTINUUM_BASIS_GATES,
|
|
306
310
|
"memory": False,
|
|
307
311
|
"n_qubits": self._get_n_qubits(name),
|
|
308
312
|
"conditional": False,
|
|
309
313
|
"max_shots": None,
|
|
310
|
-
"max_experiments": 1,
|
|
311
314
|
"open_pulse": False,
|
|
312
315
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
313
316
|
"azure": self._azure_config(),
|
|
314
317
|
}
|
|
315
318
|
)
|
|
316
|
-
configuration
|
|
317
|
-
"configuration", default_config
|
|
319
|
+
configuration = _ensure_backend_config(
|
|
320
|
+
kwargs.pop("configuration", default_config)
|
|
318
321
|
)
|
|
319
|
-
logger.info(
|
|
322
|
+
logger.info("Initializing %sEmulatorBackend", self._provider_name)
|
|
320
323
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
321
324
|
|
|
322
325
|
|
|
@@ -331,27 +334,26 @@ class QuantinuumQPUBackend(QuantinuumBackend):
|
|
|
331
334
|
self._provider_id = QUANTINUUM_PROVIDER_ID
|
|
332
335
|
self._provider_name = QUANTINUUM_PROVIDER_NAME
|
|
333
336
|
|
|
334
|
-
default_config =
|
|
337
|
+
default_config = AzureBackendConfig.from_dict(
|
|
335
338
|
{
|
|
336
339
|
"backend_name": name,
|
|
337
340
|
"backend_version": __version__,
|
|
338
341
|
"simulator": False,
|
|
339
342
|
"local": False,
|
|
340
343
|
"coupling_map": None,
|
|
341
|
-
"description":
|
|
344
|
+
"description": "Quantinuum QPU on Azure Quantum",
|
|
342
345
|
"basis_gates": QUANTINUUM_BASIS_GATES,
|
|
343
346
|
"memory": False,
|
|
344
347
|
"n_qubits": self._get_n_qubits(name),
|
|
345
348
|
"conditional": False,
|
|
346
349
|
"max_shots": 10000,
|
|
347
|
-
"max_experiments": 1,
|
|
348
350
|
"open_pulse": False,
|
|
349
351
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
350
352
|
"azure": self._azure_config(),
|
|
351
353
|
}
|
|
352
354
|
)
|
|
353
|
-
configuration
|
|
354
|
-
"configuration", default_config
|
|
355
|
+
configuration = _ensure_backend_config(
|
|
356
|
+
kwargs.pop("configuration", default_config)
|
|
355
357
|
)
|
|
356
|
-
logger.info(
|
|
358
|
+
logger.info("Initializing %sQPUBackend", self._provider_name)
|
|
357
359
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
@@ -7,10 +7,8 @@ from typing import TYPE_CHECKING, Dict
|
|
|
7
7
|
from azure.quantum.version import __version__
|
|
8
8
|
from azure.quantum.target.rigetti import RigettiTarget
|
|
9
9
|
from abc import abstractmethod
|
|
10
|
-
from .backend import AzureQirBackend
|
|
11
|
-
|
|
12
|
-
from qiskit.providers.models import BackendConfiguration
|
|
13
|
-
from qiskit.providers import Options, Provider
|
|
10
|
+
from .backend import AzureBackendConfig, AzureQirBackend, _ensure_backend_config
|
|
11
|
+
from qiskit.providers import Options
|
|
14
12
|
from qsharp import TargetProfile
|
|
15
13
|
|
|
16
14
|
if TYPE_CHECKING:
|
|
@@ -20,7 +18,7 @@ import logging
|
|
|
20
18
|
|
|
21
19
|
logger = logging.getLogger(__name__)
|
|
22
20
|
|
|
23
|
-
__all__ = ["RigettiSimulatorBackend" "RigettiQPUBackend"]
|
|
21
|
+
__all__ = ["RigettiSimulatorBackend", "RigettiQPUBackend"]
|
|
24
22
|
|
|
25
23
|
|
|
26
24
|
_DEFAULT_SHOTS_COUNT = 500
|
|
@@ -32,7 +30,7 @@ class RigettiBackend(AzureQirBackend):
|
|
|
32
30
|
|
|
33
31
|
@abstractmethod
|
|
34
32
|
def __init__(
|
|
35
|
-
self, configuration:
|
|
33
|
+
self, configuration: AzureBackendConfig, provider: "AzureQuantumProvider" = None, **fields
|
|
36
34
|
):
|
|
37
35
|
super().__init__(configuration, provider, **fields)
|
|
38
36
|
|
|
@@ -58,7 +56,7 @@ class RigettiSimulatorBackend(RigettiBackend):
|
|
|
58
56
|
|
|
59
57
|
def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
|
|
60
58
|
"""Base class for interfacing with an Rigetti Simulator backend"""
|
|
61
|
-
default_config =
|
|
59
|
+
default_config = AzureBackendConfig.from_dict(
|
|
62
60
|
{
|
|
63
61
|
"backend_name": name,
|
|
64
62
|
"backend_version": __version__,
|
|
@@ -71,7 +69,6 @@ class RigettiSimulatorBackend(RigettiBackend):
|
|
|
71
69
|
"n_qubits": RigettiTarget.num_qubits(name),
|
|
72
70
|
"conditional": False,
|
|
73
71
|
"max_shots": 10000,
|
|
74
|
-
"max_experiments": 1,
|
|
75
72
|
"open_pulse": False,
|
|
76
73
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
77
74
|
"azure": self._azure_config(),
|
|
@@ -79,8 +76,8 @@ class RigettiSimulatorBackend(RigettiBackend):
|
|
|
79
76
|
}
|
|
80
77
|
)
|
|
81
78
|
logger.info("Initializing RigettiSimulatorBackend")
|
|
82
|
-
configuration
|
|
83
|
-
"configuration", default_config
|
|
79
|
+
configuration = _ensure_backend_config(
|
|
80
|
+
kwargs.pop("configuration", default_config)
|
|
84
81
|
)
|
|
85
82
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|
|
86
83
|
|
|
@@ -90,7 +87,7 @@ class RigettiQPUBackend(RigettiBackend):
|
|
|
90
87
|
|
|
91
88
|
def __init__(self, name: str, provider: "AzureQuantumProvider", **kwargs):
|
|
92
89
|
"""Base class for interfacing with a Rigetti QPU backend"""
|
|
93
|
-
default_config =
|
|
90
|
+
default_config = AzureBackendConfig.from_dict(
|
|
94
91
|
{
|
|
95
92
|
"backend_name": name,
|
|
96
93
|
"backend_version": __version__,
|
|
@@ -103,7 +100,6 @@ class RigettiQPUBackend(RigettiBackend):
|
|
|
103
100
|
"n_qubits": RigettiTarget.num_qubits(name),
|
|
104
101
|
"conditional": False,
|
|
105
102
|
"max_shots": 10000,
|
|
106
|
-
"max_experiments": 1,
|
|
107
103
|
"open_pulse": False,
|
|
108
104
|
"gates": [{"name": "TODO", "parameters": [], "qasm_def": "TODO"}],
|
|
109
105
|
"azure": self._azure_config(),
|
|
@@ -111,7 +107,7 @@ class RigettiQPUBackend(RigettiBackend):
|
|
|
111
107
|
}
|
|
112
108
|
)
|
|
113
109
|
logger.info("Initializing RigettiQPUBackend")
|
|
114
|
-
configuration
|
|
115
|
-
"configuration", default_config
|
|
110
|
+
configuration = _ensure_backend_config(
|
|
111
|
+
kwargs.pop("configuration", default_config)
|
|
116
112
|
)
|
|
117
113
|
super().__init__(configuration=configuration, provider=provider, **kwargs)
|