cirq-core 1.2.0.dev20230421171826__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 CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.0.dev20230421171826"
1
+ __version__ = "1.2.0.dev20230422220059"
@@ -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.row, self.col, dimension=dimension)
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.row - other.row) + abs(self.col - other.col) == 1
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.col + 1j * self.row
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.row + other.row, col=self.col + other.col)
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.row + other[0], col=self.col + other[1])
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.row - other.row, col=self.col - other.col)
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.row - other[0], col=self.col - other[1])
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.row, col=-self.col)
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.row}, {self.col}, dimension={self.dimension})"
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.row}, {self.col}) (d={self.dimension})"
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.row}, {self.col}) (d={self.dimension})",)
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.row == other.row and self.col == other.col
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.row != other.row or self.col != other.col
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.row}, {self.col})"
415
+ return f"cirq.GridQubit({self._row}, {self._col})"
416
416
 
417
417
  def __str__(self) -> str:
418
- return f"q({self.row}, {self.col})"
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.row}, {self.col})",))
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'])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.2.0.dev20230421171826
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
@@ -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=aYo-OWmBqZ9euXJWr9_NY-_PYX1BhuVYvfgel3mHw6k,40
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=lonQw8ye6ad9oyS721TAooHelQzN6SVLqMRk6VYFeiI,15762
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
@@ -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.dev20230421171826.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1130
- cirq_core-1.2.0.dev20230421171826.dist-info/METADATA,sha256=22FsPolclCJk6w6LpMWy1rNDLwQZUmKxhs_8ziNakX4,2155
1131
- cirq_core-1.2.0.dev20230421171826.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
1132
- cirq_core-1.2.0.dev20230421171826.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1133
- cirq_core-1.2.0.dev20230421171826.dist-info/RECORD,,
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,,