# Hydrogen Four states of the hydrogen atom in a section through the axis: 1s and 2s above, a 2p and a 3d state below. ```python import matplotlib.pyplot as plt import sympy as sp import pdemagic as pm r, theta, alpha = sp.symbols("r theta alpha", real=True) E = sp.Symbol("E") psi = sp.Function("psi")(r, theta, alpha) atom = pm.Problem( sp.Eq(-pm.laplacian(psi) / 2 - psi / r, E * psi), domain=pm.Ball(r, theta, alpha, radius=35), boundary=sp.Eq(psi, 0), eigenvalue=(E, 6), ) states = pm.solve(atom) figure, panels = plt.subplots( 2, 2, figsize=(9, 7), sharex=True, sharey=True, layout="constrained" ) panels[0, 0].set(xlim=(-20, 20), ylim=(-20, 20)) for number, panel in zip([0, 4, 1, 5], panels.flat): states.plot(state=number, ax=panel) ``` ## What it shows The Schrödinger equation of the electron in a hydrogen atom, $-\tfrac12\nabla^2\psi - \psi/r = E\,\psi$, in spherical coordinates. The potential has a singularity at the centre, which a ball takes and free space does not. The energies that come out are $-1/2$ once, $-1/8$ four times and then $-1/18$: the levels $-1/(2n^2)$ of the atom, the second with its four states. The panels show the two round states, 1s and 2s, a 2p state with its nodal plane, and a 3d state with its two nodal cones. A state of the level $n$ reaches to about $2n^2$, so each level is larger than the one before. ## What pdemagic decided The planner chose the modes of the ball (`collocation_modes`): each is the product of a spherical harmonic and a radial mode for its degree, from collocation at Gauss points along the radius, which a potential of the radius alone allows. The grid has 48 points along the radius, 48 along the angle from the axis and 96 around it. The surface of the ball is a wall, and a state that reaches it is squeezed: with the radius 35 the first two levels are right to ten digits and the third to five. The panels show the middle of the ball. ## More - [Eigenproblems: bound states](../topics/eigen.md) - [Disks, rings, balls, shells and cylinders](../topics/round.md) - [The modes of boxes and round domains](../methods/cavity-modes.md) - [What is solved on round domains](../ref/equations-round.md)