-
可逆逻辑综合[1-2]是可逆计算研究的关键问题之一,也是量子计算和量子信息技术的重要组成部分。最初可逆计算的提出是为了解决计算机中的能量消耗问题,文献[3]指出在传统计算过程中,由于擦除信息的不可逆造成了能耗的产生。文献[4]证明了对所有不可逆图灵机都有一个可逆图灵机,即计算机中的每步操作均可变为可逆操作,且可逆逻辑计算可避免传统计算过程中的能量消耗。
所有的量子计算都是可逆计算,量子计算的算法可以通过量子可逆线路表示。可逆逻辑线路分解与优化是量子线路设计过程中至关重要的步骤,选取合适的分解与优化方法能够有利于将高级量子线路分解为低级量子线路,以进一步转换为已有不同量子计算机可执行量子线路。因此,可逆逻辑线路的分解与优化研究是量子计算技术的重要内容。
现有的可逆电路化简方法有基于规则的方法[5-7]与基于模板[8-9]的方法。文献[6]提出Toffoli电路的约简规则,根据移动规则对可逆电路进行扫描,寻找满足约简规则的进行优化,直到电路不发生变化为止。文献[9]提出了可逆电路优化模板,通过模板等价替换某部分逻辑门,达到减少逻辑门的目的。但现有研究多针对量子线路进行设计优化[1, 2, 8-15],没有把高级量子可逆线路转换为接近物理量子计算机执行的低级量子线路,且时间代价较高,如何把高级量子线路如MCT门(Multiple Control Target)更高效地分解并优化为低级量子线路如NCV门的研究较少。
本文提出了一种MCT门分解为NCV门的模板,与现有分解方法相比,能降低量子代价和分解时间,提高分解效率。
-
为了验证所提优化模板的有效性,使用C++语言实现了本文描述的算法,实验环境为Intel(R) Core(TM) i5-7200U CPU@2.5 GHz、8 GB内存及Windows10操作系统。分别用本文算法和已有算法对m∈{3,10}的MCT门进行测试,结果如表1所示。
为测试在实际应用中的效果,分别用本文算法和已有算法对Benchmark部分例题进行实验,结果如表2所示。可以看出,本算法的量子代价与文献[18]方法优化后的量子代价基本一致,但运行时间有较大改善。结果表明,本算法对于控制位越多的MCT门,分解时量子代价、执行时间的优化效果越好,整体优化效果越明显。
表 1 MCT门分解效果
Benchmark 量子代价 执行时间/s 分解后未化简 先分解,再优化[18] 本文算法 分解后未化简 先分解,再优化[18] 本文算法 3_17_13 14 14 14 - 0.002 0.002 4gt10-va_81 48 36 36 - 0.012 0.005 4gt11_84 7 7 7 - 0.003 0.001 4gt4-v0_80 58 44 44 - 0.025 0.006 4gt5_75 28 22 22 - 0.008 0.003 ham15_108 642 458 458 - 1.76 0.079 Ham7_104 111 87 87 - 0.061 0.010 Hwb4_52 23 23 23 - 0.007 0.002 Hwb6_58 170 144 146 - 0.142 0.021 Mod5adder_128 111 87 87 - 0.105 0.012 表 2 Benchmark分解效果
A Method for Decomposing and Optimizing MCT Gate Quantum Reversible Circuits
-
摘要: 为提高可逆线路中MCT门的分解和优化效率,提出了一种MCT门的优化分解方法,根据该方法得出MCT分解模板并验证了正确性。基于该模板给出了相应的分解与优化算法,算法对MCT门分解出的Toffoli线路进行分类,使用优化分解模板将其分解为NCV线路。该算法的时间复杂度为O(m),优于传统算法的复杂度O(m2)。通过对控制位m∈{3,10}的MCT门与Benchmark可逆线路的实验,验证了该算法优化和分解的有效性。Abstract: One of the key problems in reversible logic synthesis is optimizing the reversible circuits, and the focus of research is on how to decompose advanced reversible gates into basic reversible gates more efficiently. To improve the decomposition and optimization efficiency of Multiple Control Target (MCT) gates, an optimal decomposition method of MCT gates is proposed in the paper, along with an MCT decomposition template which correctness is verified. Based on this template, the corresponding decomposition and optimization algorithm is given. Using the optimal decomposition template, the algorithm classifies the Toffoli circuits decomposed by MCT gates and decomposes them into NCV circuits. The time complexity of the algorithm is O(m), which is better than O(m2) for the conventional algorithm. Experiments on MCT gates with benchmark reversible circuits for control bits m∈{3,10} show the effectiveness of the algorithm’s optimization and decomposition.
-
Key words:
- circuit optimization /
- MCT gate /
- NCV gate /
- quantum circuit /
- reversible logic synthesis
-
表 1 MCT门分解效果
Benchmark 量子代价 执行时间/s 分解后未化简 先分解,再优化[18] 本文算法 分解后未化简 先分解,再优化[18] 本文算法 3_17_13 14 14 14 - 0.002 0.002 4gt10-va_81 48 36 36 - 0.012 0.005 4gt11_84 7 7 7 - 0.003 0.001 4gt4-v0_80 58 44 44 - 0.025 0.006 4gt5_75 28 22 22 - 0.008 0.003 ham15_108 642 458 458 - 1.76 0.079 Ham7_104 111 87 87 - 0.061 0.010 Hwb4_52 23 23 23 - 0.007 0.002 Hwb6_58 170 144 146 - 0.142 0.021 Mod5adder_128 111 87 87 - 0.105 0.012 表 2 Benchmark分解效果
-
[1] 陈汉武, 李文骞, 阮越, 等. 基于汉明距离递减变换的可逆逻辑综合算法[J]. 计算机学报, 2014, 37(8): 1840-1845. CHEN H W, LI W Q, RUAN Y, et al. A synthesis algorithm of reversible logic circuit based on the decreasing transform of Hamming distance[J]. Chinese Journal of Computers, 2014, 37(8): 1840-1845. [2] GAOFENG L, SHEXIANG J, LIANG Z. Quantum image filtering and its reversible logic circuit design[J]. International Journal of Embedded Systems, 2021, 14(3): 248-258. doi: 10.1504/IJES.2021.116111 [3] LANDAUER R. Irreversibility and heat generation in the computing process (reprinted from IBM research and development, vol 5, 1961)[J]. IBM Journal of Research and Development, 2000, 44(1/2): 261-269. [4] BENNET M A, SELVI TM, PRIYA S M, et al. Efficient approaches for designing the logical reversibility of computation[J]. International Journal on Smart Sensing and Intelligent Systems, 2017, 10(4): 46-61. [5] ARABZADEH M, SAEEDI M, ZAMANI M S. Rule-Based optimization of reversible circuits[C]//2010 15th Asia and South Pacific Design Automation Conference (ASP-DAC 2010). New York: IEEE, 2010: 853-858. [6] 程学云, 谈莹莹, 管致锦, 等. 优化的可逆MCT电路化简算法[J]. 量子电子学报, 2017, 34(6): 713-720. CHENG X Y, TAN Y Y, GUAN Z J, et al. An optimized siplification algorithm for reversible MCT circuits[J]. Chinese Journal of Quantum Electroincs, 2017, 34(6): 713-720. [7] 王艺臻, 管致锦, 管海宇. 基于预评价的量子电路线性最近邻综合算法[J]. 量子电子学报, 2021, 38(1): 75-85. WANG Y Z, GUAN Z J, GUAN H Y. Linear nearest neighbor synthesis algorithm of quantum circuits based on pre-evaluation[J]. Chinese Journal of Quantum Electronics, 2021, 38(1): 75-85. [8] GOLUBITSKY O, MASLOV D. A study of optimal 4-bit reversible Toffoli circuits and their synthesis[J]. IEEE Transactions on Computers, 2012, 61(9): 1341-1353. doi: 10.1109/TC.2011.144 [9] MASLOV D, DUECK G W, MILLER D M. Techniques for the synthesis of reversible Toffoli networks[J]. ACM Transactions on Design Automation of Electronic Systems (TODAES), 2007, 12(4): 42-62. doi: 10.1145/1278349.1278355 [10] PHILIPP N, de ALEXANDRE A A A, GERHARD D, et al. Template-Based mapping of reversible circuits to IBM quantum computers[J]. Microprocessors and Microsystems, 2022, 90: 104487. doi: 10.1016/j.micpro.2022.104487 [11] ESLAMY M, HOUSHMAND M, SEDIGHI M, et al. Optimization of one-way quantum computation measurement patterns[J]. International Journal of Theoretical Physics, 2018, 57(11): 3296-3317. doi: 10.1007/s10773-018-3844-x [12] SLIMANI A, BENSLAMA A, MISRA N K. Optimal designs of reversible/quantum decoder circuit using new quantum gates[J]. International Journal of Theoretical Physics, 2022, 61: 72-91. doi: 10.1007/s10773-022-05017-w [13] ADISA I A, WONG T G. Implementing quantum gates using length-3 dynamic quantum walks[J]. Physical Review Research, 2021, 104(4): 042604. doi: 10.1103/PhysRevA.104.042604 [14] EZAWA M. Universal quantum gates, artificial neurons, and pattern recognition simulated by LC resonators[J]. Physical Review Research, 2021, 3(2): 023051. doi: 10.1103/PhysRevResearch.3.023051 [15] ALI M B, RAHMAN M M, RAHMAN H A. Design and optimization of nanometric reversible 4 bit numerical comparator[C]//2012 International Conference on Informatics, Electronics & Vision (ICIEV). New York: IEEE, 2012: 577-581. [16] BARENCO A, BENNETT CH, CLEVE R, et al. Elementary gates for quantum computation[J]. Physical Review A, 1995, 52(5): 3457-3467. doi: 10.1103/PhysRevA.52.3457 [17] MILLER D M, WILLE R, SASANIAN Z. Elementary quantum gate realizations for multiple-control Toffoli gates[C]//2011 41st IEEE International Symposium on Multiple-Valued Logic (ISMVL). Los Alamitos: IEEE, 2011: 288-293. [18] TAN Y Y, CHENG X Y, GUAN Z J, et al. Multi-Strategy based quantum cost reduction of linear nearest-neighbor quantum circuit[J]. Quantum Information Processing, 2018, 17(3): 61-73. doi: 10.1007/s11128-018-1832-y