cirq-core 1.3.0.dev20230818204552__py3-none-any.whl → 1.3.0.dev20230823201251__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.3.0.dev20230818204552"
1
+ __version__ = "1.3.0.dev20230823201251"
@@ -113,7 +113,7 @@ def _register_resolver(dict_factory: Callable[[], Dict[str, ObjectFactory]]) ->
113
113
  class SupportsJSON(Protocol):
114
114
  """An object that can be turned into JSON dictionaries.
115
115
 
116
- The magic method _json_dict_ must return a trivially json-serializable
116
+ The magic method `_json_dict_` must return a trivially json-serializable
117
117
  type or other objects that support the SupportsJSON protocol.
118
118
 
119
119
  During deserialization, a class must be able to be resolved (see
@@ -150,7 +150,7 @@ def obj_to_dict_helper(obj: Any, attribute_names: Iterable[str]) -> Dict[str, An
150
150
  """Construct a dictionary containing attributes from obj
151
151
 
152
152
  This is useful as a helper function in objects implementing the
153
- SupportsJSON protocol, particularly in the _json_dict_ method.
153
+ SupportsJSON protocol, particularly in the `_json_dict_` method.
154
154
 
155
155
  In addition to keys and values specified by `attribute_names`, the
156
156
  returned dictionary has an additional key "cirq_type" whose value
@@ -169,7 +169,7 @@ def obj_to_dict_helper(obj: Any, attribute_names: Iterable[str]) -> Dict[str, An
169
169
 
170
170
  # pylint: enable=redefined-builtin
171
171
  def dataclass_json_dict(obj: Any) -> Dict[str, Any]:
172
- """Return a dictionary suitable for _json_dict_ from a dataclass.
172
+ """Return a dictionary suitable for `_json_dict_` from a dataclass.
173
173
 
174
174
  Dataclasses keep track of their relevant fields, so we can automatically generate these.
175
175
 
@@ -607,7 +607,7 @@ def to_json(
607
607
  cls: Passed to json.dump; the default value of CirqEncoder
608
608
  enables the serialization of Cirq objects which implement
609
609
  the SupportsJSON protocol. To support serialization of 3rd
610
- party classes, prefer adding the _json_dict_ magic method
610
+ party classes, prefer adding the `_json_dict_` magic method
611
611
  to your classes rather than overriding this default.
612
612
  """
613
613
  if has_serializable_by_keys(obj):
cirq/vis/heatmap_test.py CHANGED
@@ -105,10 +105,8 @@ def test_cell_colors(ax, colormap_name):
105
105
  col = int(round(np.mean([v[0] for v in vertices])))
106
106
  value = test_row_col_map[(row, col)]
107
107
  color_scale = (value - vmin) / (vmax - vmin)
108
- if color_scale < 0.0:
109
- color_scale = 0.0
110
- if color_scale > 1.0:
111
- color_scale = 1.0
108
+ color_scale = max(color_scale, 0.0)
109
+ color_scale = min(color_scale, 1.0)
112
110
  expected_color = np.array(colormap(color_scale))
113
111
  assert np.all(np.isclose(facecolor, expected_color))
114
112
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.3.0.dev20230818204552
3
+ Version: 1.3.0.dev20230823201251
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=84X6ELsb5fv3Hc0_ly8-IQfMnCNQN6tHs6GZFrnuNyI,35005
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=zBZ8gLnzjmsu6SN7b1vlOPmvqrWNr7-chc9YvIPjccs,40
7
+ cirq/_version.py,sha256=ZlDSlGVqNNDEWU511dSepDZPr_kVdKhcmq-FK03YPC0,40
8
8
  cirq/_version_test.py,sha256=Ea3ZNdQKZBsZrSc9xle7TUdT9bUINs-qezPruQ_m38s,133
9
9
  cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
10
10
  cirq/json_resolver_cache.py,sha256=JJiO1dhHsEqYClUv68eg-hiOzbb_C1QiQ-BCcvoe4Ck,13067
@@ -395,7 +395,7 @@ cirq/protocols/has_unitary_protocol.py,sha256=inj17qr8Pz2Zofj0Lsp2o7TWlfmdU1Tybt
395
395
  cirq/protocols/has_unitary_protocol_test.py,sha256=IjmJ3dqvteFUUO4FLwCTokgUvYy8H2HJjLmTDzt2__Q,5610
396
396
  cirq/protocols/inverse_protocol.py,sha256=CEqtGRRj86WQyyALonRXxQrNq-fENOs_Zqrlr_BVau8,4115
397
397
  cirq/protocols/inverse_protocol_test.py,sha256=pqqIU4_G4Npc9Z-SeoM9eCB2T5JRTeI02NCXhP0UtaI,2017
398
- cirq/protocols/json_serialization.py,sha256=T3bslX3lolYjPX-A66nGJRS20XFSFots38N0k1bTE7g,29266
398
+ cirq/protocols/json_serialization.py,sha256=DVgbYQBYlPVV50gidAIDuRJn3griTkD-PDJiJTAgxe8,29274
399
399
  cirq/protocols/json_serialization_test.py,sha256=6gl_rtChOJiGmBtkUqByFKLOBgfNp_H1tkLWcj2njn0,28783
400
400
  cirq/protocols/kraus_protocol.py,sha256=GKQ748yxo6B6i0jUzq8OyR6lcEFYbh4FV2UryjUgSuk,9158
401
401
  cirq/protocols/kraus_protocol_test.py,sha256=QpPwkk7XBiGKNdrOcjXqtvhESVbUzujnUPz47uUNyqc,5401
@@ -1114,7 +1114,7 @@ cirq/vis/__init__.py,sha256=e3Z1PI-Ay0hDHhIgFZEDwQIuO8C_aayNdL-EByF0J4o,1001
1114
1114
  cirq/vis/density_matrix.py,sha256=kMAPcRh6f0ghZKSe86nB_2iFngrDsw0pNael1EZ5BEw,4819
1115
1115
  cirq/vis/density_matrix_test.py,sha256=Xg41NQZBfoyrkaX3n9pW4q1LIxWpOW3Cr_I_Wx51GlQ,6965
1116
1116
  cirq/vis/heatmap.py,sha256=sNLjAyebdO1vLbugySsIHe61TfvBIsZA9qgd3XbvZWE,16072
1117
- cirq/vis/heatmap_test.py,sha256=u0P1fkTG51_hKG4cr77CZgsI7CVv-zy9n_cpxL04lUQ,13272
1117
+ cirq/vis/heatmap_test.py,sha256=kS8kvIWH6SCjQVOEQ_xRWmjlmtaP-2pUcRcNxqF4kWI,13240
1118
1118
  cirq/vis/histogram.py,sha256=xqgy77nF0vyBjeul83G0yH_e342ecqpWu2RlwVIGEAo,5061
1119
1119
  cirq/vis/histogram_test.py,sha256=Qlw0e3amw_MFga-hNweiLzRCH174W9bB2qkmX_RiS-U,1904
1120
1120
  cirq/vis/state_histogram.py,sha256=hKU7frKG2wdXsrQjZu0-Fz1FqmAC-IVhS4ieArqN1ec,4208
@@ -1140,8 +1140,8 @@ cirq/work/sampler.py,sha256=JVv1vvfa6EgFiR3UeDk44U186dCrioH2NZXueCgsb9w,19828
1140
1140
  cirq/work/sampler_test.py,sha256=zo1Hj6sn6fLs_WZMxYRApBqgBsldmptn74NL0jhNukc,12325
1141
1141
  cirq/work/zeros_sampler.py,sha256=D3hbNZC-jXKuNAWg2OUiUuT8pmDV_WFnEfMank6In4o,2357
1142
1142
  cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
1143
- cirq_core-1.3.0.dev20230818204552.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1144
- cirq_core-1.3.0.dev20230818204552.dist-info/METADATA,sha256=KoqTVd0KOIHR_U_jqan5bCzpHPdm7mHqGg7Jgqy6dZ0,2077
1145
- cirq_core-1.3.0.dev20230818204552.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
1146
- cirq_core-1.3.0.dev20230818204552.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1147
- cirq_core-1.3.0.dev20230818204552.dist-info/RECORD,,
1143
+ cirq_core-1.3.0.dev20230823201251.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1144
+ cirq_core-1.3.0.dev20230823201251.dist-info/METADATA,sha256=SppzyxHfficNPSyKqGbYAYpiaenkKsRYR8bNeSNPEJ4,2077
1145
+ cirq_core-1.3.0.dev20230823201251.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
1146
+ cirq_core-1.3.0.dev20230823201251.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1147
+ cirq_core-1.3.0.dev20230823201251.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.1)
2
+ Generator: bdist_wheel (0.41.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5