cirq-core 1.7.0.dev20251020235234__py3-none-any.whl → 1.7.0.dev20251023014716__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.7.0.dev20251020235234"
31
+ __version__ = "1.7.0.dev20251023014716"
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.7.0.dev20251020235234"
6
+ assert cirq.__version__ == "1.7.0.dev20251023014716"
@@ -14,6 +14,9 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
+ import multiprocessing
18
+ from typing import Iterator
19
+
17
20
  import numpy as np
18
21
  import pandas as pd
19
22
  import pytest
@@ -31,6 +34,15 @@ _ANGLES = ['theta', 'phi', 'chi', 'zeta', 'gamma']
31
34
  # fix random generator seed to ensure reproducibility and faster convergence
32
35
  _SEED = 276154030
33
36
 
37
+ _POOL_NUM_PROCESSES = min(4, multiprocessing.cpu_count())
38
+
39
+
40
+ @pytest.fixture
41
+ def pool() -> Iterator[multiprocessing.pool.Pool]:
42
+ ctx = multiprocessing.get_context()
43
+ with ctx.Pool(_POOL_NUM_PROCESSES) as pool:
44
+ yield pool
45
+
34
46
 
35
47
  def _create_tests(n, with_options: bool = False):
36
48
  rng = np.random.default_rng(_SEED)
@@ -88,7 +100,7 @@ class _TestSimulator(cirq.Simulator):
88
100
  @pytest.mark.parametrize(
89
101
  ['angles', 'error', 'characterization_flags'], _create_tests(n=10, with_options=True)
90
102
  )
91
- def test_calibrate_z_phases(angles, error, characterization_flags) -> None:
103
+ def test_calibrate_z_phases(pool, angles, error, characterization_flags) -> None:
92
104
 
93
105
  original_gate = cirq.PhasedFSimGate(**{k: v for k, v in zip(_ANGLES, angles)})
94
106
  actual_gate = cirq.PhasedFSimGate(**{k: v + e for k, v, e in zip(_ANGLES, angles, error)})
@@ -109,6 +121,7 @@ def test_calibrate_z_phases(angles, error, characterization_flags) -> None:
109
121
  n_circuits=10,
110
122
  cycle_depths=range(3, 10),
111
123
  random_state=_SEED,
124
+ num_workers_or_pool=pool,
112
125
  )[qubits]
113
126
 
114
127
  initial_unitary = cirq.unitary(original_gate)
@@ -127,7 +140,7 @@ def test_calibrate_z_phases(angles, error, characterization_flags) -> None:
127
140
 
128
141
 
129
142
  @pytest.mark.parametrize(['angles', 'error'], _create_tests(n=3))
130
- def test_calibrate_z_phases_no_options(angles, error) -> None:
143
+ def test_calibrate_z_phases_no_options(pool, angles, error) -> None:
131
144
 
132
145
  original_gate = cirq.PhasedFSimGate(**{k: v for k, v in zip(_ANGLES, angles)})
133
146
  actual_gate = cirq.PhasedFSimGate(**{k: v + e for k, v, e in zip(_ANGLES, angles, error)})
@@ -144,6 +157,7 @@ def test_calibrate_z_phases_no_options(angles, error) -> None:
144
157
  n_circuits=10,
145
158
  cycle_depths=range(3, 10),
146
159
  random_state=_SEED,
160
+ num_workers_or_pool=pool,
147
161
  )[qubits]
148
162
 
149
163
  initial_unitary = cirq.unitary(original_gate)
@@ -162,7 +176,7 @@ def test_calibrate_z_phases_no_options(angles, error) -> None:
162
176
 
163
177
 
164
178
  @pytest.mark.parametrize(['angles', 'error'], _create_tests(n=3))
165
- def test_calibrate_z_phases_workflow_no_options(angles, error) -> None:
179
+ def test_calibrate_z_phases_workflow_no_options(pool, angles, error) -> None:
166
180
 
167
181
  original_gate = cirq.PhasedFSimGate(**{k: v for k, v in zip(_ANGLES, angles)})
