cirq-core 1.5.0.dev20250102031424__py3-none-any.whl → 1.5.0.dev20250102032600__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 CHANGED
@@ -28,4 +28,4 @@ if sys.version_info < (3, 10, 0): # pragma: no cover
28
28
  'of cirq (e.g. "python -m pip install cirq==1.1.*")'
29
29
  )
30
30
 
31
- __version__ = "1.5.0.dev20250102031424"
31
+ __version__ = "1.5.0.dev20250102032600"
cirq/_version_test.py CHANGED
@@ -3,4 +3,4 @@ import cirq
3
3
 
4
4
 
5
5
  def test_version():
6
- assert cirq.__version__ == "1.5.0.dev20250102031424"
6
+ assert cirq.__version__ == "1.5.0.dev20250102032600"
cirq/protocols/qasm.py CHANGED
@@ -151,7 +151,7 @@ def qasm(
151
151
  involving qubits that the operation wouldn't otherwise know about.
152
152
  qubits: A list of qubits that the value is being applied to. This is
153
153
  needed for `cirq.Gate` values, which otherwise wouldn't know what
154
- qubits to talk about.
154
+ qubits to talk about. It should generally not be specified otherwise.
155
155
  default: A default result to use if the value doesn't have a
156
156
  `_qasm_` method or that method returns `NotImplemented` or `None`.
157
157
  If not specified, non-decomposable values cause a `TypeError`.
@@ -172,10 +172,16 @@ def qasm(
172
172
  kwargs: Dict[str, Any] = {}
173
173
  if args is not None:
174
174
  kwargs['args'] = args
175
+ # pylint: disable=not-callable
175
176
  if qubits is not None:
176
177
  kwargs['qubits'] = tuple(qubits)
177
- # pylint: disable=not-callable
178
- result = method(**kwargs)
178
+ try:
179
+ result = method(**kwargs)
180
+ except TypeError as error:
181
+ raise TypeError(
182
+ "cirq.qasm does not expect qubits or args to be specified"
183
+ f"for the given value of type {type(val)}."
184
+ ) from error
179
185
  # pylint: enable=not-callable
180
186
  if result is not None and result is not NotImplemented:
181
187
  return result
@@ -54,6 +54,11 @@ def test_qasm():
54
54
  assert cirq.qasm(ExpectsArgsQubits(), args=cirq.QasmArgs(), qubits=()) == 'text'
55
55
 
56
56
 
57
+ def test_qasm_qubits_improperly_supplied():
58
+ with pytest.raises(TypeError, match="does not expect qubits or args to be specified"):
59
+ _ = cirq.qasm(cirq.Circuit(), qubits=[cirq.LineQubit(1)])
60
+
61
+
57
62
  def test_qasm_args_formatting():
58
63
  args = cirq.QasmArgs()
59
64
  assert args.format_field(0.01, '') == '0.01'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.5.0.dev20250102031424
3
+ Version: 1.5.0.dev20250102032600
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,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=5pWmfxDp4iN4kw_7jAavnRAesEFgnkeMTB0U1IHsxbk,1206
8
- cirq/_version_test.py,sha256=1k0ZzJtAwKVheUlL8kw8ZHX8K5lp2F0KiQYxV533MSs,147
7
+ cirq/_version.py,sha256=J0r5SOn_ANC11d5zrAPyjHHvRUEV09wGAkLtD7X9Ys0,1206
8
+ cirq/_version_test.py,sha256=aEJgmUVMrQnnHdSVCrH9FeJ0sdS_gJr4MrLK1cYKTa0,147
9
9
  cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
10
10
  cirq/json_resolver_cache.py,sha256=03MVo6Y-UYrzt9CKHmwpiBLN2ixL6uSU-OWnKZXfG7k,13302
11
11
  cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
@@ -419,8 +419,8 @@ cirq/protocols/phase_protocol.py,sha256=dXZRJb7aT8ZvtliItZOvoiaev-QvjBT4SknwZ5p-
419
419
  cirq/protocols/phase_protocol_test.py,sha256=eU4g6VDqfWZCpklVlY1t5msc5kAZsP-UlPrROLll_ms,1939
420
420
  cirq/protocols/pow_protocol.py,sha256=0wgb4LLAkOWjmP_u-_6IweXovDViocbdSgtsMOcXdkM,3290
421
421
  cirq/protocols/pow_protocol_test.py,sha256=8eBcGUqRWSSYkEkvSHXL6tcv1o-ilnl6nzgNl9vfctg,1626
422
- cirq/protocols/qasm.py,sha256=gvJNuqHfz2asDpysrCmTUPkaJUMfDarumsZlXqMvn5g,7116
423
- cirq/protocols/qasm_test.py,sha256=MFkqSHByCbB46XOlAJgKQgEpANVwnmfO-tD-XofqrQ4,2013
422
+ cirq/protocols/qasm.py,sha256=5i9_hznujNQ96dNipsBd7gy9B3p2SKlXk3VMTEBh-RY,7406
423
+ cirq/protocols/qasm_test.py,sha256=O6QdL45eEPigqzy_oLB_CjFSQhtKUBmCtQWNdk7j8Zg,2216
424
424
  cirq/protocols/qid_shape_protocol.py,sha256=jCAdpBBkEyK6JGmZwVBp__lHW3JhLmYt0Qzf8OgZtNU,7690
425
425
  cirq/protocols/qid_shape_protocol_test.py,sha256=Qjo-wemjkP__1jQnVkkB91mUs8EpfXyKI9GzeZQVb1E,2303
426
426
  cirq/protocols/resolve_parameters.py,sha256=NVFS5PSq18Hcvjv_P6vaZIa2D4OCgZY1u5j6QgPMlTA,7374
@@ -1189,8 +1189,8 @@ cirq/work/sampler.py,sha256=bE5tmVkcR6cZZMLETxDfHehdsYUMbx2RvBeIBetehI4,19187
1189
1189
  cirq/work/sampler_test.py,sha256=hL2UWx3dz2ukZVNxWftiKVvJcQoLplLZdQm-k1QcA40,13282
1190
1190
  cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
1191
1191
  cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
1192
- cirq_core-1.5.0.dev20250102031424.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1193
- cirq_core-1.5.0.dev20250102031424.dist-info/METADATA,sha256=equ_3gS9FNaDWX50ZAcWEUz0X6CWWqLrKSjM-gLvt0Y,1992
1194
- cirq_core-1.5.0.dev20250102031424.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1195
- cirq_core-1.5.0.dev20250102031424.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1196
- cirq_core-1.5.0.dev20250102031424.dist-info/RECORD,,
1192
+ cirq_core-1.5.0.dev20250102032600.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1193
+ cirq_core-1.5.0.dev20250102032600.dist-info/METADATA,sha256=WoEJv1juOxa6z-_njCWMj9FJErh6l6ZzYzSRdsG8CeU,1992
1194
+ cirq_core-1.5.0.dev20250102032600.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1195
+ cirq_core-1.5.0.dev20250102032600.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1196
+ cirq_core-1.5.0.dev20250102032600.dist-info/RECORD,,