Recently SE.QuantumComputing started private beta (bit of a misnomer, as users can join freely), and we started a $\mathrm{\TeX}$-tutorial Meta discussion like the one found here at SE.Math.
Since quantum computing makes frequent use of bra-ket notation and it's a bit tedious to type out the $\mathrm{\TeX}$ for it constantly, it'd be nice if we could auto-include custom $\mathrm{\TeX}$ definitions for it, along with other common quantum-computing concepts, in our MathJax implementation.
For example, it'd be cool if we could auto-include
\newcommand{\bra}[1]{ \left< #1 \right| }
\newcommand{\ket}[1]{ \left| #1 \right> }
\newcommand{\bk }[2]{ \left< #1 \middle| #2 \right> }
\newcommand{\bke}[3]{ \left< #1 \middle| #2 \middle| #3 \right> }
, so then users could type
$\bra{x}$
to get $\left< x \right|$;$\ket{y}$
to get $\left| y \right>$;$\bk{x}{y}$
to get $\left< x \middle| y \right>$;
etc..
Questions:
Does SE.Math or any other SE have such custom-defined ${\rlap{\raise{0.5ex}{\rule{2em}{1px}}}} \mathrm{\TeX}$ commands?- As pointed out by @Quasicoherent in the comments, this has been proposed before and rejected. However, still curious about whether or not it's technically possible in the case that there's broad community agreement on common $\mathrm{\TeX}$ commands for specialized SE's.
If not, is it something that could be reasonably done if the community agrees on a set of highly useful commands?
\langle
and\rangle
be a more natural choice than<
and>
. There is a related TeX.SE question: Braket notation in LaTeX. (Although it is not exactly about this, it seems to be mainly about braket package.) Since this is unrelated to the main question, I'd suggest that we could discuss this further (if needed) in the MathJax chatroom. $\endgroup$\langle
and\rangle
is that they're just characters, so they don't resize to their content. A working alternative is to use\left\langle
and\right\rangle
to get the same effect as\left<
and\right>
, but then it's just more characters for the same thing. $\endgroup$\mid
, though unfortunately it doesn't scale (at least not with\middle\mid
), so at the moment I wouldn't bother with it. I guess if we cared for the space, it could be\newcommand{\bk}[2]{\left< #1 \hspace{5px} \middle| \hspace{5px} #2 \right>}
instead. Or, maybe a bit less than5px
, since it looks a bit much. $\endgroup$