Adapted the potential definition based on the hf.cpp code from Camille