@sohlmann It seems that this problems comes from the fact that we do not copy vtau to the GPU before computing the energy. I will prepare a merge request for this, but there is a problem with the design I think.
I would suggest to make vtau private (in hamiltonian_elec_base) and to later change it via a setter that would move it to GPU immediately. Would you agree to go along this line?
I would then do i) a bugfix for hotfix-14.1, and ii) a feature branch for main. Does this makes sense to you?
vtau is accessed in quite a few places, so probably it is some work involved, but in principle I like this approach because it reduces the potential for errors.
This is actually a more general problem with arrays that live on CPU and GPU that need to be in sync.