  We develop a general and unified first-principles theory of piezoelectric and
flexoelectric tensor, formulated in such a way that the tensor elements can be
computed directly in the context of density-functional calculations, including
electronic and lattice contributions. We introduce a practical supercell-based
methods for calculating the flexoelectric coefficients from first principles,
and demonstrate them by computing the coefficients for a variety of cubic
insulating materials, including C, Si, MgO, NaCl, CsCl, BaZrO3, BaTiO3, PbTiO3
and SrTiO3.
