cirq-aqt 1.6.0.dev20250527171805__py3-none-any.whl → 1.7.0.dev20251211190616__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.
- cirq_aqt/_version.py +1 -1
- cirq_aqt/_version_test.py +1 -1
- cirq_aqt/aqt_device.py +6 -5
- cirq_aqt/aqt_device_metadata.py +5 -4
- cirq_aqt/aqt_device_metadata_test.py +3 -3
- cirq_aqt/aqt_device_test.py +14 -14
- cirq_aqt/aqt_sampler.py +2 -1
- cirq_aqt/aqt_sampler_test.py +17 -16
- cirq_aqt/aqt_simulator_test.py +2 -2
- cirq_aqt/aqt_target_gateset_test.py +8 -4
- cirq_aqt/conftest.py +1 -1
- {cirq_aqt-1.6.0.dev20250527171805.dist-info → cirq_aqt-1.7.0.dev20251211190616.dist-info}/METADATA +3 -4
- cirq_aqt-1.7.0.dev20251211190616.dist-info/RECORD +21 -0
- cirq_aqt-1.6.0.dev20250527171805.dist-info/RECORD +0 -21
- {cirq_aqt-1.6.0.dev20250527171805.dist-info → cirq_aqt-1.7.0.dev20251211190616.dist-info}/WHEEL +0 -0
- {cirq_aqt-1.6.0.dev20250527171805.dist-info → cirq_aqt-1.7.0.dev20251211190616.dist-info}/licenses/LICENSE +0 -0
- {cirq_aqt-1.6.0.dev20250527171805.dist-info → cirq_aqt-1.7.0.dev20251211190616.dist-info}/top_level.txt +0 -0
cirq_aqt/_version.py
CHANGED
cirq_aqt/_version_test.py
CHANGED
cirq_aqt/aqt_device.py
CHANGED
|
@@ -27,8 +27,9 @@ The native gate set consists of the local gates: X, Y, and XX entangling gates
|
|
|
27
27
|
from __future__ import annotations
|
|
28
28
|
|
|
29
29
|
import json
|
|
30
|
+
from collections.abc import Iterable, Sequence
|
|
30
31
|
from enum import Enum
|
|
31
|
-
from typing import Any, cast
|
|
32
|
+
from typing import Any, cast
|
|
32
33
|
|
|
33
34
|
import networkx as nx
|
|
34
35
|
import numpy as np
|
|
@@ -189,7 +190,7 @@ class AQTSimulator:
|
|
|
189
190
|
self.noise_dict = noise_dict
|
|
190
191
|
self.simulate_ideal = simulate_ideal
|
|
191
192
|
|
|
192
|
-
def generate_circuit_from_list(self, json_string: str):
|
|
193
|
+
def generate_circuit_from_list(self, json_string: str) -> None:
|
|
193
194
|
"""Generates a list of cirq operations from a json string.
|
|
194
195
|
|
|
195
196
|
The default behavior is to add a measurement to any qubit at the end
|
|
@@ -288,11 +289,11 @@ class AQTDevice(cirq.Device):
|
|
|
288
289
|
def metadata(self) -> aqt_device_metadata.AQTDeviceMetadata:
|
|
289
290
|
return self._metadata
|
|
290
291
|
|
|
291
|
-
def validate_gate(self, gate: cirq.Gate):
|
|
292
|
+
def validate_gate(self, gate: cirq.Gate) -> None:
|
|
292
293
|
if gate not in self.metadata.gateset:
|
|
293
294
|
raise ValueError(f'Unsupported gate type: {gate!r}')
|
|
294
295
|
|
|
295
|
-
def validate_operation(self, operation):
|
|
296
|
+
def validate_operation(self, operation) -> None:
|
|
296
297
|
if not isinstance(operation, cirq.GateOperation):
|
|
297
298
|
raise ValueError(f'Unsupported operation: {operation!r}')
|
|
298
299
|
|
|
@@ -304,7 +305,7 @@ class AQTDevice(cirq.Device):
|
|
|
304
305
|
if q not in self.qubits:
|
|
305
306
|
raise ValueError(f'Qubit not on device: {q!r}')
|
|
306
307
|
|
|
307
|
-
def validate_circuit(self, circuit: cirq.AbstractCircuit):
|
|
308
|
+
def validate_circuit(self, circuit: cirq.AbstractCircuit) -> None:
|
|
308
309
|
super().validate_circuit(circuit)
|
|
309
310
|
_verify_unique_measurement_keys(circuit.all_operations())
|
|
310
311
|
|
cirq_aqt/aqt_device_metadata.py
CHANGED
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
|
-
from
|
|
19
|
+
from collections.abc import Iterable, Mapping
|
|
20
|
+
from typing import Any
|
|
20
21
|
|
|
21
22
|
import networkx as nx
|
|
22
23
|
|
|
@@ -56,9 +57,9 @@ class AQTDeviceMetadata(cirq.DeviceMetadata):
|
|
|
56
57
|
cirq.GateFamily(cirq.ZPowGate): self._oneq_gates_duration,
|
|
57
58
|
cirq.GateFamily(cirq.PhasedXPowGate): self._oneq_gates_duration,
|
|
58
59
|
}
|
|
59
|
-
assert not self._gateset.gates.symmetric_difference(
|
|
60
|
-
|
|
61
|
-
)
|
|
60
|
+
assert not self._gateset.gates.symmetric_difference(
|
|
61
|
+
self._gate_durations.keys()
|
|
62
|
+
), "AQTDeviceMetadata.gate_durations must have the same Gates as AQTTargetGateset."
|
|
62
63
|
|
|
63
64
|
@property
|
|
64
65
|
def gateset(self) -> cirq.Gateset:
|
|
@@ -38,7 +38,7 @@ def metadata(qubits) -> AQTDeviceMetadata:
|
|
|
38
38
|
)
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def test_aqtdevice_metadata(metadata, qubits):
|
|
41
|
+
def test_aqtdevice_metadata(metadata, qubits) -> None:
|
|
42
42
|
assert metadata.qubit_set == frozenset(qubits)
|
|
43
43
|
assert set(qubits) == set(metadata.nx_graph.nodes())
|
|
44
44
|
edges = metadata.nx_graph.edges()
|
|
@@ -48,7 +48,7 @@ def test_aqtdevice_metadata(metadata, qubits):
|
|
|
48
48
|
assert len(metadata.gate_durations) == 4
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
def test_aqtdevice_duration_of(metadata, qubits):
|
|
51
|
+
def test_aqtdevice_duration_of(metadata, qubits) -> None:
|
|
52
52
|
q0, q1 = qubits[:2]
|
|
53
53
|
ms = cirq.Duration(millis=1)
|
|
54
54
|
assert metadata.duration_of(cirq.Z(q0)) == 10 * ms
|
|
@@ -59,5 +59,5 @@ def test_aqtdevice_duration_of(metadata, qubits):
|
|
|
59
59
|
metadata.duration_of(cirq.I(q0))
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
def test_repr(metadata):
|
|
62
|
+
def test_repr(metadata) -> None:
|
|
63
63
|
cirq.testing.assert_equivalent_repr(metadata, setup_code='import cirq\nimport cirq_aqt\n')
|
cirq_aqt/aqt_device_test.py
CHANGED
|
@@ -43,11 +43,11 @@ class NotImplementedOperation(cirq.Operation):
|
|
|
43
43
|
raise NotImplementedError()
|
|
44
44
|
|
|
45
45
|
@property
|
|
46
|
-
def qubits(self):
|
|
46
|
+
def qubits(self) -> tuple[cirq.Qid, ...]:
|
|
47
47
|
raise NotImplementedError()
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
def test_init_qubits(device, qubits):
|
|
50
|
+
def test_init_qubits(device, qubits) -> None:
|
|
51
51
|
ms = cirq.Duration(millis=1)
|
|
52
52
|
assert device.qubits == frozenset(qubits)
|
|
53
53
|
with pytest.raises(TypeError, match="NamedQubit"):
|
|
@@ -55,12 +55,12 @@ def test_init_qubits(device, qubits):
|
|
|
55
55
|
measurement_duration=100 * ms,
|
|
56
56
|
twoq_gates_duration=200 * ms,
|
|
57
57
|
oneq_gates_duration=10 * ms,
|
|
58
|
-
qubits=[cirq.LineQubit(0), cirq.NamedQubit("a")],
|
|
58
|
+
qubits=[cirq.LineQubit(0), cirq.NamedQubit("a")], # type: ignore[list-item]
|
|
59
59
|
)
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
@pytest.mark.parametrize('ms', [cirq.Duration(millis=1), timedelta(milliseconds=1)])
|
|
63
|
-
def test_init_durations(ms, qubits):
|
|
63
|
+
def test_init_durations(ms, qubits) -> None:
|
|
64
64
|
dev = aqt_device.AQTDevice(
|
|
65
65
|
qubits=qubits,
|
|
66
66
|
measurement_duration=100 * ms,
|
|
@@ -72,12 +72,12 @@ def test_init_durations(ms, qubits):
|
|
|
72
72
|
assert dev.metadata.measurement_duration == cirq.Duration(millis=100)
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
def test_metadata(device, qubits):
|
|
75
|
+
def test_metadata(device, qubits) -> None:
|
|
76
76
|
assert isinstance(device.metadata, aqt_device_metadata.AQTDeviceMetadata)
|
|
77
77
|
assert device.metadata.qubit_set == frozenset(qubits)
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
def test_repr(device):
|
|
80
|
+
def test_repr(device) -> None:
|
|
81
81
|
assert repr(device) == (
|
|
82
82
|
"cirq_aqt.aqt_device.AQTDevice("
|
|
83
83
|
"measurement_duration=cirq.Duration(millis=100), "
|
|
@@ -89,13 +89,13 @@ def test_repr(device):
|
|
|
89
89
|
cirq.testing.assert_equivalent_repr(device, setup_code='import cirq\nimport cirq_aqt\n')
|
|
90
90
|
|
|
91
91
|
|
|
92
|
-
def test_validate_measurement_non_adjacent_qubits_ok(device):
|
|
92
|
+
def test_validate_measurement_non_adjacent_qubits_ok(device) -> None:
|
|
93
93
|
device.validate_operation(
|
|
94
94
|
cirq.GateOperation(cirq.MeasurementGate(2, 'key'), (cirq.LineQubit(0), cirq.LineQubit(1)))
|
|
95
95
|
)
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
def test_validate_operation_existing_qubits(device):
|
|
98
|
+
def test_validate_operation_existing_qubits(device) -> None:
|
|
99
99
|
device.validate_operation(cirq.GateOperation(cirq.XX, (cirq.LineQubit(0), cirq.LineQubit(1))))
|
|
100
100
|
device.validate_operation(cirq.Z(cirq.LineQubit(0)))
|
|
101
101
|
device.validate_operation(
|
|
@@ -114,7 +114,7 @@ def test_validate_operation_existing_qubits(device):
|
|
|
114
114
|
device.validate_operation(cirq.X(cirq.NamedQubit("q1")))
|
|
115
115
|
|
|
116
116
|
|
|
117
|
-
def test_validate_operation_supported_gate(device):
|
|
117
|
+
def test_validate_operation_supported_gate(device) -> None:
|
|
118
118
|
class MyGate(cirq.Gate):
|
|
119
119
|
def num_qubits(self):
|
|
120
120
|
return 1
|
|
@@ -128,12 +128,12 @@ def test_validate_operation_supported_gate(device):
|
|
|
128
128
|
device.validate_operation(NotImplementedOperation())
|
|
129
129
|
|
|
130
130
|
|
|
131
|
-
def test_aqt_device_eq(device):
|
|
131
|
+
def test_aqt_device_eq(device) -> None:
|
|
132
132
|
eq = cirq.testing.EqualsTester()
|
|
133
133
|
eq.make_equality_group(lambda: device)
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
def test_validate_circuit_repeat_measurement_keys(device):
|
|
136
|
+
def test_validate_circuit_repeat_measurement_keys(device) -> None:
|
|
137
137
|
circuit = cirq.Circuit()
|
|
138
138
|
circuit.append(
|
|
139
139
|
[cirq.measure(cirq.LineQubit(0), key='a'), cirq.measure(cirq.LineQubit(1), key='a')]
|
|
@@ -143,16 +143,16 @@ def test_validate_circuit_repeat_measurement_keys(device):
|
|
|
143
143
|
device.validate_circuit(circuit)
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
def test_aqt_device_str(device):
|
|
146
|
+
def test_aqt_device_str(device) -> None:
|
|
147
147
|
assert str(device) == "q(0)───q(1)───q(2)"
|
|
148
148
|
|
|
149
149
|
|
|
150
|
-
def test_aqt_device_pretty_repr(device):
|
|
150
|
+
def test_aqt_device_pretty_repr(device) -> None:
|
|
151
151
|
cirq.testing.assert_repr_pretty(device, "q(0)───q(1)───q(2)")
|
|
152
152
|
cirq.testing.assert_repr_pretty(device, "AQTDevice(...)", cycle=True)
|
|
153
153
|
|
|
154
154
|
|
|
155
|
-
def test_at(device):
|
|
155
|
+
def test_at(device) -> None:
|
|
156
156
|
assert device.at(-1) is None
|
|
157
157
|
assert device.at(0) == cirq.LineQubit(0)
|
|
158
158
|
assert device.at(2) == cirq.LineQubit(2)
|
cirq_aqt/aqt_sampler.py
CHANGED
|
@@ -27,7 +27,8 @@ from __future__ import annotations
|
|
|
27
27
|
import json
|
|
28
28
|
import time
|
|
29
29
|
import uuid
|
|
30
|
-
from
|
|
30
|
+
from collections.abc import Callable, Sequence
|
|
31
|
+
from typing import cast, Literal, TypedDict
|
|
31
32
|
from urllib.parse import urljoin
|
|
32
33
|
|
|
33
34
|
import numpy as np
|
cirq_aqt/aqt_sampler_test.py
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
17
|
import json
|
|
18
|
+
from typing import Any, Self
|
|
18
19
|
from unittest import mock
|
|
19
20
|
|
|
20
21
|
import numpy as np
|
|
@@ -33,11 +34,11 @@ class GetResultReturn:
|
|
|
33
34
|
self.test_dict = {'job': {'job_id': '2131da'}, 'response': {'status': 'queued'}}
|
|
34
35
|
self.counter = 0
|
|
35
36
|
|
|
36
|
-
def json(self):
|
|
37
|
+
def json(self) -> dict[str, Any]:
|
|
37
38
|
self.counter += 1
|
|
38
39
|
return self.test_dict
|
|
39
40
|
|
|
40
|
-
def update(self, *args, **kwargs):
|
|
41
|
+
def update(self, *args, **kwargs) -> Self:
|
|
41
42
|
return self
|
|
42
43
|
|
|
43
44
|
|
|
@@ -55,7 +56,7 @@ class GetResultNoStatus(GetResultReturn):
|
|
|
55
56
|
"""A put mock class for testing error responses
|
|
56
57
|
This will not return a status in the second call"""
|
|
57
58
|
|
|
58
|
-
def update(self, *args, **kwargs):
|
|
59
|
+
def update(self, *args, **kwargs) -> Self:
|
|
59
60
|
del self.test_dict['response']['status']
|
|
60
61
|
return self
|
|
61
62
|
|
|
@@ -64,14 +65,14 @@ class GetResultErrorSecond(GetResultReturn):
|
|
|
64
65
|
"""A put mock class for testing error responses
|
|
65
66
|
This will return an error on the second put call"""
|
|
66
67
|
|
|
67
|
-
def update(self, *args, **kwargs):
|
|
68
|
+
def update(self, *args, **kwargs) -> Self:
|
|
68
69
|
if self.counter >= 1:
|
|
69
70
|
self.test_dict['response']['status'] = 'error'
|
|
70
71
|
return self
|
|
71
72
|
|
|
72
73
|
|
|
73
74
|
class SubmitGoodResponse:
|
|
74
|
-
def json(self):
|
|
75
|
+
def json(self) -> dict[str, Any]:
|
|
75
76
|
return {"job": {"job_id": "test_job"}, "response": {"status": "queued"}}
|
|
76
77
|
|
|
77
78
|
|
|
@@ -79,7 +80,7 @@ class SubmitResultNoID:
|
|
|
79
80
|
"""A put mock class for testing error responses
|
|
80
81
|
This will not return an id at the first call"""
|
|
81
82
|
|
|
82
|
-
def json(self):
|
|
83
|
+
def json(self) -> dict[str, Any]:
|
|
83
84
|
return {"job": {}, "response": {"status": "queued"}}
|
|
84
85
|
|
|
85
86
|
|
|
@@ -87,7 +88,7 @@ class SubmitResultNoStatus:
|
|
|
87
88
|
"""A put mock class for testing error responses
|
|
88
89
|
This will not return an id at the first call"""
|
|
89
90
|
|
|
90
|
-
def json(self):
|
|
91
|
+
def json(self) -> dict[str, Any]:
|
|
91
92
|
return {"job": {"job_id": "test_job"}, "response": {}}
|
|
92
93
|
|
|
93
94
|
|
|
@@ -95,11 +96,11 @@ class SubmitResultWithError:
|
|
|
95
96
|
"""A put mock class for testing error responses
|
|
96
97
|
This will not return an id at the first call"""
|
|
97
98
|
|
|
98
|
-
def json(self):
|
|
99
|
+
def json(self) -> dict[str, Any]:
|
|
99
100
|
return {"job": {"job_id": "test_job"}, "response": {"status": "error"}}
|
|
100
101
|
|
|
101
102
|
|
|
102
|
-
def test_aqt_sampler_submit_job_error_handling():
|
|
103
|
+
def test_aqt_sampler_submit_job_error_handling() -> None:
|
|
103
104
|
for e_return in [SubmitResultNoID(), SubmitResultNoStatus(), SubmitResultWithError()]:
|
|
104
105
|
with (
|
|
105
106
|
mock.patch('cirq_aqt.aqt_sampler.post', return_value=e_return),
|
|
@@ -119,7 +120,7 @@ def test_aqt_sampler_submit_job_error_handling():
|
|
|
119
120
|
_results = sampler.run_sweep(circuit, params=sweep, repetitions=repetitions)
|
|
120
121
|
|
|
121
122
|
|
|
122
|
-
def test_aqt_sampler_get_result_error_handling():
|
|
123
|
+
def test_aqt_sampler_get_result_error_handling() -> None:
|
|
123
124
|
for e_return in [GetResultError(), GetResultErrorSecond(), GetResultNoStatus()]:
|
|
124
125
|
with (
|
|
125
126
|
mock.patch('cirq_aqt.aqt_sampler.post', return_value=SubmitGoodResponse()),
|
|
@@ -141,7 +142,7 @@ def test_aqt_sampler_get_result_error_handling():
|
|
|
141
142
|
_results = sampler.run_sweep(circuit, params=sweep, repetitions=repetitions)
|
|
142
143
|
|
|
143
144
|
|
|
144
|
-
def test_aqt_sampler_empty_circuit():
|
|
145
|
+
def test_aqt_sampler_empty_circuit() -> None:
|
|
145
146
|
num_points = 10
|
|
146
147
|
max_angle = np.pi
|
|
147
148
|
repetitions = 1000
|
|
@@ -155,7 +156,7 @@ def test_aqt_sampler_empty_circuit():
|
|
|
155
156
|
_results = sampler.run_sweep(circuit, params=sweep, repetitions=repetitions)
|
|
156
157
|
|
|
157
158
|
|
|
158
|
-
def test_aqt_sampler():
|
|
159
|
+
def test_aqt_sampler() -> None:
|
|
159
160
|
class ResultReturn:
|
|
160
161
|
def __init__(self):
|
|
161
162
|
self.request_counter = 0
|
|
@@ -200,7 +201,7 @@ def test_aqt_sampler():
|
|
|
200
201
|
assert result_method.call_count == 3
|
|
201
202
|
|
|
202
203
|
|
|
203
|
-
def test_aqt_sampler_sim():
|
|
204
|
+
def test_aqt_sampler_sim() -> None:
|
|
204
205
|
theta = sympy.Symbol('theta')
|
|
205
206
|
num_points = 10
|
|
206
207
|
max_angle = np.pi
|
|
@@ -228,7 +229,7 @@ def test_aqt_sampler_sim():
|
|
|
228
229
|
assert excited_state_probs[-1] == 0.25
|
|
229
230
|
|
|
230
231
|
|
|
231
|
-
def test_aqt_sampler_sim_xtalk():
|
|
232
|
+
def test_aqt_sampler_sim_xtalk() -> None:
|
|
232
233
|
num_points = 10
|
|
233
234
|
max_angle = np.pi
|
|
234
235
|
repetitions = 100
|
|
@@ -249,7 +250,7 @@ def test_aqt_sampler_sim_xtalk():
|
|
|
249
250
|
_results = sampler.run_sweep(circuit, params=sweep, repetitions=repetitions)
|
|
250
251
|
|
|
251
252
|
|
|
252
|
-
def test_aqt_sampler_ms():
|
|
253
|
+
def test_aqt_sampler_ms() -> None:
|
|
253
254
|
repetitions = 1000
|
|
254
255
|
num_qubits = 4
|
|
255
256
|
_, qubits = get_aqt_device(num_qubits)
|
|
@@ -264,7 +265,7 @@ def test_aqt_sampler_ms():
|
|
|
264
265
|
assert hist[0] > repetitions / 3
|
|
265
266
|
|
|
266
267
|
|
|
267
|
-
def test_aqt_device_wrong_op_str():
|
|
268
|
+
def test_aqt_device_wrong_op_str() -> None:
|
|
268
269
|
circuit = cirq.Circuit()
|
|
269
270
|
q0, q1 = cirq.LineQubit.range(2)
|
|
270
271
|
circuit.append(cirq.CNOT(q0, q1) ** 1.0)
|
cirq_aqt/aqt_simulator_test.py
CHANGED
|
@@ -21,13 +21,13 @@ from cirq_aqt import AQTSimulator
|
|
|
21
21
|
from cirq_aqt.aqt_device import AQTNoiseModel, get_aqt_device
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
def test_simulator_no_circ():
|
|
24
|
+
def test_simulator_no_circ() -> None:
|
|
25
25
|
with pytest.raises(RuntimeError):
|
|
26
26
|
sim = AQTSimulator(num_qubits=1)
|
|
27
27
|
sim.simulate_samples(1)
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
def test_ms_crosstalk_n_noise():
|
|
30
|
+
def test_ms_crosstalk_n_noise() -> None:
|
|
31
31
|
num_qubits = 4
|
|
32
32
|
noise_mod = AQTNoiseModel()
|
|
33
33
|
_, qubits = get_aqt_device(num_qubits)
|
|
@@ -51,24 +51,27 @@ Q, Q2, Q3, Q4 = cirq.LineQubit.range(4)
|
|
|
51
51
|
(cirq.ZPowGate(exponent=0.5)(Q).controlled_by(Q2, Q3), False),
|
|
52
52
|
],
|
|
53
53
|
)
|
|
54
|
-
def test_gateset(op: cirq.Operation, expected: bool):
|
|
54
|
+
def test_gateset(op: cirq.Operation, expected: bool) -> None:
|
|
55
55
|
gs = aqt_target_gateset.AQTTargetGateset()
|
|
56
56
|
assert gs.validate(op) == expected
|
|
57
57
|
assert gs.validate(cirq.Circuit(op)) == expected
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
def test_decompose_single_qubit_operation():
|
|
60
|
+
def test_decompose_single_qubit_operation() -> None:
|
|
61
61
|
gs = aqt_target_gateset.AQTTargetGateset()
|
|
62
62
|
tgoph = gs.decompose_to_target_gateset(cirq.H(Q), 0)
|
|
63
|
+
assert isinstance(tgoph, list)
|
|
63
64
|
assert len(tgoph) == 2
|
|
64
65
|
assert isinstance(tgoph[0].gate, cirq.Rx)
|
|
65
66
|
assert isinstance(tgoph[1].gate, cirq.Ry)
|
|
66
67
|
tcoph = cirq.CircuitOperation(cirq.FrozenCircuit(cirq.H(Q))).with_tags('tagged')
|
|
67
68
|
tgtcoph = gs.decompose_to_target_gateset(tcoph, 0)
|
|
69
|
+
assert isinstance(tgtcoph, list)
|
|
68
70
|
assert len(tgtcoph) == 2
|
|
69
71
|
assert isinstance(tgtcoph[0].gate, cirq.Rx)
|
|
70
72
|
assert isinstance(tgtcoph[1].gate, cirq.Ry)
|
|
71
73
|
tgopz = gs.decompose_to_target_gateset(cirq.Z(Q), 0)
|
|
74
|
+
assert isinstance(tgopz, list)
|
|
72
75
|
assert len(tgopz) == 1
|
|
73
76
|
assert isinstance(tgopz[0].gate, cirq.ZPowGate)
|
|
74
77
|
theta = sympy.Symbol('theta')
|
|
@@ -76,9 +79,10 @@ def test_decompose_single_qubit_operation():
|
|
|
76
79
|
return
|
|
77
80
|
|
|
78
81
|
|
|
79
|
-
def test_decompose_two_qubit_operation():
|
|
82
|
+
def test_decompose_two_qubit_operation() -> None:
|
|
80
83
|
gs = aqt_target_gateset.AQTTargetGateset()
|
|
81
84
|
tgopsqrtxx = gs.decompose_to_target_gateset(cirq.XX(Q, Q2) ** 0.5, 0)
|
|
85
|
+
assert isinstance(tgopsqrtxx, list)
|
|
82
86
|
assert len(tgopsqrtxx) == 1
|
|
83
87
|
assert isinstance(tgopsqrtxx[0].gate, cirq.XXPowGate)
|
|
84
88
|
theta = sympy.Symbol('theta')
|
|
@@ -86,6 +90,6 @@ def test_decompose_two_qubit_operation():
|
|
|
86
90
|
return
|
|
87
91
|
|
|
88
92
|
|
|
89
|
-
def test_postprocess_transformers():
|
|
93
|
+
def test_postprocess_transformers() -> None:
|
|
90
94
|
gs = aqt_target_gateset.AQTTargetGateset()
|
|
91
95
|
assert len(gs.postprocess_transformers) == 2
|
cirq_aqt/conftest.py
CHANGED
{cirq_aqt-1.6.0.dev20250527171805.dist-info → cirq_aqt-1.7.0.dev20251211190616.dist-info}/METADATA
RENAMED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cirq-aqt
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0.dev20251211190616
|
|
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
|
|
7
7
|
Author-email: cirq-dev@googlegroups.com
|
|
8
8
|
Maintainer: Google Quantum AI open-source maintainers
|
|
9
9
|
Maintainer-email: quantum-oss-maintainers@google.com
|
|
10
|
-
License: Apache
|
|
10
|
+
License: Apache-2.0
|
|
11
11
|
Keywords: algorithms,api,cirq,google,google quantum,nisq,python,quantum,quantum algorithms,quantum circuit,quantum circuit simulator,quantum computer simulator,quantum computing,quantum development kit,quantum information,quantum programming,quantum programming language,quantum simulation,sdk,simulation
|
|
12
12
|
Classifier: Development Status :: 5 - Production/Stable
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
14
|
Classifier: Intended Audience :: Education
|
|
15
15
|
Classifier: Intended Audience :: Science/Research
|
|
16
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
16
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
18
17
|
Classifier: Operating System :: Microsoft :: Windows
|
|
19
18
|
Classifier: Operating System :: POSIX :: Linux
|
|
@@ -28,7 +27,7 @@ Requires-Python: >=3.11.0
|
|
|
28
27
|
Description-Content-Type: text/markdown
|
|
29
28
|
License-File: LICENSE
|
|
30
29
|
Requires-Dist: requests~=2.32
|
|
31
|
-
Requires-Dist: cirq-core==1.
|
|
30
|
+
Requires-Dist: cirq-core==1.7.0.dev20251211190616
|
|
32
31
|
Dynamic: author
|
|
33
32
|
Dynamic: author-email
|
|
34
33
|
Dynamic: classifier
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
cirq_aqt/__init__.py,sha256=M8r1U_8xYpcIUhs8U110BFWQ4jUCqS9IQf8trjq0rvI,888
|
|
2
|
+
cirq_aqt/_version.py,sha256=fPl9oAdnRZ0GC3NQMzPAdLYNNvrIyk4w8HqeouvsTgw,696
|
|
3
|
+
cirq_aqt/_version_test.py,sha256=m1uzmwu2GhY8PH1nNP7pU1rDkDdZj5rsHK0Qkqd0vsE,155
|
|
4
|
+
cirq_aqt/aqt_device.py,sha256=hu0f8Ct0rkAJvBUgShDawVAUKzXLTHt7nzoT2Yny5cs,13690
|
|
5
|
+
cirq_aqt/aqt_device_metadata.py,sha256=LWPwPvQYPkwietulNqzxeJ9_pEFkFpIKOTi2QMuHkkc,4811
|
|
6
|
+
cirq_aqt/aqt_device_metadata_test.py,sha256=jzKPFEHuHJ_GeKBKCu5eQDQHak4TKFv_GmLIR9Wfm80,2146
|
|
7
|
+
cirq_aqt/aqt_device_test.py,sha256=uu9EWQAOZ8bw0fvlRgFPcmLqJvhu48sLjVBJHOLVrH0,5367
|
|
8
|
+
cirq_aqt/aqt_sampler.py,sha256=WU6lSdw0JrXKaLW9DJZ8i1qWJeUoMhSOSCMANk0OWYE,18379
|
|
9
|
+
cirq_aqt/aqt_sampler_test.py,sha256=2N1-cs1emcSKTQo3qTdHqsddcxKndiII5RSlh8qVhwM,16646
|
|
10
|
+
cirq_aqt/aqt_simulator_test.py,sha256=Kwd8bnQGSA_NTymPedOo8wvy2AZHp2fWyKFW4WFhWQM,1693
|
|
11
|
+
cirq_aqt/aqt_target_gateset.py,sha256=ZxrmxhXwM81OL5HFJ_jrW7TkliN4X4CAJa8dIJxHaz8,2840
|
|
12
|
+
cirq_aqt/aqt_target_gateset_test.py,sha256=Y6xgNE_bMC1934FHQwvjoswm2gQzz6tI2wjV98EG8bo,3550
|
|
13
|
+
cirq_aqt/conftest.py,sha256=sl0zfNCkCC6KnRiH5uWpL8lk9xrnNZsUc8-Kff29dic,675
|
|
14
|
+
cirq_aqt/json_resolver_cache.py,sha256=qGUV-S69bnqqg2UAgnhVbW0ZHC8UczZr8KBmj09KCso,855
|
|
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.7.0.dev20251211190616.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
18
|
+
cirq_aqt-1.7.0.dev20251211190616.dist-info/METADATA,sha256=YZ8y__JPEOuRNI95jk48ddS8KwioMmw3ImTnHK60Mts,4717
|
|
19
|
+
cirq_aqt-1.7.0.dev20251211190616.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
20
|
+
cirq_aqt-1.7.0.dev20251211190616.dist-info/top_level.txt,sha256=culYyFTEtuC3Z7wT3wZ6kGVspH3hYFZUEKooByfe9h0,9
|
|
21
|
+
cirq_aqt-1.7.0.dev20251211190616.dist-info/RECORD,,
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
cirq_aqt/__init__.py,sha256=M8r1U_8xYpcIUhs8U110BFWQ4jUCqS9IQf8trjq0rvI,888
|
|
2
|
-
cirq_aqt/_version.py,sha256=gOvMba6oJbovsyHVV74lR1c2uoXmYEcLExYU9Y-6wxk,696
|
|
3
|
-
cirq_aqt/_version_test.py,sha256=JZkqO_NPSSdFRuXuuSkGaUBpstxvVGt2m2eqZEmGLZc,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=ZxrmxhXwM81OL5HFJ_jrW7TkliN4X4CAJa8dIJxHaz8,2840
|
|
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=qGUV-S69bnqqg2UAgnhVbW0ZHC8UczZr8KBmj09KCso,855
|
|
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.dev20250527171805.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
18
|
-
cirq_aqt-1.6.0.dev20250527171805.dist-info/METADATA,sha256=LFkKd7mP5vQSG6dUtFuARifrobjFEfJYSoG0AAZjKlo,4778
|
|
19
|
-
cirq_aqt-1.6.0.dev20250527171805.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
20
|
-
cirq_aqt-1.6.0.dev20250527171805.dist-info/top_level.txt,sha256=culYyFTEtuC3Z7wT3wZ6kGVspH3hYFZUEKooByfe9h0,9
|
|
21
|
-
cirq_aqt-1.6.0.dev20250527171805.dist-info/RECORD,,
|
{cirq_aqt-1.6.0.dev20250527171805.dist-info → cirq_aqt-1.7.0.dev20251211190616.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|