cirq-core 1.2.0.dev20230421134537__py3-none-any.whl → 1.2.0.dev20230422220059__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/_version.py +1 -1
- cirq/devices/grid_qubit.py +16 -16
- cirq/vis/heatmap_test.py +2 -2
- {cirq_core-1.2.0.dev20230421134537.dist-info → cirq_core-1.2.0.dev20230422220059.dist-info}/METADATA +1 -1
- {cirq_core-1.2.0.dev20230421134537.dist-info → cirq_core-1.2.0.dev20230422220059.dist-info}/RECORD +8 -8
- {cirq_core-1.2.0.dev20230421134537.dist-info → cirq_core-1.2.0.dev20230422220059.dist-info}/LICENSE +0 -0
- {cirq_core-1.2.0.dev20230421134537.dist-info → cirq_core-1.2.0.dev20230422220059.dist-info}/WHEEL +0 -0
- {cirq_core-1.2.0.dev20230421134537.dist-info → cirq_core-1.2.0.dev20230422220059.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.2.0.
|
|
1
|
+
__version__ = "1.2.0.dev20230422220059"
|
cirq/devices/grid_qubit.py
CHANGED
|
@@ -45,13 +45,13 @@ class _BaseGridQid(ops.Qid):
|
|
|
45
45
|
return self._col
|
|
46
46
|
|
|
47
47
|
def with_dimension(self, dimension: int) -> 'GridQid':
|
|
48
|
-
return GridQid(self.
|
|
48
|
+
return GridQid(self._row, self._col, dimension=dimension)
|
|
49
49
|
|
|
50
50
|
def is_adjacent(self, other: 'cirq.Qid') -> bool:
|
|
51
51
|
"""Determines if two qubits are adjacent qubits."""
|
|
52
52
|
return (
|
|
53
53
|
isinstance(other, GridQubit)
|
|
54
|
-
and abs(self.
|
|
54
|
+
and abs(self._row - other._row) + abs(self._col - other._col) == 1
|
|
55
55
|
)
|
|
56
56
|
|
|
57
57
|
def neighbors(self, qids: Optional[Iterable[ops.Qid]] = None) -> Set['_BaseGridQid']:
|
|
@@ -71,7 +71,7 @@ class _BaseGridQid(ops.Qid):
|
|
|
71
71
|
"""Returns a qid with the same type but a different coordinate."""
|
|
72
72
|
|
|
73
73
|
def __complex__(self) -> complex:
|
|
74
|
-
return self.
|
|
74
|
+
return self._col + 1j * self._row
|
|
75
75
|
|
|
76
76
|
def __add__(self, other: Union[Tuple[int, int], Self]) -> Self:
|
|
77
77
|
if isinstance(other, _BaseGridQid):
|
|
@@ -80,7 +80,7 @@ class _BaseGridQid(ops.Qid):
|
|
|
80
80
|
"Can only add GridQids with identical dimension. "
|
|
81
81
|
f"Got {self.dimension} and {other.dimension}"
|
|
82
82
|
)
|
|
83
|
-
return self._with_row_col(row=self.
|
|
83
|
+
return self._with_row_col(row=self._row + other._row, col=self._col + other._col)
|
|
84
84
|
if not (
|
|
85
85
|
isinstance(other, (tuple, np.ndarray))
|
|
86
86
|
and len(other) == 2
|
|
@@ -90,7 +90,7 @@ class _BaseGridQid(ops.Qid):
|
|
|
90
90
|
'Can only add integer tuples of length 2 to '
|
|
91
91
|
f'{type(self).__name__}. Instead was {other}'
|
|
92
92
|
)
|
|
93
|
-
return self._with_row_col(row=self.
|
|
93
|
+
return self._with_row_col(row=self._row + other[0], col=self._col + other[1])
|
|
94
94
|
|
|
95
95
|
def __sub__(self, other: Union[Tuple[int, int], Self]) -> Self:
|
|
96
96
|
if isinstance(other, _BaseGridQid):
|
|
@@ -99,7 +99,7 @@ class _BaseGridQid(ops.Qid):
|
|
|
99
99
|
"Can only subtract GridQids with identical dimension. "
|
|
100
100
|
f"Got {self.dimension} and {other.dimension}"
|
|
101
101
|
)
|
|
102
|
-
return self._with_row_col(row=self.
|
|
102
|
+
return self._with_row_col(row=self._row - other._row, col=self._col - other._col)
|
|
103
103
|
if not (
|
|
104
104
|
isinstance(other, (tuple, np.ndarray))
|
|
105
105
|
and len(other) == 2
|
|
@@ -109,7 +109,7 @@ class _BaseGridQid(ops.Qid):
|
|
|
109
109
|
"Can only subtract integer tuples of length 2 to "
|
|
110
110
|
f"{type(self).__name__}. Instead was {other}"
|
|
111
111
|
)
|
|
112
|
-
return self._with_row_col(row=self.
|
|
112
|
+
return self._with_row_col(row=self._row - other[0], col=self._col - other[1])
|
|
113
113
|
|
|
114
114
|
def __radd__(self, other: Tuple[int, int]) -> Self:
|
|
115
115
|
return self + other
|
|
@@ -118,7 +118,7 @@ class _BaseGridQid(ops.Qid):
|
|
|
118
118
|
return -self + other
|
|
119
119
|
|
|
120
120
|
def __neg__(self) -> Self:
|
|
121
|
-
return self._with_row_col(row=-self.
|
|
121
|
+
return self._with_row_col(row=-self._row, col=-self._col)
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
class GridQid(_BaseGridQid):
|
|
@@ -255,16 +255,16 @@ class GridQid(_BaseGridQid):
|
|
|
255
255
|
return [GridQid(*c, dimension=dimension) for c in coords]
|
|
256
256
|
|
|
257
257
|
def __repr__(self) -> str:
|
|
258
|
-
return f"cirq.GridQid({self.
|
|
258
|
+
return f"cirq.GridQid({self._row}, {self._col}, dimension={self.dimension})"
|
|
259
259
|
|
|
260
260
|
def __str__(self) -> str:
|
|
261
|
-
return f"q({self.
|
|
261
|
+
return f"q({self._row}, {self._col}) (d={self.dimension})"
|
|
262
262
|
|
|
263
263
|
def _circuit_diagram_info_(
|
|
264
264
|
self, args: 'cirq.CircuitDiagramInfoArgs'
|
|
265
265
|
) -> 'cirq.CircuitDiagramInfo':
|
|
266
266
|
return protocols.CircuitDiagramInfo(
|
|
267
|
-
wire_symbols=(f"({self.
|
|
267
|
+
wire_symbols=(f"({self._row}, {self._col}) (d={self.dimension})",)
|
|
268
268
|
)
|
|
269
269
|
|
|
270
270
|
def _json_dict_(self) -> Dict[str, Any]:
|
|
@@ -305,13 +305,13 @@ class GridQubit(_BaseGridQid):
|
|
|
305
305
|
def __eq__(self, other):
|
|
306
306
|
# Explicitly implemented for performance (vs delegating to Qid).
|
|
307
307
|
if isinstance(other, GridQubit):
|
|
308
|
-
return self.
|
|
308
|
+
return self._row == other._row and self._col == other._col
|
|
309
309
|
return NotImplemented
|
|
310
310
|
|
|
311
311
|
def __ne__(self, other):
|
|
312
312
|
# Explicitly implemented for performance (vs delegating to Qid).
|
|
313
313
|
if isinstance(other, GridQubit):
|
|
314
|
-
return self.
|
|
314
|
+
return self._row != other._row or self._col != other._col
|
|
315
315
|
return NotImplemented
|
|
316
316
|
|
|
317
317
|
@property
|
|
@@ -412,15 +412,15 @@ class GridQubit(_BaseGridQid):
|
|
|
412
412
|
return [GridQubit(*c) for c in coords]
|
|
413
413
|
|
|
414
414
|
def __repr__(self) -> str:
|
|
415
|
-
return f"cirq.GridQubit({self.
|
|
415
|
+
return f"cirq.GridQubit({self._row}, {self._col})"
|
|
416
416
|
|
|
417
417
|
def __str__(self) -> str:
|
|
418
|
-
return f"q({self.
|
|
418
|
+
return f"q({self._row}, {self._col})"
|
|
419
419
|
|
|
420
420
|
def _circuit_diagram_info_(
|
|
421
421
|
self, args: 'cirq.CircuitDiagramInfoArgs'
|
|
422
422
|
) -> 'cirq.CircuitDiagramInfo':
|
|
423
|
-
return protocols.CircuitDiagramInfo(wire_symbols=(f"({self.
|
|
423
|
+
return protocols.CircuitDiagramInfo(wire_symbols=(f"({self._row}, {self._col})",))
|
|
424
424
|
|
|
425
425
|
def _json_dict_(self) -> Dict[str, Any]:
|
|
426
426
|
return protocols.obj_to_dict_helper(self, ['row', 'col'])
|
cirq/vis/heatmap_test.py
CHANGED
|
@@ -97,7 +97,7 @@ def test_cell_colors(ax, colormap_name):
|
|
|
97
97
|
)
|
|
98
98
|
_, mesh = random_heatmap.plot(ax)
|
|
99
99
|
|
|
100
|
-
colormap = mpl.
|
|
100
|
+
colormap = mpl.colormaps[colormap_name]
|
|
101
101
|
for path, facecolor in zip(mesh.get_paths(), mesh.get_facecolors()):
|
|
102
102
|
vertices = path.vertices[0:4]
|
|
103
103
|
row = int(round(np.mean([v[1] for v in vertices])))
|
|
@@ -218,7 +218,7 @@ def test_non_float_values(ax, format_string):
|
|
|
218
218
|
|
|
219
219
|
_, mesh = random_heatmap.plot(ax)
|
|
220
220
|
|
|
221
|
-
colormap = mpl.
|
|
221
|
+
colormap = mpl.colormaps[colormap_name]
|
|
222
222
|
for path, facecolor in zip(mesh.get_paths(), mesh.get_facecolors()):
|
|
223
223
|
vertices = path.vertices[0:4]
|
|
224
224
|
row = int(round(np.mean([v[1] for v in vertices])))
|
{cirq_core-1.2.0.dev20230421134537.dist-info → cirq_core-1.2.0.dev20230422220059.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cirq-core
|
|
3
|
-
Version: 1.2.0.
|
|
3
|
+
Version: 1.2.0.dev20230422220059
|
|
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.2.0.dev20230421134537.dist-info → cirq_core-1.2.0.dev20230422220059.dist-info}/RECORD
RENAMED
|
@@ -4,7 +4,7 @@ cirq/_compat_test.py,sha256=715FwOmqB8ZFhREgMHckalA0txpGgOMfien8c5o1h0U,34178
|
|
|
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=
|
|
7
|
+
cirq/_version.py,sha256=FHhqojNkVli17fLfl4l72gO51F6yokVkVx3y5EB6oSU,40
|
|
8
8
|
cirq/_version_test.py,sha256=ZM9GLAiU02rzyJQ_HOT2o_tZixJ0lMXs4tCkOareqTA,133
|
|
9
9
|
cirq/conftest.py,sha256=mHCDs5--u17oLFDAfIlkTS4TRGSc35eLnZ2CXuIuB7I,1175
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=RIHbAhGsww7jqhU59vi7nYI7yFP_GJidO8VbfrQM_os,13028
|
|
@@ -155,7 +155,7 @@ cirq/devices/device.py,sha256=9rUZwpbbmqk8AUVH4N4KfJ59j5im7hVgDJAHtN9iH_0,5361
|
|
|
155
155
|
cirq/devices/device_test.py,sha256=v3gT6jrGLLfYnZbTizIaIMkI3s5_xVM3OV9JQchvAxY,1124
|
|
156
156
|
cirq/devices/grid_device_metadata.py,sha256=h4Xo_PaiZqQSVUgb1ctVtYYYE2tNik2KQhCgooilZrE,8629
|
|
157
157
|
cirq/devices/grid_device_metadata_test.py,sha256=IeOqYOZcUGhB4ivuQW2g0Q9dt-zFA0H6Dav6yv6Lul0,8592
|
|
158
|
-
cirq/devices/grid_qubit.py,sha256=
|
|
158
|
+
cirq/devices/grid_qubit.py,sha256=GgovxTSJMia58U2MLx45DN7Xi2srXbzKYqAdlm5l1S4,15804
|
|
159
159
|
cirq/devices/grid_qubit_test.py,sha256=3s_ZqcxR5Rhxd1KsllnYJb_fM2SaP3rthJOddl7p3fw,12968
|
|
160
160
|
cirq/devices/insertion_noise_model.py,sha256=e_29kwFYb7k7fEBjHjfhfgE73bofMOG4gWC0DoH1_-Q,2907
|
|
161
161
|
cirq/devices/insertion_noise_model_test.py,sha256=QJxIjmdxqJU-cHf7aQghWhHnklZY9JtOlvsbPAjOLkI,3848
|
|
@@ -1100,7 +1100,7 @@ cirq/vis/__init__.py,sha256=e3Z1PI-Ay0hDHhIgFZEDwQIuO8C_aayNdL-EByF0J4o,1001
|
|
|
1100
1100
|
cirq/vis/density_matrix.py,sha256=kMAPcRh6f0ghZKSe86nB_2iFngrDsw0pNael1EZ5BEw,4819
|
|
1101
1101
|
cirq/vis/density_matrix_test.py,sha256=Xg41NQZBfoyrkaX3n9pW4q1LIxWpOW3Cr_I_Wx51GlQ,6965
|
|
1102
1102
|
cirq/vis/heatmap.py,sha256=mn0AnrAQQvnzpIDTXQF5WcULuQEelq0lZlvNkr3o2bw,16071
|
|
1103
|
-
cirq/vis/heatmap_test.py,sha256=
|
|
1103
|
+
cirq/vis/heatmap_test.py,sha256=pk3-IpkbDBb75smvlyNp5_rn3YVeXIQgDRZ5xhFg-3c,13231
|
|
1104
1104
|
cirq/vis/histogram.py,sha256=xqgy77nF0vyBjeul83G0yH_e342ecqpWu2RlwVIGEAo,5061
|
|
1105
1105
|
cirq/vis/histogram_test.py,sha256=Qlw0e3amw_MFga-hNweiLzRCH174W9bB2qkmX_RiS-U,1904
|
|
1106
1106
|
cirq/vis/state_histogram.py,sha256=hKU7frKG2wdXsrQjZu0-Fz1FqmAC-IVhS4ieArqN1ec,4208
|
|
@@ -1126,8 +1126,8 @@ cirq/work/sampler.py,sha256=JVv1vvfa6EgFiR3UeDk44U186dCrioH2NZXueCgsb9w,19828
|
|
|
1126
1126
|
cirq/work/sampler_test.py,sha256=zo1Hj6sn6fLs_WZMxYRApBqgBsldmptn74NL0jhNukc,12325
|
|
1127
1127
|
cirq/work/zeros_sampler.py,sha256=D3hbNZC-jXKuNAWg2OUiUuT8pmDV_WFnEfMank6In4o,2357
|
|
1128
1128
|
cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
|
|
1129
|
-
cirq_core-1.2.0.
|
|
1130
|
-
cirq_core-1.2.0.
|
|
1131
|
-
cirq_core-1.2.0.
|
|
1132
|
-
cirq_core-1.2.0.
|
|
1133
|
-
cirq_core-1.2.0.
|
|
1129
|
+
cirq_core-1.2.0.dev20230422220059.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1130
|
+
cirq_core-1.2.0.dev20230422220059.dist-info/METADATA,sha256=OsM4hIA3AcRKfZTOw0J9fzJ306_0zZEH8gcSZyr7-wc,2155
|
|
1131
|
+
cirq_core-1.2.0.dev20230422220059.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
1132
|
+
cirq_core-1.2.0.dev20230422220059.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1133
|
+
cirq_core-1.2.0.dev20230422220059.dist-info/RECORD,,
|
{cirq_core-1.2.0.dev20230421134537.dist-info → cirq_core-1.2.0.dev20230422220059.dist-info}/LICENSE
RENAMED
|
File without changes
|
{cirq_core-1.2.0.dev20230421134537.dist-info → cirq_core-1.2.0.dev20230422220059.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|