  This technical note describes the physical model, numerical implementation,
and validation of multilevel atomic media for lasers and saturable absorbers in
Meep: a free/open-source finite-difference time-domain (FDTD) software package
for electromagnetics simulation. Simulating multilevel media in the time domain
involves coupling rate equations for the populations of electronic energy
levels with Maxwell's equations via a generalization of the Maxwell--Bloch
equations. We describe the underlying equations and their implementation using
a second-order discretization scheme, and also demonstrate their equivalence to
a quantum density-matrix model. The Meep implementation is validated using a
separate FDTD density-matrix model as well as a frequency-domain solver based
on steady-state ab-initio laser theory (SALT).
