The equality function returns 1 exactly when two binary inputs are equal. It is the negation of XOR: x₀ EQUAL x₁ = NOT(x₀ XOR x₁). section 6.4.1
Implement the reversible, out-of-place form on three qubits:
- Preserve inputs x₀ and x₁ while using y for the output. section 6.4.1
- Apply CNOT(x₀, y), then CNOT(x₁, y), producing y ⊕ x₀ ⊕ x₁. section 6.4.1
- Apply an in-place NOT to y, converting the XOR result into equality. section 6.4.1
- Validate reversible implementations by comparing their basis-state effects with the classical truth table. section 6.4.1
