Abstract
Materials that compute-or process stimuli to generate a result output-are important in applications ranging from soft robotics to therapeutics. Here, we report a NAND gate based on the interactions of three self-trapped beams in a photoresponsive hydrogel. The beams self-trap by triggering localised contraction and corresponding refractive index changes (Δn) and communicate with each other through the interconnected hydrogel network. Light-induced Δn in one region suppresses contraction (and Δn) elsewhere. This inhibits self-trapping and reduces the power of the central beam-which competes with two equidistant neighbours-compared to either peripheral beam, which competes with just one neighbour. The NAND gate exploits this geometry-dependent inhibition: the central beam's peak power-the output-exceeds a threshold value unless both neighbours-inputs-are on, i.e., an output = 0 is retrieved only with input [1, 1]. We then demonstrate two and, separately, twelve sequentially chained NAND operations, and propose a route to multiple, simultaneously linked operations in a single, internally mediated step. Here, the output from one operation is spontaneously directed to subsequent operations. Our findings open pathways to soft materials with autonomous computational functionality.