Abstract
Kohn-Sham inversion, in which the effective Kohn-Sham mean-field potential is found for a given density, provides insights into the nature of exact density functional theory (DFT) that can be exploited for the development of density functional approximations. Unfortunately, and despite significant and sustained progress in both theory and software libraries, KS inversion remains rather difficult in practice, and especially in finite basis sets. The present work presents a Kohn-Sham inversion method, dubbed the "Lieb-response" approach, that naturally works with existing Fock-matrix DFT infrastructure in finite basis sets, is numerically efficient, and directly provides meaningful matrix and energy quantities for pure-state and ensemble systems. Some additional work yields potentials. It thus enables the routine inversion of KS systems, as illustrated on a variety of problems within this work; and provides outputs that can be used for embedding schemes or machine learning of density functional approximations.