$$
\newcommand{\LetThereBe}[2]{\newcommand{#1}{#2}}
\newcommand{\letThereBe}[3]{\newcommand{#1}[#2]{#3}}
% Declare mathematics (so they can be overwritten for PDF)
\newcommand{\declareMathematics}[2]{\DeclareMathOperator{#1}{#2}}
\newcommand{\declareMathematicsStar}[2]{\DeclareMathOperator*{#1}{#2}}
% striked integral
\newcommand{\avint}{\mathop{\mathchoice{\,\rlap{-}\!\!\int}
{\rlap{\raise.15em{\scriptstyle -}}\kern-.2em\int}
{\rlap{\raise.09em{\scriptscriptstyle -}}\!\int}
{\rlap{-}\!\int}}\nolimits}
% \d does not work well for PDFs
\LetThereBe{\d}{\differential}
\LetThereBe{\Im}{\mathrm{Im}}
\LetThereBe{\Re}{\mathrm{Re}}
\letThereBe{\imOf}{1}{\Im\,#1}
\letThereBe{\reOf}{1}{\Re\,#1}
\letThereBe{\ImOf}{1}{\Im \brackets{#1}}
\letThereBe{\ReOf}{1}{\Re \brackets{#1}}
\letThereBe{\linefrac}{2}{#1/#2}
$$
$$
% Simply for testing
\LetThereBe{\foo}{\textrm{FIXME: this is a test!}}
% Font styles
\letThereBe{\mcal}{1}{\mathcal{#1}}
\letThereBe{\chem}{1}{\mathrm{#1}}
% Sets
\LetThereBe{\C}{\mathbb{C}}
\LetThereBe{\R}{\mathbb{R}}
\LetThereBe{\Z}{\mathbb{Z}}
\LetThereBe{\N}{\mathbb{N}}
\LetThereBe{\im}{\mathrm{i}}
% Sets from PDEs
\LetThereBe{\boundary}{\partial}
\letThereBe{\closure}{1}{\overline{#1}}
\letThereBe{\Contf}{1}{C^{#1}}
\letThereBe{\contf}{2}{\Contf{#2}(#1)}
\letThereBe{\compactContf}{2}{C_c^{#2}(#1)}
\letThereBe{\ball}{2}{B\brackets{#1, #2}}
\letThereBe{\closedBall}{2}{B\parentheses{#1, #2}}
\LetThereBe{\compactEmbed}{\subset\subset}
\letThereBe{\inside}{1}{#1^o}
\LetThereBe{\neighborhood}{\mcal O}
\letThereBe{\neigh}{1}{\neighborhood \brackets{#1}}
% Basic notation - vectors and random variables
\letThereBe{\vi}{1}{\boldsymbol{#1}} %vector or matrix
\letThereBe{\dvi}{1}{\vi{\dot{#1}}} %differentiated vector or matrix
\letThereBe{\vii}{1}{\mathbf{#1}} %if \vi doesn't work
\letThereBe{\dvii}{1}{\vii{\dot{#1}}} %if \dvi doesn't work
\letThereBe{\rnd}{1}{\mathup{#1}} %random variable
\letThereBe{\vr}{1}{\mathbf{#1}} %random vector or matrix
\letThereBe{\vrr}{1}{\boldsymbol{#1}} %random vector if \vr doesn't work
\letThereBe{\dvr}{1}{\vr{\dot{#1}}} %differentiated vector or matrix
\letThereBe{\vb}{1}{\pmb{#1}} %#TODO
\letThereBe{\dvb}{1}{\vb{\dot{#1}}} %#TODO
\letThereBe{\oper}{1}{\mathsf{#1}}
% Basic notation - general
\letThereBe{\set}{1}{\left\{#1\right\}}
\letThereBe{\seqnc}{4}{\set{#1_{#2}}_{#2 = #3}^{#4}}
\letThereBe{\Seqnc}{3}{\set{#1}_{#2}^{#3}}
\letThereBe{\brackets}{1}{\left( #1 \right)}
\letThereBe{\parentheses}{1}{\left[ #1 \right]}
\letThereBe{\dom}{1}{\mcal{D}\, \brackets{#1}}
\letThereBe{\complexConj}{1}{\overline{#1}}
\LetThereBe{\divider}{\; \vert \;}
\LetThereBe{\gets}{\leftarrow}
\letThereBe{\rcases}{1}{\left.\begin{aligned}#1\end{aligned}\right\}}
\letThereBe{\rcasesAt}{2}{\left.\begin{alignedat}{#1}#2\end{alignedat}\right\}}
\letThereBe{\lcases}{1}{\begin{cases}#1\end{cases}}
\letThereBe{\lcasesAt}{2}{\left\{\begin{alignedat}{#1}#2\end{alignedat}\right.}
\letThereBe{\evaluateAt}{2}{\left.#1\right|_{#2}}
\LetThereBe{\Mod}{\;\mathrm{mod}\;}
% Special symbols
\LetThereBe{\const}{\mathrm{const}}
\LetThereBe{\konst}{\mathrm{konst.}}
\LetThereBe{\vf}{\varphi}
\LetThereBe{\ve}{\varepsilon}
\LetThereBe{\tht}{\theta}
\LetThereBe{\Tht}{\Theta}
\LetThereBe{\after}{\circ}
\LetThereBe{\lmbd}{\lambda}
% Shorthands
\LetThereBe{\xx}{\vi x}
\LetThereBe{\yy}{\vi y}
\LetThereBe{\XX}{\vi X}
\LetThereBe{\AA}{\vi A}
\LetThereBe{\bb}{\vi b}
\LetThereBe{\vvf}{\vi \vf}
\LetThereBe{\ff}{\vi f}
\LetThereBe{\gg}{\vi g}
% Basic functions
\letThereBe{\absval}{1}{\left| #1 \right|}
\LetThereBe{\id}{\mathrm{id}}
\letThereBe{\floor}{1}{\left\lfloor #1 \right\rfloor}
\letThereBe{\ceil}{1}{\left\lceil #1 \right\rceil}
\declareMathematics{\image}{im} %image
\declareMathematics{\domain}{dom} %image
\declareMathematics{\tg}{tg}
\declareMathematics{\sign}{sign}
\declareMathematics{\card}{card} %cardinality
\letThereBe{\setSize}{1}{\left| #1 \right|}
\declareMathematics{\exp}{exp}
\letThereBe{\Exp}{1}{\exp\brackets{#1}}
\letThereBe{\indicator}{1}{\mathbb{I}_{#1}}
\declareMathematics{\arccot}{arccot}
\declareMathematics{\complexArg}{arg}
\declareMathematics{\gcd}{gcd} % Greatest Common Divisor
\declareMathematics{\lcm}{lcm} % Least Common Multiple
\letThereBe{\limInfty}{1}{\lim_{#1 \to \infty}}
\letThereBe{\limInftyM}{1}{\lim_{#1 \to -\infty}}
% Useful commands
\letThereBe{\onTop}{2}{\mathrel{\overset{#2}{#1}}}
\letThereBe{\onBottom}{2}{\mathrel{\underset{#2}{#1}}}
\letThereBe{\tOnTop}{2}{\mathrel{\overset{\text{#2}}{#1}}}
\letThereBe{\tOnBottom}{2}{\mathrel{\underset{\text{#2}}{#1}}}
\LetThereBe{\EQ}{\onTop{=}{!}}
\LetThereBe{\letDef}{:=} %#TODO: change the symbol
\LetThereBe{\isPDef}{\onTop{\succ}{?}}
\LetThereBe{\inductionStep}{\tOnTop{=}{induct. step}}
% Optimization
\declareMathematicsStar{\argmin}{argmin}
\declareMathematicsStar{\argmax}{argmax}
\letThereBe{\maxOf}{1}{\max\set{#1}}
\letThereBe{\minOf}{1}{\min\set{#1}}
\declareMathematics{\prox}{prox}
\declareMathematics{\loss}{loss}
\declareMathematics{\supp}{supp}
\letThereBe{\Supp}{1}{\supp\brackets{#1}}
\LetThereBe{\constraint}{\text{s.t.}\;}
$$
$$
% Operators - Analysis
\LetThereBe{\hess}{\nabla^2}
\LetThereBe{\lagr}{\mcal L}
\LetThereBe{\lapl}{\Delta}
\declareMathematics{\grad}{grad}
\declareMathematics{\Dgrad}{D}
\LetThereBe{\gradient}{\nabla}
\LetThereBe{\jacobi}{\nabla}
\LetThereBe{\Jacobi}{\vi{\mathrm J}}
\letThereBe{\jacobian}{2}{\Dgrad_{#1}\brackets{#2}}
\LetThereBe{\d}{\mathrm{d}}
\LetThereBe{\dd}{\,\mathrm{d}}
\letThereBe{\partialDeriv}{2}{\frac {\partial #1} {\partial #2}}
\letThereBe{\npartialDeriv}{3}{\partialDeriv{^{#1} #2} {#3^{#1}}}
\letThereBe{\partialOp}{1}{\frac {\partial} {\partial #1}}
\letThereBe{\npartialOp}{2}{\frac {\partial^{#1}} {\partial #2^{#1}}}
\letThereBe{\pDeriv}{2}{\partialDeriv{#1}{#2}}
\letThereBe{\npDeriv}{3}{\npartialDeriv{#1}{#2}{#3}}
\letThereBe{\deriv}{2}{\frac {\d #1} {\d #2}}
\letThereBe{\nderiv}{3}{\frac {\d^{#1} #2} {\d #3^{#1}}}
\letThereBe{\derivOp}{1}{\frac {\d} {\d #1}\,}
\letThereBe{\nderivOp}{2}{\frac {\d^{#1}} {\d #2^{#1}}\,}
$$
$$
% Linear algebra
\letThereBe{\norm}{1}{\left\lVert #1 \right\rVert}
\letThereBe{\scal}{2}{\left\langle #1, #2 \right\rangle}
\letThereBe{\avg}{1}{\overline{#1}}
\letThereBe{\Avg}{1}{\bar{#1}}
\letThereBe{\linspace}{1}{\mathrm{lin}\set{#1}}
\letThereBe{\algMult}{1}{\mu_{\mathrm A} \brackets{#1}}
\letThereBe{\geomMult}{1}{\mu_{\mathrm G} \brackets{#1}}
\LetThereBe{\Nullity}{\mathrm{nullity}}
\letThereBe{\nullity}{1}{\Nullity \brackets{#1}}
\LetThereBe{\nulty}{\nu}
\declareMathematics{\SpanOf}{span}
\letThereBe{\Span}{1}{\SpanOf\set{#1}}
% Linear algebra - Matrices
\LetThereBe{\tr}{\top}
\LetThereBe{\Tr}{^\tr}
\LetThereBe{\pinv}{\dagger}
\LetThereBe{\Pinv}{^\dagger}
\LetThereBe{\Inv}{^{-1}}
\LetThereBe{\ident}{\vi{I}}
\letThereBe{\mtr}{1}{\begin{pmatrix}#1\end{pmatrix}}
\letThereBe{\bmtr}{1}{\begin{bmatrix}#1\end{bmatrix}}
\declareMathematics{\trace}{tr}
\declareMathematics{\diagonal}{diag}
\declareMathematics{\rank}{rank}
$$
$$
% Statistics
\LetThereBe{\iid}{\overset{\text{i.i.d.}}{\sim}}
\LetThereBe{\ind}{\overset{\text{ind}}{\sim}}
\LetThereBe{\condp}{\,\vert\,}
\letThereBe{\complement}{1}{\overline{#1}}
\LetThereBe{\acov}{\gamma}
\LetThereBe{\acf}{\rho}
\LetThereBe{\stdev}{\sigma}
\LetThereBe{\procMean}{\mu}
\LetThereBe{\procVar}{\stdev^2}
\declareMathematics{\variance}{var}
\letThereBe{\Variance}{1}{\variance \brackets{#1}}
\declareMathematics{\cov}{cov}
\declareMathematics{\corr}{cor}
\letThereBe{\sampleVar}{1}{\rnd S^2_{#1}}
\letThereBe{\populationVar}{1}{V_{#1}}
\declareMathematics{\expectedValue}{\mathbb{E}}
\declareMathematics{\rndMode}{Mode}
\letThereBe{\RndMode}{1}{\rndMode\brackets{#1}}
\letThereBe{\expect}{1}{\expectedValue #1}
\letThereBe{\Expect}{1}{\expectedValue \brackets{#1}}
\letThereBe{\expectIn}{2}{\expectedValue_{#1} #2}
\letThereBe{\ExpectIn}{2}{\expectedValue_{#1} \brackets{#2}}
\LetThereBe{\betaF}{\mathrm B}
\LetThereBe{\fisherMat}{J}
\LetThereBe{\mutInfo}{I}
\LetThereBe{\expectedGain}{I_e}
\letThereBe{\KLDiv}{2}{D\brackets{#1 \parallel #2}}
\LetThereBe{\entropy}{H}
\LetThereBe{\diffEntropy}{h}
\LetThereBe{\probF}{\pi}
\LetThereBe{\densF}{\vf}
\LetThereBe{\att}{_t} %at time
\letThereBe{\estim}{1}{\hat{#1}}
\letThereBe{\estimML}{1}{\hat{#1}_{\mathrm{ML}}}
\letThereBe{\estimOLS}{1}{\hat{#1}_{\mathrm{OLS}}}
\letThereBe{\estimMAP}{1}{\hat{#1}_{\mathrm{MAP}}}
\letThereBe{\predict}{3}{\estim {\rnd #1}_{#2 | #3}}
\letThereBe{\periodPart}{3}{#1+#2-\ceil{#2/#3}#3}
\letThereBe{\infEstim}{1}{\tilde{#1}}
\letThereBe{\predictDist}{1}{{#1}^*}
\LetThereBe{\backs}{\oper B}
\LetThereBe{\diff}{\oper \Delta}
\LetThereBe{\BLP}{\oper P}
\LetThereBe{\arPoly}{\Phi}
\letThereBe{\ArPoly}{1}{\arPoly\brackets{#1}}
\LetThereBe{\maPoly}{\Theta}
\letThereBe{\MaPoly}{1}{\maPoly\brackets{#1}}
\letThereBe{\ARmod}{1}{\mathrm{AR}\brackets{#1}}
\letThereBe{\MAmod}{1}{\mathrm{MA}\brackets{#1}}
\letThereBe{\ARMA}{2}{\mathrm{ARMA}\brackets{#1, #2}}
\letThereBe{\sARMA}{3}{\mathrm{ARMA}\brackets{#1}\brackets{#2}_{#3}}
\letThereBe{\SARIMA}{3}{\mathrm{ARIMA}\brackets{#1}\brackets{#2}_{#3}}
\letThereBe{\ARIMA}{3}{\mathrm{ARIMA}\brackets{#1, #2, #3}}
\LetThereBe{\pacf}{\alpha}
\letThereBe{\parcorr}{3}{\rho_{#1 #2 | #3}}
\LetThereBe{\noise}{\mathscr{N}}
\LetThereBe{\jeffreys}{\mathcal J}
\LetThereBe{\likely}{\mcal L}
\letThereBe{\Likely}{1}{\likely\brackets{#1}}
\LetThereBe{\loglikely}{\mcal l}
\letThereBe{\Loglikely}{1}{\loglikely \brackets{#1}}
\LetThereBe{\CovMat}{\Gamma}
\LetThereBe{\covMat}{\vi \CovMat}
\LetThereBe{\rcovMat}{\vrr \CovMat}
\LetThereBe{\AIC}{\mathrm{AIC}}
\LetThereBe{\BIC}{\mathrm{BIC}}
\LetThereBe{\AICc}{\mathrm{AIC}_c}
\LetThereBe{\nullHypo}{H_0}
\LetThereBe{\altHypo}{H_1}
\LetThereBe{\rve}{\rnd \ve}
\LetThereBe{\rtht}{\rnd \theta}
\LetThereBe{\rX}{\rnd X}
\LetThereBe{\rY}{\rnd Y}
\LetThereBe{\rZ}{\rnd Z}
\LetThereBe{\rA}{\rnd A}
\LetThereBe{\rB}{\rnd B}
\LetThereBe{\vrZ}{\vr Z}
\LetThereBe{\vrY}{\vr Y}
\LetThereBe{\vrX}{\vr X}
\LetThereBe{\rW}{\rnd W}
\LetThereBe{\rS}{\rnd S}
\LetThereBe{\rM}{\rnd M}
\LetThereBe{\rtau}{\rnd \tau}
% Bayesian inference
\LetThereBe{\paramSet}{\mcal T}
\LetThereBe{\sampleSet}{\mcal Y}
\LetThereBe{\bayesSigmaAlg}{\mcal B}
\LetThereBe{\ltwo}{L^2}
\LetThereBe{\ltwoEq}{\onTop{=}{\ltwo}}
% Different types of convergence
\LetThereBe{\inDist}{\onTop{\to}{d}}
\letThereBe{\inDistWhen}{1}{\onBottom{\onTop{\longrightarrow}{d}}{#1}}
\LetThereBe{\inProb}{\onTop{\to}{P}}
\letThereBe{\inProbWhen}{1}{\onBottom{\onTop{\longrightarrow}{P}}{#1}}
\LetThereBe{\inMeanSq}{\onTop{\to}{\ltwo}}
\LetThereBe{\inltwo}{\onTop{\to}{\ltwo}}
\letThereBe{\inMeanSqWhen}{1}{\onBottom{\onTop{\longrightarrow}{\ltwo}}{#1}}
\LetThereBe{\convergeAS}{\tOnTop{\to}{a.s.}}
\letThereBe{\convergeASWhen}{1}{\onBottom{\tOnTop{\longrightarrow}{a.s.}}{#1}}
% Asymptotic qualities
\LetThereBe{\simAsymp}{\tOnTop{\sim}{as.}}
% Stochastic analysis
\letThereBe{\diffOn}{2}{\diff #1_{[#2]}}
% \LetThereBe{\timeSet}{\Theta}
\LetThereBe{\eventSet}{\Omega}
\LetThereBe{\filtration}{\mcal F}
% TODO: Rename allFiltrations and the like
\letThereBe{\allFiltrations}{1}{\set{\filtration_t}_{#1}}
\letThereBe{\natFilter}{1}{\filtration_t^{#1}}
\letThereBe{\NatFilter}{2}{\filtration_{#2}^{#1}}
\letThereBe{\filterAll}{1}{\set{#1}_{t \geq 0}}
\letThereBe{\FilterAll}{2}{\set{#1}_{#2}}
\LetThereBe{\borelAlgebra}{\mcal B}
\LetThereBe{\sAlgebra}{\mcal A}
\LetThereBe{\quadVar}{Q}
\LetThereBe{\totalVar}{V}
\LetThereBe{\adaptIntProcs}{\mcal M}
\letThereBe{\reflectProc}{2}{#1^{#2}}
$$
$$
% Distributions
\letThereBe{\WN}{2}{\mathrm{WN}\brackets{#1,#2}}
\declareMathematics{\uniform}{Unif}
\declareMathematics{\binomDist}{Bi}
\declareMathematics{\negbinomDist}{NBi}
\declareMathematics{\betaDist}{Beta}
\declareMathematics{\betabinomDist}{BetaBin}
\declareMathematics{\gammaDist}{Gamma}
\declareMathematics{\igammaDist}{IGamma}
\declareMathematics{\invgammaDist}{IGamma}
\declareMathematics{\expDist}{Ex}
\declareMathematics{\poisDist}{Po}
\declareMathematics{\erlangDist}{Er}
\declareMathematics{\altDist}{A}
\declareMathematics{\geomDist}{Ge}
\LetThereBe{\normalDist}{\mathcal N}
%\declareMathematics{\normalDist}{N}
\letThereBe{\normalD}{1}{\normalDist \brackets{#1}}
\letThereBe{\mvnormalD}{2}{\normalDist_{#1} \brackets{#2}}
\letThereBe{\NormalD}{2}{\normalDist \brackets{#1, #2}}
\LetThereBe{\lognormalDist}{\log\normalDist}
$$
$$
% Game Theory
\LetThereBe{\doms}{\succ}
\LetThereBe{\isdom}{\prec}
\letThereBe{\OfOthers}{1}{_{-#1}}
\LetThereBe{\ofOthers}{\OfOthers{i}}
\LetThereBe{\pdist}{\sigma}
\letThereBe{\domGame}{1}{G_{DS}^{#1}}
\letThereBe{\ratGame}{1}{G_{Rat}^{#1}}
\letThereBe{\bestRep}{2}{\mathrm{BR}_{#1}\brackets{#2}}
\letThereBe{\perf}{1}{{#1}_{\mathrm{perf}}}
\LetThereBe{\perfG}{\perf{G}}
\letThereBe{\imperf}{1}{{#1}_{\mathrm{imp}}}
\LetThereBe{\imperfG}{\imperf{G}}
\letThereBe{\proper}{1}{{#1}_{\mathrm{proper}}}
\letThereBe{\finrep}{2}{{#2}_{#1{\text -}\mathrm{rep}}} %T-stage game
\letThereBe{\infrep}{1}{#1_{\mathrm{irep}}}
\LetThereBe{\repstr}{\tau} %strategy in a repeated game
\LetThereBe{\emptyhist}{\epsilon}
\letThereBe{\extrep}{1}{{#1^{\mathrm{rep}}}}
\letThereBe{\avgpay}{1}{#1^{\mathrm{avg}}}
\LetThereBe{\succf}{\pi} %successor function
\LetThereBe{\playf}{\rho} %player function
\LetThereBe{\actf}{\chi} %action function
$$
$$
% ODEs
\LetThereBe{\timeInt}{\mcal I}
\LetThereBe{\stimeInt}{\mcal J}
\LetThereBe{\Wronsk}{\mcal W}
\letThereBe{\wronsk}{1}{\Wronsk \parentheses{#1}}
\LetThereBe{\prufRadius}{\rho}
\LetThereBe{\prufAngle}{\vf}
\LetThereBe{\weyr}{\sigma}
\LetThereBe{\linDifOp}{\mathsf{L}}
\LetThereBe{\Hurwitz}{\vi H}
\letThereBe{\hurwitz}{1}{\Hurwitz \brackets{#1}}
% Cont. Models
\LetThereBe{\dirac}{\delta}
% PDEs
% \avint -- defined in format-respective tex files
\LetThereBe{\fundamental}{\Phi}
\LetThereBe{\fund}{\fundamental}
\letThereBe{\normaDeriv}{1}{\partialDeriv{#1}{\vec{n}}}
\letThereBe{\volAvg}{2}{\avint_{\ball{#1}{#2}}}
\LetThereBe{\VolAvg}{\volAvg{x}{\ve}}
\letThereBe{\surfAvg}{2}{\avint_{\boundary \ball{#1}{#2}}}
\LetThereBe{\SurfAvg}{\surfAvg{x}{\ve}}
\LetThereBe{\corrF}{\varphi^{\times}}
\LetThereBe{\greenF}{G}
\letThereBe{\reflect}{1}{\tilde{#1}}
\letThereBe{\unitBall}{1}{\alpha(#1)}
\LetThereBe{\conv}{*}
\letThereBe{\dotP}{2}{#1 \cdot #2}
\letThereBe{\translation}{1}{\tau_{#1}}
\declareMathematics{\dist}{dist}
\letThereBe{\regularizef}{1}{\eta_{#1}}
\letThereBe{\fourier}{1}{\widehat{#1}}
\letThereBe{\ifourier}{1}{\check{#1}}
\LetThereBe{\fourierOp}{\mcal F}
\LetThereBe{\ifourierOp}{\mcal F^{-1}}
\letThereBe{\FourierOp}{1}{\fourierOp\set{#1}}
\letThereBe{\iFourierOp}{1}{\ifourierOp\set{#1}}
\LetThereBe{\laplaceOp}{\mcal L}
\letThereBe{\LaplaceOp}{1}{\laplaceOp\set{#1}}
\letThereBe{\Norm}{1}{\absval{#1}}
% SINDy
\LetThereBe{\Koop}{\mcal K}
\letThereBe{\oneToN}{1}{\left[#1\right]}
\LetThereBe{\meas}{\mathrm{m}}
\LetThereBe{\stateLoss}{\mcal J}
\LetThereBe{\lagrm}{p}
% Stochastic analysis
\LetThereBe{\RiemannInt}{(\mcal R)}
\LetThereBe{\RiemannStieltjesInt}{(\mcal {R_S})}
\LetThereBe{\LebesgueInt}{(\mcal L)}
\LetThereBe{\ItoInt}{(\mcal I)}
\LetThereBe{\Stratonovich}{\circ}
\LetThereBe{\infMean}{\alpha}
\LetThereBe{\infVar}{\beta}
% Dynamical systems
\LetThereBe{\nUnit}{\mathrm N}
\LetThereBe{\timeUnit}{\mathrm T}
% Masters thesis
\LetThereBe{\evolOp}{\oper{\vf}}
\letThereBe{\obj}{1}{\mathbb{#1}}
\LetThereBe{\timeSet}{\obj T}
\LetThereBe{\stateSpace}{\obj X}
\LetThereBe{\contStateSpace}{\stateSpace_{C}}
\LetThereBe{\orbit}{Or}
\letThereBe{\Orbit}{1}{\orbit\brackets{#1}}
\LetThereBe{\limitSet}{\obj \Lambda}
\LetThereBe{\crossSection}{\obj \Sigma}
\declareMathematics{\codim}{codim}
% Left and right closed-or-open intervals
\LetThereBe{\lco}{\langle}
\LetThereBe{\rco}{\rangle}
\letThereBe{\testInt}{1}{\mathrm{Int}_{#1}}
\letThereBe{\evalOp}{1}{\oper{\eta}_{#1}}
\LetThereBe{\nonzeroEl}{\bullet}
\LetThereBe{\zeroEl}{\circ}
\LetThereBe{\solOp}{\oper{S}}
\LetThereBe{\infGen}{\oper{A}}
\LetThereBe{\indexSet}{\mcal I}
\letThereBe{\indicesOf}{1}{\indexSet\parentheses{#1}}
\letThereBe{\IndicesOf}{2}{\indexSet_{#2}\parentheses{#1}}
\LetThereBe{\meshGrid}{\obj M}
\declareMathematics{\starter}{starter}
\declareMathematics{\indexer}{indx}
\declareMathematics{\enumerator}{enum}
\LetThereBe{\inSS}{_{\infty}}
\LetThereBe{\manifold}{\mcal M}
\LetThereBe{\curve}{\mathcal C}
% Numerical methods
\declareMathematics{\globErr}{err}
\declareMathematics{\locErr}{le}
\declareMathematics{\locTrErr}{lte}
\declareMathematics{\incrementFunc}{Inc}
\letThereBe{\incrementF}{1}{\incrementFunc \brackets{#1}}
%Stochastic analysis
\LetThereBe{\RiemannInt}{(\mcal R)}
\LetThereBe{\RiemannStieltjesInt}{(\mcal {R_S})}
\LetThereBe{\LebesgueInt}{(\mcal L)}
\LetThereBe{\ItoInt}{(\mcal I)}
\LetThereBe{\Stratonovich}{\circ}
\LetThereBe{\infMean}{\alpha}
\LetThereBe{\infVar}{\beta}
%Optimization
\LetThereBe{\goldRatio}{\tau}
%Interpolation
\LetThereBe{\lagrPoly}{l}
$$
Phase-locked synchronization is of utmost importance for neuroscience. Specifically, in-phase synchronization refers to the phase relationship between two coupled neurons firing simultaneously, whereas anti-phase synchronization refers to the phase relationship between two coupled neurons that maximizes the frequency of their combined signal. However, the problem of determining suitable parameter values, which would result in synchronization, and the phase shift thereof, is a rather complicated task.
After building up the necessary theoretical background in the first chapter, we have delved into phase-shift detection using a grid simulation approach. Iteratively, we built and improved the methodology for the problem at hand, introducing various concepts along the way. Moreover, at each step, we applied the algorithm to a system of two weakly coupled interneuron models. Finally, the computation was executed on the MetaCentrum grid infrastructure.
In the third chapter, we discussed the localization of equilibria and limit cycles for both ODE and DDE systems. Then, we applied the showcased numerical methods to the system of interest, obtaining the cycle manifold corresponding to an Arnold tongue for a given synchronization. We were then able to compute phase shifts (between the two oscillators) of periodic orbits on the manifold. By projection onto the parameter plane, we obtained a comparable result to the more traditional grid simulation.
It is rather complicated to say which method is “better”, as each takes a very different route on the path to the same goal. The simulation-based approach more closely mimics (under the assumption of an appropriate iterator) a continuous change of parameters, which may or may not have the time to converge to the equilibrium. This renders the choice of transient interesting for applications because the method can compute synchronization modes the system can reach by continuously changing its parameters. Moreover, its strengths lie in the fact that much less theoretical background is needed, making it more accessible to a wider (academic) community.
Nevertheless, at its core, it is still a heuristic algorithm, which we have attempted to improve in various ways. Its biggest drawback probably lies in the dependence on nearby already computed trajectories and phase shifts for a given element of the grid. This very idea, which we have used to improve the Arnold tongue detection, complicates multi-threading execution and necessitates the use of a dense grid to allow us to draw reasonable conclusions. Lastly, while the initial draft of the method was rather easy to implement, each subsequent iteration makes it more complicated and introduces possible parameters and choices of methods/norms/etc. For instance, in the current version of GridWalker.jl, there are approximately 40 parameters/functions strictly related to the computation itself to be selected.
On the other hand, the approach based on bifurcation theory streamlines many parts of the process at the cost of much higher theoretical complexity of the underlying methods. Indeed, save for the shift computation, most of the algorithm uses standard continuation methods available in bifurcation toolkits, such as MATCONT or DDE-BIFTOOL. This also significantly reduces the number of parameters or selectable functions. Furthermore, the ability to easily and efficiently parallelize the computation compensates for the higher time complexity of the calculation at each individual point. Finally, the theoretical background and independence of single slice computation from the previous results guarantee that once we have computed a phase shift for a given point \((C_2^i, \lambda^i)\), it must hold for any discretization \(\Lambda\) such that \(\lambda^i \in \Lambda\). This crucial property is missing in the simulation-based approach.
In total, we believe the bifurcation-based approach should be more prevalent in applied fields, as it offers clear computational benefits. Nevertheless, some capabilities of the grid simulation approach, for instance, stochastic phenomena or the effect of transient, cannot be replicated by using the continuation-based approach. Thus, researchers should strive to pick the best methodology for their problem of interest.