168
182
  actual_gate = cirq.PhasedFSimGate(**{k: v + e for k, v, e in zip(_ANGLES, angles, error)})
@@ -179,6 +193,7 @@ def test_calibrate_z_phases_workflow_no_options(angles, error) -> None:
179
193
  n_circuits=1,
180
194
  cycle_depths=(1, 2),
181
195
  random_state=_SEED,
196
+ num_workers_or_pool=pool,
182
197
  )
183
198
 
184
199
  for params in result.final_params.values():
@@ -31,7 +31,6 @@ from cirq.transformers.analytical_decompositions.quantum_shannon_decomposition i
31
31
  )
32
32
 
33
33
 
34
- @pytest.mark.xfail(reason='#6765')
35
34
  @pytest.mark.parametrize('n_qubits', list(range(1, 8)))
36
35
  def test_random_qsd_n_qubit(n_qubits) -> None:
37
36
  U = unitary_group.rvs(2**n_qubits)
@@ -211,7 +210,6 @@ def test_three_qubit_gate(gate) -> None:
211
210
  np.testing.assert_allclose(new_unitary, desired_unitary, atol=1e-6)
212
211
 
213
212
 
214
- @pytest.mark.xfail(reason='#6765')
215
213
  def test_qft5() -> None:
216
214
  global_phase = np.exp(1j * np.random.choice(np.linspace(0, 2 * np.pi, 10)))
217
215
  desired_unitary = cirq.unitary(cirq.qft(*cirq.LineQubit.range(5))) * global_phase
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cirq-core
3
- Version: 1.7.0.dev20251020235234
3
+ Version: 1.7.0.dev20251023014716
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=emXpdD5ZvwLRlFAoQB8YatmZyU3b4e9jg6FppMTUhkU,33900
4
4
  cirq/_doc.py,sha256=28ZskY9ZtZ_4GS1oXPUgklKnJqmAE-rkUfzcsJ0--nA,2941
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=OPm3Mky13y-tUL1a0AjG1p3Idwmk_x9AmAbr-l9WRw0,1206
8
- cirq/_version_test.py,sha256=802K16LRHWNKg-i4gl726Zb9qShJ0ewZcY9FLP1AEjw,155
7
+ cirq/_version.py,sha256=t37kvxEsA2sj1GRnK7KW4q_fVriKP7AsopkYUguvhQo,1206
8
+ cirq/_version_test.py,sha256=sAJ-AyYSCqySWi08b4M5zAPTOs0WRGf9f5oDwG8lVsU,155
9
9
  cirq/conftest.py,sha256=wSDKNdIQRDfLnXvOCWD3erheOw8JHRhdfQ53EyTUIXg,1239
10
10
  cirq/json_resolver_cache.py,sha256=A5DIgFAY1hUNt9vai_C3-gGBv24116CJMzQxMcXOax4,13726
11
11
  cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
@@ -225,7 +225,7 @@ cirq/experiments/xeb_sampling_test.py,sha256=wVFcyAoErAC6tRQMA6AJ1MrTT1DGwW_0PuK
225
225
  cirq/experiments/xeb_simulation.py,sha256=HqUb7d1XIgp0GEThIEHfDEsrh3kUee9pFS7k1vFWnIA,5089
226
226
  cirq/experiments/xeb_simulation_test.py,sha256=UAm6qCTJWa9o5Nwr9LwvJ8fmlNvg6IQs8gsraasK2I8,5625
227
227
  cirq/experiments/z_phase_calibration.py,sha256=0W2VWV6SPWwQnPVJqhrxih0CLlR1SNRJU_CZ48C5PHo,15018
228
- cirq/experiments/z_phase_calibration_test.py,sha256=0no2wWui8Ha5hKDiFXzMqEdv3ghY6zN3mpCLYYE9DXM,9178
228
+ cirq/experiments/z_phase_calibration_test.py,sha256=HeRX1kvXpmokOqMEVk-8ewAmvnomWBATFcHwo-ZX3bc,9585
229
229
  cirq/experiments/benchmarking/__init__.py,sha256=oAom0qrtLKb8NqUcBJWiKd6chwFE2j6jVLI8_iNivzA,723
