\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{base}

%% \RequirePackage{dsfont}
%% \RequirePackage{textcomp}
%% \RequirePackage[latin1]{inputenc}
\RequirePackage{ctable}
%% \RequirePackage{multirow}
\RequirePackage{graphicx}
\RequirePackage{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amssymb}
%% \RequirePackage{amsthm}
%% \RequirePackage{accents}
%% \RequirePackage{tensind}
\RequirePackage[mediumspace,thinqspace,squaren,Gray]{SIunits}
%% \RequirePackage{leftidx}
\RequirePackage[small,bf]{caption}

%% \tensordelimiter{?}
%% \mathchardef\?="003F

\newcommand{\permille}{\ensuremath{\text{\textperthousand}}}
\newcommand{\textsp}[1]{${}^{\text{#1}}$}
\newcommand{\textsb}[1]{${}_{\text{#1}}$}
\newcommand{\eqpunct}[1]{\quad#1}
\newcommand{\eqsep}{\quad}

\newcolumntype{L}{>{$\displaystyle}l<{$}}
\newcolumntype{R}{>{$\displaystyle}r<{$}}
\newcolumntype{C}{>{$\displaystyle}c<{$}}

\newenvironment{environment}{}{}

\newcommand{\vfillstar}{\vspace*{\fill}}
\newcommand{\hfillstar}{\hspace*{\fill}}

\newcommand{\N}{\mathds{N}}
\newcommand{\Z}{\mathds{Z}}
\newcommand{\R}{\mathds{R}}
%% \newcommand{\C}{\mathds{C}}
\newcommand{\order}{\mathcal{O}}
\newcommand{\id}{\mathds{1}}
\newcommand{\trans}{\mathsf{T}}
\newcommand{\hc}{\text{h.c.}}

\renewcommand{\d}{\ensuremath{\mathrm{d}}}
\newcommand{\e}{\ensuremath{\mathrm{e}}}
\newcommand{\spm}{\ensuremath{\:\pm\,}}
\newcommand{\bvec}[1]{\boldsymbol{\mathrm{#1}}}
\newcommand{\uvec}[1]{\boldsymbol{\hat{\mathrm{#1}}}}
\let\avec\vec
\let\vec\bvec
\newcommand{\vecnabla}{\bvec{\nabla}}
\newcommand{\E}[1]{\ensuremath{\cdot10^{#1}}}
\newcommand{\quabla}{\square}
\newcommand{\sfrac}[2]{{\textstyle\frac{#1}{#2}}}
\newcommand{\transposed}{\ensuremath{\mathrm{T}}}
\newcommand{\smallsum}{\ensuremath{{\textstyle\sum}}}
\newcommand{\tsum}{{\textstyle\sum}}

\newcommand{\dket}[1]{\left|#1\right\rangle}
\newcommand{\dbra}[1]{\left\langle#1\right|}
\newcommand{\dbraket}[2]{\left\langle#1\,\vrule\,#2\right\rangle}
\newcommand{\dsandwich}[3]{\left\langle#1\,\vrule\,#2\,\vrule\,#3\right\rangle}
\newcommand{\dvev}[1]{\left\langle#1\right\rangle}

\newcommand{\tket}[1]{\mathopen|#1\mathclose\rangle}
\newcommand{\tbra}[1]{\mathopen\langle#1\mathclose|}
\newcommand{\tbraket}[2]{\mathopen\langle#1|#2\mathclose\rangle}
\newcommand{\tsandwich}[3]{%
  \mathopen\langle#1\mathclose|#2\mathopen|#3\mathclose\rangle}
\newcommand{\tvev}[1]{\mathopen\langle#1\mathclose\rangle}

\newcommand{\ket}[1]{\tket{#1}}
\newcommand{\bra}[1]{\tbra{#1}}
\newcommand{\braket}[2]{\tbraket{#1}{#2}}
\newcommand{\sandwich}[3]{\tsandwich{#1}{#2}{#3}}
\newcommand{\vev}[1]{\tvev{#1}}


%\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\re}{Re}
\DeclareMathOperator{\im}{Im}
\DeclareMathOperator{\tr}{Tr}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\sgn}{sgn}

\let\tempcmd=\epsilon
\let\epsilon=\varepsilon
\let\varepsilon=\tempcmd
% \let\tempcmd=\phi
% \let\phi=\varphi
% \let\varphi=\tempcmd
% \let\tempcmd=\theta
% \let\theta=\vartheta
% \let\vartheta=\tempcmd
% \let\tempcmd=\rho
% \let\rho=\varrho
% \let\varrho=\tempcmd

%\newcommand{\qed}{\newline\rightline{$\Box$}}
\newcommand{\mref}[2]{\textsl{#1\space\ref{#2}}}
\newcommand{\mrefs}[1]{\textsl{#1}}

\newcommand{\eval}[1]{\left. #1 \right|}

\renewcommand{\indent}{\hspace*{\parindent}}
\renewcommand{\atop}[2]{\genfrac{}{}{0pt}{2}{#1}{#2}}
\newcommand{\lscript}[2]{\vphantom{#2}#1#2}

\newcommand{\ccolon}{\mathrel{\mathop:}}
\newcommand{\coloneq}{\ccolon=}
\newcommand{\eqcolon}{=\ccolon}
\newcommand{\corresponds}{\mathrel{\widehat=}}
\newcommand{\mathalign}[1]{%
  \ensuremath{\raisebox{\fontdimen22\textfont2}{#1}}%
}
\newcommand{\balign}[1]{%
  \setbox\@tempboxa\hbox{{#1}}%
  \leavevmode\raise\dp\@tempboxa\box\@tempboxa%
}
\newcommand{\talign}[2][ABCDEFGHIJKLMNOPQRSTUVWXYZ]{%
  \setbox\@tempboxa\hbox{#1}%
  \@tempdimb=\ht\@tempboxa%
  \setbox\@tempboxa\hbox{{#2}}%
  \@tempdima=\ht\@tempboxa%
  \advance\@tempdimb by -\@tempdima%
  \leavevmode\raise\@tempdimb\box\@tempboxa%
}
\newcommand{\calign}[1]{%
  \setbox\@tempboxa\hbox{{#1}}%
  \@tempdima=\ht\@tempboxa%
  \@tempdima=0.5\@tempdima%
  \@tempdimb=\dp\@tempboxa%
  \@tempdimb=0.5\@tempdimb%
  \advance\@tempdima by -\@tempdimb%
  \leavevmode\raise-\@tempdima\box\@tempboxa%
}
\newcommand{\pushright}[1]{%
  \hspace*{\fill}\linebreak[0]\hspace*{\fill}\mbox{#1}%
}

%\newlength{\@templength}
\newcommand{\boxtowidth}[3][c]{%
  \settowidth{\@tempdima}{#2}%
  \makebox[\@tempdima][#1]{#3}%
}

\newcommand{\bibauthor}[1]{\textsc{#1}}
\newcommand{\bibyear}[1]{(#1)}
\newcommand{\bibtitle}[1]{\textit{#1}}
\newcommand{\bibpublishers}[1]{#1}
\newcommand{\biburl}[1]{\textsl{\texttt{#1}}}
