Gauge-invariant quantum circuits for U(1) and Yang-Mills lattice gauge theories | Synapse