Optically Gated Transistor