cirq-core 1.5.0.dev20250115192021__py3-none-any.whl → 1.5.0.dev20250115195852__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.dev20250115192021"
31
+ __version__ = "1.5.0.dev20250115195852"
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.dev20250115192021"
6
+ assert cirq.__version__ == "1.5.0.dev20250115195852"
cirq/ops/clifford_gate.py CHANGED
@@ -743,16 +743,21 @@ class SingleQubitCliffordGate(CliffordGate):
743
743
  return phased_x_z_gate.PhasedXZGate(x_exponent=x, z_exponent=z, axis_phase_exponent=a)
744
744
 
745
745
  def __pow__(self, exponent: Union[float, int]) -> 'SingleQubitCliffordGate':
746
- # First to check if we can get the sqrt and negative sqrt Clifford.
747
- if self._get_sqrt_map().get(exponent, None):
748
- pow_gate = self._get_sqrt_map()[exponent].get(self, None)
746
+ if int(exponent) == exponent:
747
+ # The single qubit Clifford gates are a group of size 24
748
+ ret_gate = super().__pow__(int(exponent) % 24)
749
+ return SingleQubitCliffordGate.from_clifford_tableau(ret_gate.clifford_tableau)
750
+ elif int(2 * exponent) == 2 * exponent:
751
+ # If exponent = k/2 for integer k, then we compute the k-th power of the square root
752
+ if exponent < 0:
753
+ sqrt_exp = -0.5
754
+ else:
755
+ sqrt_exp = 0.5
756
+ pow_gate = self._get_sqrt_map()[sqrt_exp].get(self, None)
749
757
  if pow_gate:
750
- return pow_gate
751
- # If not, we try the Clifford Tableau based method.
752
- ret_gate = super().__pow__(exponent)
753
- if ret_gate is NotImplemented:
754
- return NotImplemented
755
- return SingleQubitCliffordGate.from_clifford_tableau(ret_gate.clifford_tableau)
758
+ return pow_gate ** (abs(2 * exponent))
759
+
760
+ return NotImplemented
756
761
 
757
762
  def _act_on_(
758
763
  self,
@@ -219,6 +219,8 @@ def test_pow():
219
219
  assert cirq.SingleQubitCliffordGate.Y_nsqrt == cirq.SingleQubitCliffordGate.Y**-0.5
220
220
  assert cirq.SingleQubitCliffordGate.Z_nsqrt == cirq.SingleQubitCliffordGate.Z**-0.5
221
221
  assert cirq.SingleQubitCliffordGate.X_sqrt**-1 == cirq.SingleQubitCliffordGate.X_nsqrt
222
+ assert cirq.SingleQubitCliffordGate.X_sqrt**3 == cirq.SingleQubitCliffordGate.X**1.5
223
+ assert cirq.SingleQubitCliffordGate.Z**2.0 == cirq.SingleQubitCliffordGate.I
222
224
  assert cirq.inverse(cirq.SingleQubitCliffordGate.X_nsqrt) == (
223
225
  cirq.SingleQubitCliffordGate.X_sqrt
224
226
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.5.0.dev20250115192021
3
+ Version: 1.5.0.dev20250115195852
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=E1AIZ89PhaYNJO8rrbe9ogTS9GINVjScnCngHNtefQY,1206
8
- cirq/_version_test.py,sha256=8ovIebL7J7wnYJ37S0FvXjeE4aYmUr7UAvH8yjjCjkA,147
7
+ cirq/_version.py,sha256=yrZwA1RCY3XzMW4GhFtL0u3f4IT8TTdYVj5mof3GI-Y,1206
8
+ cirq/_version_test.py,sha256=JrEM9TnbhijvSJ1D26rFWPqSq7z7K3iqE5Ht_LrnOjg,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
@@ -270,8 +270,8 @@ cirq/ops/boolean_hamiltonian.py,sha256=li003lNq6zS8pNPTobqzfzYJvyvaIpCVo3wkliI6H
270
270
  cirq/ops/boolean_hamiltonian_test.py,sha256=1ey5yfYZPKZDsfM3jpCPAOpbPs_y8i4K_WvDK2d5_4Y,8518
271
271
  cirq/ops/classically_controlled_operation.py,sha256=qTOsbGRZFbQIaBj9iee31V_V8oMLqWIJjgFomy3kg4A,9104
272
272
  cirq/ops/classically_controlled_operation_test.py,sha256=nIYyXfNH4E2IibZSLk6QDVHpfJQbuI_iWwirCH8rhi8,50209
273
- cirq/ops/clifford_gate.py,sha256=qvzRNQ2uY7jVf7RZwF5smXKgPabMPHZLKKkxzxP2ZwE,39590
274
- cirq/ops/clifford_gate_test.py,sha256=jymAeVgf0FhZM9wmQLgJ8wgY26CgncmPoLY05Vl2dvA,39100
273
+ cirq/ops/clifford_gate.py,sha256=MOmmW5ZhxzuPvBB7oJnIhKSpZWlyYwplew29h-UtmU8,39762
274
+ cirq/ops/clifford_gate_test.py,sha256=zEdXXDA-M7wkHO6GTlltcWz6qyEiF0UaiWP8NwRTUmY,39270
275
275
  cirq/ops/common_channels.py,sha256=d53FzwsYK89vE5SV4PEoy96BPJHtdi522Rq0RRuc88M,38324
276
276
  cirq/ops/common_channels_test.py,sha256=EL_PxbqD3KPC8ioihiukhmW8bUdclqqigKoFyUQpmIM,29690
277
277
  cirq/ops/common_gate_families.py,sha256=e5M8wlDYtdrpWBrhdns6iizIvSqzfxDyIsBdxt8hVMc,8611
@@ -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.dev20250115192021.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1207
- cirq_core-1.5.0.dev20250115192021.dist-info/METADATA,sha256=AHRJbtsTU4z8HpxFNQweALlNSZp5VIzgAT1Ifu0RqT4,2105
1208
- cirq_core-1.5.0.dev20250115192021.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1209
- cirq_core-1.5.0.dev20250115192021.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1210
- cirq_core-1.5.0.dev20250115192021.dist-info/RECORD,,
1206
+ cirq_core-1.5.0.dev20250115195852.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1207
+ cirq_core-1.5.0.dev20250115195852.dist-info/METADATA,sha256=lXPYEdqj18Slo_-d70NIUWjUCHs-uhm0LHv0keEtkM4,2105
1208
+ cirq_core-1.5.0.dev20250115195852.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1209
+ cirq_core-1.5.0.dev20250115195852.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1210
+ cirq_core-1.5.0.dev20250115195852.dist-info/RECORD,,