File: zx-calculus.cwl

package info (click to toggle)
texstudio 4.3.1%2Bds-2
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 74,980 kB
  • sloc: cpp: 102,721; xml: 17,126; ansic: 8,143; sh: 194; javascript: 177; makefile: 28
file content (303 lines) | stat: -rw-r--r-- 5,008 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# zx-calculus package
# Matthew Bertucci 10/23/2021

#include:tikz-cd
#include:amssymb
#include:etoolbox
#include:ifthen
#include:xparse
#include:bm

\zx[options]{diagram%formula}
\begin{ZX}#\array,math
\begin{ZX}[options]#\array,math
\end{ZX}

#keyvals:\zx#c,\begin{ZX}#c
every diagram
diagrams=%<options%>
every matrix
every cell
cells=%<options%>
row sep=
column sep=
sep=
cramped
math mode#true,false
background color=#%color
every arrow
arrows=%<options%>
arrow style=#Latin Modern,math font,tikz
phantom
shift left=##L
shift right=##L
shift={%<coordinate%>}
xshift=##L
yshift=##L
start anchor=
end anchor=
shorten=##L
crossing over
crossing over clearance=##L
every label
labels=%<options%>
marking
description
center yshift=##L
execute at begin picture={%<code%>}
text=
/zx/user overlay nodes/.style=
/zx/user overlay wires/.style=
#endkeyvals

\arrow[options%keyvals]
\arrow[options%keyvals]{direction}#*
\ar[options%keyvals]#*
\rar[options%keyvals]%<labels%>#*
\lar[options%keyvals]%<labels%>#*
\dar[options%keyvals]%<labels%>#*
\uar[options%keyvals]%<labels%>#*
\drar[options%keyvals]%<labels%>#*
\urar[options%keyvals]%<labels%>#*
\dlar[options%keyvals]%<labels%>#*
\ular[options%keyvals]%<labels%>#*

#keyvals:\arrow#c,\ar#c,\rar#c,\lar#c,\dar#c,\uar#c,\drar#c,\urar#c,\dlar#c,\ular#c
to head
rightarrow
leftarrow
leftrightarrow
Rightarrow
Leftarrow
Leftrightarrow
maps to
mapsto
mapsfrom
Mapsto
Mapsfrom
hook
hook'
hookrightarrow
hookleftarrow
dashed
dashrightarrow
dashleftarrow
tail
rightarrowtail
leftarrowtail
squiggly
rightsquigarrow
leftsquigarrow
leftrightsquigarrow
two heads
twoheadrightarrow
twoheadleftarrow
no head
no tail
dash
equal
harpoon
harpoon'
rightharpoonup
rightharpoondown
leftharpoonup
leftharpoondown
crossing over
bend right
bend left
from=
to=
start anchor=
end anchor=
C
C=%<radius ratio%>
C.
C.=%<radius ratio%>
C'
C'=%<radius ratio%>
C-
C-=%<radius ratio%>
o'
o'=%<angle%>
o.
o.=%<angle%>
o-
o-=%<angle%>
-o
-o=%<angle%>
(
(=%<angle%>
)
)=%<angle%>
('-
('=%<angle%>
)'
)'=%<angle%>
s
s'
s'=%<angle%>
s.
s.=%<angle%>
-s'
-s'=%<angle%>
-s.
-s.=%<angle%>
s'-
s'-=%<angle%>
s.-
s.-=%<angle%>
ss
ss.
ss.=%<angle%>
.ss
.ss=%<angle%>
sIs.
sIs.=%<angle%>
.sIs
.sIs=%<angle%>
ss.I-
ss.I-=%<angle%>
I.ss-
I.ss-=%<angle%>
<'
<'=%<angle%>
<.
<.=%<angle%>
'v
'v=%<angle%>
v'
v'=%<angle%>
.^
.^=%<angle%>
^.
^.=%<angle%>
3 dots=%<text%>
3 vdots=%<text%>
H
Z
X
wire centered
wc
wire centered start
wcs
wire centered end
wce
ls=%<looseness%>
between none
bn
#endkeyvals

\zxEmptyDiagram{}
\zxNone{text}
\zxNone+{text}
\zxNone-{text}
\zxNone|{text}
\zxN{text}#*
\zxN+{text}#*
\zxN-{text}#*
\zxN|{text}#*
\zxNoneDouble{text}
\zxNoneDouble+{text}
\zxNoneDouble-{text}
\zxNoneDouble|{text}
\zxFracZ{numerator}{denominator}
\zxFracZ{numerator}[num with parens][denom with parens]{denominator}
\zxFracZ-{numerator}{denominator}
\zxFracZ-{numerator}[num with parens][denom with parens]{denominator}
\zxFracX{numerator}{denominator}
\zxFracX-{numerator}{denominator}
\zxZ{text}
\zxZ[options%keyvals]{text}
\zxX{text}
\zxX[options%keyvals]{text}
\zxH{text}
\zxH[options%keyvals]{text}

#keyvals:\zx#c,\begin{ZX}#c,\zxZ#c,\zxX#c,\zxH#c,\zxSaveDiagram#c
a=%<alias%>
phase in content
phase in label
phase in label=%<style%>
pil
pil=%<style%>
phase in label above
phase in label above=%<style%>
pila
pila=%<style%>
phase in label below
phase in label below=%<style%>
pilb
pilb=%<style%>
phase in label right
phase in label right=%<style%>
pilr
pilr=%<style%>
phase in label left
phase in label left=%<style%>
pill
pill=%<style%>
#endkeyvals

#keyvals:\zxZ#c,\zxX#c,\zxH#c
a=%<alias%>
#endkeyvals

\leftManyDots{text}
\leftManyDots[text scale][dots scale]{text}
\rightManyDots{text}
\rightManyDots[text scale][dots scale]{text}
\middleManyDots{}
\zxLoop{}
\zxLoop[dir angle][open angle][styles]{}
\zxLoopAboveDots{}
\zxLoopAboveDots[open angle][styles]{}

\zxDebugMode#*
\zxConvertToFracInContent#*
\zxConvertToFracInLabel#*

colorZxZ#B
colorZxX#B
colorZxH#B

\zxHCol#*
\zxHRow#*
\zxHColFlat#*
\zxHRowFlat#*
\zxSCol#*
\zxSRow#*
\zxSColFlat#*
\zxSRowFlat#*
\zxHSCol#*
\zxHSRow#*
\zxHSColFlat#*
\zxHSRowFlat#*
\zxWCol#*
\zxWRow#*
\zxwCol#*
\zxwRow#*
\zxDotsCol#*
\zxDotsRow#*
\zxZeroCol#*
\zxZeroRow#*
\zxNCol#*
\zxNRow#*
\zxDefaultColumnSep#*
\zxDefaultRowSep#*
\zxDefaultSoftAngleS#*
\zxDefaultSoftAngleN#*
\zxDefaultSoftAngleO#*
\zxDefaultSoftAngleChevron#*
\zxScaleDots#*
\zxMinus#*
\zxDefaultLineWidth#*
\zxEdgesAbove#*
\zxControlPointsVisible#*
\zxEnableIntersections#*
\zxDisableIntersections#*
\zxEnableIntersectionsNodes#*
\zxEnableIntersectionsWires#*
\zxIntersectionLineBetweenStartEnd#*

\zxSaveDiagram{cmd}{diagram%formula}#d
\zxSaveDiagram{cmd}[options%keyvals]{diagram%formula}#d