Theory of PbTiO3, BaTiO3, and SrTiO3 surfaces