The macros with uppercase initial are "self-expanding" based on the contents, as the documentation says. Just like it's not good to always use \left
and \right
, it's also good to choose with care between \Bra
and \bra
.
As far as the additional spacing is concerned, a solution is to load mleftright
:
\documentclass{article}
\usepackage{amsmath}
\usepackage{braket,mleftright}
\mleftright
\begin{document}
\begin{align*}
\Bra{\frac{1}{\sqrt{2}}\left(\uparrow + \downarrow\right)}
&=\frac{1}{\sqrt{2}}\left(\Bra{\uparrow}+\Bra{\downarrow}\right)\\
\bra{\frac{1}{\sqrt{2}}\left(\uparrow + \downarrow\right)}
&=\frac{1}{\sqrt{2}}\left(\bra{\uparrow}+\bra{\downarrow}\right)\\
&=2 222 22\\
&=2\mathinner{222}22\\
\end{align*}
\end{document}

It's “by design”. The definitions of \bra
and \ket
are
% braket.sty, line 31:
\def\bra#1{\mathinner{\langle{#1}|}}
% braket.sty, line 32:
\def\ket#1{\mathinner{|{#1}\rangle}}
and \mathinner
adds a thin space on either side of the construction.
If you want to remove those additional thin spaces (which is not a bad idea, by the way), you can redefine them like
\renewcommand\bra[1]{{\langle{#1}|}}
\renewcommand\ket[1]{{|{#1}\rangle}}
However, the sidebearings of \langle
and \rangle
will still leave a hole.
\documentclass[10pt,a4paper]{article}
\usepackage{braket}
\renewcommand\bra[1]{{\langle{#1}|}}
\renewcommand\ket[1]{{|{#1}\rangle}}
\begin{document}
\[
\ket{x}\bra{x}
\]
\[
\ket{x}\!\bra{x}
\]
\end{document}

You might check whether a \bra
immediately follows a \ket
:
\documentclass[10pt,a4paper]{article}
\usepackage{braket}
\renewcommand\bra[1]{{\langle{#1}|}}
\makeatletter
\renewcommand\ket[1]{%
\@ifnextchar\bra{\k@t{#1}\!}{\k@t{#1}}%
}
\newcommand\k@t[1]{{|{#1}\rangle}}
\makeatother
\begin{document}
\[
\ket{x}\bra{x}
\]
\end{document}

Best Answer
Use
\braket{0|0}
: