cirq-core 1.5.0.dev20250114225139__py3-none-any.whl → 1.5.0.dev20250115152944__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.dev20250114225139"
31
+ __version__ = "1.5.0.dev20250115152944"
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.dev20250114225139"
6
+ assert cirq.__version__ == "1.5.0.dev20250115152944"
@@ -273,7 +273,7 @@ class MeasurementGate(raw_types.Gate):
273
273
  (idxs, tuple(v for _, v in np.ndenumerate(cmap)))
274
274
  for idxs, cmap in self._confusion_map.items()
275
275
  )
276
- return self.key, self.invert_mask, self._qid_shape, hashable_cmap
276
+ return self.key, self.full_invert_mask(), self._qid_shape, hashable_cmap
277
277
 
278
278
  def _json_dict_(self) -> Dict[str, Any]:
279
279
  other: Dict[str, Any] = {}
@@ -74,11 +74,11 @@ def test_measurement_eq():
74
74
  eq.make_equality_group(
75
75
  lambda: cirq.MeasurementGate(1, 'a'),
76
76
  lambda: cirq.MeasurementGate(1, 'a', invert_mask=()),
77
+ lambda: cirq.MeasurementGate(1, 'a', invert_mask=(False,)),
77
78
  lambda: cirq.MeasurementGate(1, 'a', qid_shape=(2,)),
78
79
  lambda: cirq.MeasurementGate(1, 'a', confusion_map={}),
79
80
  )
80
81
  eq.add_equality_group(cirq.MeasurementGate(1, 'a', invert_mask=(True,)))
81
- eq.add_equality_group(cirq.MeasurementGate(1, 'a', invert_mask=(False,)))
82
82
  eq.add_equality_group(
83
83
  cirq.MeasurementGate(1, 'a', confusion_map={(0,): np.array([[0, 1], [1, 0]])})
84
84
  )
@@ -76,11 +76,9 @@ qreg q[{num_qubits}];
76
76
 
77
77
  qasm_unitary = None
78
78
  try:
79
- result = qiskit.execute(
80
- qiskit.QuantumCircuit.from_qasm_str(qasm),
81
- backend=qiskit.Aer.get_backend('unitary_simulator'),
82
- )
83
- qasm_unitary = result.result().get_unitary()
79
+ qc = qiskit.QuantumCircuit.from_qasm_str(qasm)
80
+ qc.remove_final_measurements()
81
+ qasm_unitary = qiskit.quantum_info.Operator(qc).data
84
82
  qasm_unitary = _reorder_indices_of_matrix(qasm_unitary, list(reversed(range(num_qubits))))
85
83
 
