From 6f5a887b19fd4c120b107864cf307dad1d4302d1 Mon Sep 17 00:00:00 2001 From: Mc-Zen Date: Sat, 14 Sep 2024 17:55:16 +0200 Subject: [PATCH] [add] basic multi-qubit support for `midstick`, see #10 --- src/decorations.typ | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/decorations.typ b/src/decorations.typ index 967a3ec..0763a1d 100644 --- a/src/decorations.typ +++ b/src/decorations.typ @@ -76,11 +76,19 @@ /// - label (array, str, content, dictionary): One or more labels to add to the gate. #let midstick( content, + n: 1, fill: none, label: none, x: auto, y: auto -) = gate(content, draw-function: draw-functions.draw-unboxed-gate, label: label, fill: fill, x: x, y: y) +) = { + if n == 1 { + gate(content, draw-function: draw-functions.draw-unboxed-gate, label: label, fill: fill, x: x, y: y) + } else { + mqgate(content, n: n, draw-function: draw-functions.draw-boxed-multigate, label: label, fill: fill, x: x, y: y, stroke: none) + } +} +