All the electrical measurements were carried out on a micromanipulator probe station equipped with a heating stage. Ferroelectric properties were measured using a commercial ferroelectric tester (Precision LC, Radiant Technologies). Dielectric data were collected using a commercial impedance LCR meter (E4980A, Agilent). Photovoltaic responses were characterized by a picoampere meter/dc voltage source (4140B, Hewlett Packard) under ≈100 mW/cm2 white light illumination from a halogen lamp (see fig. S7 for detailed spectrum). The irradiation intensity was carefully calibrated using a standard reference cell (91150V, Newport). To ensure the reproducibility of the results, at least 10 devices from two to three different batches of samples were tested for each doping concentration.