2026-07-072026-07-07http://salesiana.dossiersoluciones.com/handle/123456789/229117We propose a quantum algorithm for the purification of a generic mixed state $ρ$ of a $n$-qudit system by using an ancillary $n$-qudit system. The algorithm is optimal in that (i) the number of ancillary qudits cannot be reduced, (ii) the number of parameters which determine the purification state $|Ψ>$ exactly equals the number of degrees of freedom of $ρ$, and (iii) $|Ψ>$ is easily determined from the density matrix $ρ$. Moreover, we introduce a quantum circuit in which the quantum gates are unitary transformations acting on a $2n$-qudit system. These transformations are determined by parameters that can be tuned to generate, once the ancillary qudits are disregarded, any given mixed $n$-qudit state.8 pages, 9 figures, remarks addedQuantum PhysicsOptimal purification of a generic n-qudit statetext