Quantum-chemical insight into the design of molecular optoelectrical switch