cirq-core 1.5.0.dev20241228161200__py3-none-any.whl → 1.5.0.dev20250102012912__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.dev20241228161200"
31
+ __version__ = "1.5.0.dev20250102012912"
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.dev20241228161200"
6
+ assert cirq.__version__ == "1.5.0.dev20250102012912"
@@ -169,15 +169,12 @@ class ClassicallyControlledOperation(raw_types.Operation):
169
169
  + ', '.join(str(c) for c in self._conditions)
170
170
  + '])',
171
171
  ) + wire_symbols[1:]
172
- exponent_qubit_index = None
173
- if sub_info.exponent_qubit_index is not None:
174
- exponent_qubit_index = sub_info.exponent_qubit_index + control_label_count
175
- elif sub_info.exponent is not None:
176
- exponent_qubit_index = control_label_count
172
+ exp_index = sub_info.exponent_qubit_index
173
+ if exp_index is None:
174
+ # None means at bottom, which means the last of the original wire symbols
175
+ exp_index = len(sub_info.wire_symbols) - 1
177
176
  return protocols.CircuitDiagramInfo(
178
- wire_symbols=wire_symbols,
179
- exponent=sub_info.exponent,
180
- exponent_qubit_index=exponent_qubit_index,
177
+ wire_symbols=wire_symbols, exponent=sub_info.exponent, exponent_qubit_index=exp_index
181
178
  )
182
179
 
183
180
  def _json_dict_(self) -> Dict[str, Any]:
@@ -1033,3 +1033,64 @@ def test_moment_diagram():
1033
1033
 
