NMR shielding constants from ab initio and Kohn-Sham electron densities