Skip to content

Commit

Permalink
attempt to fix error when reverse_circuit is false for classical cont…
Browse files Browse the repository at this point in the history
…rol gate
  • Loading branch information
kpobrien committed Nov 1, 2023
1 parent 6a2977e commit 7bd5994
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/qutip_qip/circuit/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,9 @@ def latex_code(self):
gate.classical_controls
and (n - self.N) in gate.classical_controls
):
control_tag = n - gate.targets[0]
control_tag = (-1 if self.reverse_states else 1) * (
gate.targets[0] - n
)
col.append(r" \ctrl{%d} " % control_tag)

elif not gate.controls and not gate.targets:
Expand Down

0 comments on commit 7bd5994

Please sign in to comment.