I'm writing my thesis on quantum mechanics, and as such I need to use physicists' bra-ket notation. I copied my template from http://www.dfcd.net/articles/latex/latex.html and it works quite well to make the angles and bars larger in a consistent way when one of the factors is large.
(I'm aware now that there's a package that does this, but my notation is quite set as switching to the package would require changing all my brackets from \bracket{...}{...} to \bracket{...|...}).
There's just one thing that's bugging me, and I can't really figure out what's going on:
Code: Select all
\documentclass[11pt,notitlepage]{book}%,cmss,c,
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\newcommand{\bra}[1]{\ensuremath{\left\langle#1\right|}}
\newcommand{\ket}[1]{\ensuremath{\left|#1\right\rangle}}
\newcommand{\bracket}[2]{\ensuremath{\left\langle#1 \vphantom{#2}\right| \left. #2 \vphantom{#1}\right\rangle}}
\newcommand{\matrixel}[3]{\ensuremath{\left\langle #1 \vphantom{#2#3} \right| #2 \left| #3 \vphantom{#1#2} \right\rangle}}
\begin{document}
These commands write quantum-mechanical bras and kets, such as \bra{\alpha} and \ket{\beta}, as well as their products, like \bracket{\alpha}{\eta}, and also matrix elements such as \matrixel{\xi}{T}{\pi}. They're quite useful when one of the factors is large: for instance \ket{\xi} vs \ket{\hat{\xi}}, or when one has \matrixel{\xi}{\hat{T}}{\pi}.
There's only one funny space, in the bracket (as opposed to the ket) below, which shouldn't really be there, and which I can't really figure out:
\begin{align*}
a\ket{\alpha,1}&=\alpha\ket{\alpha,1}+\ket{\alpha}\\
\bracket{\alpha,1}{\alpha,1}&=1
\end{align*}
\end{document}
Any thoughts?
cheers!