grand potential $\Omega$) [@Mer65] is given as a functional of the (static) density ${\bf n}$. The variational principle associated with the functional $E[{\bf n}]$ is rigorous but cannot be evaluated as $E[{\bf n}]$ is generally unknown. In the standard local-density approximation (LDA) the (unknown part of the) functional is replaced by an explicitly known but approximate functional which is taken from the homogeneous system. For systems with weakly varying density the LDA should be justified. Information on excitation properties is contained in dynamic response functions which are in principle accessible via time-dependent DF theory [@RG84] where the action $A$ is considered as a functional of the time-dependent density ${\bf n}$. Again, the exact but unknown functional $A[{\bf n}]$ is approximated to make it explicit and the variational principle is exploited afterwards.

The method proposed here rests on a variational principle which uses the electron self-energy ${\bf \Sigma}$ as the basic dynamic variable. A new functional $\Omega[{\bf \Sigma}]$ is constructed which can be shown to be stationary at the physical self-energy. The main result is that the variational principle can be exploited without any approximation of the functional dependence. Namely, a [*rigorous*]{} evaluation of the functional $\Omega[{\bf \Sigma}]$ is possible on 