Both constraints are ensured in the TDDFT module of CP2K by explicitly orthonormalizing the ES eigenvectors as well as by orthogonalizing the ES eigenvectors with respect to the MO coefficients at each step of the Davidson algorithm. Eq. ( ) implies the transformation rules from AO to MO basis and vice versa, which are given for vectors V and matrices M in general as