Balanced Boolean function 2026-10-25
A Boolean function on a finite nonempty domain is balanced when it is zero on exactly half the inputs and one on the other half. For a one-bit domain, the balanced functions are and , while the remaining two functions are constant functions. The Deutsch algorithm distinguishes these two classes with one Boolean quantum oracle query in the absence of noise.
Deutsch algorithm Created 2026-10-14 Updated 2026-11-05
The one-input Deutsch algorithm determines whether a Boolean function is constant or balanced using one Boolean quantum oracle call. Initialize the input qubit in and the answer qubit in . Quantum phase kickback changes the input to . A Hadamard gate and computational-basis measurement therefore return the parity with certainty.
Deutsch algorithm with pure dephasing Created 2026-10-14 Updated 2026-11-05
If the input qubit of the Deutsch algorithm acquires conditional environment states with overlap between its two Hadamard gates, its fixed zero-for-constant, one-for-balanced rule succeeds with probability . A known phase can be compensated before the last Hadamard gate, raising the success probability to . An orthogonal pair of environment states gives and destroys all information in the input qubit about the answer; unit overlap modulus preserves coherence up to a known phase.
One-query obstruction to exact Boolean truth-table identification Created 2026-10-24 Updated 2026-11-05
For a one-bit-input Boolean oracle, decompose a query input into target eigenstates. The unchanged target- sector has weight , while the target- sectors at inputs have weights . Distinguishing functions differing only at one entry requires , leaving . Then functions differing at both entries have output overlap , so are the same physical ray. Thus one quantum query cannot identify all four truth tables with certainty, although the Deutsch algorithm finds their constant/balanced classification in one query.
Normalize the second qubit as . Since a Pauli X gate changes to , the Boolean quantum oracle acts as
This quantum phase kickback leaves the second qubit uncorrelated with the first. Put : for a constant function and for a balanced Boolean function. Apart from the irrelevant global phase , the first qubit and environment reach
The population-preserving interaction commutes with the quantum oracle on this answer-register input, so its placement before or after the oracle, between the two Hadamard gates, gives the same result. Substitute into b:
The printed Deutsch algorithm uses the rule zero means constant function; one means balanced Boolean function. With that rule, the Deutsch algorithm with pure dephasing succeeds for either class with
For real nonnegative environment overlap this is , ranging from certainty at to random guessing at . For general complex overlap, a coherent shift can invert the printed answer: for example makes the printed rule always wrong. If the overlap is known but the printed quantum measurement is retained, choose the better labeling of its outcomes; this gives
There is a further improvement if a known can be compensated by the phase gate before the final Hadamard gate. It removes the coherent shift without reversing any actual quantum decoherence, and yields
This is optimal when only the first qubit is accessible, with equal prior probabilities for the two classes. Before the final Hadamard gate, their reduced density matrices are
The difference has eigenvalues , giving trace distance . The Holevo–Helstrom theorem therefore bounds the success probability by , exactly attained by the compensated procedure. A known phase shift and loss of coherence have different effects: at the two density matrices coincide and no measurement on the available qubit can reveal the answer.
Use a classical target bit and initialized auxiliary bits. The NOT gate maps , the CNOT gate maps , and the Toffoli gate maps . They are bijections and are their own inverses. Explicit circuits with their retained input wires are:
  • AND: a Toffoli gate on produces .
  • OR: apply NOT to both controls, a Toffoli gate with target initialized to , then restore both controls. The target becomes .
  • CLONE: a CNOT gate on gives .
  • SWAP: apply , and . The successive pairs are , , then .
These maps also give the truth tables for all input combinations. AND and OR are not themselves reversible maps if the inputs are discarded; the retained inputs are what make their implementations reversible. Classical CLONE copies a known orthogonal computational basis alphabet; the no-cloning theorem forbids interpreting it as a copier of arbitrary quantum superpositions.
A Boolean circuit can express any finite Boolean function using AND, OR and NOT. Replace its operations by the reversible versions, keeping inputs and intermediate bits. Copy the final output into a fresh answer register with CNOT gates, then run the entire computing network backward. Intermediate auxiliary bits return to zero, yielding
This compute-copy-uncompute construction proves universality in the usual model with initialized auxiliary bits. If is a reversible permutation, compute , use a reversible implementation of to clear , and swap registers, leaving with clean auxiliaries. The ancillary-resource qualification matters; a blanket claim about all permutations on an arbitrary fixed number of unassisted wires has parity restrictions.
Figure 1.
Reversible Boolean constructions and a one-query Deutsch algorithm
. Original circuits for AND, OR, copying a classical bit and SWAP, with retained inputs and initialized targets shown explicitly. The lower panels show two classical oracle queries for the truth table and the phase-kickback quantum network that obtains only its parity in one query. Circuit operations run from left to right. Details.
Take the Hadamard gate to be and the phase gate to be . This fixes the sign convention for the interference phase.
For the coherent quantum circuit, the successive quantum states are
The Born rule therefore gives the concise answer
With the stated quantum decoherence after the phase gate, the joint pure state before the last Hadamard gate is
After that Hadamard gate, its environment coefficient at output zero is . Squaring its norm sums over every unobserved environment outcome, so
The Cauchy-Schwarz inequality gives . In this single-qubit interference with conditional environment states, is the interference visibility: orthogonal environment states erase the fringe, while a unit-modulus overlap shifts its phase without reducing visibility. The plus sign in follows from the specified overlap , rather than its complex conjugate.
If the same quantum decoherence occurs before the phase gate, the joint pure state is first . The phase gate then produces exactly the same state used above. Equivalently, the controlled environment interaction commutes with the diagonal phase gate. The probability is unchanged.
For the Deutsch algorithm, use the reversible Boolean quantum oracle
The algebraic oracle map printed in the source has its arguments misplaced: taken literally, it sends two distinct answer inputs to the same output for constant , so it cannot be a unitary operator. The corrected map above agrees with the diagram's input-control, answer-target arrangement. Put the answer qubit in . Since the Pauli X gate satisfies , quantum phase kickback gives
Write . Up to the irrelevant global phase , the input qubit acquires relative phase , so its ideal final computational-basis measurement returns : zero for a constant function and one for a balanced function.
Let the specified quantum decoherence occur in the interference portion between the two Hadamard gates. It commutes with the oracle's effective diagonal phase on the input, so the same analysis applies whether it occurs just before or just after the query. The two likelihoods are
Thus the diagram's usual zero-for-constant decision rule has
This is the reliability for either promised class separately, with no prior needed. For equally likely classes, if is known to be negative, reversing the interpretation gives . A known environment phase can instead be compensated by the phase gate before the final Hadamard gate, giving success probability . In particular, gives no information and permits certainty after phase compensation. These refinements distinguish a shifted fringe from lost quantum coherence; with the unmodified diagram a phase shift alone can reverse the apparent answer. Quantum decoherence after the final Hadamard gate leaves its computational populations unchanged, so that different placement would not spoil the measured answer.