diff --git a/src/bloqade/cirq_utils/lowering.py b/src/bloqade/cirq_utils/lowering.py index fc6d895a..934e25b3 100644 --- a/src/bloqade/cirq_utils/lowering.py +++ b/src/bloqade/cirq_utils/lowering.py @@ -282,8 +282,6 @@ def generic_visit(self, state: lowering.State[cirq.Circuit], node: CirqNode): ) raise lowering.BuildError(f"Cannot lower {node}") - # return self.visit_Operation(state, node) - def lower_literal(self, state: lowering.State[cirq.Circuit], value) -> ir.SSAValue: raise lowering.BuildError("Literals not supported in cirq circuit") @@ -658,3 +656,10 @@ def visit_AsymmetricDepolarizingChannel( probabilities, controls=control_qarg, targets=target_qarg ) ) + + def visit_ResetChannel( + self, state: lowering.State[cirq.Circuit], node: cirq.ResetChannel + ): + qubits = self.lower_qubit_getindices(state, node.qubits) + stmt = qubit.stmts.Reset(qubits) + return state.current_frame.push(stmt) diff --git a/test/cirq_utils/test_cirq_to_squin.py b/test/cirq_utils/test_cirq_to_squin.py index 479ba051..de61f8d4 100644 --- a/test/cirq_utils/test_cirq_to_squin.py +++ b/test/cirq_utils/test_cirq_to_squin.py @@ -64,6 +64,13 @@ def phased_gates(): ) +def reset_circuit(): + q = cirq.LineQubit.range(2) + return cirq.Circuit( + cirq.reset(q[0]), cirq.ResetChannel().on_each(*q), cirq.measure(*q) + ) + + def pow_gate_circuit(): q0 = cirq.LineQubit(0) q1 = cirq.LineQubit(1) @@ -188,6 +195,7 @@ def nested_circuit(): nested_circuit, bit_flip, depolarizing_channels, + reset_circuit, ], ) def test_circuit(circuit_f, run_sim: bool = False):