# 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 |

The Hamiltonian.

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.

An atomic system consisting of a

J=0 state and a

J=1 state.

Out[2]= | |

The Hamiltonian for this system in the absence of external fields.

Out[3]//MatrixForm= |

| |

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.

The Hamiltonian in the presence of a

z-directed electric field and

y-directed magnetic field.

Out[4]//MatrixForm= |

| |

The Hamiltonian can be written more cleanly in terms of the "reduced" Rabi frequency

_{R}=(1||d||2)E_{0} and the nominal Larmor frequency

_{L}=_{B}B.

Out[5]//MatrixForm= |

| |

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 |

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.

An atomic system consisting of a

J=2 state with specified values for scalar and tensor polarizability. (It is not necessary to specify values; the default symbolic values will be used if values are not specified.)

Out[6]= | |

The effective Hamiltonian describing the response of the state to a

y-directed electric field in terms of the polarizabilities.

Out[7]//MatrixForm= |

| |