We prove that (1-o(1))-fidelity N-qubit Greenberger–Horne–Zeilinger (GHZ) encoding can be performed in time O(\log N/N) using all-to-all 2-local Hamiltonians with bounded 2-qubit interaction terms. This saturates the theoretical lower bound $\
We prove that (1-o(1))-fidelity N-qubit Greenberger–Horne–Zeilinger (GHZ) encoding can be performed in time O(\log N/N) using all-to-all 2-local Hamiltonians with bounded 2-qubit interaction terms. This saturates the theoretical lower bound \Omega(\log N/N), and by rescaling, also saturates the lower bound on signaling time for Hamiltonians with power-law interaction strengths 1/r^\gamma, \gamma<d in dimension d. The protocol uses spin-squeezing dynamics combined with quantum signal processing.