Skip to content

Commit be20002

Browse files
committed
Fix issue where dagger arg was not set.
1 parent 19dd7b3 commit be20002

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/bloqade/stim/rewrite/qubit_to_stim.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ def rewrite_SingleQubitGate(
8080
stim_stmt_cls = getattr(stim_gate.stmts, stmt_name, None)
8181
if stim_stmt_cls is None:
8282
return RewriteResult()
83-
stim_stmt = stim_stmt_cls(targets=tuple(qubit_idx_ssas))
83+
84+
if isinstance(stmt, gate.stmts.SingleQubitNonHermitianGate):
85+
stim_stmt = stim_stmt_cls(
86+
targets=tuple(qubit_idx_ssas), dagger=stmt.adjoint
87+
)
88+
else:
89+
stim_stmt = stim_stmt_cls(targets=tuple(qubit_idx_ssas))
8490
stmt.replace_by(stim_stmt)
8591

8692
return RewriteResult(has_done_something=True)

0 commit comments

Comments
 (0)