
AtomicDensityMatrix
mathematica package
about : installation : documentation : release notes : feedback
AtomicDensityMatrix is a package for Mathematica version 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.
The package has been updated for compatibility with Mathematica 11. Please send bug reports to simon@rochesterscientific.com.
Features:- Supports systems with an arbitrary number of states, automatically generating Zeeman and hyperfine substructure. Also supports calculations for model systems that neglect angular momentum
- Automatic generation of Hamiltonians including the effects of arbitrary static or dynamic electric, magnetic, and optical fields
- Routines for automatic application of the rotating-wave approximation
- Automatic generation of terms describing relaxation effects, including spontaneous decay
- Formulates and solves density matrix evolution equations, either analytically or numerically, as a function of time or in the steady state
- Routines implementing the matrix-continued fraction method for efficient numerical computation of periodic solutions for the case of modulated fields
- Supports generation and simultaneous solution of coupled density matrices describing different velocity classes and physical regions in the system
- Finds the effect of atomic polarization on light polarization, using various light polarization parameterization schemes
- Performs irreducible tensor decomposition of the density matrix
- General implementation of irreducible tensor algebra
- Performs arbitrary rotations of operators and irreducible tensors
- Automatic generation of level diagrams showing level structure, electromagnetic-field induced coupling, and atomic sublevel populations from the density matrix
- Plots angular-momentum probability surfaces: a 3D geometrical representation of atomic polarization
- An associated graphics package aids the generation of plots and animations for visualization of the physical processes
- A growing collection of basic and advanced examples, showing the application of the package to real atomic physics problems
- User extensible
First download ADM_yy.mm.dd.zip.
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:
- Using the
File > Install
menu item (Mathematica version 8 and up):- Start Mathematica.
- Select the menu item
File > Install
. - In the dialog box, for "Type of Item to Install" choose "Application" (not "Package").
- For "Source" choose "From File..."
- When the file selector appears, choose the zip file that you have downloaded, and select "Open".
- Leave the "Install Name" as it's given, and click "OK".
- Mathematica will extract the contents of the zip file, and copy them to the correct install location.
- Manually (all versions):
- Locate your Mathematica base directory (for installation for all users) or user base directory (for installation for the current user only). You can find these directories by evaluating
$BaseDirectory
or$UserBaseDirectory
in Mathematica. In Mathematica 7 or later, you can open the directory in a file browser by evaluating
orSystemOpen[$BaseDirectory]
(Note that in Windows or Mac OS X, these directories may be hidden in the file system by default.)SystemOpen[$UserBaseDirectory]
- Unzip the contents of the downloaded zip archive into the "Applications" subdirectory of the base directory.
- The package files should now be in the directory
where[BaseDirectory]/Applications/AtomicDensityMatrix
[BaseDirectory]
is the directory you chose in the previous step.
- Locate your Mathematica base directory (for installation for all users) or user base directory (for installation for the current user only). You can find these directories by evaluating
To load and test the package in Mathematica, evaluate
<<AtomicDensityMatrix`
and then
$ADMVersion
to see the package version number,
AMPSPlot[DiagonalMatrix[{1, 0, 1}]]
to see a simple angular-momentum-probability surface, and
LevelDiagram[ZeemanSystem[1]]
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 now have to restart Mathematica 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.
- v17.08.24
- Added
L
andS
operators. - Now supports M1 transitions between fine-structure states in
Hamiltonian
. - New
RestrictCoupling
option forHamiltonian
. - Optimized
WignerEckart
function for large systems. - Expanded functionality of
Recomposition
function. - New documentation pages for symbols.
- Added
- v17.06.12
- Added pressure broadening parameter to
LinearAbsorption
function and changed argument order. - Updated "Linear Absorption Fitting" tutorial and added
LinearAbsorption
symbol page.
- Added pressure broadening parameter to
- v17.05.31
- Improvements to
LevelDiagram
. - Code refactoring.
- Allowed supplying an atomic system to
ReducedME
. - Symbol documentation pages for
LevelDiagram
,AMPSPlot
,ToCartesian
. - Bugfix for
CartesianQ
. - Generalized
MatrixMultiply
. - Removed
MapOnParameters
andReplaceMatrixElement
functions. - Improved
Energies
andTransitionFrequencies
functions. - Added unit tests.
- Updated rotations tutorial.
- Removed
SpontaneousEmission
operator. - Set
HyperfineShift
to zero for Toy and Zeeman systems. - Fixed
StateLabel
so that undefined symbols can be used as labels. - Added Na 3D_3/2 state and Na branching ratios to
AtomicData
. - Added "Nonlinear Magneto-Optical Rotation in a Radio-Frequency field" tutorial.
- Changed default style options for
Arrow3D
. - Bugfix for
TextOnTop
function.
- Improvements to
- v17.02.12
- Updated for compatibility with
Mathematica
11. - Renamed
Region
toExperimentalRegion
. User notebooks that useRegion
will need to be updated. - Extended
StateLabelQ
andStateMatchQ
functions, removed deprecated syntax forStatePosition
andStateMatchQ
, addedStateEvaluate
function. - Rewrote and improved
LevelDiagram
function. - Added
Fluorescence
function. - Fixed
FluorescenceOperator
for toy systems. - Set
BranchingRatio
to zero for same-parity states. - Added symbol documentation page for
LevelDiagram
. - Renamed
GetLine
toGetLines
. - Other minor fixes and improvements.
- Updated for compatibility with
- v15.08.27
- Moved
Arrow3D
andPlotAndFit
packages into the AtomicDensityMatrix application. These packages no longer have to be loaded separately. The Graphics and DataAnalysis folders have been removed from the ADM application. - Speed improvements in
WignerEckart
,Hamiltonian
, andOpticalRepopulation
. - Updates to
Arrow3D
for Mathematica 10. Tweaked default graphics options forAxes3D
andAMPSPlot
. - Fixed options handling in
PlotAndFit
for Mathematica 10. - Updated documentation for compatibility with
Mathematica
10 graphics. - Added "Magneto-Optical Rotation in an Alkali Atom" tutorial.
- Moved
- v15.04.24
- Added GPL license info to source files.
- Removed dummy AtomicPhysics` package.
- For compatibility with Mathematica 10, renamed
Void
asVoidRegion
. User notebooks that use theVoid
command will need to be changed accordingly. - Adopted WWBCommon package for cross-version-compatible documentation.
- Higher-res banner and logo images.
- Speed improvements in
FixTicks
andAlignedGraphicsGrid
. - Reorganized and improved unit tests.
- v14.02.28
- Fixed behavior of
BranchingRatio
for setting branching ratios for inverse decays to zero. - Modified
OpticalRepopulation
to give more reasonable result when BranchingRatios are not specified. - Added rule to
MatrixMultiply
to allow multiplying a scalar operator by a (Cartesian) vector operator. - Changed possible values for
Interaction
option ofHamiltonian
to the strings"Internal
","ElectricDipole"
,"MagneticDipole"
, and"Polarizability"
- Updated (and renamed) the "Electromagnetically Induced Transparency and Atomic Polarization" example.
- Speed optimizations.
- Dummy position variables
Xx
,Yy
, andZz
are defined only if theVectorAnalysis`
package has not been loaded. If usingVectorAnalysis`
package, load it first to avoid name conflict warnings. - Modified
OpticalField
to produce simpler expressions for arbitrary polarization and propagation vectors. - Added and updated symbol documentation pages.
- Fixed behavior of
- v13.07.19
- Updated for compatibility with Mathematica 9:
- In Mathematica 9, the functionality of
PhysicalConstants`
andUnits`
has been completely redesigned, and merged with the kernel. However, I don't think loading these packages causes any conflict with built-in functionality, so for backwards compatibility I'm going to continue loading these packages (and suppress the obsolete package warning). Please let me know if you encounter any conflicts. - The functionality of the
VectorAnalysis`
package has been redesigned and incorporated into the kernel. There was very little use of it in the ADM package, so I was able to remove the dependency on theVectorAnalysis`
package altogether. - There is a new
TensorProduct
function in Mathematica 9, so the ADMTensorProduct
function has been renamedSphericalTensorProduct
- Renamed
Label
asStateLabel
; the optionLabel
forDensityMatrix
has been renamedDMLabel
. User notebooks that use theLabel
command will need to be changed correspondingly. - Fixed problems stemming from new (fixed)
ComplexExpand
behavior. - Native documentation was restyled in version 9, producing some ugly layout problems in the ADM documentation. Cross-version documentation has now been implemented using the method described here.
- In Mathematica 9, the functionality of
- Updated documentation.
- Fixed a bug blocking the package from showing up in the "Add-ons" section of the Documentation Center.
- Fixed web links in the ADM documentation, making them point to the online version of the documentation.
- Made functions for obtaining atomic parameters automatically thread over atomic systems.
- Speed optimizations.
- Changed optical field parameterization specifications to strings.
- Updated for compatibility with Mathematica 9:
- v13.07.07
- Added "Nonlinear Magneto-optical Rotation with Frequency-modulated Light" example.
- Updated "EIT and Atomic Polarization", "Breit-Rabi", "Rotating-wave Approximation", and other assorted tutorials.
- Added symbol pages for
RotatingWaveApproximation
andF
. - Modified
DropFastTerms
(andRotatingWaveApproximation
) so that sums of two different optical frequencies are not dropped. Also extended to allow some more complicated expressions as frequency arguments. - Extended
StatePosition
,SelectStates
, and related functions to allow specification of the selection criteriaLabel ==
lab as just lab. - Extended
RotatingWaveApproximation
,RotatingWaveTransform
andRotatingWaveTransformMatrix
to automatically generate the RWA transform matrix given a list of optical frequencies and the associated levels that they couple. Also allow the possibility to specify the optical detuning parameters along with the optical frequencies. - Defined new function
ReplaceMatrixElement
that applies replacement rules to particular matrix elements in an operator selected according to their correspondingAtomicState
parameters. - Defined new function
StateMatchQ
- v13.06.09
- Corrected the units for quantities in AtomicData by changing
Hertz
to1/Second
(all quantities are in omega units, rad/sec, but were incorrectly labelled as being Hertz). If your application depends on the AtomicData package, it may require modification. - Extended
RotatingWaveTransformMatrix
to allow manual specification of level shifts - Changed
ToContravariant
andToCovariant
to useDual
rather thanGeneralizedConjugateTranspose
when converting between co- and contravariant quantities in order to correctly handle complex vectors - Included
SphericalPhase
parameterization inOpticalField
- Modified
BranchingRatio
so that it returns zero if it can tell that the reverse branching ratio is nonzero. - Fixed links in documentation.
- Updated documentation.
- Updated installation instructions
- Corrected the units for quantities in AtomicData by changing
- v12.08.15
- Added parities for alkali states to
AtomicData
- Added
ParityOffset
option toLevelDiagram
- Updated and added usage messages.
- Added parities for alkali states to
- v12.06.21
- Documented the Voigt profile in the "Linear Absorption Fitting" example
- Modified
SublevelMultiplicity
so that it returns(2F+1)
whenF
is defined (suggested by Guobin Liu) - Modified
DopplerWidth
to work if lower and upper states are given in either order (suggested by Guobin Liu) WignerD
is defined as a system function in Mathematica 8. Therefore the ADM version ofWignerD
has been renamedADMWignerD
, and the built-inWignerD
has been overloaded so that it callsADMWignerD
when given arguments that match theADMWignerD
format.- Fixed linear absorption for Toy systems
SelectStates
now allows boolean operators in the selection criteria- Speed enhancements
- Split more functions into subpackages
- Removed outer matrix in return value of
PolarizationMatrices
with numerical argument LevelDiagram
improvements- Assorted documentation improvements
- v10.07.17
- Package now loads with
<<AtomicDensityMatrix`
rather than<<AtomicPhysics`
. A dummyAtomicPhysics
package that calls theAtomicDensityMatrix
package is provided for backwards compatibility. - Updated documentation
- Package now loads with
- v10.07.09
- Standardized
WignerRotate
function - Standardized
AMPSPlot
for polarization-moment expansions - Added "Quantum-mechanical rotations" tutorial
- Updated documentation
- Standardized
- v10.06.28
- Added options to
Ket
function - Updated some tutorials
- Split
LevelDiagram
and perturbative solve functions into subpackages - Fixed bug in
LevelDiagram
for Mathematica 6.0 and made speed improvements
- Added options to
- v10.04.28
- Speed improvements in
SteadyStatePerturbativeSolve
,OpticalRepopulation
- Speed improvements in
- v10.04.20
- Modified package context structure
- Speed optimizations
- Migrated development to Wolfram Workbench
- Added
DopplerWidth
andMostProbableSpeed
functions - Added "Linear Absorption Fitting" example
- Fixed
Component
function for tensor decomposition matrix input - Combined
DMElementPattern
andDMElementPartPattern
functions
- v09.12.08
- Corrected sign error in optical-field azimuthal angle
- Flipped rotating wave transform from active to passive
- Changed
UnitaryTransformation
toEffectiveHamiltonian
- Changed
DMRotating
toDMFromRotatingDM
- Included
PlotAndFit
package in distribution
- v09.09.07
- Added potassium to
AtomicData
- Added
AtomicTransition
function toAtomicData
package
- Added potassium to
- v09.08.07
- Added
ExcitedStates
function - Added
LinearAbsorption
function - Improved
LevelDiagram
function - Improved
SphericalTensorQ
function - Extended
SublevelMultiplicity
function - Change in internals of
WignerEckart
function - Fixed bug in
RotatingWaveTransform
- Added
- v09.06.09
- Internal change in
ExprToReIm
- Fixed bug in
DMElementPattern
- Fixed bug in
FluorescenceOperator
for angle-integrated case
- Internal change in
- v08.12.09
- Improved
LevelDiagram
function - Renamed
FluorescenceOperator
asOpticalRepopulationOperator
, added newFluorescenceOperator
function that calculates fluorescence into a solid angle - Wrote usage messages for some symbols.
- Updated values in
AtomicData
and added Na
- Improved
- v08.10.30
- Improved
TensorForm
,Component
,PolarizationMoments
,LevelDiagram
functions - Added
PolarizationMoments
representation toOpticalRepopulation
function - Set up
LiouvilleEquation
function to produce Bloch equations in terms of polarization moments - Extended
ToCartesian
function to apply to operators and arbitrary rank spherical tensors - Added "EIT and Atomic Polarization" example
- Improved
- v08.10.23
- Worked on
LevelDiagram
function - Separated out
AtomicDensityMatrix`Common`
package - Changed behavior of
F
parameter: it now returnsJ
ifF
is not defined - Changed labeling of density matrix elements in Toy systems: labels are no longer enclosed in lists
- Generalized tensor operations to include imaginary/nonhermitian tensors
- Improved
TensorForm
function - Updated "MatrixNotation", "Matrix Multiplication" tutorials
- Worked on
- v08.10.07
- Fixed bug in
Recomposition
function - Improved
LevelDiagram
function - Updated "Angular-momentum Probability surfaces" example
- Improved "Collapse and Revival Quantum Beats" example
- Fixed bug in
- v08.09.22
- Expanded "Two-level system", and "NMOR" examples
- Updated "Breit-Rabi Diagram", "Collapse and Revival", "Three-level System", "Angular-momentum Probability Surfaces" examples
- Improved
LevelDiagram
,TransitRepopulation
,DensityMatrix
,DMVariables
,Recomposition
functions - Changed polarization moment expansion coefficients to contravariant to match Varshalovich
- Fixed bug in
Component
function - Added
CovariantDecompositionQ
,ContravariantDecompositionQ
,CovariantDecompositionMatrixQ
,ContravariantDecompositionMatrixQ
,TensorForm
functions - Added link to source code in documentation
- v08.07.07
- Added "The AC Stark Effect" example
- Added "The Wigner-Eckart Theorem", "Constructing the Hamiltonian", "The Rotating-wave Approximation" tutorials
- Improved
LevelDiagram
function
- v08.06.29
- Got documentation working in 6.0.3
- Revamped Guide page
- Added "Displaying the Density Matrix" tutorial
- Added "Collapse and Revival Quantum Beats" example
- Added symbol reference pages for
DensityMatrix
,DMVariables
,Ket
,AtomicState
,L
,S
- Added
$ADMVersion
symbol.
- v08.05.26
- Streamlined internals of
OpticalField
- Improved
Region
input toHamiltonian
- Eliminated
FractionalDensity
Region parameter - Included case of multiple ground states in
TransitRepopulation
- Added "Isolating the Hexadecapole Moment" example
- Added
GFactor
parameter toAtomicState
- Added
LevelDiagram
function (prototype) - Added "The Stark Effect" example
- Added "Hyperfine Structure: Breit-Rabi Diagram" example
- Streamlined internals of