Abstract
Starting from the knowledge of first-order changes of wave functions and density with respect to small atomic displacements or infinitesimal homogeneous electric fields within the density-functional theory, we write the expressions for the diagonal or mixed second-order derivatives of the total energy with respect to these perturbations: dynamical matrices for different wave vectors, Born effective-charge tensors and electronic dielectric permittivity tensors. Interatomic force constants and the phonon-band structure are then obtained by computing the Fourier transform of dynamical matrices on a regular mesh of wave vectors, with an eventual, separate treatment of the long-range dipole-dipole interaction. The same ingredients also allow one to compute the low-frequency response of the crystal to homogeneous electric fields.