230
230
  cirq/experiments/benchmarking/parallel_xeb.py,sha256=xC7BOr9cDTGshRNG4tgXAXXH4VuMntIBYjp_PQZW5Tc,26117
231
231
  cirq/experiments/benchmarking/parallel_xeb_test.py,sha256=mrP97qFvhPa7_FYuW-PXGP9wAnxOFVCo8jwjwcGGWFQ,16352
@@ -1124,7 +1124,7 @@ cirq/transformers/analytical_decompositions/cphase_to_fsim_test.py,sha256=1jlK8a
1124
1124
  cirq/transformers/analytical_decompositions/pauli_string_decomposition.py,sha256=7GKdVnN5jvpjABudB0zE1kUn0BPZmuvRZcM2yLMUoWs,4540
1125
1125
  cirq/transformers/analytical_decompositions/pauli_string_decomposition_test.py,sha256=yWHkXXErOxLmnp5t65WUsY9e9iN6L950MZRw5OY3QW0,2172
1126
1126
  cirq/transformers/analytical_decompositions/quantum_shannon_decomposition.py,sha256=CaOmLzoIM8r5lC9LRYZW9b7omSP0tAi8Th3ZTYF-EQE,15476
1127
- cirq/transformers/analytical_decompositions/quantum_shannon_decomposition_test.py,sha256=FqatqXTZU-7AKvzKtiLcCC-S6OXr8j7ExF0rpCbZiY8,9100
1127
+ cirq/transformers/analytical_decompositions/quantum_shannon_decomposition_test.py,sha256=Unbrv-bIFKSneH_Lr40iZvdxj8MSBeo_6aQns7KbThw,9030
1128
1128
  cirq/transformers/analytical_decompositions/single_qubit_decompositions.py,sha256=6kaQfcXY7je42o-pVprSwgPXCDJXraDXQ9mHyR_BaBk,8428
1129
1129
  cirq/transformers/analytical_decompositions/single_qubit_decompositions_test.py,sha256=v8vO3ykhUmTiK5yFiSZ8E8UShhvh7HVBw7AVxVgolWY,12653
1130
1130
  cirq/transformers/analytical_decompositions/single_to_two_qubit_isometry.py,sha256=CRZylmI8nA_aq6vXj0WmMce8PIe8OFCjq4_bqYfkenk,2464
@@ -1246,8 +1246,8 @@ cirq/work/sampler.py,sha256=rxbMWvrhu3gfNSBjZKozw28lLKVvBAS_1EGyPdYe8Xg,19041
1246
1246
  cirq/work/sampler_test.py,sha256=SsMrRvLDYELyOAWLKISjkdEfrBwLYWRsT6D8WrsLM3Q,13533
1247
1247
  cirq/work/zeros_sampler.py,sha256=Fs2JWwq0n9zv7_G5Rm-9vPeHUag7uctcMOHg0JTkZpc,2371
1248
1248
  cirq/work/zeros_sampler_test.py,sha256=lQLgQDGBLtfImryys2HzQ2jOSGxHgc7-koVBUhv8qYk,3345
1249
- cirq_core-1.7.0.dev20251020235234.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1250
- cirq_core-1.7.0.dev20251020235234.dist-info/METADATA,sha256=WdQGAEXPvsM5QUAz5DlYWx1HBbCDQQB4O7Nl0Dlf-Uo,4757
1251
- cirq_core-1.7.0.dev20251020235234.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1252
- cirq_core-1.7.0.dev20251020235234.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1253
- cirq_core-1.7.0.dev20251020235234.dist-info/RECORD,,
1249
+ cirq_core-1.7.0.dev20251023014716.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1250
+ cirq_core-1.7.0.dev20251023014716.dist-info/METADATA,sha256=s8uZoCNcgfffrHtpdOLFFs9ggTbvOCmNOBDhEnB6vxQ,4757
1251
+ cirq_core-1.7.0.dev20251023014716.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
1252
+ cirq_core-1.7.0.dev20251023014716.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1253
+ cirq_core-1.7.0.dev20251023014716.dist-info/RECORD,,