Start with the claim
A simulator that starts in |0⟩ answers a question about one input. An equivalence checker asks whether replacing one ideal unitary circuit with another preserves its effect on every input. An empty circuit and a Z gate both leave |0⟩ unchanged, for example. Feed in |+⟩ and the distinction appears as a relative sign.
One shared phase
The outputs for each computational basis input form the columns of the unitary matrix. Since the action is linear, matching all columns verifies the entire operation in the model. Quantum states have an arbitrary global phase, so the checker fits a single unit-magnitude factor and uses it across every column. Fitting a new phase for each column would incorrectly treat relative phase as invisible.
The workspace uses floating-point arithmetic and reports a tolerance and a mismatching matrix entry when the difference exceeds it. Adding measurements, noise or classical controls would change the model and the definition of equivalence.
Try a rewrite
Load the Equivalence example. Circuit A applies H, then Z, then H. Circuit B applies X. Check that they agree, then replace Z with S and compare again. The second comparison tests a genuinely different operation even if a single probability plot looks familiar.