Skip to content

Commit

Permalink
[add] Expose tequila multi-controlled-gate API
Browse files Browse the repository at this point in the history
  • Loading branch information
Mc-Zen committed Oct 15, 2024
1 parent 7a9095e commit c9a3791
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/tequila-impl.typ
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@
control, target, gates.ctrl, gates.gate.with(content)
)

#let multi-controlled-gate(controls, qubit, target) = generate-multi-controlled-gate(
controls, qubit, target
)


/// Constructs a circuit from operation instructions.
///
Expand Down
2 changes: 1 addition & 1 deletion src/tequila.typ
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#import "tequila-impl.typ": build, h, gate, mqgate, x, y, z, cx, cz, s, sdg, sx, sxdg, t, tdg, p, rx, ry, rz, u, barrier, swap, meter, graph-state, qft, ccx, ccz, cca, cccx
#import "tequila-impl.typ": build, h, gate, mqgate, x, y, z, cx, cz, s, sdg, sx, sxdg, t, tdg, p, rx, ry, rz, u, barrier, swap, meter, graph-state, qft, ccx, ccz, cca, cccx, multi-controlled-gate
Binary file modified tests/tequila/basic/ref/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion tests/tequila/basic/test.typ
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
tq.y(1),
tq.cca(1, 4, 2, $X$),
tq.h(range(5)),
tq.cccx(0, 1, 3, 2)
tq.cccx(0, 1, 3, 2),
tq.multi-controlled-gate((0,1,4), 2, quill.mqgate.with(n:2, $K$))
))

0 comments on commit c9a3791

Please sign in to comment.