In a quantum circuit, a gate transforms a probability distribution over states — call it p₀ (before) into p₁ (after). The underlying transition rule is a doubly-stochastic matrixΓ, where each entry Γᵢⱼ is the probability of transitioning from state j to state i.
The problem: given only the two static distributions p₀ and p₁, recover a valid Γ such that Γ · p₀ = p₁. This is underdetermined — many matrices satisfy it — so the algorithm starts from the natural initial guess Γᵢⱼ = |Uᵢⱼ|², the squared magnitudes of the unitary matrix entries, which is itself doubly-stochastic by unitarity.
Each iteration applies a rank-1 correction in the direction of the residual error, then clamps and renormalizes to keep Γ stochastic. The chart shows the error norm |p₁ − Γ·p₀| falling toward zero — demonstrating that repeated application of this correction converges to a valid transition matrix, and can therefore be used to progressively improve any initial approximation.
Γ doubly-stochastic · cols and rows sum to 1 · entries ∈ [0,1]
update: Γ ← clamp(Γ) + (p₁ − Γ·p₀) · p₀ᵀ / ‖p₀‖²