Unique device operations by combining optical-memory effect and electrical-gate modulation in a photochromism-based dual-gate transistor.