-
Notifications
You must be signed in to change notification settings - Fork 0
/
semtex.sty
969 lines (869 loc) · 32.6 KB
/
semtex.sty
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
% Names:
% lowerCaseThenCamelCase : typographical constructs
% CamelCaseWithUnambiguousName : semantic commands.
% prefixcharacteralias, : properly-formatted variable names; the prefix denotes
% prefixcharacter the object type, e.g., \gj, \vx, \matA, \miga
% whateverFeelsright : shorthands
%TODO follow these conventions, make shorthands optional / customisable.
%TODO use xkeyval to manage options and make parameter syntax more consistent.
% Currently this sets everything up for ISO 80000-2:2009 compliant mathematical
% typesetting. Eventually, options should be added to support other styles,
% e.g., french, non-bold vectors &c.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{semtex}[2013/03/12 Semantic commands for LaTeX]
\newif\ifPhysicistNotation
\PhysicistNotationfalse
\newif\ifPedanticNotation
\PedanticNotationfalse
\DeclareOption{Physics}{\PhysicistNotationtrue}
\DeclareOption{Mathematics}{\PhysicistNotationfalse}
\DeclareOption{Pedantic}{\PedanticNotationtrue}
\ProcessOptions\relax
\RequirePackage{etoolbox}
\RequirePackage{expl3}
\RequirePackage{xparse}
\RequirePackage{amsmath}
%\RequirePackage{amsthm}
\RequirePackage{mathtools}
\RequirePackage{xfrac}
\RequirePackage{fouridx}
\RequirePackage{relsize}
\RequirePackage[slash-delimiter=frac]{unicode-math}
\setmathfont[Scale=MatchLowercase, math-style=ISO]{Cambria Math}
\setmathfont[Scale=MatchLowercase, range={\mathcal,\mathbfcal}]{texgyrepagella-math.otf}
\newcommand{\VectorSymbol}\mathbfit
\newcommand{\MultiIndexSymbol}\VectorSymbol
\newcommand{\MatrixSymbol}\mathbfit
\newcommand{\TensorSymbol}\mathbfsfit
\newcommand{\OperatorSymbol}[1]{\operatorname{\mathit{#1}}}
\newcommand{\StandardSymbol}\symup
\newcommand{\StandardMatrixSymbol}{\mathbfup}
\newcommand{\StandardVectorSymbol}{\mathbfup}
\newcommand{\StandardTensorSymbol}{\mathbfsfup}
\RequirePackage[amsmath,thmmarks,hyperref]{ntheorem}
%%%% Layout.
\newcommand\numberthis{\addtocounter{equation}{1}\tag{\theequation}}
\makeatletter % Don't try to make my math bold!
\def\theorem@checkbold{}
\makeatother
\numberwithin{equation}{section}
% Theorem styles.
\theoremstyle{nonumberplain}
\theoremheaderfont{\normalfont\bfseries}\theorembodyfont{\upshape}
\theoremseparator{.}
\theoremsymbol{\ensuremath{\mdlgwhtlozenge}}
\newtheorem{definition}{Definition}
\newtheorem{postulate}{Postulate}
\newtheorem{example}{Example}
\newtheorem{consequence}{Consequence}
\newtheorem{exercise}{Exercise}
\newtheorem{remark}{Remark}
%\qedsymbol{\ensuremath{\mdlgwhtsquare}}
\theoremsymbol{\ensuremath{\mdlgwhtsquare}}
\newtheorem{proof}{Proof}
\theorembodyfont{\itshape}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{corollary}{Corollary}
\newtheorem{proposition}{Proposition}
\newtheorem{claim}{Claim}
%%%% Typographical constructs, not to be used directly.
%%% begin Voodoo
% This adds a widecheck, unicode-math style.
% TODO(egg): now it doesn't work and I don't know why.
%\ExplSyntaxOn
%\cs_gset_protected_nopar:Npx \widecheck {
% \@@_accent:nnn {} { \um_symfont_tl } { "030C }
%}
%%\cs_gset_protected_nopar:Npx \slashed { %circumvent an extremely weird bug...
%% \um_accent:nnn {} { \um_symfont_tl } { "0338 }
%%}
%\ExplSyntaxOff
\usepackage{cancel}
% U00338 works well for operators, but isn't so nice for letters.
\newcommand{\slashed}{\cancel}
% This is declares a scaling delimiter which does not scale
% with indices, exponents, limits etc.
\makeatletter
% Something seems to be very buggy, so we need to do some
% dark magic to render things in the right order.
% In particular, this involves negative phantoms.
\def\nvphantom{\v@true\h@false\nph@nt}
\def\nhphantom{\v@false\h@true\nph@nt}
\def\nphantom{\v@true\h@true\nph@nt}
\def\nph@nt{\ifmmode\def\next{\mathpalette\nmathph@nt}%
\else\let\next\nmakeph@nt\fi\next}
\def\nmakeph@nt#1{\setbox\z@\hbox{#1}\nfinph@nt}
\def\nmathph@nt#1#2{\setbox\z@\hbox{$\m@th#1{#2}$}\nfinph@nt}
\def\nfinph@nt{\setbox\tw@\null
\ifv@ \ht\tw@\ht\z@ \dp\tw@\dp\z@\fi
\ifh@ \wd\tw@-\wd\z@\fi \box\tw@}
% This is a well-known hack.
\newcommand\@delimiterWrapper[3]{\mathopen{}\mathclose\bgroup #1 #2\aftergroup\egroup #3}
\newcommand\delimsize[1]{
\if@delimsize
\else
\mathopen{
\left.{\kern-\nulldelimiterspace}
\@delimsizetrue\vphantom{\@delimcontent}\@delimsizefalse
\middle#1
{\kern-\nulldelimiterspace}\right.
}
\fi
}
% The dance with \(n)phantoms typesets the content first,
% then the left bracket and finally the right one. XeLaTeX
% does weird stuff when mathmode starts with a delimiter
% containing only a vphantom.
\def\DeclareDelimiterX#1[#2]#3#4#5 {
\DeclareRobustCommand{#1}[#2]{
\if@delimsize
#5
\else
\begingroup
\mathopen{}
\@delimsizetrue
\hphantom{
\@delimiterWrapper{\left#3}{
\vphantom{#5}
{\kern-\nulldelimiterspace}
}{\right.}
\kern-\nulldelimiterspace
}
\def\@delimcontent{#5}
\@delimsizefalse
{#5}
\nhphantom{#5}
\@delimsizetrue
\nhphantom{
\@delimiterWrapper{\left#3}{
\vphantom{#5}
{\kern-\nulldelimiterspace}
}{\right.}
\kern-\nulldelimiterspace
}
\@delimiterWrapper{\left#3}{
\vphantom{#5}
{\kern-\nulldelimiterspace}
}{\right.}
\kern-\nulldelimiterspace
\@delimsizefalse
\hphantom{#5}
\mathclose{
\@delimsizetrue
\kern-\nulldelimiterspace
\@delimiterWrapper{\left.}{
{\kern-\nulldelimiterspace}
\vphantom{#5}
}{\right#4}
}
\endgroup
\fi
}
}
\newcommand\DeclareDelimiter[3]{\DeclareDelimiterX{#1}[1]{#2}{#3}{##1}}
\makeatother
% This makes a scaling integral sign that seems to (kind of) work.
\makeatletter
\def\@delint{\Udelimiter 4 \symoperators "222B }
\newcommand{\@mathraisebox}[3][\scriptstyle]{%
\raisebox{#2}{$#1 #3$}%
}
\newcommand\scalingIntegralSign[3]{
\@mathraisebox[\displaystyle]{.75pt}{
\operatorname*{
\left.{\kern-\nulldelimiterspace}
\vphantom{#3}\vphantom{\mathlarger{{\integralSign}}}
\middle
\@delint
\right.{\kern-\nulldelimiterspace}
}
\if@delimsize
\else
_{\mathclap{\@mathraisebox{-3pt}{#1\hspace{6.75pt}}}}
^{\mathclap{\@mathraisebox{1pt}{\hspace{3.6pt} #2}}}
\fi
}{\hspace{-1.25pt}#3}
}
\let\oldunderbrace\underbrace
\renewcommand{\underbrace}[1]{\if@delimsize#1\else\oldunderbrace{#1}\fi}
\let\oldvec\vec
\renewcommand{\vec}[1]{\if@delimsize#1\else\oldvec{#1}\fi}
\let\oldoverbrace\overbrace
\renewcommand{\overbrace}[1]{\if@delimsize#1\else\oldoverbrace{#1}\fi}
\makeatother
%%% end Voodoo
% We need ^ and _ to be active in order to ignore
% them when sizing brackets. Beware that
% ^\frac{1}{2} will no longer work, use
% ^{\frac{1}{2}} instead. (^, _, now work as normal
% commands).
\mathcode`\^="8000
\mathcode`\_="8000
\makeatletter
\def\livechars@{
\catcode`\^=\active
\catcode`\_=\active
}
\def\killchars@{
\catcode`\^=7
\catcode`\_=8
}
\makeatother
%\makeatletter
%\ExplSyntaxOn
% \newcommand{\semtexsyntax}{
% \seq_put_left:Nn\l_char_active_seq{^}
% \seq_put_left:Nn\l_char_active_seq{_}
% \catcode`\^=\active
% \catcode`\_=\active
% }
% \newcommand{\normalsyntax}{
% \seq_pop_left:NN\l_char_active_seq\@junk
% \seq_pop_left:NN\l_char_active_seq\@junk
% \catcode`\^=7
% \catcode`\_=8
% }
%\ExplSyntaxOff
%\makeatother
%\semtexsyntax
%
%\newenvironment{safecatcodes}{\normalsyntax}{\semtexsyntax}
\makeatletter
\newif\if@delimsize
\@delimsizefalse
\livechars@
\newcommand^[1]{\if@delimsize{}\else\sp{#1}\fi}
\newcommand_[1]{\if@delimsize{}\else\sb{#1}\fi}
\let\@bar\bar
\renewcommand\bar[1]{\if@delimsize{}\else\@bar{#1}\fi}
\makeatother
\AtBeginDocument{
% Use the proper unicode line extender for long arrows in x*arrow, instead of
% the minus sign which leads to holes in the arrows.
\renewcommand{\relbar}{\mathrel{\harrowextender}}
\let\integralSign\int
\let\summationSign\sum
\let\productSign\prod
\let\muchGreaterThan\gg
\let\muchSmallerThan\ll
\let\capitalGamma\Gamma
\let\capitalPi\Pi
%%% Delimiters.
%% Unary.
\DeclareDelimiter\doubleBars{\Vert}{\Vert}
\DeclareDelimiter\singleBars{\lvert}{\rvert}
\DeclareDelimiter\emptyBarUnkerned{.}{|}
\newcommand{\emptyBar}[1]{\emptyBarUnkerned{\kern-\nulldelimiterspace #1}}
\DeclareDelimiter\parentheses{\lparen}{\rparen}
\DeclareDelimiter\squareBrackets{[}{]}
\DeclareDelimiter\curlyBrackets{\lbrace}{\rbrace}
\DeclareDelimiter\angleBrackets{\langle}{\rangle}
\DeclareDelimiter\floor{\lfloor}{\rfloor}
\DeclareDelimiter\ceil{\lceil}{\rceil}
%% Binary.
\DeclareDelimiterX\lsquareCommaRsquare[2]{[}{]}{#1, #2}
\DeclareDelimiterX\lsquareCommaLsquare[2]{[}{[}{#1, #2}
\DeclareDelimiterX\rsquareCommaRsquare[2]{]}{]}{#1, #2}
\DeclareDelimiterX\rsquareCommaLsquare[2]{]}{[}{#1, #2}
\DeclareDelimiterX\langleBarRangle[2]{\langle}{\rangle}{#1\delimsize\vert #2}
\DeclareDelimiterX\langleCommaRangle[2]{\langle}{\rangle}{#1, #2}
\DeclareDelimiterX\lAngleCommaRAngle[2]{\lAngle}{\rAngle}{#1, #2}
\DeclareDelimiterX\lparenCommaRparen[2]{\lparen}{\rparen}{#1, #2}
\DeclareDelimiterX\lParenCommaRParen[2]{\lParen}{\rParen}{#1, #2}
\DeclareDelimiterX\unkernedEmptySlashEmpty[2]{.}{.}{#1\delimsize\fracslash #2}
\DeclareDelimiterX\unkernedEmptyDotEmpty[2]{.}{.}{#1\cdot #2}
\DeclareDelimiterX\lcurlyBarRcurly[2]{\lbrace}{\rbrace}{#1\:\delimsize\vert\: #2}
\DeclareDelimiterX\lcurlyCommaRcurly[2]{\lbrace}{\rbrace}{#1, #2}
\DeclareDocumentCommand\emptyDotEmpty{mm}{
\unkernedEmptyDotEmpty
{\kern-\nulldelimiterspace #1 }
{#2}\kern-\nulldelimiterspace
}
\DeclareDocumentCommand\emptySlashEmpty{mm}{
\unkernedEmptySlashEmpty
{\kern-\nulldelimiterspace #1 }
{#2}\kern-\nulldelimiterspace
}
%%%% Semantic commands. These are the ones that should be used in the document.
% Set PedanticNotation to true for explicit notations of function
% brackets vs. parentheses, absolute value vs. multi-index total,
% commutators vs. closed intervals, etc.
%%% Constants.
% Mathematical are typeset in roman as per ISO 80000-2:2009
% \Pi is the circle constant.
\renewcommand{\Pi}{{\StandardSymbol \pi}}
% \GoldenRatio is the golden ratio.
\newcommand{\GoldenRatio}{{\StandardSymbol \phi}}
% \I is the maginary unit.
\newcommand\I{\StandardSymbol{i}}
% \E is the base of the natural logarithm.
\newcommand\E{\StandardSymbol{e}}
% \EulerGamma is Euler's constant.
\newcommand\EulerGamma{\StandardSymbol{\gamma}}
% \GaussPi is Gauss's notation for \Gamma, with \Gamma\of{z+1}=\GaussPi\of z.
\newcommand\GaussPi{\StandardSymbol{\capitalPi}}
% \Pauli k is the k-th Pauli matrix.
\newcommand{\PauliMatrix}[1]{\StandardMatrixSymbol{\sigma}_{k}}
%\newcommand{\PauliTensor}{\StandardTensorSymbol\sigma} Nonstandard.
%%% Operators, standard functions.
%% Prefix operators and functions.
% \DiracDelta[x] is the dirac delta distribution, with \DiracDelta[x]\of y = 0
% for all x \neq 0. \DiracDelta is a shorter notation for \DiracDelta[0].
\newcommand{\DiracDelta}[1][]{\operatorname{\delta}_{#1}}
% \RiemannZeta is Riemann's zeta function.
\newcommand{\RiemannZeta}{\operatorname{\StandardSymbol \zeta}}
% \Gamma is the Euler's gamma function.
\renewcommand{\Gamma}{\operatorname{\capitalGamma}}
% \HyperbolicCosine is the hyperbolic cosine.
\DeclareMathOperator{\HyperbolicCosine}{ch}
% \HyperbolicSine is the hyperbolic cosine.
\DeclareMathOperator{\HyperbolicSine}{sh}
% \HyperbolicTangent is the hyperbolic cosine.
\DeclareMathOperator{\HyperbolicTangent}{th}
% \Sign is the sign function.
\DeclareMathOperator{\Sign}{sgn}
% \Laplacian is the Laplacian.
\DeclareMathOperator{\Laplacian}{\increment}
% \diffd is the total differential.
\DeclareMathOperator{\diffd}{d}
% \FT is the prefix notation for the fourier transform.
\DeclareMathOperator{\FT}{\mathscr{F}}
\newcommand{\RFT}{\FT^{-1}}
% \End X is the endomorphism monoid of X.
\DeclareMathOperator{\Endomorphisms}{End}
% \Aut X is the endomorphism group of X.
\DeclareMathOperator{\Automorphisms}{Aut}
\newcommand{\Matrices}[2]{\operatorname{Mat}_{#1}\of{#2}}
% \GL\of{n,F} is the general linear group of degree n over F.
% \GL\of{V} is the general linear group of the vector space V.
% Use \GL\of{n} when the field is implicit.
\DeclareMathOperator{\GeneralLinearGroup}{GL}
% \SL\of{n,F} is the special linear group of degree n over F.
% Remarks from \GL apply.
\DeclareMathOperator{\SpecialLinearGroup}{SL}
% \Orth\of{n,F} is the orthogonal group of degree n over F.
% Remarks from \GL apply.
\DeclareMathOperator{\OrthogonalGroup}{O}
% \SO\of{n,F} is the special orthogonal group of degree n over F.
% Remarks from \GL apply.
\DeclareMathOperator{\SpecialOrthogonalGroup}{SO}
\DeclareMathOperator{\UnitaryGroup}{U}
\DeclareMathOperator{\SpecialUnitaryGroup}{SU}
\DeclareMathOperator{\SymplecticGroup}{Sp}
\DeclareMathOperator{\HermitianOperators}{Hermitian}
%% Diacritics (one-parameter LaTeX commands).
% \conj z is the complex conjugate of z.
% By ISO 80000-2:2009 \overline{z} is the standard notation
% in mathematics, z^* the standard notation in physics.
\newcommand{\conj}[1]{\overline{#1}}
% \ft is the compact notation for the fourier transform.
\newcommand\ft\widehat
% \rft is the compact notation for the reverse fourier transform.
\newcommand\rft\widecheck
%% Postfix operators.
% \Pullback s is the pullback of s.
\newcommand{\Pullback}[1]{#1^*}
% \Dual V is the dual space of V.
\newcommand{\Dual}[1]{#1^*}
% \contdual V is the continuous dual of V.
\newcommand{\contdual}[1]{#1'}
% \adj A is the adjoint of A.
\newcommand{\adj}[1]{#1^\dagger}
% \Closure A is the closure of A.
\newcommand{\Closure}[1]{\overline{#1}}
% f\der is a compact notation for the derivative of f.
\newcommand{\der}{'}
%% Many-argument operators.
% \deriv[n] x f is the nth derivative of f with respect to x.
% Use \deriv x f for the first derivative, and
% \derivop[n] x for the operator 'nth derivative with respect to x.
\newcommand\deriv[3][]{\frac{\diffd^{#1} {#3}}{{\diffd {#2}}^{#1}}}
\newcommand{\derivop}[2][]{\deriv[#1]{#2}{}}
% \pderiv[n] {x_j} f is the nth derivative of f with respect to x_j.
% Remarks from \deriv apply.
\newcommand\pderiv[3][]{\frac{\partial^{#1} #3}{{\partial {#2}}^{#1}}}
\newcommand{\pderivop}[2][]{\pderiv[#1]{#2}{}}
% \pd\vx\miga is the composition of the partial derivation
% operators \pderiv[\ga_j]x_j{}.
\newcommand{\pd}[2]{{\partial_{#1}}^{#2}}
% \pdop\miga is the operator which to f associates the function that
% maps \vx to \pd\vx\miga.
\newcommand{\pdop}[1]{\partial^{#1}}
% \int, \prod and \sum are respectively integration, product and summation over a space
% indicated below. An optional second argument (upper bound) can follow, within square brackets.
\DeclareDocumentCommand\int{m O{}}{\mathchoice
{\scalingIntegralSign{#1}{#2}{}}
{\integralSign_{#1}^{#2}}
{\integralSign_{#1}^{#2}}
{\integralSign_{#1}^{#2}}
}
\DeclareDocumentCommand\sum{m O{}}{\mathchoice
{\summationSign\limits_{\mathclap{#1}}^{\mathclap{#2}}}
{\summationSign_{#1}^{#2}}
{\summationSign_{#1}^{#2}}
{\summationSign_{#1}^{#2}}
}
\DeclareDocumentCommand\prod{m O{}}{\mathchoice
{\productSign\limits_{#1}^{#2}}
{\productSign_{#1}^{#2}}
{\productSign_{#1}^{#2}}
{\productSign_{#1}^{#2}}
}
%%% Sets.
% \NonZero{X} is the complement of {0} in X.
\newcommand{\NonZero}[1]{{#1}^*}
% \Naturals is the set of natural numbers. 0\in\Naturals by ISO 80000-2:2009.
\newcommand{\Naturals}{\mathbb{N}}
% \Positives is the set of stricly positive natural numbers.
\newcommand{\Positives}{\NonZero\Naturals}
% \Integers is the set of integers.
\newcommand{\Integers}{\mathbb{Z}}
% \IntegersModulo{n} is the quotient \Z / n \Z.
\newcommand{\IntegersModulo}[1]{\Integers /{#1}\Integers}
% \Rationals is the set of rationals.
\newcommand{\Rationals}{\mathbb{Q}}
% \Reals is the set of real numbers.
\newcommand{\Reals}{\mathbb{R}}
% \Complexes is the set of complex numbers.
\newcommand{\Complexes}{\mathbb{C}}
% \OpenBall r \vx is the open ball of radius r aroud \vx.
\newcommand{\OpenBall}[2]{B_{#1}{#2}}
% \Cont[k]\of{X,Y} is the set of all continuous functions from X to Y with
% continuous j-th derivatives for j \leq k. \Cont\of{X,Y} = \Cont[0]\of{X,Y} is
% the set of all continuous functions from X to Y. Use \Cont[k]\of{X} when
% Y is implicit, e.g., the standard field.
\newcommand{\Cont}[1][0]{C^{#1}}
% \Continf is the set of all smooth functions.
\newcommand{\Continf}{\Cont[\infty]}
% \Analytic is the set of all analytic functions.
\newcommand{\Analytic}{\Cont[\omega]}
% \Lspace[p]\of X is the space of all functions on X that have finite \Lnorm[p].
% Use \Lspace for the \Lnorm (L - infinity).
\newcommand{\Lspace}[1][\infty]{\operatorname{L}^{#1}}
% \LspaceLoc[p]\of X is the space of all functions on X that have finite \Lnorm[p] locally.
\newcommand{\LspaceLoc}[1][\infty]{\Lspace[{#1}]_{\mathrm{loc}}}
% Remarks from \Lspace apply.
% \SchwartzSpace\of{\R^d} is the Schwartz space of \R^d.
\newcommand{\SchwartzSpace}{\mathcal{S}}
%%% Delimiters.
% \of is the bracketing for function arguments, as in
% f\of\vx, \diffd{x^2+1}. It is distinct from the normal parenthesising.
\newcommand\of[1]{\parentheses{#1}}
% \Associate is the parenthesising for associativity, as in \pa{x+y}^2.
\newcommand\Associate[1]{\parentheses{#1}}
% \tuple{a,b,c} is the tuple containing a, b and c in that order.
\newcommand\tuple[1]{\parentheses{#1}}
% \set{a,b,c} is the set containing a, b and c.
\newcommand\set[1]{\curlyBrackets{#1}}
%% Normlike delimiters.
% \abs is the absolute value on C or R, \abs z = \sqrt{z\conj{z}}.
\newcommand\abs[1]{\singleBars{#1}}
% \norm is the Euclidean norm on R^n, \norm \vx = \sum_i \abs{x_i}^2.
\newcommand\norm[1]{\mathord{\singleBars{#1}}}
% \Lnorm[p] is the Lp function norm, \Lnorm[p] f = \pa{Int_\Rn \abs{f}^p \diffd x}^\frac{1}{p}
% \Lnorm is the L\infty function norm,
% \Lnorm f = \setst{C\geq0}{\abs{f}\leq C \text{almost everywhere}}.
\newcommand\Lnorm[2][\infty]{\doubleBars{#2}_{#1}}
\newcommand\FrobeniusNorm[1]{\doubleBars{#1}}
\newcommand{\FrobeniusInner}[2]{\langleCommaRangle{#1}{#2}}
% \SchwartzNorm\miga\migb{f} is defined as \sup_\{\vx\in\R^n}\abs{\vx^\miga\pd\vx\miga f\of\vx}.
% The Schwartz space is the space of functions for which it is finite for all \miga and \migb.
\newcommand{\SchwartzNorm}[3]{\doubleBars{#3}_{#1,#2}}
% \total is the total of multi-indices, \total \miga = \sum_i \ga_i.
\newcommand\total[1]{\singleBars{#1}}
% \diff{0}{1}{F} is F\of 1 - F\of 0. This notation is used for definite integrals,
% as in \Int 0[1] f\of x \diffd x = \diff 0 1 F if F\der = f
\newcommand{\diff}[3]{\squareBrackets{#3}_{#1}^{#2}}
\newcommand{\Evaluate}[2]{\emptyBar{#1}_{\mathrlap{#2}}}
\newcommand\Floor[1]{\floor{#1}}
\newcommand\Ceiling[1]{\ceil{#1}}
%% Binary delimiters.
% Intervals.
% \intopen a b is the open interval from a excluded to b excluded.
% \intopcl a b is the left half-open interval from a excluded to b included.
% \intclop a b is the right half-open interval from a included to b excluded.
% \intclos a b is the closed interval from a included to b included.
% While this is not the main notation given by ISO 80000-2:2009,
% it is listed as valid alternative.
\newcommand{\intopen}[2]{\rsquareCommaLsquare{#1}{#2}}
\newcommand{\intopcl}[2]{\rsquareCommaRsquare{#1}{#2}}
\newcommand{\intclop}[2]{\lsquareCommaLsquare{#1}{#2}}
\newcommand{\intclos}[2]{\lsquareCommaRsquare{#1}{#2}}
% \commutator is the commutator of operators, \commutator A B = AB - BA.
\newcommand\commutator[2]{\lsquareCommaRsquare{#1}{#2}}
% \InnerProduct is the standard scalar product on R^n, \InnerProduct \vx \vy = \sum_i x_i y_i
% we use \emptyDotEmpty as per ISO 80000-2:2009.
\newcommand\InnerProduct[2]{\emptyDotEmpty{#1}{#2}}
% \pascal is used for expressions which need to be parenthesised if the notation for the
% scalar product \InnerProduct does not include delimiters, e.g. \emptyDotEmpty, but should not be if
% it does, e.g. \angleCommaAngle. 'pascal' stands for pa[rentheses] scal[ar].
% Set \NeedPascal accordingly.
\newif\ifNeedPascal \NeedPascaltrue
\ifNeedPascal \newcommand{\pascal}[1]{\pa{#1}}
\else \newcommand{\pascal}[1]{#1} \fi
% \setst{x\in X}{P\of x} is the set of x in X such that P\of x is true.
\newcommand{\setst}[2]{\lcurlyBarRcurly{#1}{#2}}
\newcommand{\GroupPresentation}[2]{\langleBarRangle{#1}{#2}}
% \LTwoInner{\gj}{\gy} is the standard inner product on \Lspace[2].
\newcommand{\LTwoInner}[2]{\langleCommaRangle{#1}{#2}}
\newcommand{\Poisson}[2]{\lcurlyCommaRcurly{#1}{#2}}
%%% Variable names.
%% Greek letters.
% \g[*] refers to a variable named after a greek letter.
% The command for greek letterforms is of the form \g[shortest Mathematica alias]
\newcommand\ga\alpha
\newcommand\gb\beta
\renewcommand\gg\gamma
\newcommand\gd\delta
\renewcommand\ge\epsilon
\newcommand\gce\varepsilon
\newcommand\gz\zeta
\newcommand\gh\eta
\newcommand\gq\theta
\newcommand\gcq\vartheta
\newcommand\gi\iota
\newcommand\gl\lambda
\newcommand\gk\kappa
\newcommand\gm\mu
\newcommand\gn\nu
\newcommand\gx\xi
\newcommand\gom{o}
\newcommand\gp\pi
\newcommand\gcp\varpi
\newcommand\gr\rho
\newcommand\gcr\varrho
\newcommand\gs\sigma
\newcommand\gfs\varsigma
\newcommand\gt\tau
\newcommand\gu\upsilon
\newcommand\gf\phi
\newcommand\gj\varphi
\newcommand\gc\chi
\newcommand\gy\psi
\newcommand\gw\omega
\newcommand\gdig\digamma
\newcommand\gD\Delta
\newcommand\gL\Lambda
\newcommand\gG\capitalGamma
\newcommand\gS\Sigma
\newcommand\gP\capitalPi
\newcommand\gX\Xi
\newcommand\gW\Omega
%% Vectors, matrices, higher-order tensors.
% Vectors are typeset in bold italic as per ISO 80000-2:2009.
% We use the same convention for multi-indices.
% \v[symbol] is a vector, \mi[symbol] is a multi-index. \nullmi is the multi index (0,\ldots 0),
% \nullvec is the null vector.
\newcommand{\va}{\VectorSymbol a}
\newcommand{\vb}{\VectorSymbol b}
\newcommand{\vc}{\VectorSymbol c}
\newcommand{\vd}{\VectorSymbol d}
\newcommand{\ve}{\VectorSymbol e}
\newcommand{\vf}{\VectorSymbol f}
\newcommand{\vg}{\VectorSymbol g}
\newcommand{\vh}{\VectorSymbol h}
\newcommand{\vi}{\VectorSymbol i}
\newcommand{\vj}{\VectorSymbol j}
\newcommand{\vk}{\VectorSymbol k}
\newcommand{\vl}{\VectorSymbol l}
\newcommand{\vm}{\VectorSymbol m}
\newcommand{\vn}{\VectorSymbol n}
\newcommand{\vo}{\VectorSymbol o}
\newcommand{\vp}{\VectorSymbol p}
\newcommand{\vq}{\VectorSymbol q}
\newcommand{\vr}{\VectorSymbol r}
\newcommand{\vs}{\VectorSymbol s}
\newcommand{\vt}{\VectorSymbol t}
\newcommand{\vu}{\VectorSymbol u}
\newcommand{\vv}{\VectorSymbol v}
\newcommand{\vw}{\VectorSymbol w}
\newcommand{\vx}{\VectorSymbol x}
\newcommand{\vy}{\VectorSymbol y}
\newcommand{\vz}{\VectorSymbol z}
\newcommand{\vF}{\VectorSymbol F}
\newcommand{\vQ}{\VectorSymbol Q}
\newcommand{\vP}{\VectorSymbol P}
\newcommand{\miga}{{\MultiIndexSymbol \alpha}}
\newcommand{\migb}{{\MultiIndexSymbol \beta}}
\newcommand{\vgg}{\VectorSymbol \gamma}
\newcommand{\vgl}{\VectorSymbol \lambda}
\newcommand{\vgm}{\VectorSymbol \mu}
\newcommand{\vgx}{\VectorSymbol \xi}
\newcommand{\nullmi}{\mathbf 0}
\newcommand{\nullvec}{\mathbf 0}
\newcommand{\nullmat}{\mathbf 0}
\newcommand{\opA}{\OperatorSymbol A}
\newcommand{\opB}{\OperatorSymbol B}
\newcommand{\opC}{\OperatorSymbol C}
\newcommand{\opD}{\OperatorSymbol D}
\newcommand{\opE}{\OperatorSymbol E}
\newcommand{\opF}{\OperatorSymbol F}
\newcommand{\opG}{\OperatorSymbol G}
\newcommand{\opH}{\OperatorSymbol H}
\newcommand{\opI}{\OperatorSymbol I}
\newcommand{\opJ}{\OperatorSymbol J}
\newcommand{\opK}{\OperatorSymbol K}
\newcommand{\opL}{\OperatorSymbol L}
\newcommand{\opM}{\OperatorSymbol M}
\newcommand{\opN}{\OperatorSymbol N}
\newcommand{\opO}{\OperatorSymbol O}
\newcommand{\opP}{\OperatorSymbol P}
\newcommand{\opQ}{\OperatorSymbol Q}
\newcommand{\opR}{\OperatorSymbol R}
\newcommand{\opS}{\OperatorSymbol S}
\newcommand{\opT}{\OperatorSymbol T}
\newcommand{\opU}{\OperatorSymbol U}
\newcommand{\opV}{\OperatorSymbol V}
\newcommand{\opW}{\OperatorSymbol W}
\newcommand{\opX}{\OperatorSymbol X}
\newcommand{\opY}{\OperatorSymbol Y}
\newcommand{\opZ}{\OperatorSymbol Z}
\newcommand{\opgP}{\OperatorSymbol \capitalPi}
% Vectors of operators.
\newcommand{\opvP}{\operatorname{\VectorSymbol{P}}}
\newcommand{\opvQ}{\operatorname{\VectorSymbol{Q}}}
\newcommand{\tensgs}{\TensorSymbol \gs}
\newcommand{\tensA}{\TensorSymbol A}
\newcommand{\tensB}{\TensorSymbol B}
\newcommand{\tensC}{\TensorSymbol C}
\newcommand{\tensD}{\TensorSymbol D}
\newcommand{\tensE}{\TensorSymbol E}
\newcommand{\tensF}{\TensorSymbol F}
\newcommand{\tensG}{\TensorSymbol G}
\newcommand{\tensH}{\TensorSymbol H}
\newcommand{\tensI}{\TensorSymbol I}
\newcommand{\tensJ}{\TensorSymbol J}
\newcommand{\tensK}{\TensorSymbol K}
\newcommand{\tensL}{\TensorSymbol L}
\newcommand{\tensM}{\TensorSymbol M}
\newcommand{\tensN}{\TensorSymbol N}
\newcommand{\tensO}{\TensorSymbol O}
\newcommand{\tensP}{\TensorSymbol P}
\newcommand{\tensQ}{\TensorSymbol Q}
\newcommand{\tensR}{\TensorSymbol R}
\newcommand{\tensS}{\TensorSymbol S}
\newcommand{\tensT}{\TensorSymbol T}
\newcommand{\tensU}{\TensorSymbol U}
\newcommand{\tensV}{\TensorSymbol V}
\newcommand{\tensW}{\TensorSymbol W}
\newcommand{\tensX}{\TensorSymbol X}
\newcommand{\tensY}{\TensorSymbol Y}
\newcommand{\tensZ}{\TensorSymbol Z}
\newcommand{\matgg}{\MatrixSymbol \gg}
\newcommand{\matgr}{\MatrixSymbol \gr}
\newcommand{\matg}{\MatrixSymbol g}
\newcommand{\mata}{\MatrixSymbol a}
\newcommand{\matb}{\MatrixSymbol b}
\newcommand{\matx}{\MatrixSymbol x}
\newcommand{\maty}{\MatrixSymbol y}
\newcommand{\matgs}{\MatrixSymbol \gs}
\newcommand{\matrh}{\MatrixSymbol h}
\newcommand{\matA}{\MatrixSymbol A}
\newcommand{\matB}{\MatrixSymbol B}
\newcommand{\matC}{\MatrixSymbol C}
\newcommand{\matD}{\MatrixSymbol D}
\newcommand{\matE}{\MatrixSymbol E}
\newcommand{\matF}{\MatrixSymbol F}
\newcommand{\matG}{\MatrixSymbol G}
\newcommand{\matH}{\MatrixSymbol H}
\newcommand{\matI}{\MatrixSymbol I}
\newcommand{\matJ}{\,\MatrixSymbol J} % Bad kerning in Cambria Math...
\newcommand{\matK}{\MatrixSymbol K}
\newcommand{\matL}{\MatrixSymbol L}
\newcommand{\matM}{\MatrixSymbol M}
\newcommand{\matN}{\MatrixSymbol N}
\newcommand{\matO}{\MatrixSymbol O}
\newcommand{\matP}{\MatrixSymbol P}
\newcommand{\matQ}{\MatrixSymbol Q}
\newcommand{\matR}{\MatrixSymbol R}
\newcommand{\matS}{\MatrixSymbol S}
\newcommand{\matT}{\MatrixSymbol T}
\newcommand{\matU}{\MatrixSymbol U}
\newcommand{\matV}{\MatrixSymbol V}
\newcommand{\matW}{\MatrixSymbol W}
\newcommand{\matX}{\MatrixSymbol X}
\newcommand{\matY}{\MatrixSymbol Y}
\newcommand{\matZ}{\MatrixSymbol Z}
\newcommand{\Identity}{\mathbb{1}}
\newcommand{\ReducedPlanck}{\hslash}
%%% Miscellaneous.
% \placeholder is a placeholder for a parameter,
% as in 'if f is linear, f\of{\gl\placeholder}=\gl f.'
\newcommand\placeholder{\mbox{\:\cdot\:}}
% \funcspec{f}{X}{Y} specifies that f is a function from X to Y.
% \MapSpec [f] X Y does the same, in a more compact notation
% appropriate for chains, eg \MapSpec [f] X {\MapSpec [g] Y Z}
\newcommand{\MapSpec}[3][]{
\ifstrempty{#1}%
{#2 \rightarrow #3}%
{#2\xrightarrow{#1}#3}
}
\DeclareDocumentCommand{\FunctionSpec}{s m m m}{
\IfBooleanTF{#1}{
{#2}:{#3}&\rightarrow{#4}
}{
{#2}:{#3}\rightarrow{#4}
}
}
\newcommand{\FunctionNamedBody}[3]{{#1}:{#2}\mapsto{#3}}
\DeclareDocumentCommand{\FunctionBody}{s m m}{
\IfBooleanTF{#1}{
#2&\mapsto#3
}{
#2\mapsto#3
}
}
% \conv[<type>]{a_k}a indicates that the sequence of a_k s converges to a.
% the type of convergence, e.g., uniform, uniform for all derivatives, etc.
% is indicated by <type>. Use \conv{a_k}{a} when <type> is implicit.
\newcommand{\conv}[3][]{%
\ifstrempty{#1}%
{#2 \rightarrow #3}%
{#2\xrightarrow{#1}#3}%
}
% \tupleSpec{f\of i}{i\in X} denotes the Cartesian product \prod{i\in X}f\of i.
% as such it should be used for defining sequences, vectors, and higher-order
% tensors (with several index specifications.
\newcommand{\tuplespec}[2]{\parentheses{#1}_{#2}}
%%% Pedantic variants.
\ifPedanticNotation
\renewcommand\Associate[1]{\parentheses{#1}_\mathrm{Assoc.}}
\renewcommand\of[1]{\squareBrackets{#1}}
\renewcommand\total[1]{\singleBars{#1}_{\mathrm{MI}}}
\renewcommand\norm[1]{\singleBars{#1}_{2}}
\renewcommand\abs[1]{\singleBars{#1}_{\mathrm{abs}}}
\renewcommand\tuple[1]{\parentheses{#1}_{\mathrm{tuple}}}
\renewcommand\commutator[2]{\lsquareCommaRsquare{#1}{#2}_{\mathrm{commutator}}}
\renewcommand\Lnorm[2][\infty]{\doubleBars{#2}_{\mathcal{L}_{#1}}}
\renewcommand{\intopen}[2]{\rsquareCommaLsquare{#1}{#2}_{\mathrm{interval}}}
\renewcommand{\intopcl}[2]{\rsquareCommaRsquare{#1}{#2}_{\mathrm{interval}}}
\renewcommand{\intclop}[2]{\lsquareCommaLsquare{#1}{#2}_{\mathrm{interval}}}
\renewcommand{\intclos}[2]{\lsquareCommaRsquare{#1}{#2}_{\mathrm{interval}}}
\fi
%%% Shorthands.
\newcommand{\scal}{\InnerProduct}
\newcommand{\pa}{\Associate}
\newcommand\N\Naturals
\newcommand\Nstar\Positives
\newcommand\Z\Integers
\newcommand\Q\Rationals
\newcommand\R\Reals
\renewcommand\C\Complexes
\newcommand{\FreeGroup}[1]{\operatorname{F}_{#1}}
\newcommand{\GroupGeneratedBy}[1]{\angleBrackets{#1}}
\newcommand{\Subgroup}{\leq}
\newcommand{\NormalSubgroup}{\trianglelefteq}
\newcommand{\Cardinality}[1]{\singleBars{#1}}
\newcommand{\HeisenbergGroup}[1][]{\ifstrempty{#1}{\operatorname{H}}{\operatorname{Heisenberg}_{#1}}}
% We used these ever so slightly confusing notations.
\newcommand{\FiniteHeisenbergGroup}[1]{\operatorname{H}_{#1}}
\newcommand{\Helt}[3]{\squareBrackets{#1,#2;#3}}
\newcommand{\Compose}{\circ}
\newcommand{\LongDomainSpec}[1]{
\substack{#1}
}
\newcommand{\LeftConjugationAction}[2]{\fourIdx{#1}{}{}{}#2}
\newcommand{\LeftCosets}[2]{\emptySlashEmpty{#1}{#2}}
\newcommand{\QuotientGroup}{\LeftCosets}
\newcommand{\EmptySet}\varnothing
\newcommand{\Union}{\cup}
\newcommand{\Intersection}{\cap}
\newcommand{\SymmetricDifference}{\bigtriangleup}
\newcommand{\DefineAs}{\coloneq}
% When using ComputerModern, Subset will be undefined,
% but it will be defined when using Utopia, so we use
% a \def.
\def\Subset{\subseteq}
\def\Superset{\supseteq}
\newcommand{\StrictSubset}{\subsetneq}
% \Character[\gr] is the character of the
% representation \gr. Use \Character when
% \gr is implicit.
\newcommand\Character[1][]{\mathrm{\chi}_{#1}}
\DeclareMathOperator{\OpenSets}{Open}
\newcommand\UnitSphere[1]{\mathrm{S}^{#1}}
% \Functions{X}{Y} is the set of functions from X to Y.
\newcommand\Functions[2]{{#2}^{#1}}
\newcommand\PontryaginDual\widehat
\newcommand\PowerSet[1]{2^{#1}}
\newcommand{\KroneckerDelta}[2]{\mathrm{\delta}_{#1\,#2}}
\DeclareMathOperator\LinearSpan{span}
\newcommand{\Orthogonal}{\mathrel{\bot}}
\newcommand\LebesgueMeasure[1]{\operatorname{\mathcal{L}}^{#1}}
\DeclareDocumentCommand\DirectSumOver{m O{}}{\mathchoice
{\bigoplus\limits_{#1}^{#2}}
{\bigoplus_{#1}^{#2}}
{\bigoplus_{#1}^{#2}}
{\bigoplus_{#1}^{#2}}
}
\newcommand{\DirectSum}{\oplus}
\DeclareDocumentCommand\UnionOver{m O{}}{\mathchoice
{\bigcup\limits_{#1}^{#2}}
{\bigcup_{#1}^{#2}}
{\bigcup_{#1}^{#2}}
{\bigcup_{#1}^{#2}}
}
\DeclareDocumentCommand\IntersectionOver{m O{}}{\mathchoice
{\bigcap\limits_{#1}^{#2}}
{\bigcap_{#1}^{#2}}
{\bigcap_{#1}^{#2}}
{\bigcap_{#1}^{#2}}
}
\newcommand{\Homeomorphic}{\simeq}
\newcommand{\Isomorphic}{\cong}
\renewcommand\And\wedge
\newcommand\Transpose[1]{{#1}^\top}
\DeclareDocumentCommand\FiniteSum{m}{\mathchoice
{{\summationSign\limits_{#1}}'}
{\summationSign'_{#1}}
{\summationSign'_{#1}}
{\summationSign'_{#1}}
}
\newcommand{\TangentSpace}[2]{\operatorname{T}_{#1}{#2}}
\newcommand{\CotangentSpace}[2]{\Dual{\operatorname{T}}_{#1}{#2}}
\newcommand{\TangentBundle}[1]{\operatorname{T}{#1}}
\newcommand{\CotangentBundle}[1]{\Dual{\operatorname{T}}{#1}}
\newcommand\TimeDerivative[1]{\dot{#1}}
\newcommand\SecondTimeDerivative[1]{\ddot{#1}}
\newcommand{\LieAlgebraSymbol}[1]{\mathfrak{#1}}
\DeclareMathOperator{\LieAlgebra}{Lie}
\newcommand{\Cartesian}{\times}
\newcommand{\DirectProduct}{\Cartesian}
\newcommand\DefinitionOf\eqcolon
\newcommand{\Equivalent}{\iff}
\newcommand{\CircleGroup}{\mathbb{T}}
\newcommand{\Torus}[1]{\CircleGroup^{#1}}
\newcommand{\FunctionDefinition}[5]{
\begin{aligned}
{#1}:{#2}&\rightarrow{#3}\\
{#4}&\mapsto{#5}
\end{aligned}
}
\newcommand{\Factorial}[1]{#1 !}
\newcommand{\Implies}{\implies}
\newcommand\dder{^\dprime}
\newcommand{\Identically}{\equiv}
\newcommand{\Exterior}{\wedge}
\newcommand{\FunctionActionSpecBody}[5]{#1:#2&\rightarrow #3\\#4 &= #5}
\newcommand{\MapSpecBody}[5][]{#2&\ifstrempty{#1}{\rightarrow}{\xrightarrow{#1}} #3\\#4 &\mapsto #5}
\newcommand{\Probability}[2][]{\operatorname{\mathbb P_{#1}}\squareBrackets{#2}}
\newcommand{\ExpectedValue}[2][]{\operatorname{\mathbb E_{#1}}\squareBrackets{#2}}
\renewcommand{\Variance}[2][]{\operatorname{Var}_{#1}\squareBrackets{#2}}
\DeclareMathOperator\Determinant{det}
\DeclareMathOperator\Trace{tr}
\newcommand{\Tensor}{\otimes}
\newcommand{\grad}{\mathbf{\nabla}}
\newcommand{\ifrac}[2]{\emptySlashEmpty{#1}{#2}}
\newcommand{\Dimension}[1][]{\operatorname{dim}_{#1}}
\newcommand{\HarmonicNumber}[1]{\operatorname{H}_{#1}}
\renewcommand{\binom}[2]{\parentheses{\genfrac{}{}{0pt}{}{#1}{#2}}}
\DeclareMathOperator{\ConjugacyClass}{C}
\newcommand{\Multiply}{\cdot}
\newcommand{\Divides}{\mid}
\newcommand{\DoesNotDivide}{\nmid}
\DeclareMathOperator\BigO{\mathscr{O}}
%\makeatletter
%\killchars@
%\makeatother
}%AtBeginDocument