Skip to content

Commit 638ed83

Browse files
committed
add MSGate to top level
1 parent 6a40da5 commit 638ed83

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

cirq-core/cirq/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@
240240
MatrixGate,
241241
MixedUnitaryChannel,
242242
M,
243+
MSGate,
243244
measure,
244245
measure_each,
245246
measure_paulistring_terms,

cirq-core/cirq/json_resolver_cache.py

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def _symmetricalqidpair(qids):
157157
'LineTopology': cirq.LineTopology,
158158
'Linspace': cirq.Linspace,
159159
'ListSweep': cirq.ListSweep,
160+
'MSGate': cirq.MSGate,
160161
'MatrixGate': cirq.MatrixGate,
161162
'MixedUnitaryChannel': cirq.MixedUnitaryChannel,
162163
'MeasurementKey': cirq.MeasurementKey,

cirq-core/cirq/ops/parity_gates_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def test_trace_distance():
258258
def test_ms_arguments():
259259
eq_tester = cirq.testing.EqualsTester()
260260
eq_tester.add_equality_group(
261-
cirq.ms(np.pi / 2), cirq.ops.MSGate(rads=np.pi / 2), cirq.XXPowGate(global_shift=-0.5)
261+
cirq.ms(np.pi / 2), cirq.MSGate(rads=np.pi / 2), cirq.XXPowGate(global_shift=-0.5)
262262
)
263263
eq_tester.add_equality_group(
264264
cirq.ms(np.pi / 4), cirq.XXPowGate(exponent=0.5, global_shift=-0.5)
@@ -325,7 +325,7 @@ def test_ms_diagrams():
325325
def test_json_serialization():
326326
def custom_resolver(cirq_type: str):
327327
if cirq_type == "MSGate":
328-
return cirq.ops.MSGate
328+
return cirq.MSGate
329329
return None
330330

331331
assert cirq.read_json(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"cirq_type": "MSGate",
3+
"rads": 1.5707963267948966
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cirq.ms(np.pi/2)

0 commit comments

Comments
 (0)