Backward Pauli updates for Hadamard and phase gates Created 2026-10-06 Updated 2026-11-05
For the binary phase representation of a Pauli string, these local rules implement for the Hadamard gate and the phase gate . In particular , so the phase update differs in sign from forward conjugation. Use the old input bits, and reduce modulo four.
For a qubit, computational basis dephasing with complex overlap maps to and preserves the diagonal entries. Conjugation by the phase gate maps the same entry to . Since these scalar factors commute, their quantum channels commute on every density matrix. More directly, an interaction and a diagonal phase gate give the same joint quantum state in either order on the specified initial environment state. This need not hold for an interaction that changes the quantum state populations.
For a qubit control and finite-dimensional target with unitary operator V, the controlled unitary gate is entangling if and only if V is not scalar. If , the controlled operation is a phase gate on the control tensored with the target identity and preserves every product state.
Otherwise the spectral theorem supplies two orthonormal eigenvectors with distinct eigenvalues . Set and use product input . The two conditional target vectors and are linearly independent because their eigenbasis coefficients would otherwise require . The conditional-vector product-state criterion shows that their coherent controlled superposition is entangled. Thus even a target gate arbitrarily close to scalar can be entangling, although the resulting entanglement need not be large.
Controlled unitary gate Created 2026-09-24 Updated 2026-11-05
A controlled unitary gate applies a unitary operator to a target system when a control qubit is , and leaves the target unchanged when the control is :
For a coherent control, linearity gives
The control has not been measured; the output may be entangled. The controlled-unitary entangling criterion states exactly when some product input becomes entangled.
The global phase of a controlled quantum gate matters: if , then acts as a phase gate on the control. A phase invisible on the isolated target is a relative phase between control branches. [ref]
Dyadic phase-gate identification Created 2026-10-14 Updated 2026-11-05
For the phase gate , apply powers to a uniform quantum superposition on qubits. Binary positional weights multiply the phases into on basis vector . The inverse quantum Fourier transform returns exactly, by orthogonality of roots of unity. Preparing the powers by repeated applications uses copies of ; this does not claim a number of gate calls polynomial in . If is odd, its powers generate the entire set of dyadic phase gates because has a modular inverse modulo .
Hadamard gate Created 2026-09-24 Updated 2026-10-20
The Hadamard gate is the unitary operator
where is the identity operator. It maps the computational basis to the Hadamard basis:
These outputs have equal computational-basis measurement probabilities, but their relative quantum phase differs. Applying another Hadamard gate sends them to different definite outputs. Calling this gate a classical coin toss would discard precisely the information that makes this possible. [ref].
Starting from , compare two quantum circuits, reading matrix products from right to left:
Here is the Pauli Z gate. After the first Hadamard gate, the probability amplitudes are . Inserting changes them to without changing their squared magnitudes. At the final gate, the contributions to output zero cancel and those to output one add. Without , cancellation occurs at output one instead. This is controlled interference, with the quantum phase determining which answer emerges.
The same calculation works for any phase gate :
For example, gives , while gives . The output-one amplitude at is : its two complex contributions add before the Born rule is applied. A phase gate alone leaves the populations unchanged; recombination converts its relative quantum phase into observable probabilities.
Figure 1.
Hadamard interference: a relative phase changes output probabilities through complex amplitude addition; the dotted circle traces the output-one amplitude as the phase varies
. Details.
If quantum decoherence completely removes the computational basis coherence between the gates, the intermediate density matrix becomes . Both the phase gate and final Hadamard gate leave unchanged, so for every . The disappearing fringe explains why preserving quantum coherence matters: it enables the gate sequence to carry phase information into the final measurement.
In a Hadamard gate, phase gate, Hadamard gate sequence starting from , let a population-preserving interaction correlate with a normalized environment state between the two Hadamard gates. Use and . The environment-valued output-zero coefficient is , whose squared norm is the displayed probability. The modulus controls contrast, while shifts the quantum interference fringe. For there is no mixing; a deterministic relative quantum phase accounts for the shift.
Imaginary-part Hadamard test Created 2026-09-24 Updated 2026-11-05
Adding a phase gate to the Hadamard test rotates the interference signal and measures the imaginary part of .
For the printed equatorial-basis convention,
It is the Hadamard gate after a phase gate. The identities and follow by multiplying their matrices. For these are Clifford gates. In particular , permitting a sign change of the measurement angle to be absorbed into a Pauli frame.
The J gate is , where : the phase gate acts first and the Hadamard gate acts second. Unitary invariance of the operator norm reduces its angle error to the single nonzero diagonal difference of the phase gate. Its norm is . The quantum circuit gate-error telescoping bound then makes an angle tolerance of sufficient for such imperfect gates and exact other gates.
Use CNOT gates to encode one logical qubit and zero ancillas into the repetition subspace spanned by . Apply the phase gate in parallel to all physical qubits, then undo the encoding. The logical phase is multiplied by in one oracle-time layer. This copies computational-basis labels coherently rather than cloning an arbitrary quantum state. Blocks of sizes prepare a dyadic Fourier phase state using parallel oracle applications.
The first Hadamard gate maps the prepared superposition to . The phase gate leaves that state unchanged, and the last Hadamard gate returns it to . Therefore
This is a fully polarized pure state, not an unpolarized ensemble. Its Bloch vector lies along the rotation axis of the combined operation. There is no Ramsey interferometry fringe as varies, because the state during phase accumulation occupies only one basis level. Quantum coherence in the final state alone does not guarantee phase sensitivity to the specified sequence.
Fix the qubit polarization convention by , where the Pauli matrices are ordered in the basis and . Thus the ground state is the north pole of the Bloch sphere. In a rotating frame and within the rotating-wave approximation, choose the drive phase and detuning sign so that
For example, with this ground-state convention one may take and choose the transverse coupling positive. The Bloch vector precesses around the effective field at angular frequency , tracing a circle at fixed projection on that axis. Its length is conserved under coherent unitary time evolution. On resonance the axis is transverse and the Rabi oscillation can fully invert an initially ground-state atom. Away from resonance the axis tilts, and
There is no relaxation towards an equilibrium Bloch vector in this ideal model. An inhomogeneous ensemble can nevertheless lose its averaged qubit polarization through dephasing even without spontaneous emission; the circle description assumes a common drive and detuning.
For , the stated quantum state gives
The diagonal elements are the two state populations. The off-diagonal elements are quantum coherences: they retain the relative quantum phase and determine interference under a subsequent pulse. This is a pure state, even if both populations are nonzero: , , and . A mixed state averages projectors over preparation probabilities and generally has . Equal populations alone do not distinguish an equal coherent superposition from an unpolarized mixture.
For use in all three cases, multiplication of the gates gives the Hadamard-phase-Hadamard qubit rotation
The global phase cancels in . Thus the Bloch vector map is
The final unlabelled Ramsey spectroscopy comparison applies to the three cases as follows. In an atomic clock, an initial coherent pulse prepares a superposition, a free interval accumulates a relative quantum phase proportional to detuning times , and a final coherent pulse converts that phase to a population. Here plays the role of that accumulated phase, with sign and fringe offset set by pulse conventions. In (a), the first Hadamard gate creates the needed superposition and the final gate reveals full-contrast Ramsey interferometry. In (b), the first Hadamard gate instead puts the state in , so the intervening phase gate has no relative quantum phase to imprint: the output is independent of . In (c), the unpolarized density matrix remains unchanged under every gate, so the ensemble has no Ramsey interferometry contrast. A coherent unitary gate alone cannot initialize a maximally mixed ensemble into a pure clock state.
The Ramsey interferometry analogy concerns preparation, phase accumulation, and readout; a Hadamard gate is not literally a transverse rotation on every input. In this basis , and its Bloch sphere action is a rotation about , up to a global phase. The phase conventions of physical Ramsey spectroscopy pulses must be specified to compare their outputs for arbitrary initial states.
By the spectral theorem, the nonscalar unitary V has orthonormal eigenvectors with distinct eigenvalues . Choose . Then is not proportional to .
On the product input , the controlled unitary gate produces
Its two conditional target vectors are linearly independent, so the conditional-vector product-state criterion proves that the output is entangled. Equivalently, in the control computational basis and target eigenbasis its coefficient matrix is , whose determinant is . Thus U is an entangling gate. The excluded scalar case would only apply a phase gate to the control and could not entangle the factors; this is the controlled-unitary entangling criterion.
No: is not an entangling gate. Its factorization gives, for every product input,
which remains a product state. More generally, a convex mixture of product density matrices remains separable under these local unitary operators. Thus being distinguishable from does not require creating entanglement. The first qubit undergoes a genuine local phase gate, while the target undergoes the same in both branches.
Use the conventional phase gate in computational basis order . The single-qubit Hadamard gate and the successive quantum states are
The final Hadamard gate recombines the two components, giving
The leading factor in the last expression is a global phase. The Born rule therefore yields
At the output is certainly zero, whereas at it is certainly one. The phase gate changes no intermediate outcome probabilities; the final Hadamard gate converts a relative quantum phase into an observable quantum interference fringe.
Write . The Cauchy-Schwarz inequality gives because the two environment states are normalized. Immediately after the interaction, the joint quantum state is
Applying the last Hadamard gate gives
Since the environment is unobserved, the Born rule uses the squared norm of the environment-valued coefficient of :
Thus the Hadamard interference with environment overlap formula is
The plus sign follows from the explicitly chosen phase gate and the order of the inner product. Equivalently, before the last Hadamard gate the partial trace over the environment gives
The complex environment overlap in qubit dephasing both reduces the quantum coherence by and adds a relative quantum phase . Orthogonal environment states have and give for every . If , the quantum interference fringe has full contrast and is only shifted; the qubit has not become mixed. For , is immaterial.
Moving the interaction to between the first Hadamard gate and the phase gate gives
the identical joint quantum state. Therefore the expression is unchanged. This is the commutation of computational-basis dephasing and phase gates; it uses the specified population-preserving interaction with the same environment states, rather than an arbitrary model of quantum decoherence.
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.
Define the Hadamard basis and write . After the two-qubit quantum state is
Applying the Hadamard gate to the first qubit gives the normalized quantum state
For , , so
The first is a product state. The second is exactly the minus Bell state in the printed phase gate convention; its reduced density matrices are .
For three qubits, let use the ordered pair and the ordered pair . The two diagonal quantum gates commute. For their action before the final Hadamard gates is
If is even this is , and gives . If is odd, group the quantum superposition by the middle qubit:
Since and , the final states are
The odd case is a GHZ state: each individual qubit has reduced density matrix , and it is related to by the local Pauli gates . Conversely, applying those gates converts to that standard form. They have not been applied in the printed network, so the actual output used in the next part is .
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.