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 الفيزياء →

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 poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث