cirq-core 1.2.0.dev20230321202148__py3-none-any.whl → 1.2.0.dev20230321220522__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.
cirq/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.0.dev20230321202148"
1
+ __version__ = "1.2.0.dev20230321220522"
@@ -839,10 +839,10 @@ class PauliSum:
839
839
  if exponent == 0:
840
840
  return PauliSum(value.LinearDict({frozenset(): 1 + 0j}))
841
841
  if exponent > 0:
842
- base = self.copy()
842
+ result = self.copy()
843
843
  for _ in range(exponent - 1):
844
- base *= base
845
- return base
844
+ result *= self
845
+ return result
846
846
  return NotImplemented
847
847
 
848
848
  def __truediv__(self, a: value.Scalar):
@@ -1156,6 +1156,22 @@ def test_pauli_sum_pow():
1156
1156
  for psum in [psum1, psum2, psum3, psum4]:
1157
1157
  assert cirq.approx_eq(psum**0, identity)
1158
1158
 
1159
+ # tests for exponents greater than two for both even and odd
1160
+ psum5 = cirq.Z(q0) * cirq.Z(q1) + cirq.Z(q2) + cirq.Z(q3)
1161
+ correctresult = psum5.copy()
1162
+ for e in range(1, 9):
1163
+ assert correctresult == psum5**e
1164
+ correctresult *= psum5
1165
+
1166
+ psum6 = cirq.X(q0) * cirq.Y(q1) + cirq.Z(q2) + cirq.X(q3)
1167
+ assert psum6 * psum6 * psum6 * psum6 * psum6 * psum6 * psum6 * psum6 == psum6**8
1168
+
1169
+ # test to ensure pow doesn't make any change to the original value
1170
+ psum7 = cirq.X(q0) * cirq.Y(q1) + cirq.Z(q2)
1171
+ psum7copy = psum7.copy()
1172
+ assert psum7**5 == psum7 * psum7 * psum7 * psum7 * psum7
1173
+ assert psum7copy == psum7
1174
+
1159
1175
 
1160
1176
  # Using the entries of table 1 of https://arxiv.org/abs/1804.09130 as golden values.
1161
1177
  @pytest.mark.parametrize(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.2.0.dev20230321202148
3
+ Version: 1.2.0.dev20230321220522
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,7 +4,7 @@ cirq/_compat_test.py,sha256=t8YBfeSj-0lQmI1jTxXF4w2BxXZyFnPy31N90extqH4,34121
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=tugiMrJkdqM-EEIJS2RvwMjFLK2Z46ADXSI2dGz4ntU,40
7
+ cirq/_version.py,sha256=Nw332qJD9R6SmuMxDlZcoEmRsB-LG8QrPIfTd4lSOgI,40
8
8
  cirq/_version_test.py,sha256=ZM9GLAiU02rzyJQ_HOT2o_tZixJ0lMXs4tCkOareqTA,133
9
9
  cirq/conftest.py,sha256=mHCDs5--u17oLFDAfIlkTS4TRGSc35eLnZ2CXuIuB7I,1175
10
10
  cirq/json_resolver_cache.py,sha256=RIHbAhGsww7jqhU59vi7nYI7yFP_GJidO8VbfrQM_os,13028
@@ -303,8 +303,8 @@ cirq/ops/identity.py,sha256=_dqF3ngTLZyQoCZYufONIPuZVp5bt33ZcBGJibfJrlI,5502
303
303
  cirq/ops/identity_test.py,sha256=dGx9nzeFCoVo3SmlEbqCGJT1XyzJh-qoPl9n2gEd9WQ,7422
304
304
  cirq/ops/kraus_channel.py,sha256=tCPAEzr_GAL5vTwI43rBoiOnT04l-ebZanuuEuYWDo8,5085
305
305
  cirq/ops/kraus_channel_test.py,sha256=rIApoyo6NvF-FQN0JVbf6MvlI5zbXCcnfbBx7MtjXwU,4708
306
- cirq/ops/linear_combinations.py,sha256=7FHTj87AfPal__nEEDd8CIJk5SLzgJ9AxIdQ9jj2ySs,39659
307
- cirq/ops/linear_combinations_test.py,sha256=gWbO9cL25Y_3P-0DiTCbesduh5nZYZYQGlDKdOR10wA,65719
306
+ cirq/ops/linear_combinations.py,sha256=BTshrcISWEWciiGz83cizVvU7H6RvFm-214oI1eWIpk,39665
307
+ cirq/ops/linear_combinations_test.py,sha256=sTtPzZ4B-Jc7KYAHybEFfaK9JsYNbupb2Z2FShOvhYQ,66367
308
308
  cirq/ops/matrix_gates.py,sha256=wfyVUyEHEx-ciiv48Txy80KyY7amzXKBaLQZ1qGbCvA,9280
309
309
  cirq/ops/matrix_gates_test.py,sha256=PmhZnaaZBmIML9jT9rDPFUcVuAj6Qh62Cl7KkvY8KHk,14236
310
310
  cirq/ops/measure_util.py,sha256=Yu2oyHOPnw4ZN2l3llMdm7Y0iGwBL5uPwmWqdavAFCg,7309
@@ -1126,8 +1126,8 @@ cirq/work/sampler.py,sha256=eqf8gcHsxVqiVJfMwJNVCh5oeoqKgxIqNHhrwJX8Bw8,19760
1126
1126
  cirq/work/sampler_test.py,sha256=zo1Hj6sn6fLs_WZMxYRApBqgBsldmptn74NL0jhNukc,12325
1127
1127
  cirq/work/zeros_sampler.py,sha256=ADBRlKkdUtwfbSWEqyC4j_yB7rMoE8VVPCoQvMuO2PM,2337
1128
1128
  cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
1129
- cirq_core-1.2.0.dev20230321202148.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1130
- cirq_core-1.2.0.dev20230321202148.dist-info/METADATA,sha256=mjHeZbXWXuQaBswQiorxo8AszD701TWYuNgV7_DsX9s,2147
1131
- cirq_core-1.2.0.dev20230321202148.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
1132
- cirq_core-1.2.0.dev20230321202148.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1133
- cirq_core-1.2.0.dev20230321202148.dist-info/RECORD,,
1129
+ cirq_core-1.2.0.dev20230321220522.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1130
+ cirq_core-1.2.0.dev20230321220522.dist-info/METADATA,sha256=6BPCpU86V8FzSuTVy0dWAcXCNYE3SIQl8ahWOnoJqAA,2147
1131
+ cirq_core-1.2.0.dev20230321220522.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
1132
+ cirq_core-1.2.0.dev20230321220522.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1133
+ cirq_core-1.2.0.dev20230321220522.dist-info/RECORD,,