为了将可逆函数以较小的代价自动构造为对应的可逆逻辑电路,提出了一种基于对换门库的综合算法.首先,将可逆函数的输出作为快速排序算法的输入数据,在排序算法中按顺序保留所交换的元素对,并输出该元素对序列;其次,利用置换群规则对该序列进行优化处理,获得相似度最高的对换序列;然后,逆序排列该对换序列,并基于对换门库生成可逆函数的初始电路;最后,应用电路门优化规则,对初始电路进行优化,得到最终的可逆逻辑电路.相比于其他算法,所提算法明显提高了可逆逻辑综合效率,其思想的简洁性使得算法更易于理解和实现.
To automatically construct desired quantum reversible logic circuit with minor quantum cost, an synthesis algorithm based on the transposition gate library (TGL) is presented. First, the output of the reversible function is taken as the input of the quick sort algorithm (QSA). The order of elements pairs which are swapped in the QSA are retained in order, and the sequence of elements pairs is as the output. Secondly, the sequence is optimized according to the permutation group rules to get a new one in which the similarity is highest among pairs. Thirdly, the new sequence is re- versed and the initial circuit is generated based on the TGL. Finally, according to the gate optimiza- tion rules, the initial circuit is optimized to get the final reversible logic circuit. Compared with other algorithms, the proposed one has higher efficiency of synthesis of quantum reversible logic circuits. Due to its concise idea, it is easy to understand and realize.