58 lines
1.0 KiB
TeX
Raw Normal View History

2024-01-27 13:16:52 -08:00
\usetikzlibrary{arrows.meta}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{calc}
\usetikzlibrary{circuits.logic.US}
\usetikzlibrary{plotmarks}
\tikzset{
gate/.style = {
draw,
rectangle,
fill = white,
line width = 0.35mm
},
qubit/.style = {
fill = \ORMCbgcolor,
line width = 0.35mm
},
wire/.style = {
line width = 1
},
wirejoin/.style = {
fill = oblue,
draw = oblue,
line width = 1.5
},
wireijoin/.style = {
fill = white,
draw = oblue,
line width = 1.5
},
}
% Macros
2024-01-31 09:23:08 -08:00
% Do NOT put a semicolon after qubox,
% it gives a "character ; not found" error.
% LaTeX is odd.
2024-01-27 13:16:52 -08:00
\def\qubox#1#2#3#4#5{
% 1: point ne
% 2: point ne x offset
% 3: point sw
% 4: point sw x offset
% 5: label text
\draw[
line width = 1,
fill = white,
draw = black
]
([shift={(#2 + 0.1, 0.4)}] #1.center)
-- ([shift={(#2 + 0.1, -0.4)}] #1.center |- #3.center)
-- ([shift={(#4 - 0.1, -0.4)}] #3.center)
-- ([shift={(#4 - 0.1, 0.4)}] #1.center -| #3.center)
-- cycle
;
\node at ($([shift={(#2,0)}] #1)!0.5!([shift={(#4,0)}] #3)$) {#5};
}