All-optically controlled terahertz memristor for multidimensional neuromorphic computing | Synapse