  Within the framework of density functional perturbation theory (DFPT), we
implement and test a novel "metric wave" response-function approach. It
consists in the reformulation of an acoustic phonon perturbation in the
curvilinear frame that is comoving with the atoms. This means that all the
perturbation effects are encoded in the first-order variation of the real-space
metric, while the atomic positions remain fixed. This approach can be regarded
as the generalization of the uniform strain perturbation of Hamann et al. [D.
R. Hamann, X. Wu, K. M. Rabe, and D. Vanderbilt, Phys. Rev. B 71, 035117
(2005)] to the case of inhomogeneous deformations, and greatly facilitates the
calculation of advanced electromechanical couplings such as the flexoelectric
tensor. We demonstrate the accuracy of our approach with extensive tests on
model systems and on bulk crystals of Si and SrTiO$_3$.
