Extended Quantum Computing Patterns
Intent
Apply reversible Boolean logic to values encoded in quantum registers.
Context
An oracle, arithmetic routine, or another quantum component must evaluate a classical logical expression without measuring its inputs.
Forces
The operation must preserve reversibility. Additional ancillas may be needed for intermediate values, and those ancillas should be returned to their initial state.
Solution
Build reversible AND, OR, XOR, NOT, equality, or inner-product operations from controlled quantum gates and uncompute temporary results after use.
Result
The Boolean function is evaluated coherently and can be used within a larger quantum algorithm.
Examples
Toffoli-based AND, CNOT-based XOR, reversible comparators, and inner products modulo two.
Related Patterns
Oracle; Quantum Arithmetic; Uncompute
Known Uses
Logical and comparison components in the Qiskit circuit library and Classiq's reusable function library.