The product of the data Pauli Z gates has computational-basis eigenvalue
Use the parity circuit from part (ii), apply the target unitary gate , and then uncompute the parity with . For every basis input,
This equals on the data, with the ancilla qubit returned to zero. The compute-phase-uncompute construction therefore gives an exact linear-size circuit:
This is a Pauli-string phase by parity computation, an instance of simulation of a computable diagonal Hamiltonian. Part (i) also explains it by , whose exponential restricts correctly to the target- subspace. If no extra line is desired, accumulate parity into the last data qubit, apply there, and undo the CNOT gates, for gates. Both constructions implement the global phase as well as the relative phases exactly.
Since , the spectral decomposition gives
Replace the middle gate of the previous compute-phase-uncompute construction by
a one-qubit rotation about the z-axis. Then
The circuit uses the gates of , their inverses, and one fixed rotation; it returns the quantum ancilla to . The same construction implements with middle gate , an instance of simulation of a computable diagonal Hamiltonian.
Rotation about the z-axis Created 2026-10-05 Updated 2026-10-14
The one-qubit rotation gate is . It implements the two relative phases needed in simulation of a computable diagonal Hamiltonian.