cirq-core 1.5.0.dev20241119054807__py3-none-any.whl → 1.5.0.dev20241119223926__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/circuits/moment.py +5 -2
- cirq/circuits/moment_test.py +8 -0
- {cirq_core-1.5.0.dev20241119054807.dist-info → cirq_core-1.5.0.dev20241119223926.dist-info}/METADATA +1 -1
- {cirq_core-1.5.0.dev20241119054807.dist-info → cirq_core-1.5.0.dev20241119223926.dist-info}/RECORD +9 -9
- {cirq_core-1.5.0.dev20241119054807.dist-info → cirq_core-1.5.0.dev20241119223926.dist-info}/LICENSE +0 -0
- {cirq_core-1.5.0.dev20241119054807.dist-info → cirq_core-1.5.0.dev20241119223926.dist-info}/WHEEL +0 -0
- {cirq_core-1.5.0.dev20241119054807.dist-info → cirq_core-1.5.0.dev20241119223926.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
cirq/_version_test.py
CHANGED
cirq/circuits/moment.py
CHANGED
|
@@ -275,8 +275,11 @@ class Moment:
|
|
|
275
275
|
resolved_ops: List['cirq.Operation'] = []
|
|
276
276
|
for op in self:
|
|
277
277
|
resolved_op = protocols.resolve_parameters(op, resolver, recursive)
|
|
278
|
-
|
|
279
|
-
changed
|
|
278
|
+
changed = (
|
|
279
|
+
changed
|
|
280
|
+
or resolved_op != op
|
|
281
|
+
or (protocols.is_parameterized(op) and not protocols.is_parameterized(resolved_op))
|
|
282
|
+
)
|
|
280
283
|
resolved_ops.append(resolved_op)
|
|
281
284
|
if not changed:
|
|
282
285
|
return self
|
cirq/circuits/moment_test.py
CHANGED
|
@@ -294,6 +294,14 @@ def test_resolve_parameters():
|
|
|
294
294
|
moment = cirq.Moment(cirq.X(a) ** sympy.Symbol('v'), cirq.Y(b) ** sympy.Symbol('w'))
|
|
295
295
|
resolved_moment = cirq.resolve_parameters(moment, cirq.ParamResolver({'v': 0.1, 'w': 0.2}))
|
|
296
296
|
assert resolved_moment == cirq.Moment(cirq.X(a) ** 0.1, cirq.Y(b) ** 0.2)
|
|
297
|
+
# sympy constant is resolved to a Python number
|
|
298
|
+
moment = cirq.Moment(cirq.Rz(rads=sympy.pi).on(a))
|
|
299
|
+
resolved_moment = cirq.resolve_parameters(moment, {'pi': np.pi})
|
|
300
|
+
assert resolved_moment == cirq.Moment(cirq.Rz(rads=np.pi).on(a))
|
|
301
|
+
resolved_gate = resolved_moment.operations[0].gate
|
|
302
|
+
assert not isinstance(resolved_gate.exponent, sympy.Basic)
|
|
303
|
+
assert isinstance(resolved_gate.exponent, float)
|
|
304
|
+
assert not cirq.is_parameterized(resolved_moment)
|
|
297
305
|
|
|
298
306
|
|
|
299
307
|
def test_resolve_parameters_no_change():
|
{cirq_core-1.5.0.dev20241119054807.dist-info → cirq_core-1.5.0.dev20241119223926.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.dev20241119223926
|
|
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.dev20241119054807.dist-info → cirq_core-1.5.0.dev20241119223926.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=9y5f1LhKItLYHaYBKjGOwHh5SpfBbVocT4jux2f4_U4,1206
|
|
8
|
+
cirq/_version_test.py,sha256=1lfacwQjW9VvphpGAdUk2rqmac9ohjeSxB9kJ701gOg,147
|
|
9
9
|
cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
|
|
10
10
|
cirq/json_resolver_cache.py,sha256=ytePZtNZgKjOF2NiVpUTuotB-JKZmQNOFIFdvXqsxHw,13271
|
|
11
11
|
cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
|
|
@@ -24,8 +24,8 @@ cirq/circuits/frozen_circuit.py,sha256=qSbLHqIszCbVipNZQy4N829v_mWf8N2926cYRzpxG
|
|
|
24
24
|
cirq/circuits/frozen_circuit_test.py,sha256=rHyii8hLhOQ6jdA8dC1OcYPGnyeBC4uY5Q53XspkkCk,4133
|
|
25
25
|
cirq/circuits/insert_strategy.py,sha256=L0OLXuo24TtBfdJGOAG2PsVDMrbvQl4iN5lUk6IPuyo,2851
|
|
26
26
|
cirq/circuits/insert_strategy_test.py,sha256=dgz13_ssa_GWqzzx5W4G4sJJw4SUHC3-g3K0_Z4TRiA,686
|
|
27
|
-
cirq/circuits/moment.py,sha256=
|
|
28
|
-
cirq/circuits/moment_test.py,sha256=
|
|
27
|
+
cirq/circuits/moment.py,sha256=MskIVl5jbGnZdKKLNWbrQhWI5FHwjsuPOEm0hze8GDE,26299
|
|
28
|
+
cirq/circuits/moment_test.py,sha256=oNHNXhiPEoCKbzeh16tRwiW1qZWlg4X2O_uiVDP1D58,27375
|
|
29
29
|
cirq/circuits/optimization_pass.py,sha256=uw3ne0-ebZo6GNjwfQMuQ3b5u9RCgyaXRfhpbljlxao,6468
|
|
30
30
|
cirq/circuits/optimization_pass_test.py,sha256=eQB0NBJ9EvqjgSFGQMgaHIh5niQhksdnvqSXhsj3nOg,5947
|
|
31
31
|
cirq/circuits/qasm_output.py,sha256=RrqtLmGHRcKaHIJPT0ZGIK8aC5mrixE_D8nhDUVMPNE,12441
|
|
@@ -1187,8 +1187,8 @@ cirq/work/sampler.py,sha256=y6qtCpAwO8SqZ_JKU8PwlbMLHpJskNPqGWD_pNbyZew,19779
|
|
|
1187
1187
|
cirq/work/sampler_test.py,sha256=hL2UWx3dz2ukZVNxWftiKVvJcQoLplLZdQm-k1QcA40,13282
|
|
1188
1188
|
cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
|
|
1189
1189
|
cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
|
|
1190
|
-
cirq_core-1.5.0.
|
|
1191
|
-
cirq_core-1.5.0.
|
|
1192
|
-
cirq_core-1.5.0.
|
|
1193
|
-
cirq_core-1.5.0.
|
|
1194
|
-
cirq_core-1.5.0.
|
|
1190
|
+
cirq_core-1.5.0.dev20241119223926.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1191
|
+
cirq_core-1.5.0.dev20241119223926.dist-info/METADATA,sha256=twulATMccRuzvnk2gGGsmWC5vEGQqtV-NhSODd33c8E,1992
|
|
1192
|
+
cirq_core-1.5.0.dev20241119223926.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
|
|
1193
|
+
cirq_core-1.5.0.dev20241119223926.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1194
|
+
cirq_core-1.5.0.dev20241119223926.dist-info/RECORD,,
|
{cirq_core-1.5.0.dev20241119054807.dist-info → cirq_core-1.5.0.dev20241119223926.dist-info}/LICENSE
RENAMED
|
File without changes
|
{cirq_core-1.5.0.dev20241119054807.dist-info → cirq_core-1.5.0.dev20241119223926.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|