#### Flexoelectricity via coordinate transformations

Flexoelectricity describes the electric polarization that is linearly induced by a strain gradient, and is being intensely investigated as a tantalizing new route to converting mechanical stimulation into electrical signals and vice versa.Contrary to its close cousin, piezoelectricity (the polarization response to a uniform strain), flexoelectricity is a universalproperty of all insulators regardless of crystal symmetry, and therefore appears highly attractive as a cost-effective andenvironment-friendly (piezoelectrics are typically based on lead, a toxic element) alternative to the former. Strain gradientscan be easily generated by bending a sample or by applying pressure by means of a local probe, and naturally arise when certain topological defects, such as dislocations or ferroelastic domain walls, are present in the bulk material. Particularly at the nanoscale, it is becoming increasingly clear that understanding the fundamentals of strain-gradient effects is crucially important, either for avoiding their sometimes deleterious impact (e.g. in ferroelectric memories, or in foldable electronic devices), or for harnessing the exciting new functionalities that they provide.While several breakthough experiments have been reported in the past few years, progress on the theoretical front has been comparatively slow, especially in the context of first-principles electronic-structure theory. The main difficulty with calculating the flexoelectric response of a material is the inherent breakdown of translational periodicity that a strain gradient entails, which at first sight questions the very applicability of traditional plane-wave pseudopotential methods.Here I show how these obstacles can be overcome by combining density-functional perturbation theory with generalized coordinate transformations of space. In particular, by writing the equations of electrostatics in a fully covariant form, I derive the full microscopic response (in terms of electronic charge density, polarization and atomic displacements) of a crystal or nanostructure to an arbitrary deformation field. This methodological advance sets the stage for attacking an essentially endless variety of curvature-related phenomena with full ab initio power; here I address, in full generality, the surface contributions to the flexoelectric response of a finite sample. Inspiration for solving this important materials science problem has come from the apparently unrelated field of transformation