cirq-core 1.6.0.dev20250603221345__py3-none-any.whl → 1.6.0.dev20250604225156__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, 11, 0): # pragma: no cover
28
28
  'of cirq (e.g. "python -m pip install cirq==1.5.0")'
29
29
  )
30
30
 
31
- __version__ = "1.6.0.dev20250603221345"
31
+ __version__ = "1.6.0.dev20250604225156"
cirq/_version_test.py CHANGED
@@ -3,4 +3,4 @@ import cirq
3
3
 
4
4
 
5
5
  def test_version() -> None:
6
- assert cirq.__version__ == "1.6.0.dev20250603221345"
6
+ assert cirq.__version__ == "1.6.0.dev20250604225156"
@@ -19,6 +19,7 @@ from __future__ import annotations
19
19
  from typing import Sequence
20
20
 
21
21
  import numpy as np
22
+ import scipy.linalg
22
23
 
23
24
  import cirq
24
25
  from cirq import ops, transformers as opt
@@ -47,24 +48,13 @@ def three_qubit_matrix_to_operations(
47
48
 
48
49
  Raises:
49
50
  ValueError: If the u matrix is non-unitary or not of shape (8,8).
50
- ImportError: If the decomposition cannot be done because the SciPy version is less than
51
- 1.5.0 and so does not contain the required `cossin` method.
52
51
  """
53
52
  if np.shape(u) != (8, 8):
54
53
  raise ValueError(f"Expected unitary matrix with shape (8,8) got {np.shape(u)}")
55
54
  if not cirq.is_unitary(u, atol=atol):
56
55
  raise ValueError(f"Matrix is not unitary: {u}")
57
56
 
58
- try:
59
- from scipy.linalg import cossin
60
- except ImportError: # pragma: no cover
61
- raise ImportError(
62
- "cirq.three_qubit_unitary_to_operations requires "
63
- "SciPy 1.5.0+, as it uses the cossin function. Please"
64
- " upgrade scipy in your environment to use this "
65
- "function!"
66
- )
67
- (u1, u2), theta, (v1h, v2h) = cossin(u, 4, 4, separate=True)
57
+ (u1, u2), theta, (v1h, v2h) = scipy.linalg.cossin(u, 4, 4, separate=True)
68
58
 
69
59
  cs_ops = _cs_to_ops(q0, q1, q2, theta)
70
60
  if len(cs_ops) > 0 and cs_ops[-1] == cirq.CZ(q2, q0):
@@ -15,7 +15,6 @@
15
15
  from __future__ import annotations
16
16
 
17
17
  from random import random
18
- from typing import Callable
19
18
 
20
19
  import numpy as np
21
20
  import pytest
@@ -31,20 +30,6 @@ from cirq.transformers.analytical_decompositions.three_qubit_decomposition impor
31
30
  )
32
31
 
33
32
 
34
- def _skip_if_scipy(*, version_is_greater_than_1_5_0: bool) -> Callable[[Callable], Callable]:
35
- def decorator(func): # pragma: no cover
36
- try:
37
- # pylint: disable=unused-import
38
- from scipy.linalg import cossin
39
-
40
- return None if version_is_greater_than_1_5_0 else func
41
- except ImportError:
42
- return func if version_is_greater_than_1_5_0 else None
43
-
44
- return decorator
45
-
46
-
47
- @_skip_if_scipy(version_is_greater_than_1_5_0=False)
48
33
  @pytest.mark.parametrize(
49
34
  "u",
50
35
  [
@@ -70,7 +55,6 @@ def test_three_qubit_matrix_to_operations(u) -> None:
70
55
  assert num_two_qubit_gates <= 20, f"expected at most 20 CZ/CNOTs got {num_two_qubit_gates}"
71
56
 
72
57
 
73
- @_skip_if_scipy(version_is_greater_than_1_5_0=False)
74
58
  def test_three_qubit_matrix_to_operations_errors() -> None:
75
59
  a, b, c = cirq.LineQubit.range(3)
76
60
  with pytest.raises(ValueError, match="(8,8)"):
@@ -79,17 +63,6 @@ def test_three_qubit_matrix_to_operations_errors() -> None:
79
63
  cirq.three_qubit_matrix_to_operations(a, b, c, cirq.unitary(cirq.CCX) * 2)
80
64
 
81
65
 
82
- # on environments with scipy <1.5.0 this will not be sufficient to cover the
83
- # full three_qubit_matrix_to_operations method. In case we ever introduce a CI
84
- # environment like that, we'll need to ignore the coverage somehow conditionally on
85
- # the scipy version.
86
- @_skip_if_scipy(version_is_greater_than_1_5_0=True)
87
- def test_three_qubit_matrix_to_operations_scipy_error() -> None: # pragma: no cover
88
- a, b, c = cirq.LineQubit.range(3)
89
- with pytest.raises(ImportError, match="three_qubit.*1.5.0+"):
90
- cirq.three_qubit_matrix_to_operations(a, b, c, np.eye(8))
91
-
92
-
93
66
  @pytest.mark.parametrize(
94
67
  ["theta", "num_czs"],
95
68
  [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cirq-core
3
- Version: 1.6.0.dev20250603221345
3
+ Version: 1.6.0.dev20250604225156
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=ZSmenkbqEfRJpGsvutmV8vgIlfZCWj8GAVgi3t5YRso,34635
4
4
  cirq/_doc.py,sha256=BrnoABo1hk5RgB3Cgww4zLHUfiyFny0F1V-tOMCbdaU,2909
5
5
  cirq/_import.py,sha256=ixBu4EyGl46Ram2cP3p5eZVEFDW5L2DS-VyTjz4N9iw,8429
6
6
  cirq/_import_test.py,sha256=oF4izzOVZLc7NZ0aZHFcGv-r01eiFFt_JORx_x7_D4s,1089
7
- cirq/_version.py,sha256=qsDodKLl4FqIhWv9SguAUDm7DTsASB72VJ033Fn_Ys4,1206
8
- cirq/_version_test.py,sha256=GL6enzyh170ekRbNCSyje9sEY81-b72UaQ9EkHvM2yg,155
7
+ cirq/_version.py,sha256=Q81TJh_YuirWr_dGNnYaGaDTUo6HJrU80uM82s_UgYE,1206
8
+ cirq/_version_test.py,sha256=SBpoHgOY51D6IB6zXFZsD2TSX58jxqpKpQIViH5J66A,155
9
9
  cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
10
10
  cirq/json_resolver_cache.py,sha256=S-zUVI4D_XnAxyR6z7WHDImCVmB_awJp6EStD1-CNPU,13621
11
11
  cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
@@ -1108,8 +1108,8 @@ cirq/transformers/analytical_decompositions/single_qubit_decompositions.py,sha25
1108
1108
  cirq/transformers/analytical_decompositions/single_qubit_decompositions_test.py,sha256=oh96QXddCm1v8CrYA5mEnnx_ENXwZi89W6paVZU273I,12344
1109
1109
  cirq/transformers/analytical_decompositions/single_to_two_qubit_isometry.py,sha256=CRZylmI8nA_aq6vXj0WmMce8PIe8OFCjq4_bqYfkenk,2464
1110
1110
  cirq/transformers/analytical_decompositions/single_to_two_qubit_isometry_test.py,sha256=0nHp7b_Uz-00eod1U6c8Lcx78zNes3hABWnPR_NuMo4,2554
1111
- cirq/transformers/analytical_decompositions/three_qubit_decomposition.py,sha256=kajmUyhahfPpI_tToO0zPwhmnKOsNBITEGXRZ2g90lY,9733
1112
- cirq/transformers/analytical_decompositions/three_qubit_decomposition_test.py,sha256=skyV4CwDVSHX619cuhE6uqZ_QLTlpejp2Rtnk4CdGzo,7939
1111
+ cirq/transformers/analytical_decompositions/three_qubit_decomposition.py,sha256=6IChilA5NB4X00MYumvbRUo757cLaIslXmtirJk7TxU,9252
1112
+ cirq/transformers/analytical_decompositions/three_qubit_decomposition_test.py,sha256=a21HU4BE82AG2UJU4hUVqymUU7Lw4CLw4-NChX4OpLI,6808
1113
1113
  cirq/transformers/analytical_decompositions/two_qubit_state_preparation.py,sha256=2bIpZOHBHxH2mdbJfDpo6nQgpitOI0ZmoH_5l_nA1nU,6167
1114
1114
  cirq/transformers/analytical_decompositions/two_qubit_state_preparation_test.py,sha256=c-vFBZnybd-Ez4rcs13THGGthzEZ0qw9Iw9sAKbE6yc,4494
1115
1115
  cirq/transformers/analytical_decompositions/two_qubit_to_cz.py,sha256=XwDkm7l8DnRoKcQVgm2X64mmUS16iVDsMFV-35KYHfo,9305
@@ -1220,8 +1220,8 @@ cirq/work/sampler.py,sha256=rxbMWvrhu3gfNSBjZKozw28lLKVvBAS_1EGyPdYe8Xg,19041
1220
1220
  cirq/work/sampler_test.py,sha256=SsMrRvLDYELyOAWLKISjkdEfrBwLYWRsT6D8WrsLM3Q,13533
1221
1221
  cirq/work/zeros_sampler.py,sha256=Fs2JWwq0n9zv7_G5Rm-9vPeHUag7uctcMOHg0JTkZpc,2371
1222
1222
  cirq/work/zeros_sampler_test.py,sha256=lQLgQDGBLtfImryys2HzQ2jOSGxHgc7-koVBUhv8qYk,3345
1223
- cirq_core-1.6.0.dev20250603221345.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1224
- cirq_core-1.6.0.dev20250603221345.dist-info/METADATA,sha256=M3eFTRSP_T19QCV1CAfoRRebh7bMTJ7XyLGAM-gjY-Q,4857
1225
- cirq_core-1.6.0.dev20250603221345.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1226
- cirq_core-1.6.0.dev20250603221345.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1227
- cirq_core-1.6.0.dev20250603221345.dist-info/RECORD,,
1223
+ cirq_core-1.6.0.dev20250604225156.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1224
+ cirq_core-1.6.0.dev20250604225156.dist-info/METADATA,sha256=isKq4xf4xSMPIGN8hxo3-qBKvP1RR4CIJfi2a7NjPE4,4857
1225
+ cirq_core-1.6.0.dev20250604225156.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1226
+ cirq_core-1.6.0.dev20250604225156.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1227
+ cirq_core-1.6.0.dev20250604225156.dist-info/RECORD,,