Bistable organic, organometallic, and coordination compounds for molecular electronics and spintronics