A solar transistor and photoferroelectric memory