  In recent years, methods have been developed that allow first-principles
electronic-structure calculations to be carried out under conditions of fixed
electric field. For some purposes, however, it is more convenient to work at
fixed electric displacement field. Initial implementations of the
fixed-displacement-field approach have been limited to constraining the field
along one spatial dimension only. Here, we generalize this approach to treat
the full three-dimensional displacement field as a constraint, and compute the
internal-energy landscape as a function of this multidimensional
displacement-field vector. Using PbTiO3 as a prototypical system, we identify
stable or metastable tetragonal, orthorhombic and rhombohedral structures as
the displacement field evolves along [001], [110] and [111] directions,
respectively. The energy minimum along [001] is found to be deeper than that
along [110] or [111], as expected for a system having a tetragonal ground
state. The barriers connecting these minima are found to be quite small,
consistent with the current understanding that the large piezoelectric effects
in PbTiO3 arise from the easy rotation of the polarization vector.
