i see there is a way to calculate the AO dipole matrix (<i| r |j> i believe for the AO basis) here (Calculating transition and state density matrices and dipole moment matrices), and in this post (Electron Integrals for Orthogonalized Basis) it mentions that you can transform from the AO basis to the MO one, but doesn’t say how. how precisely would i do that?

i’m also curious how to get the MO amplitude at a given point in space (phi_j(r)), i.e. for each MO that i care about.

thanks in advance!