  We explore the interplay between ferroelectricity and metallicity, which are
generally considered to be contra-indicated properties, in the prototypical
ferroelectric barium titanate, BaTiO$_3$. Using first-principles density
functional theory, we calculate the effects of electron and hole doping, first
by introducing a hypothetical background charge, and second through the
introduction of explicit impurities (La, Nb and V for electron doping, and K,
Al and Sc for hole doping). We find that, apart from a surprising increase in
polarization at small hole concentrations, both charge-carrier types decrease
the tendency towards ferroelectricity, with the strength of the polarization
suppression, which is different for electrons and holes, determined by the
detailed structure of the conduction and valence bands. Doping with impurity
atoms increases the complexity and allows us to identify three factors that
influence the ferroelectricity: structural effects arising largely from the
size of the impurity ion, electronic effects from the introduction of charge
carriers, and changes in unit-cell volume and shape. A competing balance
between these contributions can result in an increase or decrease in
ferroelectricity with doping.
