AtomicDensityMatrix is a package for Mathematica 6 and later that facilitates analytic and numerical density-matrix calculations in atomic and related systems. It is intended to be both general and user-friendly, and to be useful to the working physicist as well as to students.

AtomicDensityMatrix is open source software, licensed under the GPLv3.

EITDiagram EITLineshape EITMatrix StateVector PolMoments Hexacontatetrapole LightPolDemo CrossedEB


The package has been updated for compatibility with Mathematica 11. Please send bug reports to


Take a look at the online documentation for examples of what the package can do.



First download

Installing a Mathematica package consists entirely of placing the package files in a location where Mathematica can find them. You can do this using one of the following two methods:

  1. Using the "File > Install" menu item (Mathematica version 8 and up):
  2. Manually (all versions):

To load and test the package in Mathematica, evaluate


and then


to see the package version number,

AMPSPlot[DiagonalMatrix[{1, 0, 1}]]

to see a simple angular-momentum-probability surface, and


to plot the level diagram for a J=1 atomic system. There are many other examples in the documentation.


The package documentation is growing, but far from complete. It is available in the Mathematica Documentation Center when the package is installed. (You may have to restart Mathematica immediately after installation to see the AtomicDensityMatrix documentation appear in the Documentation Center.)

To view the documentation, select "Help > Documentation Center", and click "Add-Ons and Packages" at the bottom of the page (for version 6, "Installed Add-Ons" on the bottom right). You will reach a page of links to the documentation for installed packages. Alternatively, you can just enter "adm" in the Documentation Center search bar—one of the first few results should be for the ADM package guide page. (This shortcut appears to be broken in Mathematica 10.1, but it's working again in Mathematica 10.2.)

The documentation is also available online in html format.

Laser Guide Stars:

The LGSBloch package is an extension to the Atomic Density Matrix package that contains routines for calculating the return flux from optically excited alkali atoms, specifically designed for Na atoms in the mesosphere.

The LGSBloch package requires Mathematica 7 or later.

LGSBloch installation instructions


Pumping hexadecapole, 2->1 transition Pumping hexadecapole, 2->2 transition Nonlinear Zeeman effect Comparing EIT and nonlinear magneto-optical effects Fig. 4(c) from RF NMOR paper. Fig. 5 from RF NMOR paper. Fig. 6 from RF NMOR paper.

Release notes:


Please send questions, suggestions, and bug reports to Simon Rochester at