cirq-core 1.5.0.dev20250123022814__py3-none-any.whl → 1.5.0.dev20250127034426__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.dev20250123022814"
31
+ __version__ = "1.5.0.dev20250127034426"
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.dev20250123022814"
6
+ assert cirq.__version__ == "1.5.0.dev20250127034426"
@@ -93,15 +93,14 @@ class PhasedISwapPowGate(eigen_gate.EigenGate):
93
93
  }
94
94
 
95
95
  def _value_equality_values_cls_(self):
96
- if self.phase_exponent == 0:
97
- return swap_gates.ISwapPowGate
98
96
  return PhasedISwapPowGate
99
97
 
100
98
  def _value_equality_values_(self):
101
- if self.phase_exponent == 0:
102
- return self._iswap._value_equality_values_()
103
99
  return (self.phase_exponent, *self._iswap._value_equality_values_())
104
100
 
101
+ def _value_equality_approximate_values_(self):
102
+ return (self.phase_exponent, *self._iswap._value_equality_approximate_values_())
103
+
105
104
  def _is_parameterized_(self) -> bool:
106
105
  return protocols.is_parameterized(self._iswap) or protocols.is_parameterized(
107
106
  self._phase_exponent
@@ -34,11 +34,10 @@ def test_phased_iswap_init():
34
34
 
35
35
  def test_phased_iswap_equality():
36
36
  eq = cirq.testing.EqualsTester()
37
- eq.add_equality_group(cirq.PhasedISwapPowGate(phase_exponent=0, exponent=0.4), cirq.ISWAP**0.4)
38
- eq.add_equality_group(
39
- cirq.PhasedISwapPowGate(phase_exponent=0, exponent=0.4, global_shift=0.3),
40
- cirq.ISwapPowGate(global_shift=0.3) ** 0.4,
41
- )
37
+ eq.add_equality_group(cirq.PhasedISwapPowGate(phase_exponent=0, exponent=0.4))
38
+ eq.add_equality_group(cirq.ISWAP**0.4)
39
+ eq.add_equality_group(cirq.PhasedISwapPowGate(phase_exponent=0, exponent=0.4, global_shift=0.3))
40
+ eq.add_equality_group(cirq.ISwapPowGate(global_shift=0.3) ** 0.4)
42
41
 
43
42
 
44
43
  def test_repr():
@@ -204,3 +203,20 @@ def test_givens_rotation_equivalent_circuit():
204
203
  @pytest.mark.parametrize('angle_rads', (-np.pi / 5, 0.4, 2, np.pi))
205
204
  def test_givens_rotation_has_consistent_protocols(angle_rads):
206
205
  cirq.testing.assert_implements_consistent_protocols(cirq.givens(angle_rads))
206
+
207
+
208
+ def test_approx_eq():
209
+ gate0 = cirq.PhasedISwapPowGate(phase_exponent=0)
210
+ gate1 = cirq.PhasedISwapPowGate(phase_exponent=1e-12)
211
+ gate2 = cirq.PhasedISwapPowGate(phase_exponent=2e-12)
212
+ gate3 = cirq.PhasedISwapPowGate(phase_exponent=0.345)
213
+ gate4 = cirq.ISwapPowGate()
214
+
215
+ assert cirq.approx_eq(gate1, gate2)
216
+ assert cirq.approx_eq(gate1, gate0)
217
+ assert not cirq.approx_eq(gate1, gate3)
218
+ assert not cirq.approx_eq(gate0, gate4)
219
+
220
+ assert cirq.equal_up_to_global_phase(gate1, gate2)
221
+ assert cirq.equal_up_to_global_phase(gate1, gate0)
222
+ assert not cirq.equal_up_to_global_phase(gate1, gate3)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.5.0.dev20250123022814
3
+ Version: 1.5.0.dev20250127034426
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
@@ -12,12 +12,12 @@ Requires-Python: >=3.10.0
12
12
  License-File: LICENSE
13
13
  Requires-Dist: attrs>=21.3.0
14
14
  Requires-Dist: duet>=0.2.8
15
- Requires-Dist: matplotlib~=3.0
16
- Requires-Dist: networkx>=2.4
17
- Requires-Dist: numpy>=1.24
18
- Requires-Dist: pandas
15
+ Requires-Dist: matplotlib~=3.7
16
+ Requires-Dist: networkx~=3.1
17
+ Requires-Dist: numpy>=1.25
18
+ Requires-Dist: pandas~=2.0
19
19
  Requires-Dist: sortedcontainers~=2.0
20
- Requires-Dist: scipy~=1.8
20
+ Requires-Dist: scipy~=1.11
21
21
  Requires-Dist: sympy
22
22
  Requires-Dist: typing-extensions>=4.2
23
23
  Requires-Dist: tqdm
@@ -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=MiLgjEo202Qv-ygfNGqCcnJpmTcjZ4eQLLB5agkLPEc,1206
8
- cirq/_version_test.py,sha256=g6UUmNCvxGNzi-tf6ybG2bVSS1Q_F47Od5ycp5zbPkA,147
7
+ cirq/_version.py,sha256=caRTahIjPw3DWxkspx0AhC96jWwoXPaICJwgdyZ49jE,1206
8
+ cirq/_version_test.py,sha256=uP3CcPXXDuMubmtENqlYoE79zXb-HlIxaeo5gY5vz7o,147
9
9
  cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
10
10
  cirq/json_resolver_cache.py,sha256=p-vEOa-8GQ2cFIAdze-kd6C1un1uRvtujVPljVKaHBg,13557
11
11
  cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
@@ -343,8 +343,8 @@ cirq/ops/pauli_sum_exponential.py,sha256=n3fhKWJVMudzGuOcdPHskVNx3fHE2MAblVdkzbD
343
343
  cirq/ops/pauli_sum_exponential_test.py,sha256=wVnJ3FSpEimHT8ERVkmljALrgSuuDYo6GRg91uJ7ztk,5370
344
344
  cirq/ops/permutation_gate.py,sha256=2h8n76N2M3nu5MA8JkRQgVLByq5cOEluKUN042ClSRs,4196
345
345
  cirq/ops/permutation_gate_test.py,sha256=SwXRgsZNLn5jnGhfcKPJ0J0CIssNzElbFaqylV2TXD8,3281
346
- cirq/ops/phased_iswap_gate.py,sha256=UVg7-aPKxKU984CaKfEVZveu_nC4xGfNlUGx17a43AY,9023
347
- cirq/ops/phased_iswap_gate_test.py,sha256=oH3RQ8tlSD0sU5Cf3M0uR92y3M1Xd7Yk3ayOoca9Neg,6708
346
+ cirq/ops/phased_iswap_gate.py,sha256=Q-1PuSc4F3gsZL9UUN8EgrO31Ix6mA-7HoUIndvePbk,8990
347
+ cirq/ops/phased_iswap_gate_test.py,sha256=tB1MqH8Y0Kgr0QIxs1kq1yl2g0mKYI7Q_AaadBhFe2U,7360
348
348
  cirq/ops/phased_x_gate.py,sha256=qjlkdbj7SWMvgTJkTqEqsLe2XDgAGioA6ayanns-apg,9983
349
349
  cirq/ops/phased_x_gate_test.py,sha256=IpY-Z-MsqtYbyIEdxWu1NqgAJF2B7nddxPc2Hxafr4s,10202
350
350
  cirq/ops/phased_x_z_gate.py,sha256=uVmROoiKYxGPs_QZbpwoi7EmVHV4J2-LRa7jyLeIbCM,11563
@@ -1202,8 +1202,8 @@ cirq/work/sampler.py,sha256=bE5tmVkcR6cZZMLETxDfHehdsYUMbx2RvBeIBetehI4,19187
1202
1202
  cirq/work/sampler_test.py,sha256=hL2UWx3dz2ukZVNxWftiKVvJcQoLplLZdQm-k1QcA40,13282
1203
1203
  cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
1204
1204
  cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
1205
- cirq_core-1.5.0.dev20250123022814.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1206
- cirq_core-1.5.0.dev20250123022814.dist-info/METADATA,sha256=l3DTeYXoz7dLV4htqmUW3xdKr0kGjVt8VtvEEHHXBas,2105
1207
- cirq_core-1.5.0.dev20250123022814.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1208
- cirq_core-1.5.0.dev20250123022814.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1209
- cirq_core-1.5.0.dev20250123022814.dist-info/RECORD,,
1205
+ cirq_core-1.5.0.dev20250127034426.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1206
+ cirq_core-1.5.0.dev20250127034426.dist-info/METADATA,sha256=kyvG-ReT3GpED8x3UpouFoYZJ4Pbmrup7LgDPncvVDM,2111
1207
+ cirq_core-1.5.0.dev20250127034426.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1208
+ cirq_core-1.5.0.dev20250127034426.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1209
+ cirq_core-1.5.0.dev20250127034426.dist-info/RECORD,,