cirq-core 1.5.0.dev20240823202236__py3-none-any.whl → 1.5.0.dev20240830235756__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.dev20240823202236"
31
+ __version__ = "1.5.0.dev20240830235756"
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.dev20240823202236"
6
+ assert cirq.__version__ == "1.5.0.dev20240830235756"
@@ -11,6 +11,7 @@
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
+
14
15
  import itertools
15
16
  import multiprocessing
16
17
  from typing import Iterable
@@ -36,6 +37,8 @@ from cirq.experiments.xeb_fitting import (
36
37
  )
37
38
  from cirq.experiments.xeb_sampling import sample_2q_xeb_circuits
38
39
 
40
+ _POOL_NUM_PROCESSES = min(4, multiprocessing.cpu_count())
41
+
39
42
 
40
43
  @pytest.fixture(scope='module')
41
44
  def circuits_cycle_depths_sampled_df():
@@ -229,7 +232,7 @@ def test_characterize_phased_fsim_parameters_with_xeb():
229
232
  characterize_phi=False,
230
233
  )
231
234
  p_circuits = [parameterize_circuit(circuit, options) for circuit in circuits]
232
- with multiprocessing.Pool() as pool:
235
+ with multiprocessing.Pool(_POOL_NUM_PROCESSES) as pool:
233
236
  result = characterize_phased_fsim_parameters_with_xeb(
234
237
  sampled_df=sampled_df,
235
238
  parameterized_circuits=p_circuits,
@@ -270,7 +273,7 @@ def test_parallel_full_workflow(use_pool):
270
273
  )
271
274
 
272
275
  if use_pool:
273
- pool = multiprocessing.Pool()
276
+ pool = multiprocessing.Pool(_POOL_NUM_PROCESSES)
274
277
  else:
275
278
  pool = None
276
279
 
@@ -11,6 +11,7 @@
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
+
14
15
  import multiprocessing
15
16
  from typing import Dict, Any, Optional
16
17
  from typing import Sequence
@@ -23,6 +24,8 @@ import cirq
23
24
  import cirq.experiments.random_quantum_circuit_generation as rqcg
24
25
  from cirq.experiments.xeb_simulation import simulate_2q_xeb_circuits
25
26
 
27
+ _POOL_NUM_PROCESSES = min(4, multiprocessing.cpu_count())
28
+
26
29
 
27
30
  def test_simulate_2q_xeb_circuits():
28
31
  q0, q1 = cirq.LineQubit.range(2)
@@ -42,7 +45,7 @@ def test_simulate_2q_xeb_circuits():
42
45
  assert len(row['pure_probs']) == 4
43
46
  assert np.isclose(np.sum(row['pure_probs']), 1)
44
47
 
45
- with multiprocessing.Pool() as pool:
48
+ with multiprocessing.Pool(_POOL_NUM_PROCESSES) as pool:
46
49
  df2 = simulate_2q_xeb_circuits(circuits, cycle_depths, pool=pool)
47
50
 
48
51
  pd.testing.assert_frame_equal(df, df2)
@@ -130,7 +133,7 @@ def test_incremental_simulate(multiprocess):
130
133
  cycle_depths = np.arange(3, 100, 9, dtype=np.int64)
131
134
 
132
135
  if multiprocess:
133
- pool = multiprocessing.Pool()
136
+ pool = multiprocessing.Pool(_POOL_NUM_PROCESSES)
134
137
  else:
135
138
  pool = None
136
139
 
@@ -26,7 +26,7 @@ def _gate_in_moment(gate: ops.Gate, moment: circuits.Moment) -> bool:
26
26
 
27
27
 
28
28
  @transformer_api.transformer
