I try to figure out the correct way of inputting  Dirac bra-ket notation, as noted here:  <
https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation>, in my LaTeX document. Currently, I tested with the following example:
<quote>
\documentclass{paper}
\usepackage{mathtools} 
\usepackage{amsmath} 
\begin{document}
	$|a \rangle \langle a|$ 
	
	$ \rvert a\rangle \langle a\lvert$
\end{document}
</quote>
It seems the above methods will generate the exact same results. But I still not so sure on it. Any hints for the preferable way to do this trick will be highly appreciated.
Regards,
HY