Best way to do bra-kets in latex?

  • Context: LaTeX 
  • Thread starter Thread starter LAHLH
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary
SUMMARY

The discussion focuses on the best practices for typesetting bra-ket notation in LaTeX. Users recommend using the command \mid for bra-kets but note that it can create undesirable spacing. The alternative command | is suggested, although it may also lead to spacing issues depending on the following symbol. The use of \left| is highlighted for better spacing control, and users can manually adjust spacing with \!. Additionally, defining a custom command like \def\ket#1{\left | #1 \right \rangle} is proposed for convenience.

PREREQUISITES
  • Familiarity with LaTeX typesetting
  • Understanding of bra-ket notation in quantum mechanics
  • Knowledge of LaTeX spacing commands
  • Experience with defining custom commands in LaTeX
NEXT STEPS
  • Research LaTeX spacing adjustments using commands like \! and \,
  • Learn about custom command definitions in LaTeX for efficient typesetting
  • Explore advanced LaTeX packages for mathematical typesetting, such as amsmath
  • Investigate best practices for typesetting quantum mechanics notation in LaTeX
USEFUL FOR

Mathematicians, physicists, and anyone involved in academic writing who needs to typeset quantum mechanics notation professionally in LaTeX.

LAHLH
Messages
405
Reaction score
2
Hi,

sorry if this is the wrong place, but is there a good way to do bras and kets in latex. I usually just do \mid 0\rangle but this gives big gaps that doesn't look very professional
 
Physics news on Phys.org
You can use | directly, as in |0\rangle.
 
cheers
 
The distance can come out wrong when you use | too. Apparently it doesn't when the next symbol is 0, but it does when the next symbol is \uparrow, as you can see here: |\uparrow\rangle. Then you can use \left| to get \left|\uparrow\rangle. I'm too lazy to type \left every time though.
 
Interestingly, \mid works with \uparrow.

Anyways, You can always subtract spacing yourself with \!. For example, using mid and 0:
\mid \!\! 0 \rangle
and, you can always make a definition to abbreviate stuff, although that doesn't work as well on PF:

\def\ket#1{\left | #1 \right \rangle}<br /> \ket{0} \qquad \ket{\uparrow} \qquad \ket{\frac{1}{2}}
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
2K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 0 ·
Replies
0
Views
1K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K