On the application of the Kohn–Sham theory to the calculation of potential energy curves