AND gate (source code)

= AND gate
{c}
{wiki}

An <AND gate> computes $a\land b=ab$ for bits $a,b$. It is irreversible when only its one-bit output is retained. The <Toffoli gate> embeds the operation reversibly as $(a,b,c)\mapsto(a,b,c\oplus ab)$; setting $c=0$ preserves the inputs while recording their <logical conjunction>.