Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/bloqade/cirq_utils/lowering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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)
8 changes: 8 additions & 0 deletions test/cirq_utils/test_cirq_to_squin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -188,6 +195,7 @@ def nested_circuit():
nested_circuit,
bit_flip,
depolarizing_channels,
reset_circuit,
],
)
def test_circuit(circuit_f, run_sim: bool = False):
Expand Down
Loading