cirq-aqt 1.6.0.dev20250519190234__py3-none-any.whl → 1.6.0.dev20250519202416__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.
Potentially problematic release.
This version of cirq-aqt might be problematic. Click here for more details.
- cirq_aqt/_version.py +1 -1
- cirq_aqt/_version_test.py +1 -1
- cirq_aqt/aqt_device.py +10 -10
- cirq_aqt/aqt_device_metadata_test.py +1 -3
- cirq_aqt/aqt_device_test.py +1 -2
- cirq_aqt/aqt_sampler.py +7 -9
- cirq_aqt/aqt_target_gateset.py +1 -3
- cirq_aqt/json_resolver_cache.py +1 -2
- {cirq_aqt-1.6.0.dev20250519190234.dist-info → cirq_aqt-1.6.0.dev20250519202416.dist-info}/METADATA +2 -2
- cirq_aqt-1.6.0.dev20250519202416.dist-info/RECORD +21 -0
- cirq_aqt-1.6.0.dev20250519190234.dist-info/RECORD +0 -21
- {cirq_aqt-1.6.0.dev20250519190234.dist-info → cirq_aqt-1.6.0.dev20250519202416.dist-info}/WHEEL +0 -0
- {cirq_aqt-1.6.0.dev20250519190234.dist-info → cirq_aqt-1.6.0.dev20250519202416.dist-info}/licenses/LICENSE +0 -0
- {cirq_aqt-1.6.0.dev20250519190234.dist-info → cirq_aqt-1.6.0.dev20250519202416.dist-info}/top_level.txt +0 -0
cirq_aqt/_version.py
CHANGED
cirq_aqt/_version_test.py
CHANGED
cirq_aqt/aqt_device.py
CHANGED
|
@@ -28,7 +28,7 @@ from __future__ import annotations
|
|
|
28
28
|
|
|
29
29
|
import json
|
|
30
30
|
from enum import Enum
|
|
31
|
-
from typing import Any, cast,
|
|
31
|
+
from typing import Any, cast, Iterable, Sequence
|
|
32
32
|
|
|
33
33
|
import networkx as nx
|
|
34
34
|
import numpy as np
|
|
@@ -89,7 +89,7 @@ class AQTNoiseModel(cirq.NoiseModel):
|
|
|
89
89
|
|
|
90
90
|
def noisy_moment(
|
|
91
91
|
self, moment: cirq.Moment, system_qubits: Sequence[cirq.Qid]
|
|
92
|
-
) ->
|
|
92
|
+
) -> list[cirq.Operation]:
|
|
93
93
|
"""Returns a list of noisy moments.
|
|
94
94
|
|
|
95
95
|
The model includes
|
|
@@ -117,7 +117,7 @@ class AQTNoiseModel(cirq.NoiseModel):
|
|
|
117
117
|
|
|
118
118
|
def get_crosstalk_operation(
|
|
119
119
|
self, operation: cirq.Operation, system_qubits: Sequence[cirq.Qid]
|
|
120
|
-
) ->
|
|
120
|
+
) -> list[cirq.Operation]:
|
|
121
121
|
"""Returns a list of operations including crosstalk
|
|
122
122
|
|
|
123
123
|
Args:
|
|
@@ -127,7 +127,7 @@ class AQTNoiseModel(cirq.NoiseModel):
|
|
|
127
127
|
Returns:
|
|
128
128
|
List of operations including crosstalk
|
|
129
129
|
"""
|
|
130
|
-
cast(
|
|
130
|
+
cast(tuple[cirq.LineQubit], system_qubits)
|
|
131
131
|
num_qubits = len(system_qubits)
|
|
132
132
|
xtlk_arr = np.zeros(num_qubits)
|
|
133
133
|
idx_list = []
|
|
@@ -169,7 +169,7 @@ class AQTSimulator:
|
|
|
169
169
|
num_qubits: int,
|
|
170
170
|
circuit: cirq.Circuit = cirq.Circuit(),
|
|
171
171
|
simulate_ideal: bool = False,
|
|
172
|
-
noise_dict:
|
|
172
|
+
noise_dict: dict | None = None,
|
|
173
173
|
):
|
|
174
174
|
"""Initializes the AQT simulator.
|
|
175
175
|
|
|
@@ -200,7 +200,7 @@ class AQTSimulator:
|
|
|
200
200
|
"""
|
|
201
201
|
self.circuit = cirq.Circuit()
|
|
202
202
|
json_obj = json.loads(json_string)
|
|
203
|
-
gate:
|
|
203
|
+
gate: cirq.PhasedXPowGate | cirq.EigenGate
|
|
204
204
|
for circuit_list in json_obj:
|
|
205
205
|
op_str = circuit_list[0]
|
|
206
206
|
if op_str == 'R':
|
|
@@ -308,7 +308,7 @@ class AQTDevice(cirq.Device):
|
|
|
308
308
|
super().validate_circuit(circuit)
|
|
309
309
|
_verify_unique_measurement_keys(circuit.all_operations())
|
|
310
310
|
|
|
311
|
-
def at(self, position: int) ->
|
|
311
|
+
def at(self, position: int) -> cirq.LineQubit | None:
|
|
312
312
|
"""Returns the qubit at the given position, if there is one, else None."""
|
|
313
313
|
q = cirq.LineQubit(position)
|
|
314
314
|
return q if q in self.qubits else None
|
|
@@ -341,7 +341,7 @@ class AQTDevice(cirq.Device):
|
|
|
341
341
|
p.text("AQTDevice(...)" if cycle else self.__str__())
|
|
342
342
|
|
|
343
343
|
|
|
344
|
-
def get_aqt_device(num_qubits: int) ->
|
|
344
|
+
def get_aqt_device(num_qubits: int) -> tuple[AQTDevice, list[cirq.LineQubit]]:
|
|
345
345
|
"""Returns an AQT ion device
|
|
346
346
|
|
|
347
347
|
Args:
|
|
@@ -361,7 +361,7 @@ def get_aqt_device(num_qubits: int) -> Tuple[AQTDevice, List[cirq.LineQubit]]:
|
|
|
361
361
|
return ion_device, qubit_list
|
|
362
362
|
|
|
363
363
|
|
|
364
|
-
def get_default_noise_dict() ->
|
|
364
|
+
def get_default_noise_dict() -> dict[str, Any]:
|
|
365
365
|
"""Returns the current noise parameters"""
|
|
366
366
|
default_noise_dict = {
|
|
367
367
|
OperationString.R.value: cirq.depolarize(1e-3),
|
|
@@ -373,7 +373,7 @@ def get_default_noise_dict() -> Dict[str, Any]:
|
|
|
373
373
|
|
|
374
374
|
|
|
375
375
|
def _verify_unique_measurement_keys(operations: Iterable[cirq.Operation]):
|
|
376
|
-
seen:
|
|
376
|
+
seen: set[str] = set()
|
|
377
377
|
for op in operations:
|
|
378
378
|
if isinstance(op.gate, cirq.MeasurementGate):
|
|
379
379
|
meas = op.gate
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
|
-
from typing import List
|
|
20
|
-
|
|
21
19
|
import pytest
|
|
22
20
|
|
|
23
21
|
import cirq
|
|
@@ -26,7 +24,7 @@ from cirq_aqt.aqt_target_gateset import AQTTargetGateset
|
|
|
26
24
|
|
|
27
25
|
|
|
28
26
|
@pytest.fixture
|
|
29
|
-
def qubits() ->
|
|
27
|
+
def qubits() -> list[cirq.LineQubit]:
|
|
30
28
|
return cirq.LineQubit.range(5)
|
|
31
29
|
|
|
32
30
|
|
cirq_aqt/aqt_device_test.py
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
17
|
from datetime import timedelta
|
|
18
|
-
from typing import List
|
|
19
18
|
|
|
20
19
|
import pytest
|
|
21
20
|
|
|
@@ -24,7 +23,7 @@ from cirq_aqt import aqt_device, aqt_device_metadata
|
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
@pytest.fixture
|
|
27
|
-
def qubits() ->
|
|
26
|
+
def qubits() -> list[cirq.LineQubit]:
|
|
28
27
|
return cirq.LineQubit.range(3)
|
|
29
28
|
|
|
30
29
|
|
cirq_aqt/aqt_sampler.py
CHANGED
|
@@ -27,7 +27,7 @@ from __future__ import annotations
|
|
|
27
27
|
import json
|
|
28
28
|
import time
|
|
29
29
|
import uuid
|
|
30
|
-
from typing import Callable, cast,
|
|
30
|
+
from typing import Callable, cast, Literal, Sequence, TypedDict
|
|
31
31
|
from urllib.parse import urljoin
|
|
32
32
|
|
|
33
33
|
import numpy as np
|
|
@@ -251,16 +251,14 @@ class AQTSampler(cirq.Sampler):
|
|
|
251
251
|
RuntimeError: If the circuit is empty.
|
|
252
252
|
"""
|
|
253
253
|
|
|
254
|
-
seq_list:
|
|
255
|
-
[]
|
|
256
|
-
)
|
|
254
|
+
seq_list: list[tuple[str, float, list[int]] | tuple[str, float, float, list[int]]] = []
|
|
257
255
|
circuit = cirq.resolve_parameters(circuit, param_resolver)
|
|
258
256
|
for op in circuit.all_operations():
|
|
259
|
-
line_qubit = cast(
|
|
257
|
+
line_qubit = cast(tuple[cirq.LineQubit], op.qubits)
|
|
260
258
|
op = cast(cirq.GateOperation, op)
|
|
261
259
|
qubit_idx = [obj.x for obj in line_qubit]
|
|
262
260
|
op_str = get_op_string(op)
|
|
263
|
-
gate:
|
|
261
|
+
gate: cirq.EigenGate | cirq.PhasedXPowGate
|
|
264
262
|
if op_str == 'R':
|
|
265
263
|
gate = cast(cirq.PhasedXPowGate, op.gate)
|
|
266
264
|
seq_list.append(
|
|
@@ -369,7 +367,7 @@ class AQTSampler(cirq.Sampler):
|
|
|
369
367
|
|
|
370
368
|
response = post(submission_url, json=submission_data, headers=headers)
|
|
371
369
|
response = response.json()
|
|
372
|
-
data = cast(
|
|
370
|
+
data = cast(dict, response)
|
|
373
371
|
|
|
374
372
|
if 'response' not in data.keys() or 'status' not in data['response'].keys():
|
|
375
373
|
raise RuntimeError('Got unexpected return data from server: \n' + str(data))
|
|
@@ -384,7 +382,7 @@ class AQTSampler(cirq.Sampler):
|
|
|
384
382
|
while True:
|
|
385
383
|
response = get(result_url, headers=headers)
|
|
386
384
|
response = response.json()
|
|
387
|
-
data = cast(
|
|
385
|
+
data = cast(dict, response)
|
|
388
386
|
|
|
389
387
|
if 'response' not in data.keys() or 'status' not in data['response'].keys():
|
|
390
388
|
raise RuntimeError('Got unexpected return data from AQT server: \n' + str(data))
|
|
@@ -426,7 +424,7 @@ class AQTSampler(cirq.Sampler):
|
|
|
426
424
|
# TODO: Use measurement name from circuit.
|
|
427
425
|
# Github issue: https://github.com/quantumlib/Cirq/issues/2199
|
|
428
426
|
meas_name = 'm'
|
|
429
|
-
trial_results:
|
|
427
|
+
trial_results: list[cirq.Result] = []
|
|
430
428
|
for param_resolver in cirq.to_resolvers(params):
|
|
431
429
|
id_str = str(uuid.uuid1())
|
|
432
430
|
num_qubits = len(program.all_qubits())
|
cirq_aqt/aqt_target_gateset.py
CHANGED
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
|
-
from typing import List
|
|
20
|
-
|
|
21
19
|
import numpy as np
|
|
22
20
|
|
|
23
21
|
import cirq
|
|
@@ -67,6 +65,6 @@ class AQTTargetGateset(cirq.TwoQubitCompilationTargetGateset):
|
|
|
67
65
|
return NotImplemented
|
|
68
66
|
|
|
69
67
|
@property
|
|
70
|
-
def postprocess_transformers(self) ->
|
|
68
|
+
def postprocess_transformers(self) -> list[cirq.TRANSFORMER]:
|
|
71
69
|
"""List of transformers which should be run after decomposing individual operations."""
|
|
72
70
|
return [cirq.drop_negligible_operations, cirq.drop_empty_moments]
|
cirq_aqt/json_resolver_cache.py
CHANGED
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
17
|
import functools
|
|
18
|
-
from typing import Dict
|
|
19
18
|
|
|
20
19
|
from cirq.protocols.json_serialization import ObjectFactory
|
|
21
20
|
|
|
22
21
|
|
|
23
22
|
@functools.lru_cache()
|
|
24
|
-
def _class_resolver_dictionary() ->
|
|
23
|
+
def _class_resolver_dictionary() -> dict[str, ObjectFactory]:
|
|
25
24
|
return {}
|
{cirq_aqt-1.6.0.dev20250519190234.dist-info → cirq_aqt-1.6.0.dev20250519202416.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cirq-aqt
|
|
3
|
-
Version: 1.6.0.
|
|
3
|
+
Version: 1.6.0.dev20250519202416
|
|
4
4
|
Summary: A Cirq package to simulate and connect to Alpine Quantum Technologies quantum computers
|
|
5
5
|
Home-page: http://github.com/quantumlib/cirq
|
|
6
6
|
Author: The Cirq Developers
|
|
@@ -28,7 +28,7 @@ Requires-Python: >=3.11.0
|
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
License-File: LICENSE
|
|
30
30
|
Requires-Dist: requests~=2.32
|
|
31
|
-
Requires-Dist: cirq-core==1.6.0.
|
|
31
|
+
Requires-Dist: cirq-core==1.6.0.dev20250519202416
|
|
32
32
|
Dynamic: author
|
|
33
33
|
Dynamic: author-email
|
|
34
34
|
Dynamic: classifier
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
cirq_aqt/__init__.py,sha256=M8r1U_8xYpcIUhs8U110BFWQ4jUCqS9IQf8trjq0rvI,888
|
|
2
|
+
cirq_aqt/_version.py,sha256=pqPLctdF8RQc_EGmWi1N8i70AyOpGgfKrxsdTPdaJiE,696
|
|
3
|
+
cirq_aqt/_version_test.py,sha256=oeQ_uZzW8zRIf_oh6C7MRRW-bDgToStiOPGHihxdyoU,155
|
|
4
|
+
cirq_aqt/aqt_device.py,sha256=dvM84YSUSOqJ30o4c6harNR2YW-f9zrH9Rrm8eSOeSM,13631
|
|
5
|
+
cirq_aqt/aqt_device_metadata.py,sha256=iAXdDMJJBltw1wL_1QnU114PEWOEdlbdCYAjofk1PjA,4789
|
|
6
|
+
cirq_aqt/aqt_device_metadata_test.py,sha256=NGLqYvqrCaSiJNexFP_YAhkYikUYj9aBdiX47_psjbE,2122
|
|
7
|
+
cirq_aqt/aqt_device_test.py,sha256=aq--11dP7kNicNdwhXUz2XVrNYLc-t5dmR1I2_1augQ,5220
|
|
8
|
+
cirq_aqt/aqt_sampler.py,sha256=TlI1q671__OR8OObB5KkXHVMlld1apvr2sNDIVuxTsY,18352
|
|
9
|
+
cirq_aqt/aqt_sampler_test.py,sha256=La7S9mzplq6NLHZWBL_SZ4krPYJ4e_g11ZympJaGyao,16439
|
|
10
|
+
cirq_aqt/aqt_simulator_test.py,sha256=LgXTa85E2FnIWdiP_HDT46wpxAp3MBTtF6lGqNxALj4,1677
|
|
11
|
+
cirq_aqt/aqt_target_gateset.py,sha256=skMMWal1qVDMmF92DoBGTB6IaSYcmyPGbpLeVmM0MDI,2783
|
|
12
|
+
cirq_aqt/aqt_target_gateset_test.py,sha256=atFVjNgAMrjuWZ6MEM-dA3QjRhHd_hs4xkyOO9KoCIA,3371
|
|
13
|
+
cirq_aqt/conftest.py,sha256=2-K0ZniZ28adwVNB-f5IqvYjavKEBwC4jes_WQ17Xzg,667
|
|
14
|
+
cirq_aqt/json_resolver_cache.py,sha256=ReOa7_bbsTqsZml0kzkLx1clVGZTvlr-Fwh6I22swiM,800
|
|
15
|
+
cirq_aqt/json_test_data/__init__.py,sha256=UZKkYSBrgpUKN5Y5Gb-SJzJAa7h-oTA0K3BKecMbDs8,904
|
|
16
|
+
cirq_aqt/json_test_data/spec.py,sha256=OfF8lLmTIVJF9ZgGoKBjx7tqYG5qvkLo6RqK19DtFCA,1050
|
|
17
|
+
cirq_aqt-1.6.0.dev20250519202416.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
18
|
+
cirq_aqt-1.6.0.dev20250519202416.dist-info/METADATA,sha256=gxbgSqUlwcUTF5d1PwtzwIlLIYjaJdxLcV5HuGW65rI,4778
|
|
19
|
+
cirq_aqt-1.6.0.dev20250519202416.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
20
|
+
cirq_aqt-1.6.0.dev20250519202416.dist-info/top_level.txt,sha256=culYyFTEtuC3Z7wT3wZ6kGVspH3hYFZUEKooByfe9h0,9
|
|
21
|
+
cirq_aqt-1.6.0.dev20250519202416.dist-info/RECORD,,
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
cirq_aqt/__init__.py,sha256=M8r1U_8xYpcIUhs8U110BFWQ4jUCqS9IQf8trjq0rvI,888
|
|
2
|
-
cirq_aqt/_version.py,sha256=BmZRqa6n8xD0G3eyRpzyXKXxa6X7vywVEJJBQrka2gY,696
|
|
3
|
-
cirq_aqt/_version_test.py,sha256=_YCDLjCpDzeRKTdM8SE-uTn-wVLKwKqMaLnD9OgA9MQ,155
|
|
4
|
-
cirq_aqt/aqt_device.py,sha256=xNU6nYLy6N95U6hIyVVt6k9IqCmQcmAqIycmfusR_Ns,13684
|
|
5
|
-
cirq_aqt/aqt_device_metadata.py,sha256=iAXdDMJJBltw1wL_1QnU114PEWOEdlbdCYAjofk1PjA,4789
|
|
6
|
-
cirq_aqt/aqt_device_metadata_test.py,sha256=0K-gPILlUc0WTY7zM6rh7t8ARowusrpYVmNOEUsX2L0,2147
|
|
7
|
-
cirq_aqt/aqt_device_test.py,sha256=reeS9xdmamOGICmz6y6tBmKsc0EZFPWVUrpe3Hw53QE,5244
|
|
8
|
-
cirq_aqt/aqt_sampler.py,sha256=aSS12_H3WF3ZXgFEbBwyN-Gu8r9VMVepvnejdzhINyE,18414
|
|
9
|
-
cirq_aqt/aqt_sampler_test.py,sha256=La7S9mzplq6NLHZWBL_SZ4krPYJ4e_g11ZympJaGyao,16439
|
|
10
|
-
cirq_aqt/aqt_simulator_test.py,sha256=LgXTa85E2FnIWdiP_HDT46wpxAp3MBTtF6lGqNxALj4,1677
|
|
11
|
-
cirq_aqt/aqt_target_gateset.py,sha256=NqorUKVGLlcTOBK3MdDrjyS9JoDXj-zWj8ULg4-bfZ8,2808
|
|
12
|
-
cirq_aqt/aqt_target_gateset_test.py,sha256=atFVjNgAMrjuWZ6MEM-dA3QjRhHd_hs4xkyOO9KoCIA,3371
|
|
13
|
-
cirq_aqt/conftest.py,sha256=2-K0ZniZ28adwVNB-f5IqvYjavKEBwC4jes_WQ17Xzg,667
|
|
14
|
-
cirq_aqt/json_resolver_cache.py,sha256=6aHXNYJhtERpYT6a_MfjUr_fZ6kgPTwY7KFVdwDiXAM,824
|
|
15
|
-
cirq_aqt/json_test_data/__init__.py,sha256=UZKkYSBrgpUKN5Y5Gb-SJzJAa7h-oTA0K3BKecMbDs8,904
|
|
16
|
-
cirq_aqt/json_test_data/spec.py,sha256=OfF8lLmTIVJF9ZgGoKBjx7tqYG5qvkLo6RqK19DtFCA,1050
|
|
17
|
-
cirq_aqt-1.6.0.dev20250519190234.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
18
|
-
cirq_aqt-1.6.0.dev20250519190234.dist-info/METADATA,sha256=msANaMm7AK-DkXqeHaB7SscRzWiqAG0i41g4yMTFEz4,4778
|
|
19
|
-
cirq_aqt-1.6.0.dev20250519190234.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
20
|
-
cirq_aqt-1.6.0.dev20250519190234.dist-info/top_level.txt,sha256=culYyFTEtuC3Z7wT3wZ6kGVspH3hYFZUEKooByfe9h0,9
|
|
21
|
-
cirq_aqt-1.6.0.dev20250519190234.dist-info/RECORD,,
|
{cirq_aqt-1.6.0.dev20250519190234.dist-info → cirq_aqt-1.6.0.dev20250519202416.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|