# How to implement a gate that generate a uniform superposition of all permutation of element

I'm looking for a quantum circuit that permits generating a uniform superposition of all possible permutations for example if we have as input $$|0123\rangle$$ the output will be the uniform superposition of all possible permutation $$1/a(|0123\rangle+|1023\rangle+|0213\rangle+.....+|3210\rangle)$$. I have already implemented a circuit with SWAP gates but the problem is I'm not getting the uniform superposition.

• seems related to quantumcomputing.stackexchange.com/q/11682/55
– glS
Apr 27 at 9:15
• It would be helpful if you include the circuit you implemented and the result you get from it. Apr 27 at 9:48