Calligraphic H (Hamiltonian) in LaTeX (\mathcal{H})

H\mathcal{H}
LaTeX command
\mathcal{H}
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Calligraphic H, used for the Hamiltonian (energy function) and frequently for a Hilbert space.

In classical mechanics Hamilton's equations read \dot{q} = \partial \mathcal{H}/\partial p and \dot{p} = -\partial \mathcal{H}/\partial q. Quantum mechanics usually writes the Hamiltonian operator as \hat{H} and uses \mathcal{H} for the Hilbert space of states, so the two calligraphic meanings can collide in one paper. Statistical physics uses \mathcal{H} for a Hamiltonian functional in the Boltzmann weight e^{-\beta \mathcal{H}}. Learning theory uses it for a hypothesis class. Pick distinct letters if more than one appears. Note that \mathcal only covers capital letters in the default fonts.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

q˙=∂pH,p˙=−∂qH\dot{q} = \partial_p \mathcal{H}, \quad \dot{p} = -\partial_q \mathcal{H}
\documentclass{article}
\begin{document}
Calligraphic H (Hamiltonian): $\mathcal{H}$

\[ \dot{q} = \partial_p \mathcal{H}, \quad \dot{p} = -\partial_q \mathcal{H} \]
\end{document}

Related symbols

All Fysica →

Frequently asked questions

How do I write Calligraphic H (Hamiltonian) in LaTeX?
Type \mathcal{H} in math mode, for example $\dot{q} = \partial_p \mathcal{H}, \quad \dot{p} = -\partial_q \mathcal{H}$. It works in plain LaTeX without loading any package.
Which package do I need for \mathcal{H}?
None. \mathcal{H} is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \mathcal{H} in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\mathcal{H}$ in running text.
Math poweredSchrijf LaTeX met AI

Beste AI LaTeX Editor, Overleaf Alternatief

Octree helpt onderzoekers van 15+ universiteiten sneller onderzoeksartikelen schrijven met AI

  • Genereer mooie TikZ-diagrammen met AI
  • Upload afbeelding en converteer naadloos naar LaTeX
  • Krijg directe hulp bij het schrijven en opmaken van onderzoeksartikelen