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 Fisika →

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 poweredTulis LaTeX menggunakan AI

Editor LaTeX AI Terbaik, Alternatif Overleaf

Octree membantu peneliti dari 15+ universitas menulis makalah penelitian lebih cepat menggunakan AI

  • Hasilkan diagram TikZ yang indah menggunakan AI
  • Unggah gambar dan konversi ke LaTeX dengan mulus
  • Dapatkan bantuan instan untuk menulis dan memformat makalah penelitian