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.