I have diagonalized a Hamiltonian matrix many times with a varying parameter (varying magnetic field). This gives me the eigenstates and eigenvalues of the matrix for the different field values. I now need to track the diabatic states through (avoided) level crossings of the eigenvalues (energies/adiabatic states). In other words, if the system has an initial populated eigenstate and I start increasing the field very rapidly, I would like to know which eigenstate would be populated at the end Does anyone know an easy way to do that? Is there a readymade code I can use? Thank you Yoav.