  All-optical logic gates have been studied intensively for their potential to
enable broadband, low-loss, and high-speed communication. However, poor
tunability has remained a key challenge in this field. In this paper, we
propose a Y-shaped structure composed of Yttrium Iron Garnet (YIG) layers that
can serve as tunable all-optical logic gates, including, but not limited to,
OR, AND, and NOT gates, by applying external magnetic fields to magnetize the
YIG layers. Our findings demonstrate that these logic gates are based on
topologically protected one-way edge modes, ensuring exceptional robustness
against imperfections and nonlocal effects while maintaining extremely high
precision. Furthermore, the operating band of the logic gates is shown to be
tunable. In addition, we introduce a straightforward and practical method for
controlling and switching the logic gates between "work", "skip", and "stop"
modes. These findings have important implications for the design of
high-performance and precise all-optical integrated circuits.
