cirq-core 1.5.0.dev20250228190359__py3-none-any.whl → 1.5.0.dev20250303221005__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-core might be problematic. Click here for more details.
- cirq/_version.py +1 -1
- cirq/_version_test.py +1 -1
- cirq/devices/grid_qubit.py +2 -6
- cirq/devices/grid_qubit_test.py +16 -8
- cirq/devices/line_qubit.py +2 -4
- cirq/devices/line_qubit_test.py +13 -5
- cirq/study/sweeps.py +2 -1
- {cirq_core-1.5.0.dev20250228190359.dist-info → cirq_core-1.5.0.dev20250303221005.dist-info}/METADATA +1 -1
- {cirq_core-1.5.0.dev20250228190359.dist-info → cirq_core-1.5.0.dev20250303221005.dist-info}/RECORD +12 -12
- {cirq_core-1.5.0.dev20250228190359.dist-info → cirq_core-1.5.0.dev20250303221005.dist-info}/LICENSE +0 -0
- {cirq_core-1.5.0.dev20250228190359.dist-info → cirq_core-1.5.0.dev20250303221005.dist-info}/WHEEL +0 -0
- {cirq_core-1.5.0.dev20250228190359.dist-info → cirq_core-1.5.0.dev20250303221005.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
cirq/_version_test.py
CHANGED
cirq/devices/grid_qubit.py
CHANGED
|
@@ -213,8 +213,6 @@ class GridQid(_BaseGridQid):
|
|
|
213
213
|
dimension: The dimension of the qid's Hilbert space, i.e.
|
|
214
214
|
the number of quantum levels.
|
|
215
215
|
"""
|
|
216
|
-
row = int(row)
|
|
217
|
-
col = int(col)
|
|
218
216
|
dimension = int(dimension)
|
|
219
217
|
key = (row, col, dimension)
|
|
220
218
|
inst = cls._cache.get(key)
|
|
@@ -224,7 +222,7 @@ class GridQid(_BaseGridQid):
|
|
|
224
222
|
inst._row = row
|
|
225
223
|
inst._col = col
|
|
226
224
|
inst._dimension = dimension
|
|
227
|
-
inst._hash = ((dimension - 2) * 1_000_003 + col) * 1_000_003 + row
|
|
225
|
+
inst._hash = ((dimension - 2) * 1_000_003 + hash(col)) * 1_000_003 + hash(row)
|
|
228
226
|
cls._cache[key] = inst
|
|
229
227
|
return inst
|
|
230
228
|
|
|
@@ -380,15 +378,13 @@ class GridQubit(_BaseGridQid):
|
|
|
380
378
|
row: the row coordinate
|
|
381
379
|
col: the column coordinate
|
|
382
380
|
"""
|
|
383
|
-
row = int(row)
|
|
384
|
-
col = int(col)
|
|
385
381
|
key = (row, col)
|
|
386
382
|
inst = cls._cache.get(key)
|
|
387
383
|
if inst is None:
|
|
388
384
|
inst = super().__new__(cls)
|
|
389
385
|
inst._row = row
|
|
390
386
|
inst._col = col
|
|
391
|
-
inst._hash = col * 1_000_003 + row
|
|
387
|
+
inst._hash = hash(col) * 1_000_003 + hash(row)
|
|
392
388
|
cls._cache[key] = inst
|
|
393
389
|
return inst
|
|
394
390
|
|
cirq/devices/grid_qubit_test.py
CHANGED
|
@@ -393,22 +393,30 @@ def test_complex():
|
|
|
393
393
|
assert isinstance(complex(cirq.GridQubit(row=1, col=2)), complex)
|
|
394
394
|
|
|
395
395
|
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
@pytest.mark.parametrize('dtype', (np.int8, np.int64, float, np.float64))
|
|
397
|
+
def test_numpy_index(dtype):
|
|
398
|
+
np5, np6, np3 = [dtype(i) for i in [5, 6, 3]]
|
|
398
399
|
q = cirq.GridQubit(np5, np6)
|
|
399
|
-
hash(q)
|
|
400
|
+
assert hash(q) == hash(cirq.GridQubit(5, 6))
|
|
400
401
|
assert q.row == 5
|
|
401
402
|
assert q.col == 6
|
|
402
403
|
assert q.dimension == 2
|
|
403
|
-
assert isinstance(q.row, int)
|
|
404
|
-
assert isinstance(q.col, int)
|
|
405
404
|
assert isinstance(q.dimension, int)
|
|
406
405
|
|
|
407
406
|
q = cirq.GridQid(np5, np6, dimension=np3)
|
|
408
|
-
hash(q)
|
|
407
|
+
assert hash(q) == hash(cirq.GridQid(5, 6, dimension=3))
|
|
409
408
|
assert q.row == 5
|
|
410
409
|
assert q.col == 6
|
|
411
410
|
assert q.dimension == 3
|
|
412
|
-
assert isinstance(q.row, int)
|
|
413
|
-
assert isinstance(q.col, int)
|
|
414
411
|
assert isinstance(q.dimension, int)
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
@pytest.mark.parametrize('dtype', (float, np.float64))
|
|
415
|
+
def test_non_integer_index(dtype):
|
|
416
|
+
# Not supported type-wise, but is used in practice, so behavior needs to be preserved.
|
|
417
|
+
q = cirq.GridQubit(dtype(5.5), dtype(6.5))
|
|
418
|
+
assert hash(q) == hash(cirq.GridQubit(5.5, 6.5))
|
|
419
|
+
assert q.row == 5.5
|
|
420
|
+
assert q.col == 6.5
|
|
421
|
+
assert isinstance(q.row, dtype)
|
|
422
|
+
assert isinstance(q.col, dtype)
|
cirq/devices/line_qubit.py
CHANGED
|
@@ -191,7 +191,6 @@ class LineQid(_BaseLineQid):
|
|
|
191
191
|
dimension: The dimension of the qid's Hilbert space, i.e.
|
|
192
192
|
the number of quantum levels.
|
|
193
193
|
"""
|
|
194
|
-
x = int(x)
|
|
195
194
|
dimension = int(dimension)
|
|
196
195
|
key = (x, dimension)
|
|
197
196
|
inst = cls._cache.get(key)
|
|
@@ -200,7 +199,7 @@ class LineQid(_BaseLineQid):
|
|
|
200
199
|
inst = super().__new__(cls)
|
|
201
200
|
inst._x = x
|
|
202
201
|
inst._dimension = dimension
|
|
203
|
-
inst._hash = (dimension - 2) * 1_000_003 + x
|
|
202
|
+
inst._hash = (dimension - 2) * 1_000_003 + hash(x)
|
|
204
203
|
cls._cache[key] = inst
|
|
205
204
|
return inst
|
|
206
205
|
|
|
@@ -302,12 +301,11 @@ class LineQubit(_BaseLineQid):
|
|
|
302
301
|
Args:
|
|
303
302
|
x: The x coordinate.
|
|
304
303
|
"""
|
|
305
|
-
x = int(x)
|
|
306
304
|
inst = cls._cache.get(x)
|
|
307
305
|
if inst is None:
|
|
308
306
|
inst = super().__new__(cls)
|
|
309
307
|
inst._x = x
|
|
310
|
-
inst._hash = x
|
|
308
|
+
inst._hash = hash(x)
|
|
311
309
|
cls._cache[x] = inst
|
|
312
310
|
return inst
|
|
313
311
|
|
cirq/devices/line_qubit_test.py
CHANGED
|
@@ -287,18 +287,26 @@ def test_numeric():
|
|
|
287
287
|
assert isinstance(complex(cirq.LineQubit(x=5)), complex)
|
|
288
288
|
|
|
289
289
|
|
|
290
|
-
|
|
291
|
-
|
|
290
|
+
@pytest.mark.parametrize('dtype', (np.int8, np.int64, float, np.float64))
|
|
291
|
+
def test_numpy_index(dtype):
|
|
292
|
+
np5 = dtype(5)
|
|
292
293
|
q = cirq.LineQubit(np5)
|
|
293
294
|
assert hash(q) == 5
|
|
294
295
|
assert q.x == 5
|
|
295
296
|
assert q.dimension == 2
|
|
296
|
-
assert isinstance(q.x, int)
|
|
297
297
|
assert isinstance(q.dimension, int)
|
|
298
298
|
|
|
299
|
-
q = cirq.LineQid(np5,
|
|
299
|
+
q = cirq.LineQid(np5, dtype(3))
|
|
300
300
|
hash(q) # doesn't throw
|
|
301
301
|
assert q.x == 5
|
|
302
302
|
assert q.dimension == 3
|
|
303
|
-
assert isinstance(q.x, int)
|
|
304
303
|
assert isinstance(q.dimension, int)
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
@pytest.mark.parametrize('dtype', (float, np.float64))
|
|
307
|
+
def test_non_integer_index(dtype):
|
|
308
|
+
# Not supported type-wise, but is used in practice, so behavior needs to be preserved.
|
|
309
|
+
q = cirq.LineQubit(dtype(5.5))
|
|
310
|
+
assert q.x == 5.5
|
|
311
|
+
assert q.x == dtype(5.5)
|
|
312
|
+
assert isinstance(q.x, dtype)
|
cirq/study/sweeps.py
CHANGED
|
@@ -216,7 +216,8 @@ class Product(Sweep):
|
|
|
216
216
|
If one sweep assigns 'a' to the values 0, 1, 2, and the second sweep
|
|
217
217
|
assigns 'b' to the values 2, 3, then the product is a sweep that
|
|
218
218
|
assigns the tuple ('a','b') to all possible combinations of these
|
|
219
|
-
assignments: (0, 2), (
|
|
219
|
+
assignments: (0, 2), (0, 3), (1, 2), (1, 3), (2, 2), (2, 3).
|
|
220
|
+
That is, the leftmost sweep is the outer loop in a product of sweeps.
|
|
220
221
|
"""
|
|
221
222
|
|
|
222
223
|
def __init__(self, *factors: Sweep) -> None:
|
{cirq_core-1.5.0.dev20250228190359.dist-info → cirq_core-1.5.0.dev20250303221005.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cirq-core
|
|
3
|
-
Version: 1.5.0.
|
|
3
|
+
Version: 1.5.0.dev20250303221005
|
|
4
4
|
Summary: A framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
|
|
5
5
|
Home-page: http://github.com/quantumlib/cirq
|
|
6
6
|
Author: The Cirq Developers
|
{cirq_core-1.5.0.dev20250228190359.dist-info → cirq_core-1.5.0.dev20250303221005.dist-info}/RECORD
RENAMED
|
@@ -4,8 +4,8 @@ cirq/_compat_test.py,sha256=Qq3ZcfgD-Nb81cEppQdJqhAyrVqXKtfXZYGXT0p-Wh0,34718
|
|
|
4
4
|
cirq/_doc.py,sha256=yDyWUD_2JDS0gShfGRb-rdqRt9-WeL7DhkqX7np0Nko,2879
|
|
5
5
|
cirq/_import.py,sha256=p9gMHJscbtDDkfHOaulvd3Aer0pwUF5AXpL89XR8dNw,8402
|
|
6
6
|
cirq/_import_test.py,sha256=6K_v0riZJXOXUphHNkGA8MY-JcmGlezFaGmvrNhm3OQ,1015
|
|
7
|
-
cirq/_version.py,sha256=
|
|
8
|
-
cirq/_version_test.py,sha256=
|
|
7
|
+
cirq/_version.py,sha256=NczjHDuFTFMYEZ8OJS9JjPbmTG1CQcBoYhE0uCJHl0o,1206
|
|
8
|
+
cirq/_version_test.py,sha256=MXWazWp1L2KqiJZN59LqDFfIwXa-puDs6ThAWT-jnuY,147
|
|
9
9
|
cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=p-vEOa-8GQ2cFIAdze-kd6C1un1uRvtujVPljVKaHBg,13557
|
|
11
11
|
cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
|
|
@@ -157,12 +157,12 @@ cirq/devices/device.py,sha256=9rUZwpbbmqk8AUVH4N4KfJ59j5im7hVgDJAHtN9iH_0,5361
|
|
|
157
157
|
cirq/devices/device_test.py,sha256=v3gT6jrGLLfYnZbTizIaIMkI3s5_xVM3OV9JQchvAxY,1124
|
|
158
158
|
cirq/devices/grid_device_metadata.py,sha256=h4Xo_PaiZqQSVUgb1ctVtYYYE2tNik2KQhCgooilZrE,8629
|
|
159
159
|
cirq/devices/grid_device_metadata_test.py,sha256=IeOqYOZcUGhB4ivuQW2g0Q9dt-zFA0H6Dav6yv6Lul0,8592
|
|
160
|
-
cirq/devices/grid_qubit.py,sha256=
|
|
161
|
-
cirq/devices/grid_qubit_test.py,sha256=
|
|
160
|
+
cirq/devices/grid_qubit.py,sha256=oT7UbNAOL7Sgh-aksI1Uow4SH9O1MTgfOgLiSYLX94A,18859
|
|
161
|
+
cirq/devices/grid_qubit_test.py,sha256=Mf1AfjvcpKPHeg-2GWDZaKPUsXGn8wvidIbwu_3rZu4,15015
|
|
162
162
|
cirq/devices/insertion_noise_model.py,sha256=-X07pSTp-lxQj6AQT_89gTHx_jKtI9GSMrD4dozCwTs,3614
|
|
163
163
|
cirq/devices/insertion_noise_model_test.py,sha256=i9jB257VXO5wi5QdDO5G4tphx5RKMaouUsdsQT3kiBU,3992
|
|
164
|
-
cirq/devices/line_qubit.py,sha256=
|
|
165
|
-
cirq/devices/line_qubit_test.py,sha256=
|
|
164
|
+
cirq/devices/line_qubit.py,sha256=iVxyiJsnvlMQ_GExpmWyoGMwGRObxlxEFhsSjtD1RLY,11850
|
|
165
|
+
cirq/devices/line_qubit_test.py,sha256=eu47MSzy5eymIccIuHct8Z_WJeHhZYEARR3yB3NXyO8,10287
|
|
166
166
|
cirq/devices/named_topologies.py,sha256=grFXvi0UDHZl1pRyHDWSqjub3xF_Yf7RLXfMAZbyoEA,15790
|
|
167
167
|
cirq/devices/named_topologies_test.py,sha256=Nj_tlGmqPH7IVUzpUHPnAPlfUWhSGbZsIHdsLLjxIZs,4736
|
|
168
168
|
cirq/devices/noise_model.py,sha256=c00mxBd7ZYw8k-cCoKgF5ePI8WKcPyJS925NarivIRI,11339
|
|
@@ -957,7 +957,7 @@ cirq/study/result.py,sha256=KzjpjvDVCTFjMyq9r91pZSYdtcD1x3yj8jP_StlOSMg,19285
|
|
|
957
957
|
cirq/study/result_test.py,sha256=fq5BH78RswfTiYjMchJ4wEDDyaJu0QdJoGobMjKDeSI,15591
|
|
958
958
|
cirq/study/sweepable.py,sha256=CHC6NMZbenwKdTQrFJnbK4PlwoXhXTWmAzi1ZjSpS00,4357
|
|
959
959
|
cirq/study/sweepable_test.py,sha256=ENv03_GJmbUc_ukJoqfgG-H5C_yyx1jCcvxohSMyQVU,5502
|
|
960
|
-
cirq/study/sweeps.py,sha256=
|
|
960
|
+
cirq/study/sweeps.py,sha256=yJTmZUjxJNOIqXKTevF0uLd8lSP9HnwKhE5EHigUfG4,21673
|
|
961
961
|
cirq/study/sweeps_test.py,sha256=rgnU7zB7hxOXLbalYJb0yy_QPCOd-LxKgUir1bcyC2s,15426
|
|
962
962
|
cirq/testing/__init__.py,sha256=m_HUdHcJ3HcKpGQBKCwZ6E6QSkKpIN-dUGr4e75o4tY,6217
|
|
963
963
|
cirq/testing/circuit_compare.py,sha256=nBQES45wLVThOqC3WrPrYKLQP7HQ2pH5DjlJ5bHkrtU,19176
|
|
@@ -1202,8 +1202,8 @@ cirq/work/sampler.py,sha256=bE5tmVkcR6cZZMLETxDfHehdsYUMbx2RvBeIBetehI4,19187
|
|
|
1202
1202
|
cirq/work/sampler_test.py,sha256=hL2UWx3dz2ukZVNxWftiKVvJcQoLplLZdQm-k1QcA40,13282
|
|
1203
1203
|
cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
|
|
1204
1204
|
cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
|
|
1205
|
-
cirq_core-1.5.0.
|
|
1206
|
-
cirq_core-1.5.0.
|
|
1207
|
-
cirq_core-1.5.0.
|
|
1208
|
-
cirq_core-1.5.0.
|
|
1209
|
-
cirq_core-1.5.0.
|
|
1205
|
+
cirq_core-1.5.0.dev20250303221005.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1206
|
+
cirq_core-1.5.0.dev20250303221005.dist-info/METADATA,sha256=D9VDHJrusOEcC1c4IN-Po0ewVyOkmtHbfLW9BHtKDJw,4817
|
|
1207
|
+
cirq_core-1.5.0.dev20250303221005.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
1208
|
+
cirq_core-1.5.0.dev20250303221005.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1209
|
+
cirq_core-1.5.0.dev20250303221005.dist-info/RECORD,,
|
{cirq_core-1.5.0.dev20250228190359.dist-info → cirq_core-1.5.0.dev20250303221005.dist-info}/LICENSE
RENAMED
|
File without changes
|
{cirq_core-1.5.0.dev20250228190359.dist-info → cirq_core-1.5.0.dev20250303221005.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|