29
- class DepolerizingNoiseTransformer:
29
+ class DepolarizingNoiseTransformer:
30
30
  """Add local depolarizing noise after two-qubit gates in a specified circuit. More specifically,
31
31
  with probability p, append a random non-identity two-qubit Pauli operator after each specified
32
32
  two-qubit gate.
@@ -23,16 +23,16 @@ def test_noise_adding():
23
23
  circuit = one_layer * 10
24
24
 
25
25
  # test that p=0 does nothing
26
- transformed_circuit_p0 = na.DepolerizingNoiseTransformer(0.0)(circuit)
26
+ transformed_circuit_p0 = na.DepolarizingNoiseTransformer(0.0)(circuit)
27
27
  assert transformed_circuit_p0 == circuit
28
28
 
29
29
  # test that p=1 doubles the circuit depth
30
- transformed_circuit_p1 = na.DepolerizingNoiseTransformer(1.0)(circuit)
30
+ transformed_circuit_p1 = na.DepolarizingNoiseTransformer(1.0)(circuit)
31
31
  assert len(transformed_circuit_p1) == 20
32
32
 
33
33
  # test that we get a deterministic result when using a specific rng
34
34
  rng = np.random.default_rng(0)
35
- transformed_circuit_p0_03 = na.DepolerizingNoiseTransformer(0.03)(circuit, rng=rng)
35
+ transformed_circuit_p0_03 = na.DepolarizingNoiseTransformer(0.03)(circuit, rng=rng)
36
36
  expected_circuit = (
37
37
  one_layer * 2
38
38
  + circuits.Circuit(ops.I(qubits[2]), ops.Z(qubits[3]))
@@ -44,7 +44,7 @@ def test_noise_adding():
44
44
  assert transformed_circuit_p0_03 == expected_circuit
45
45
 
46
46
  # test that supplying a dictionary for p works
47
- transformed_circuit_p_dict = na.DepolerizingNoiseTransformer(
47
+ transformed_circuit_p_dict = na.DepolarizingNoiseTransformer(
48
48
  {tuple(qubits[:2]): 1.0, tuple(qubits[2:]): 0.0}
49
49
  )(circuit)
50
50
  assert len(transformed_circuit_p_dict) == 20 # depth should be doubled
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.5.0.dev20240823202236
3
+ Version: 1.5.0.dev20240830235756
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=uaGhZkeL79MtoC6D7pZ2um3GMHGp_uak0AS4Q8A9QhA,1206
8
- cirq/_version_test.py,sha256=wxtN3zuBxxteFI1ehg0I_MYAWknJe8ZXQx97iScz_ek,147
7
+ cirq/_version.py,sha256=f5oLqyBAUdRa36UE8hw7XZVryCysVQbeVszuMyuOZ30,1206
8
+ cirq/_version_test.py,sha256=Za4raE_X44VsxbqCxuBN34gb7cTUDSbyoAIG1gzxBUU,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
@@ -199,11 +199,11 @@ cirq/experiments/t2_decay_experiment_test.py,sha256=DFR0BGn0Id4qNPfqIExj70TEAqf7
199
199
  cirq/experiments/two_qubit_xeb.py,sha256=N2X9N1A6hRS2Xe4zcmLJTyZ80DKDB0Pmv2fN4-UOU_s,19943
200
200
  cirq/experiments/two_qubit_xeb_test.py,sha256=ZeZvClUAB8ir42Bd3PWr-s0_-QKWbFdYqfvvOMawsm0,10204
201
201
  cirq/experiments/xeb_fitting.py,sha256=tD678gTY495cDA6b55YIPdwq22VQFbB2AlnkeX_X9P0,29332
202
- cirq/experiments/xeb_fitting_test.py,sha256=LEgC76mYFwsX-ZqRqg2j85EiHACq8nK9ITrcl-TgeiA,15286
202
+ cirq/experiments/xeb_fitting_test.py,sha256=zjLAPc_0O2Qj-0nzd7qIwPtHBsZV3Fq_CUnHizz7628,15384
203
203
  cirq/experiments/xeb_sampling.py,sha256=6ZOidGi7Kt6p4cMQCjK7qQuIUXVHCYl47B2GnL8M-Bw,14987
204
204
  cirq/experiments/xeb_sampling_test.py,sha256=0XkQGvcURsug3IblE_wZrHVDoOQV3WuQilrqCJbDHjI,6784
205
205
  cirq/experiments/xeb_simulation.py,sha256=yML2NAnYTRFG1wsQHvxtNEGEMXuExbWjrE2JYuCqnrk,5076
206
- cirq/experiments/xeb_simulation_test.py,sha256=m_Eo9IJiebnJWyg9jwLW9BkVUeTkPxKEvWPVLj0VNho,5449
206
+ cirq/experiments/xeb_simulation_test.py,sha256=C2aVmUNwmqZAtduHUuBQUbgxMMgb1wnugIlNq9uEFe0,5547
207
207
  cirq/interop/__init__.py,sha256=zYD7hdcL5qUZ2MDzmCRZ7CgfCZ048fMKtJXCW7GMK_Y,722
208
208
  cirq/interop/quirk/__init__.py,sha256=rGKgFDaKFSHdGTEw5iD4GCg_SKzbAfA1qcr4t2lPlZI,1092
209
209
  cirq/interop/quirk/url_to_circuit.py,sha256=1ToWnFJdJIhCko9q62BEvOoCGxCpOUl8891IdCa52MM,14211
@@ -1043,8 +1043,8 @@ cirq/transformers/merge_k_qubit_gates.py,sha256=dUsswQOIHfbb6Lu37fecgrpT6_45zmDE
1043
1043
  cirq/transformers/merge_k_qubit_gates_test.py,sha256=k_ROZvUebHgPy5vsNnWNMBYU4kfIkrunPsw39ZngMwo,13920
1044
1044
  cirq/transformers/merge_single_qubit_gates.py,sha256=NRREV4Z6Ptc3mZnOUgzQePdj4H0aix17WOUwZUB7iQ8,5826
1045
1045
  cirq/transformers/merge_single_qubit_gates_test.py,sha256=SWf1Il7Bz0iUCDM7JoDG2Yxe4p2yYr2PgViQpjByFm0,9914
1046
- cirq/transformers/noise_adding.py,sha256=Ng1JoGzSJdrA7WBAOLmM5kSGWP4bqEnQc-g9kYxePNQ,4439
1047
- cirq/transformers/noise_adding_test.py,sha256=C0G16cj_hGWgpAYV0L7p3_p4LkD7SR99p0DJJq1fUwk,2134
1046
+ cirq/transformers/noise_adding.py,sha256=fndp5mHYpdErdhd8YlzUtVl0J2phcryuY_zvBIEzguc,4439
1047
+ cirq/transformers/noise_adding_test.py,sha256=ricl2YSqi0MCzudR2F_FDqr3vEAHFQEVGzHLEXRYSBM,2134
1048
1048
  cirq/transformers/optimize_for_target_gateset.py,sha256=MxhFsCm2XgW3gdpNW4NGVmz1VdQvzKdNNCtVZDuZiVE,7229
1049
1049
  cirq/transformers/optimize_for_target_gateset_test.py,sha256=MgAHjsPbVtd0fl2ytRz2R-LQuhSqImtrFK5F45QXkA8,19523
1050
1050
  cirq/transformers/qubit_management_transformers.py,sha256=A7Mweu9ElLSCsy_atmgFbYlzOFXKhct5gQ5YNTjjaVU,9430
@@ -1184,8 +1184,8 @@ cirq/work/sampler.py,sha256=JEAeQQRF3bqlO9AkOf4XbrTATDI5f5JgyM_FAUCNxao,19751
1184
1184
  cirq/work/sampler_test.py,sha256=B2ZsuqGT854gQtBIAh8k0LiG9Vj5wSzcGvkxOUoTcW4,13217
1185
1185
  cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
1186
1186
  cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
1187
- cirq_core-1.5.0.dev20240823202236.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1188
- cirq_core-1.5.0.dev20240823202236.dist-info/METADATA,sha256=klsq1CGGRho9Ux06bwHfvXSxxHu7Ua7jFRLDkklfIus,1992
1189
- cirq_core-1.5.0.dev20240823202236.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
1190
- cirq_core-1.5.0.dev20240823202236.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1191
- cirq_core-1.5.0.dev20240823202236.dist-info/RECORD,,
1187
+ cirq_core-1.5.0.dev20240830235756.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1188
+ cirq_core-1.5.0.dev20240830235756.dist-info/METADATA,sha256=kZva72qLSpg4tMC2pUsxtnuJS2H0T0eT9F2JH21-8Tc,1992
1189
+ cirq_core-1.5.0.dev20240830235756.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
1190
+ cirq_core-1.5.0.dev20240830235756.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1191
+ cirq_core-1.5.0.dev20240830235756.dist-info/RECORD,,