-
Notifications
You must be signed in to change notification settings - Fork 53
/
macros+pkgs--random-features.tex
232 lines (193 loc) · 7.33 KB
/
macros+pkgs--random-features.tex
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
\usepackage{braket}
\newcommand{\Z}{{\mathbb{Z}}}
\newcommand{\C}{{\mathbb{C}}}
\newcommand{\R}{{\mathbb{R}}}
\newcommand{\id}{{\mathbbm{1}}} % identity matrix
\newcommand{\CNOT}{\mathop\mathrm{CNOT}} % CNOT gate inside math environments
\newcommand{\SU}{\mathrm{SU}} % Lie group SU
\newcommand{\su}{\mathfrak{su}} % Lie algebra SU
\newcommand{\qft}{\mathrm{qft}}
\newcommand{\qftf}{\mathrm{\mathbf{f}}} % qft f
\newcommand{\ii}{\mathrm{i}}
\newcommand{\ee}{\mathrm{e}}
% an alias because otimes occurs too often
\newcommand{\ox}{\otimes}
\newcommand{\bolma}{\mathbf{\upsigma}} % tensor product of paulis
\newcommand{\floor}[1]{\left \lfloor #1 \right \rfloor}
\renewcommand{\O}{\mathcal{O}}
\newcommand{\norm}[1]{\|{#1}\|}
\newcommand{\Norm}[1]{\left\|{#1}\right\|}
\newcommand{\Abs}[1]{\left|{#1}\right|}
\newcommand{\Tr}[1]{\mathop{}\text{Tr}\left({#1}\right)}
% \newcommand{\ketbra}[2]{\ket{#1}\!\!\bra{#2}}
\newcommand{\proj}[1]{\ketbra{{#1}}{{#1}}}
\DeclareMathOperator{\spn}{span}
\DeclareMathOperator{\spec}{Spec}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\dom}{dom}
\DeclareMathOperator{\argmax}{argmax}
\DeclareMathOperator{\tr}{Tr}
\newcommand{\curly}[1]{\mathcal{{#1}}} % `script' or gothic/curly letters
\newcommand{\cc}[1]{\mathsf{{#1}}} % complexity class
\newcommand{\parahead}[1]{\noindent\textbf{{#1}}} % left-indented bold paragraph headers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\x}{{\mathbf{x}}} % vectors in bold
\newcommand{\w}{{\mathbf{w}}}
\renewcommand{\v}{{\mathbf{v}}}
\newcommand{\polylog}{\text{poly}\log}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareMathOperator{\BigO}{\mathcal{O}}
\DeclareMathOperator{\smallO}{\mathrm{o}}
\newcommand\field\mathds
\newcommand{\dd}{\mathrm d}
\renewcommand{\H}{\mathcal{H}}
\newcommand\op\mathbf
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\supp}{supp}
\DeclareMathOperator{\Expect}{\mathbbm E}
\DeclareMathOperator{\Var}{Var}
\DeclareMathOperator{\Cov}{Cov}
\DeclareMathOperator{\smallOmega}{\omega}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% random features- essential macros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% bold operator type symbols
% 1. probability density operators
\newcommand{\q}{\mathbf{q}}
\newcommand{\Q}{\mathbf{Q}}
\newcommand{\uQ}{\underline{\Q}} % for the normalised Q/Q_max
\newcommand{\SgOp}{\mathbf{\Sigma}}
\newcommand{\F}{\mathbf{F}}
% 2. generic quantum operators
\newcommand{\A}{\mathbf{A}}
\newcommand{\U}{\mathbf{U}}
\newcommand{\Rot}{\mathbf{R}}
% 3. kernel operator
\newcommand{\krn}{\mathbf{k}}
\newcommand{\Lam}{\mathbf{\Lambda}}
\newcommand{\trInv}{{\mathrm{TI}}}
% tilde-d letters
\newcommand{\tx}{\tilde{x}}
\newcommand{\tk}{\tilde{k}}
\newcommand{\tv}{\tilde{v}}
% hatted letters
\newcommand{\hbq}{\hat{\q}}
\newcommand{\hq}{\hat{q}}
\newcommand{\hg}{\hat{g}}
\newcommand{\hSgOp}{\hat{\SgOp}}
% sets in domains and ranges of functions etc
\newcommand{\sX}{\mathcal{X}}
\newcommand{\sH}{\mathcal{H}}
\newcommand{\sV}{\mathcal{V}}
\newcommand{\sW}{\mathcal{W}}
\newcommand{\tsX}{\tilde{\sX}}
\newcommand{\tsV}{\tilde{\sV}}
% oracles
\newcommand{\Or}{{\mathrm{Orc}}}
\DeclareMathOperator{\erf}{erf}
\DeclareMathOperator{\poly}{poly}
\DeclareMathOperator{\diam}{diam}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% referencing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% clever references
\usepackage[nameinlink]{cleveref}
\crefname{lemma}{lemma}{lemmas}
\crefname{proposition}{Proposition}{Propositions}
\crefname{definition}{Definition}{Definitions}
\crefname{theorem}{Theorem}{Theorems}
\crefname{conjecture}{conjecture}{conjectures}
\crefname{corollary}{Corollary}{Corollaries}
\crefname{example}{example}{examples}
\crefname{section}{Section}{Sections}
\crefname{chapter}{Chapter}{Chapters}
\crefname{appendix}{Appendix}{Appendices}
\crefname{subappendix}{Appendix}{Appendices}
\crefname{figure}{fig.}{figs.}
\crefname{equation}{eq.}{eqs.}
\crefname{table}{Table}{Tables}
\crefname{item}{property}{properties}
\crefname{remark}{Remark}{Remarks}
\crefname{algorithm}{Algorithm}{Algorithms}
\crefname{problem}{}{}
%https://tex.stackexchange.com/questions/54728/hyperref-jumps-to-the-wrong-equation-if-the-equation-has-a-tag-and-cleveref-is
\makeatletter
\def\make@df@tag@@#1{%
\gdef\df@tag{%
\maketag@@@{\Hy@make@anchor#1}%
\def\@currentlabel{#1}%
\def\cref@currentlabel{[equation][2147483647][]#1}%
}%
}
\def\make@df@tag@@@#1{%
\gdef\df@tag{%
\tagform@{\Hy@make@anchor#1}%
\toks@\@xp{\p@equation{#1}}%
\edef\@currentlabel{\the\toks@}%
\edef\cref@currentlabel{[equation][2147483647][]\the\toks@}
}%
}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% theorem, lemma etc. environments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% newtheorem
\newtheorem{theorem}{Theorem}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{example}[theorem]{Example}
\newtheorem{remark}[theorem]{Remark}
\newtheorem*{remark*}{Remark}
\newtheorem*{theorem*}{Theorem}
\newtheorem*{proposition*}{Proposition}
\newtheorem*{lemma*}{Lemma}
\newenvironment{abstract}
{% \small
\list{\textbf{Synopsis:}}{%
\setlength{\leftmargin}{6mm}
\setlength{\rightmargin}{6mm}%
}%
\item\relax}
{\endlist}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% code listings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{listings}
\lstset{basicstyle=\ttfamily, keywordstyle=\bfseries}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% bibliography with biblatex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[backend=biber,
style=trad-alpha,
% style=alphabetic,
% citestyle=authoryear-comp,
sorting=nty,
doi=true,
isbn=false,
url=false,
maxbibnames=20,
maxcitenames=2,
% refsection=chapter,
backref,
backrefstyle=three]{biblatex}
\DefineBibliographyStrings{english}{%
backrefpage = {page},% originally "cited on page"
backrefpages = {pages},% originally "cited on pages"
}
\renewcommand\multicitedelim{\addcomma\space} % comma between multiple citations, instead of semicolon
\addbibresource{bibs/featureSamp.bib}
% Use DOI links in titles
% \newbibmacro{string+doi}[1]{\iffieldundef{doi}{#1}{\href{https://dx.doi.org/\thefield{doi}}{#1}}}
% mod to check if URL is available when DOI isn't
\newbibmacro{string+doi}[1]{\iffieldundef{doi}%
{\iffieldundef{url}{#1}{\href{\thefield{url}}{#1}}}%
{\href{https://dx.doi.org/\thefield{doi}}{#1}}}
\DeclareFieldFormat{title}{\usebibmacro{string+doi}{\mkbibemph{#1}}}
\DeclareFieldFormat[article]{title}{\usebibmacro{string+doi}{\mkbibquote{#1}}}
\DeclareFieldFormat[incollection]{title}{\usebibmacro{string+doi}{\mkbibquote{#1}}}
% changing bibliography heading style
\defbibheading{customhead}[]{%
\chapter*{#1}}
% can give an optional name argument