Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/Quantum.m4

raw
1 .PS
2 # Quantum.m4
3 cct_init
4
5 [
6 boxht = 0.30
7 boxwid = boxht
8 define(`dotrad_',boxht/5)
9
10 define(`Bus',`line right_ 10*boxwid `$1'
11 circle diam boxht `$2' at last line.start
12 box fill_(1) "H" at last line.start+(boxwid*3/2,0)
13 box fill_(1) "H" at last line.end-(boxwid*2.5,0) ')
14
15 define(`Meter',`[ Box: box wid boxwid*3/2 fill_(1)
16 r = Box.wid/3
17 C: 0.3 between Box.s and Box.n
18 arc cw from C+(-r,0) to C+(r,0) with .c at C
19 arrow from C+(-r/4,0) to C+(0.9*r,0.9*r) ]')
20
21 X: Bus(,shaded rgbstring(0.5,0.5,1) "X")
22 A1: Bus(from X.start+(0,-boxht*3/2), shaded "red" "A")
23 A2: Bus(from 2 between X.start and A1.start,shaded "red" "A")
24 dot(at X.start+(3*boxwid,0))
25 line to (Here,A2); dot
26 circle rad dotrad_ at A1.start+(4*boxwid,0)
27 line from last circle.s to (last circle,X); dot
28 Meter with .e at X.end
29 box wid boxwid*1.2 ht boxht*1.2 fill_(1) "$R_{\psi}^{\pi/2}$" \
30 at A2.end-(4.5*boxwid,0)
31 ]
32 [
33 #.PS
34 # Rxx gate
35 # https://tex.stackexchange.com/questions/741304/quantikz-how-to-draw-a-r-xx-gate-using-quantikz-in-latex
36 #cct_init
37 define(`dotrad_',`(0.04*dimen_)')
38
39 linethick = 1.6
40 define(`Box',`box wid boxwid*2/3 ht boxht*2/3 rad boxht/8 outlined "red!60" \
41 "$\theta_{xx}^{{\color{red}2},`$1',`$2'}$" shaded "white"')
42
43 del = boxht/4
44 Outer: box rad boxht/4 dashed wid 3*boxwid ht 4*boxwid shaded "red!4"
45 Rxx: [
46 B1: Box(1,i)
47 B2: Box(1,j) with .w at B1.e+(del,0)
48 B3: Box(1,j) with .n at (1/2 between B1 and B2,B1.s-(0,B1.ht+del))
49 B4: Box(1,8) with .w at B3.e+(B1.ht+del/2,0)
50 B5: Box(j,8) with .n at (B1,B4.s-(0,B1.ht+del))
51 B6: Box(i,8) at (B4.w.x-del/2,B5.y)
52 I1: B1.nw+(-B1.ht,del)
53 Rail1: line from I1 right_ B4.e.x+B1.w.x-2*I1.x
54 Rail2: line from (Rail1.start,B3.n+(0,del)) right_ Rail1.len
55 Rail3: line from (Rail1.start,B3.s-(0,del)) right_ Rail1.len
56 Rail4: line from (Rail1.start,B5.s-(0,del)) right_ Rail1.len
57 define(`connx',
58 `dot(at (`$1',`$2')); line to `$1'.n; dot(at (`$1',`$3')); line to `$1'.s')
59 connx(B1,Rail1,Rail2)
60 connx(B2,Rail1,Rail3)
61 connx(B3,Rail2,Rail3)
62 connx(B4,Rail1,Rail4)
63 connx(B5,Rail3,Rail4)
64 connx(B6,Rail2,Rail4)
65 "$\cdots$" at (B3,Rail2)+(0,del)
66 "$\cdots$" at (B6,Rail2)+(0,del)
67 "$\cdots$" at (B2,Rail3)-(0,del)
68 ] at Outer
69 #.PE
70 ] with .nw at last [].ne+(boxht/3,0)
71
72 #.PE
73 #.PS
74 # SQUID.m4
75 cct_init
76
77 [
78 down_
79 #source
80 S1: SQUID
81 "J1" at S1.J1 above rjust
82 "J2" at S1.J2 above ljust
83
84 S2: SQUID(3,dimen_*1.5,-120) at S1.e+(elen_,0)
85 "J1" at S2.J1 above rjust
86 "J2" at S2.J2 below ljust
87 "J3" at S2.J3 above ljust
88 arcrad = S2.C.rad*0.7
89 arc from S2.c+(Rect_(arcrad,-135)) to S2.c+(Rect_(arcrad,-45)) \
90 with .c at S2.C ->
91 ] with .w at (1st [].w.x+boxwid/2,last [].s.y+boxht)
92
93 .PE