1034
1034
  """.strip()
1035
1035
  )
1036
+
1037
+
1038
+ def test_diagram_exponents():
1039
+ q0, q1 = cirq.LineQubit.range(2)
1040
+ circuit = cirq.Circuit(
1041
+ cirq.measure(q0, key='m'), (cirq.X(q1) ** 0.5).with_classical_controls('m')
1042
+ )
1043
+ cirq.testing.assert_has_diagram(
1044
+ circuit,
1045
+ """
1046
+ 0: ───M───────────
1047
+
1048
+ 1: ───╫───X^0.5───
1049
+ ║ ║
1050
+ m: ═══@═══^═══════
1051
+ """,
1052
+ )
1053
+
1054
+
1055
+ def test_diagram_exponents_cx():
1056
+ q0, q1, q2 = cirq.LineQubit.range(3)
1057
+ circuit = cirq.Circuit(
1058
+ cirq.measure(q0, key='m'), (cirq.CX(q2, q1) ** 0.5).with_classical_controls('m')
1059
+ )
1060
+ cirq.testing.assert_has_diagram(
1061
+ circuit,
1062
+ """
1063
+ 0: ───M───────────
1064
+
1065
+ 1: ───╫───X^0.5───
1066
+ ║ ║
1067
+ 2: ───╫───@───────
1068
+ ║ ║
1069
+ m: ═══@═══^═══════
1070
+ """,
1071
+ )
1072
+
1073
+
1074
+ def test_diagram_exponents_multiple_keys():
1075
+ q0, q1, q2 = cirq.LineQubit.range(3)
1076
+ circuit = cirq.Circuit(
1077
+ cirq.measure(q0, key='m0'),
1078
+ cirq.measure(q1, key='m1'),
1079
+ (cirq.X(q2) ** 0.5).with_classical_controls('m0', 'm1'),
1080
+ )
1081
+ cirq.testing.assert_has_diagram(
1082
+ circuit,
1083
+ """
1084
+ ┌──┐
1085
+ 0: ─────M─────────────
1086
+
1087
+ 1: ─────╫M────────────
1088
+ ║║
1089
+ 2: ─────╫╫────X^0.5───
1090
+ ║║ ║
1091
+ m0: ════@╬════^═══════
1092
+ ║ ║
1093
+ m1: ═════@════^═══════
1094
+ └──┘
1095
+ """,
1096
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cirq-core
3
- Version: 1.5.0.dev20241228161200
3
+ Version: 1.5.0.dev20250102012912
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=bq4_wnvhtareggCDxhJ1t20XB0S_eBc_WAU7eSQbdFE,1206
8
- cirq/_version_test.py,sha256=Drw6_yHNQkQQ_5pTI2vYDMr7yQmMwHg7_FgEig-bco4,147
7
+ cirq/_version.py,sha256=hjDNzZiwSD3oblkH7KQS5JtKGD16TXuAu3uVEJV87h8,1206
8
+ cirq/_version_test.py,sha256=MglY2GxB6Y-NcvW-8KMSoXN1aa9DZMDsQlDxlbe1vZs,147
9
9
  cirq/conftest.py,sha256=X7yLFL8GLhg2CjPw0hp5e_dGASfvHx1-QT03aUbhKJw,1168
10
10
  cirq/json_resolver_cache.py,sha256=03MVo6Y-UYrzt9CKHmwpiBLN2ixL6uSU-OWnKZXfG7k,13302
11
11
  cirq/py.typed,sha256=VFSlmh_lNwnaXzwY-ZuW-C2Ws5PkuDoVgBdNCs0jXJE,63
@@ -268,8 +268,8 @@ cirq/ops/arithmetic_operation.py,sha256=PBqIwOfADRlsij11Lo1ao_OZM-O8PDlObgZBxGKs
268
268
  cirq/ops/arithmetic_operation_test.py,sha256=axy8xy9IvDb-ATUV-LE1HNWRqCEz06VyZWVrLNOtXXI,4942
269
269
  cirq/ops/boolean_hamiltonian.py,sha256=li003lNq6zS8pNPTobqzfzYJvyvaIpCVo3wkliI6Hzk,14930
270
270
  cirq/ops/boolean_hamiltonian_test.py,sha256=1ey5yfYZPKZDsfM3jpCPAOpbPs_y8i4K_WvDK2d5_4Y,8518
271
- cirq/ops/classically_controlled_operation.py,sha256=dppPudKJQppYH3YsIWIfzy2-kJZYM5x6JivcC9tB3K0,9173
272
- cirq/ops/classically_controlled_operation_test.py,sha256=MNU0Adff4kTosqsrQ3PUT3ARcZee_PkchT6u0xDl8Qg,48039
271
+ cirq/ops/classically_controlled_operation.py,sha256=3YhnNQa7wNyDN0A45z23nkWzl5cI95KMYukUb4cQa2c,9082
272
+ cirq/ops/classically_controlled_operation_test.py,sha256=aNyt2RFWlC_v0PX5TVYWiSkvXB_-z-rkVrHu6ZjJdVg,49679
273
273
  cirq/ops/clifford_gate.py,sha256=qAKS0wqqoHljOF63treyR95I6H0yWFZBiHQoM4sLgSc,39350
274
274
  cirq/ops/clifford_gate_test.py,sha256=NF_if1X8LCMA9hy0vBO7lxvVPdumlvMMnI2XRQ-RLpk,37472
275
275
  cirq/ops/common_channels.py,sha256=uqgocTUhtuJ4VZI_9_3L34gBRTf1A10mByhZY4Q1fB8,38283
@@ -1189,8 +1189,8 @@ cirq/work/sampler.py,sha256=bE5tmVkcR6cZZMLETxDfHehdsYUMbx2RvBeIBetehI4,19187
1189
1189
  cirq/work/sampler_test.py,sha256=hL2UWx3dz2ukZVNxWftiKVvJcQoLplLZdQm-k1QcA40,13282
1190
1190
  cirq/work/zeros_sampler.py,sha256=x1C7cup66a43n-3tm8QjhiqJa07qcJW10FxNp9jJ59Q,2356
1191
1191
  cirq/work/zeros_sampler_test.py,sha256=JIkpBBFPJe5Ba4142vzogyWyboG1Q1ZAm0UVGgOoZn8,3279
1192
- cirq_core-1.5.0.dev20241228161200.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1193
- cirq_core-1.5.0.dev20241228161200.dist-info/METADATA,sha256=2GGctYrgbEDBPDvPhtZFNPWIAtnfjAPH_EVtm5i9c-w,1992
1194
- cirq_core-1.5.0.dev20241228161200.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1195
- cirq_core-1.5.0.dev20241228161200.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1196
- cirq_core-1.5.0.dev20241228161200.dist-info/RECORD,,
1192
+ cirq_core-1.5.0.dev20250102012912.dist-info/LICENSE,sha256=tAkwu8-AdEyGxGoSvJ2gVmQdcicWw3j1ZZueVV74M-E,11357
1193
+ cirq_core-1.5.0.dev20250102012912.dist-info/METADATA,sha256=s4xkfrGYnefP_1yKv-sW10ys8FedPI67_fcuBGnrpRw,1992
1194
+ cirq_core-1.5.0.dev20250102012912.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1195
+ cirq_core-1.5.0.dev20250102012912.dist-info/top_level.txt,sha256=Sz9iOxHU0IEMLSFGwiwOCaN2e9K-jFbBbtpPN1hB73g,5
1196
+ cirq_core-1.5.0.dev20250102012912.dist-info/RECORD,,