# Constructing the Hamiltonian

The Hamiltonian is the operator that governs the time evolution of the state vector or density matrix (except for evolution due to relaxation effects). The eigenvalues of the Hamiltonian are the observable energies of the system. The Hamiltonian for an atomic system subject to external electromagnetic fields can be constructed using the Hamiltonian function.

Hamiltonian[sys,opts] | the Hamiltonian for atomic system sys subject to interactions specified by opts |

If no options are specified, the external electric and magnetic fields are taken to be zero, and Hamiltonian returns the Hamiltonian describing the internal energy of the system. In the absence of external fields, this is a diagonal matrix with the diagonal comprised of the unperturbed energies of the atomic states.

By default, Hamiltonian takes into account the electric and magnetic dipole (E1 and M1) interactions when nonzero electric or magnetic fields are specified.

ElectricField | the electric field can be specified as a Cartesian vector |

MagneticField | the magnetic field can be specified as a Cartesian vector |

External fields as options to Hamiltonian.

Combinations of interactions other than the default can be selected with the Interaction option.

"Internal" | energies in the absence of external fields |

"MagneticDipole" | magnetic dipole interaction energy |

"ElectricDipole" | electric dipole interaction energy |

"Polarizability" | effective Hamiltonian due to atomic polarizability |

Automatic | equivalent to {"Internal","MagneticDipole","ElectricDipole"} |

All | all of the interactions |

In order to take into account the polarizability of an atomic state (i.e., the effect of Stark-induced mixing with additional states not considered in the atomic system), the "Polarizability" interaction can be selected.