86
84
  lin_alg_utils.assert_allclose_up_to_global_phase(
@@ -115,11 +113,9 @@ def assert_qiskit_parsed_qasm_consistent_with_unitary(qasm, unitary): # pragma:
115
113
  return
116
114
 
117
115
  num_qubits = int(np.log2(len(unitary)))
118
- result = qiskit.execute(
119
- qiskit.QuantumCircuit.from_qasm_str(qasm),
120
- backend=qiskit.Aer.get_backend('unitary_simulator'),
121
- )
122
- qiskit_unitary = result.result().get_unitary()
116
+ qc = qiskit.QuantumCircuit.from_qasm_str(qasm)
117
+ qc.remove_final_measurements() # no measurements allowed
118
+ qiskit_unitary = qiskit.quantum_info.Operator(qc).data
123
119
  qiskit_unitary = _reorder_indices_of_matrix(qiskit_unitary, list(reversed(range(num_qubits))))
124
120
 
125
121
  lin_alg_utils.assert_allclose_up_to_global_phase(unitary, qiskit_unitary, rtol=1e-8, atol=1e-8)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.5.0.dev20250114225139
3
+ Version: 1.5.0.dev20250115152944
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=4NkMp4EN09mzG9jfRecTplB1IR067vo9G54hHQzQiRc,1206
8
- cirq/_version_test.py,sha256=AWuGjxi3SxQLc9jrEqBZE1WrEmiRJA9ucK2xTxRVrPw,147
7
+ cirq/_version.py,sha256=LkgJe5eOFVNdOwCky4dktOgEF-hrFwRDpJezWKkIXcM,1206
8
+ cirq/_version_test.py,sha256=IM_DL-84DQSW3Zw270PxHbweIkfKdqagG7nE8-S3EFM,147
9
9
  cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
10
10
  cirq/json_resolver_cache.py,sha256=cpbvJMNIh0U-l1mEVb-TqhJUEXfm2vpuR3v432ORSmg,13702
11
11
  cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
@@ -314,8 +314,8 @@ cirq/ops/matrix_gates.py,sha256=inBhKPsNx7ZeejNpmbPEGl5hgyrTqmA852BVlKMUZmg,9297
314
314
  cirq/ops/matrix_gates_test.py,sha256=m5rMwq_sqVvsmkc5opVr3Ikd1ERuULmSRNAvGZUg7ds,14224
315
315
  cirq/ops/measure_util.py,sha256=wkT0XC6rIddOkqNGwkvI-m7Ncr8j5QPN_evwecc6nrw,7390
316
316
  cirq/ops/measure_util_test.py,sha256=Yzlced4nb4DHO-0cM_a-QZGO_3R8oqExkpIALN_pG4A,5307
317
- cirq/ops/measurement_gate.py,sha256=jBRJzLcEmWYWnCk6y-GiXjhS7s0AJNsxFF6i__JhWZg,11986
318
- cirq/ops/measurement_gate_test.py,sha256=XfTDqbYUUc7zsMURh7D3jo8DwKWVVT9uJRBvtTm8Frk,18308
317
+ cirq/ops/measurement_gate.py,sha256=XDjooVGYlhghaR5LJzmgROdHJgulXZuCax2_DVZBs0Q,11993
318
+ cirq/ops/measurement_gate_test.py,sha256=ZfaTXEVwf9dZFRrRWwCkn5tIyDdMnpELiEMCnxus-g0,18298
319
319
  cirq/ops/mixed_unitary_channel.py,sha256=k3O4ovH3bFs1WnAZc647IgCK8thC5JnTGxsCzjBacEY,5259
320
320
  cirq/ops/mixed_unitary_channel_test.py,sha256=x8LIAea2KcutNupnRJ_cLy1kmxhbUh3K3BkZtg3OkKQ,5058
321
321
  cirq/ops/named_qubit.py,sha256=niAsH7m32n3lEVIcy1nnVDPkPqk6PY2qlriz7mzgZmk,10006
@@ -977,7 +977,7 @@ cirq/testing/consistent_phase_by.py,sha256=oSZcZnKMOIJnBS0HgYi-8aRaVJmHGgI--WAUG
977
977
  cirq/testing/consistent_phase_by_test.py,sha256=YbI0n0FpWpBkbgYp0-yGZSeesDZEst0cmYtXgJE2LQY,3273
978
978
  cirq/testing/consistent_protocols.py,sha256=ZRLuaquTuSGhI_KaOdXa0ooDJC3gOO3ykfciKiHqhrU,7773
979
979
  cirq/testing/consistent_protocols_test.py,sha256=ZShgGWBWrzClusc-6idmnIBdCL_OAxXLHay8baqRh1g,10004
980
- cirq/testing/consistent_qasm.py,sha256=1-Rq2NfyRHh1bqPYuhBIsH9OkepUSONpNdxDMODSsrQ,5108
980
+ cirq/testing/consistent_qasm.py,sha256=DaZCJHfrqMe5U3ccORuKs0seFPRGhePLMAavSwd-QuM,5021
981
981
  cirq/testing/consistent_qasm_test.py,sha256=IM1BDeqZflv0Tui669KRLOlKKWyYnJ9JA-Xoy4lI9Bs,2883
982
982
  cirq/testing/consistent_resolve_parameters.py,sha256=hYbp6kbXrOLCc1DMDRC2zTAx1qlvCCJMuzZ7a5cGhmA,1973
983
983
  cirq/testing/consistent_specified_has_unitary.py,sha256=A8UWU8etwXmEs9GWLI94NiIkGUHUHxMNY-5Brqd9oj4,1132
@@ -1203,8 +1203,8 @@ cirq/work/sampler.py,sha256=bE5tmVkcR6cZZMLETxDfHehdsYUMbx2RvBeIBetehI4,19187
1203
1203
  cirq/work/sampler_test.py,sha256=hL2UWx3dz2ukZVNxWftiKVvJcQoLplLZdQm-k1QcA40,13282
1204
1204
  cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
1205
1205
  cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
1206
- cirq_core-1.5.0.dev20250114225139.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1207
- cirq_core-1.5.0.dev20250114225139.dist-info/METADATA,sha256=xiv814MiWePyAbympmAOEaR2Z2AifzHfI0bluTeSwoI,2105
1208
- cirq_core-1.5.0.dev20250114225139.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1209
- cirq_core-1.5.0.dev20250114225139.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1210
- cirq_core-1.5.0.dev20250114225139.dist-info/RECORD,,
1206
+ cirq_core-1.5.0.dev20250115152944.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1207
+ cirq_core-1.5.0.dev20250115152944.dist-info/METADATA,sha256=RTKOyXjzcby0YwSB_UTOSUGM2pvSYDxZEt07o_-ScHg,2105
1208
+ cirq_core-1.5.0.dev20250115152944.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1209
+ cirq_core-1.5.0.dev20250115152944.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1210
+ cirq_core-1.5.0.dev20250115152944.dist-info/RECORD,,