Two different algorithms are presented for generating a quantum circuit realization of a matrix representing a permutation on $2^n$ letters. All circuits involve $n$ qubits and only use multi--controlled Toffoli gates. The first algorithm constructs a circuit from any decomposition of the permutation into a product of transpositions, but uses one ancilla line. The second, which uses no ancillae, constructs a circuit from a decomposition into a product of transpositions that have a Hamming distance of one. We show that any permutation admits such a decomposition, and we give a strategy for reducing the number of transpositions involved.
翻译:本文提出了两种不同的算法,用于生成表示在$2^n$个字母上置换的矩阵的量子电路实现。所有电路均涉及$n$个量子比特,且仅使用多控制Toffoli门。第一种算法基于将置换分解为对换的乘积来构建电路,但需要使用一条辅助线。第二种算法无需辅助量子比特,通过将置换分解为汉明距离为一的对换乘积来构建电路。我们证明了任何置换均存在此类分解,并给出了一种减少所涉及对换数量的策略。