Ket vector in LaTeX (| \psi \rangle)
- LaTeX command
| \psi \rangle- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
A ket in Dirac notation, representing a quantum state as a column vector in Hilbert space.
States are kets: |0\rangle and |1\rangle for a qubit, |n\rangle for harmonic oscillator levels, and superpositions like \alpha|0\rangle + \beta|1\rangle. The angle bracket is \rangle, not >. Writing \lvert \psi \rangle gives TeX an explicit opening delimiter so spacing is right even after a minus sign. A macro such as \newcommand{\ket}[1]{\lvert #1 \rangle} keeps hundreds of kets consistent. Tensor products are written |\psi\rangle \otimes |\phi\rangle or compressed as |\psi\phi\rangle. A ket times a bra, |\psi\rangle\langle\psi|, is a projector or density matrix.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Ket vector: $| \psi \rangle$
\[ | \psi \rangle = \alpha | 0 \rangle + \beta | 1 \rangle \]
\end{document}Related symbols
- Braket
\langle \phi | \psi \rangle - Bra vector
\langle \psi | - Delta (Upper)
\Delta - Reduced Planck constant (h-bar)
\hbar - Nabla
\nabla - Laplacian
\nabla^2
Frequently asked questions
- How do I write Ket vector in LaTeX?
- Type | \psi \rangle in math mode, for example $| \psi \rangle = \alpha | 0 \rangle + \beta | 1 \rangle$. It works in plain LaTeX without loading any package.
- Which package do I need for | \psi \rangle?
- None. | \psi \rangle is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use | \psi \rangle in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $| \psi \rangle$ in running text.