cirq-core 1.7.0.dev20250908175350__py3-none-any.whl → 1.7.0.dev20250908175529__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 +1 -1
- cirq/_version_test.py +1 -1
- cirq/ops/pauli_string.py +23 -0
- {cirq_core-1.7.0.dev20250908175350.dist-info → cirq_core-1.7.0.dev20250908175529.dist-info}/METADATA +1 -1
- {cirq_core-1.7.0.dev20250908175350.dist-info → cirq_core-1.7.0.dev20250908175529.dist-info}/RECORD +8 -8
- {cirq_core-1.7.0.dev20250908175350.dist-info → cirq_core-1.7.0.dev20250908175529.dist-info}/WHEEL +0 -0
- {cirq_core-1.7.0.dev20250908175350.dist-info → cirq_core-1.7.0.dev20250908175529.dist-info}/licenses/LICENSE +0 -0
- {cirq_core-1.7.0.dev20250908175350.dist-info → cirq_core-1.7.0.dev20250908175529.dist-info}/top_level.txt +0 -0
cirq/_version.py
CHANGED
cirq/_version_test.py
CHANGED
cirq/ops/pauli_string.py
CHANGED
|
@@ -1095,6 +1095,23 @@ def _try_interpret_as_pauli_string(op: Any) -> PauliString | None:
|
|
|
1095
1095
|
if not isinstance(op, raw_types.Operation):
|
|
1096
1096
|
return None
|
|
1097
1097
|
|
|
1098
|
+
if isinstance(op, PauliString):
|
|
1099
|
+
return op
|
|
1100
|
+
|
|
1101
|
+
# optimize for integer exponents of Pauli gates
|
|
1102
|
+
cached_gates: dict[type[cirq.Gate | None], cirq.Pauli] = {
|
|
1103
|
+
common_gates.XPowGate: pauli_gates.X,
|
|
1104
|
+
common_gates.YPowGate: pauli_gates.Y,
|
|
1105
|
+
common_gates.ZPowGate: pauli_gates.Z,
|
|
1106
|
+
}
|
|
1107
|
+
if (pauli := cached_gates.get(type(op.gate))) is not None:
|
|
1108
|
+
exponent = op.gate.exponent # type: ignore
|
|
1109
|
+
if exponent % 2 == 0:
|
|
1110
|
+
return PauliString()
|
|
1111
|
+
if exponent % 2 == 1:
|
|
1112
|
+
return pauli.on(op.qubits[0])
|
|
1113
|
+
return None
|
|
1114
|
+
|
|
1098
1115
|
pauli_expansion_op = protocols.pauli_expansion(op, default=None)
|
|
1099
1116
|
if pauli_expansion_op is None or len(pauli_expansion_op) != 1:
|
|
1100
1117
|
return None
|
|
@@ -1133,6 +1150,12 @@ class SingleQubitPauliStringGateOperation( # type: ignore
|
|
|
1133
1150
|
assert len(self.qubits) == 1
|
|
1134
1151
|
return self.qubits[0]
|
|
1135
1152
|
|
|
1153
|
+
def __mul__(self, other):
|
|
1154
|
+
return PauliString.__mul__(self, other)
|
|
1155
|
+
|
|
1156
|
+
def __rmul__(self, other):
|
|
1157
|
+
return PauliString.__rmul__(self, other)
|
|
1158
|
+
|
|
1136
1159
|
def _json_dict_(self) -> dict[str, Any]:
|
|
1137
1160
|
return protocols.obj_to_dict_helper(self, ['pauli', 'qubit'])
|
|
1138
1161
|
|
{cirq_core-1.7.0.dev20250908175350.dist-info → cirq_core-1.7.0.dev20250908175529.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cirq-core
|
|
3
|
-
Version: 1.7.0.
|
|
3
|
+
Version: 1.7.0.dev20250908175529
|
|
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
|
{cirq_core-1.7.0.dev20250908175350.dist-info → cirq_core-1.7.0.dev20250908175529.dist-info}/RECORD
RENAMED
|
@@ -4,8 +4,8 @@ cirq/_compat_test.py,sha256=emXpdD5ZvwLRlFAoQB8YatmZyU3b4e9jg6FppMTUhkU,33900
|
|
|
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=
|
|
8
|
-
cirq/_version_test.py,sha256=
|
|
7
|
+
cirq/_version.py,sha256=peD3jdd4i1zz-kBXjyBiWStm84FTXi0JoeG5K60G1Os,1206
|
|
8
|
+
cirq/_version_test.py,sha256=irjfu-J0IKWfdEDgUtT48B73Y-gKsscTkP7J1vN8c0c,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
|
|
@@ -351,7 +351,7 @@ cirq/ops/pauli_interaction_gate.py,sha256=1drxD57PLCmp7dI9p5oDX2HPzsqwh0rrqHltUj
|
|
|
351
351
|
cirq/ops/pauli_interaction_gate_test.py,sha256=9IGQjf4cRNe1EAsxVJjTMysoO2TxUhDlp-6lXJuAYD8,4643
|
|
352
352
|
cirq/ops/pauli_measurement_gate.py,sha256=OzbQeMzr9cHQsai8K-usg3Il74o8gdXZLksLuYr8RcU,7113
|
|
353
353
|
cirq/ops/pauli_measurement_gate_test.py,sha256=IDnbQgyaj-nbYw_sslPBccl8aRGTlMrADc_EEiAvluk,6929
|
|
354
|
-
cirq/ops/pauli_string.py,sha256=
|
|
354
|
+
cirq/ops/pauli_string.py,sha256=C6QlWKHRCqAoN5DNfUsnOw1i4oJnyc_c878GtiZnDfk,63356
|
|
355
355
|
cirq/ops/pauli_string_phasor.py,sha256=5Tm_OoR_v44Kb3AQAw5XIxpcmKtompdbq5ZefYGEUmk,18207
|
|
356
356
|
cirq/ops/pauli_string_phasor_test.py,sha256=ZIoraHH3kOFjtEfThXDS-sxUvSU8MYZ2avtdiPcyN6w,28309
|
|
357
357
|
cirq/ops/pauli_string_raw_types.py,sha256=mBOAwfBT_y7yiSyC6Hr-ofLyIkjyOH5urmK-gitD3-Y,2226
|
|
@@ -1234,8 +1234,8 @@ cirq/work/sampler.py,sha256=rxbMWvrhu3gfNSBjZKozw28lLKVvBAS_1EGyPdYe8Xg,19041
|
|
|
1234
1234
|
cirq/work/sampler_test.py,sha256=SsMrRvLDYELyOAWLKISjkdEfrBwLYWRsT6D8WrsLM3Q,13533
|
|
1235
1235
|
cirq/work/zeros_sampler.py,sha256=Fs2JWwq0n9zv7_G5Rm-9vPeHUag7uctcMOHg0JTkZpc,2371
|
|
1236
1236
|
cirq/work/zeros_sampler_test.py,sha256=lQLgQDGBLtfImryys2HzQ2jOSGxHgc7-koVBUhv8qYk,3345
|
|
1237
|
-
cirq_core-1.7.0.
|
|
1238
|
-
cirq_core-1.7.0.
|
|
1239
|
-
cirq_core-1.7.0.
|
|
1240
|
-
cirq_core-1.7.0.
|
|
1241
|
-
cirq_core-1.7.0.
|
|
1237
|
+
cirq_core-1.7.0.dev20250908175529.dist-info/licenses/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
|
|
1238
|
+
cirq_core-1.7.0.dev20250908175529.dist-info/METADATA,sha256=fXvmqayZ0OHs9WbYqQ-ujSuM3BgFtd91eDyQEKUEHCY,4758
|
|
1239
|
+
cirq_core-1.7.0.dev20250908175529.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
1240
|
+
cirq_core-1.7.0.dev20250908175529.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
|
|
1241
|
+
cirq_core-1.7.0.dev20250908175529.dist-info/RECORD,,
|
{cirq_core-1.7.0.dev20250908175350.dist-info → cirq_core-1.7.0.dev20250908175529.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|