Binary Decision Diagrams (BDDs) are instrumental in many electronic design automation (EDA) tasks thanks to their compact representation of Boolean functions. In BDD-based reversible-circuit synthesis, which is critical for quantum computing, the chosen variable ordering governs the number of BDD nodes and thus the key metrics of resource consumption, such as Quantum Cost. Because finding an optimal variable ordering for BDDs is an NP-complete problem, existing heuristics often degrade as circuit complexity grows. We introduce BDD2Seq, a graph-to-sequence framework that couples a Graph Neural Network encoder with a Pointer-Network decoder and Diverse Beam Search to predict high-quality orderings. By treating the circuit netlist as a graph, BDD2Seq learns structural dependencies that conventional heuristics overlooked, yielding smaller BDDs and faster synthesis. Extensive experiments on three public benchmarks show that BDD2Seq achieves around 1.4 times lower Quantum Cost and 3.7 times faster synthesis than modern heuristic algorithms. To the best of our knowledge, this is the first work to tackle the variable-ordering problem in BDD-based reversible-circuit synthesis with a graph-based generative model and diversity-promoting decoding.
翻译:二元决策图(BDD)因其对布尔函数的紧凑表示,在众多电子设计自动化(EDA)任务中发挥着重要作用。在基于BDD的可逆电路综合中——这对量子计算至关重要——所选的变量排序决定了BDD节点的数量,进而影响资源消耗的关键指标,如量子成本。由于为BDD寻找最优变量排序是一个NP完全问题,现有启发式方法常随电路复杂度增加而性能下降。我们提出了BDD2Seq,这是一个图到序列框架,它将图神经网络编码器与指针网络解码器及多样化束搜索相结合,以预测高质量的排序。通过将电路网表视为图,BDD2Seq学习了传统启发式方法忽略的结构依赖关系,从而生成更小的BDD并实现更快的综合。在三个公开基准上的大量实验表明,相较于现代启发式算法,BDD2Seq实现了约1.4倍的量子成本降低和3.7倍的综合速度提升。据我们所知,这是首个利用基于图的生成模型和促进多样性的解码策略来解决基于BDD的可逆电路综合中变量排序问题的工作。