We present an implementation of variational perturbation theory in the fram
ework of density functional theory. We use an ab initio pseudopotential sch
eme with a plane wave basis set and expand the energy functional up to seco
nd order in the perturbation. The approach is fairly general and does not r
ely on the representativeness of the perturbation through a Hamiltonian ope
rator and does not require the use of canonical orbitals. Instead, a functi
onal formulation is used to characterize the perturbation. Several types of
applications are presented which illustrate the variety of linear response
phenomena that can be treated with our method (vibrational modes, Raman sc
attering, and nuclear magnetic resonance chemical shift computations). In c
ombination with advanced gradient correction formulas, an accurate descript
ion of second order effects in periodic and isolated systems can be achieve
d. (C) 2000 American Institute of Physics. [S0021-9606(00)30641-9].