Organic nonvolatile memory transistors with self-doped polymer energy well structures