Abstract
Two important extensions of Kohn-Sham (KS) theory are generalized KS theory and ensemble KS theory. The former allows for non-multiplicative potential operators and greatly facilitates practical calculations with advanced, orbital-dependent functionals. The latter allows for quantum ensembles and enables the treatment of, e.g., open systems and excited states. Here, we combine the two extensions, both formally and practically, first via an exact yet complicated formalism, then via a computationally tractable variant that involves a controlled approximation of ensemble "ghost interactions" by means of an iterative algorithm. The resulting formalism is illustrated using selected examples. This opens the door to the application of generalized KS theory in more challenging quantum scenarios and to the improvement of ensemble theories for the purpose of practical and accurate calculations.