% $Id: OBmaths.sty,v 1.12 2005/05/25 08:58:43 oliver Exp $
% mathe.tex
%
% Wir streben Typografische "Ubereinstimmung mit Sakurai an.
%
% Mathematisches allerlei
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesPackage{OBmaths}[2004/07/30 Oli Beckstein's maths abbreviations]
\typeout{Package: OBmaths. (Oliver Beckstein's maths stuff)
$Id: OBmaths.sty,v 1.12 2005/05/25 08:58:43 oliver Exp $}
\RequirePackage{amsmath}%
\RequirePackage{ifthen}%
%
\DeclareMathAlphabet{\mathsfbf}{T1}{cmss}{bx}{n}
%
% mathematische Objekte
%
\newcommand{\Matrix}[1]{\ensuremath{#1}}
% Operator
\newcommand{\op}[1]{\ensuremath{\hat{#1}}}
\newcommand{\obs}[1]{\mathcal{#1}}
\newcommand{\vecop}[1]{\ensuremath{\mathbf{\hat #1}}}
\newcommand{\menge}[1]{\ensuremath{\mathcal{#1}}}
\newcommand{\raum}[1]{\ensuremath{\mathsf{#1}}}
\renewcommand{\vec}[1]{\ensuremath{\mathbf{#1}}}
\newcommand{\tensor}[1]{\mathsf{#1}}
% symbol as vector
\newcommand{\vecs}[1]{\ensuremath{\boldsymbol{#1}}}

%
% Operationen/Operatoren
%
% hermitesch konjugiert, transponiert, komplex konjugiert
\newcommand{\hc}[1]{\ensuremath{#1^{\dagger}}}
\newcommand{\transp}[1]{\ensuremath{#1^{\mathsf{T}}}}
\newcommand{\cc}[1]{\ensuremath{#1^{\ast}}}
% Skalarprodukt <#1, #2> und vec.vec 
\newcommand{\scp}[2]{\ensuremath{\left\langle {#1}, {#2} \right\rangle}}
\newcommand{\sprod}[2]{\ensuremath{\vec{#1} \cdot \vec{#2} }}
% Kommutator [#1, #2]
\newcommand{\kom}[2]{\ensuremath{\left [\, {#1}, {#2} \, \right] }}
% Antikommutator {#1, #2}
\newcommand{\akom}[2]{\ensuremath{\left \{\, {#1}, {#2} \, \right \}}}
% Poissonklammern
\newcommand{\poisson}[2]{\akom{#1}{#2}}
\newcommand{\dx}[1]{d#1\,}
\newcommand{\ddx}[1]{\frac{d}{d#1}}
\newcommand{\pdx}[1]{\frac{\partial}{\partial#1}}
% thermodynamische parttielle Ableitungen: (dU/dT)V
\newcommand{\tpd}[3]{\left(\frac{\partial#1}{\partial#2}\right)_{#3}}

% \opindexed{op}{index}  --> op_{index}
\newcommand\@opindexed[2]{\ifthenelse{\equal{#2}{}}{#1}{#1_{\!\!#2}}}

% gradient, optionally with index
% starred: do not boldface
\def\vecnabla{\@ifstar\@vecnablastar\@vecnabla}%
\newcommand{\@vecnabla}[1][]{\@opindexed{\boldsymbol{\nabla}}{#1}}%
\newcommand{\@vecnablastar}[1][]{\@opindexed{\nabla}{#1}}%

% Trace
\DeclareMathOperator*{\Tr}{Tr}

% sec z = 1/cos z
\DeclareMathOperator*{\arcsec}{arcsec}
% csc z = 1/sin z
\DeclareMathOperator*{\arccsc}{arccsc}

% signum
\DeclareMathOperator*{\sgn}{sgn}

% \dd{x}{N} gives the differential including a thin sapce
% \dd*{x}{N} does not print the thin space

% differential d for n=1 (for \int\!\!\d{y} f(y))
% *: no trailing thin space
\def\d{\@ifstar\@dstar\@d}
\newcommand\@d[1]{d#1\,}
\newcommand\@dstar[1]{d#1}

% differential for n>1
% *: no trailing thin space
\def\dd{\@ifstar\@ddstar\@dd}
\newcommand\@dd[2]{d^{#2}\!#1\,}
\newcommand\@ddstar[2]{d^{#2}\!#1}

% variational and partial derivative; 
% {f[x]}{x} ; for n>1 construct denominator: \vd{2}{\Omega}{x'\delta x}
% *: put function after operator
\def\varderiv{\@ifstar\@varderivstar\@varderiv}
\newcommand{\@varderiv}[3][]{\frac{\delta^{#1}#2}{\delta#3}}
\newcommand{\@varderivstar}[3][]{\frac{\delta^{#1}}{\delta#3}#2}

% partial derivative
% [n]{f(x)}{x} ; with n>1, construct denominator explicitly
% *: put function after d/dx on baseline
\def\parderiv{\@ifstar\@parderivstar\@parderiv}
\newcommand{\@parderiv}[3][]{\frac{\partial^{#1}#2}{\partial#3}}
\newcommand{\@parderivstar}[3][]{\frac{\partial^{#1}}{\partial#3}#2}

% ensemble average <X>
% *: don't adjust size of angle brackets 
\def\avg{\@ifstar\@avgstar\@avg}%
\newcommand{\@avg}[1]{\left\langle{#1}\right\rangle}%
\newcommand{\@avgstar}[1]{\langle{#1}\rangle}%

% time average \bar X (adjusts to length)
% *:  ... useles at the moment
\def\tavg{\@ifstar\@tavgstar\@tavg}%
\newcommand{\@tavg}[1]{\overline{#1}}%
\newcommand{\@tavgstar}[1]{\overline{#1}}%


% units, typically used in math 
\newcommand{\@spacedunit}[1]{\ensuremath{\ \mathrm{#1}}}%
\newcommand{\@nospacedunit}[1]{\ensuremath{\mathrm{#1}}}%

% could learn how to do this cleanly...
\def\nm{\@ifstar\@nmN\@nmS}%
\def\@nmN{\@nospacedunit{nm}}%
\def\@nmS{\@spacedunit{nm}}%

\def\ns{\@ifstar\@nsN\@nsS}%
\def\@nsN{\@nospacedunit{ns}}%
\def\@nsS{\@spacedunit{ns}}%

\def\ps{\@ifstar\@psN\@psS}%
\def\@psN{\@nospacedunit{ps}}%
\def\@psS{\@spacedunit{ps}}%

\def\K{\@ifstar\@KN\@KS}%
\def\@KN{\@nospacedunit{K}}%
\def\@KS{\@spacedunit{K}}%

\def\bar{\@ifstar\@barN\@barS}%
\def\@barN{\@nospacedunit{bar}}%
\def\@barS{\@spacedunit{bar}}%

% use \MolL  in optional args of figure; LaTeX hates \Molar there
\newcommand{\@MolL}{\text{mol}\cdot\text{l}^{-1}}
\newcommand{\MolL}{\ \@MolL}%

\def\Molar{\@ifstar\@MolarN\@MolarS}%
\def\@MolarN{\ensuremath{\@MolL}}%
\def\@MolarS{\ensuremath{\ \@MolL}}%


\newcommand{\kJmolnm}%
   {\ensuremath{\ \text{kJ}\cdot\text{mol}^{-1}\cdot\text{nm}^{-2}}}
\newcommand{\kJmol}%
   {\ensuremath{\ \text{kJ}\cdot\text{mol}^{-1}}}
\newcommand{\kJmolrad}%
   {\ensuremath{\ \text{kJ}\cdot\text{mol}^{-1}\cdot\text{rad}^{-2}}}



%
% Benannte mathem. Objekte
%
\newcommand{\kronecker}[2]{\ensuremath{\delta_{#1\,#2}}}
\newcommand{\Rn}[1]{\ensuremath{\real^{#1}}}

\DeclareMathOperator{\erf}{erf}
\DeclareMathOperator{\erfc}{erfc}

%
% Konstanten
%
\newcommand{\eins}{\ensuremath{\mathsf{1}}}
\newcommand{\halb}{\ensuremath{\frac{1}{2}}}
\newcommand{\veps}{\varepsilon}
\newcommand{\vphi}{\varphi}
\newcommand{\element}{\,\in\,}

% Grad zeichen
\renewcommand{\deg}{\ensuremath{^{\circ}}}

% Neue Kommandos
% schamlos von Roland und Ralf geklaut

\newcommand {\arc}{\mbox{$\rm <\hspace{-0.6em}
             \raise0.3ex\hbox{$\scriptscriptstyle )$}$}}

%\newcommand{\bra}[1]{\ensuremath{\left\langle {#1} \right|}}
%\newcommand{\ket}[1]{\ensuremath{\left| {#1} \right\rangle}}
%\newcommand{\braket}[2]{\ensuremath{\left\langle {#1} | {#2} \right\rangle}}
\newcommand{\bra}[1]{\ensuremath{\langle {#1}|}}
\newcommand{\ket}[1]{\ensuremath{| {#1} \rangle}}
\newcommand{\braket}[2]{\ensuremath{\langle{#1}|{#2}\rangle}}

\newcommand{\expect}[1]{\ensuremath{\left\langle {#1} \right\rangle}}
\newcommand{\matrixel}[3]{\ensuremath{\langle{#1}|{#2}|{#3}\rangle}}

\newcommand{\onehalf}{\ensuremath{{\textstyle\frac{1}{2}}}}

\endinput

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
