# Identifying avoided crossings

Consider the following spectrum

This spectrum represents the evolution of the energy levels of a certain molecule in its ro-vibrational ground state as a function of the magnetic field. Such graphs are very common in physics.

When producing such graphs, one needs to diagonalize the relevant Hamiltonian then plot its eigenvalues as a function of the perturbation (the magnetic field here).

Question: When doing this, how can I follow the evolution of a "given state's" energy from beginning to end? For example, let's index the states by their energy when B=0. Let's focus on state number 5 when B=0. I want to follow adiabatically this state.

As B changes, the energy of this state number 5 is going to change, at some point it may cross other energy levels. When such crossings happen, how do I know if they are avoided crossings, or if they are just crossings?

Ultimately my goal is to correctly draw these energy levels when doing this kind of calculations myself, so this question is somewhat programming oriented.

• If all the crossings are avoided, then you can just sort the eigenvalues from smallest to largest at each value of the magnetic field. Then you'll be able to trace along the adiabatic curves. When there are exact crossings, then this doesn't work. In that case, you can often take advantage of a symmetry of the system, because states transforming according to different irreducible representations of the symmetry group can't mix together (e.g., states of different angular momentum when a system is rotationally symmetric). You'll want to block diagonalize according to symmetry first anyway. Commented Feb 17 at 2:58
• If you can solve the problem with $B$ as an unknown variable, then you'll be able to plot the whole thing for any range of $B$-values. The solution seems to be linear in $B$. Perhaps that can help as an ansatz. Commented Feb 17 at 3:59