REVERSIBLE GATES
5.1. BRIEF PRESENTATION OF TOP ALGORITHMS FOR SYNTHESIS OF REVERSIBLE CIRCUITS
Currently, there are two types of algorithms in literature to synthesize reversible circuits:
(T1) those like MMD [Agrawal04, Donald08, Dueck03, Gupta06, Kerntopf04,
Khlopotine02, Maslov03, Maslov08, Maslov10, Miller03, Miller03a] that start
from a reversible specification,
(T2) those that start from non-reversible specification and create ancilla bits like
[Große09, Kumar07, Kumar08 , Mishchenko01, Mishchenko02, Stedman04,
Saeedi07, Saeedi07a, Saeedi07b, Wille08, Wille08a,Wille09].
The second type of methods has been successful for large functions [Große06, Große09,
Wille08, Wille08a, Wille09] but these two groups of methods (T1 and T2) solve basically
different types of problems.
The MMD algorithm (Miller, Maslov and Dueck) is currently the leading reversible logic
synthesizer if no ancilla bits are used [Miller03a]. MMD uses permutation vector-like
reversible function specification as its data. It generates no ancilla bits and uses no
search. MMD software is reasonably fast and it distinguishes itself among other programs
135 problem being synthesized [Miller03a]. MMD can practically be applied to at most 8*8
variable reversible functions and few larger functions of special types. This program is
therefore the current benchmark for the evaluation of programs for reversible circuit
synthesis. Due to MMD’s non-minimal results, several research groups are constantly
attempting to improve this algorithm since 2003.
Mathematically, MMD decomposes a large permutation of circuit’s specification to small
permutations of reversible gates. MMD uses the permutation vector-like reversible
function specification as its input and internal data. Permutation vector corresponds to the
truth table, so it is very large for functions with more than 13 variables. This large vector
is explicitly used in the synthesis process and, thus, must be stored and processed in
memory. Since it is intrinsically bound by the natural binary order of minterms, and
hence does not use search, MMD cannot be enhanced through better search algorithms or
iterative or recursive routines.
Since MMD processes only a single minterm order, this program is fast. Practically,
however, very few reversible functions with more than 8 variables were presented as
MMD benchmarks in the literature. It was found in our research, and by other
researchers, that the complexity of both the synthesis process and the average circuit sizes
synthesized by MMD grow very quickly with “large circuits” (above 8 qubits). In our
research, it was difficult to evaluate the quality of our results for large circuits from
136 Consequently, with this chapter, we set the benchmark for future research. Observe that
recent papers on permutative quantum circuit synthesis use standard non-reversible
specifications as their input, [Rice09, Wille09], while previous tools such as MMD only
allow vector of permutations (only reversible) as the only form of function specification,
highlighting the need to develop tools that convert irreversible specification to reversible.
In any case, at this time MMD program is the current benchmark for the evaluation of
programs for reversible circuit synthesis with no ancilla bits. A strong asset of the
philosophy used in MMD, in contrast to those used in other programs is that MMD gives
a warranty of convergence if the data is small enough for MMD to be able to keep them
in memory. Due to the fact that the quality of MMD may be very low for functions where
the exact minimal solution is known, several research groups are constantly attempting to
improve on the MMD algorithm.
Agrawal and Jha’s algorithm [AgrawalJha04b, Jha06] uses the number of terms in the Positive Polarity Reed-Muller (PPRM) expansion of synthesized functions as its cost
function [AgrawalJha04b], and Kerntopf’s algorithm uses the complexity of special
BDDs, the SBDD’s, as its cost function [Kerntopf04b]. The use of the cost functions
based on complexities of ESOPs, FPRMs and other cascade types in the cost functions
that guide the search have also been proposed in newer versions of composition-based
search approaches [Khlopotine02, Mishchenko02, Perkowski01e]. Although these
algorithms are different than MMD in the sense that MMD uses no search, they belong to
137 used a new type of decision diagrams but did not prove convergence and, as a result, his
method only worked for 3 variables. In unpublished research, we used ESOPs and
FPRMs rather than PPRM but we were not able to find a heuristic that would work better
than the variants from [Agrawal04, Donald08,Gupta06]. Other cascade types have also
been proposed in newer versions of composition-based search approaches [Khlopotine02,
Mishchenko02] but there were troubles with either the size of solutions or convergence.
As PPRM (Positive Polarity Reed-Muller) expansion can be stored by an expression that
is (on the average) shorter than 2n product terms, (n is the number of variables) the
algorithms that use PPRM, could in theory minimize larger functions. On the other hand
this algorithm has to store many PPRM equations as it represents a tree-search algorithm.
Also, non-factorized PPRMs may be in many cases of similar complexity to truth tables,
for instance for function f = a’b’c’d’. Some of the algorithm variants from [Agrawal04,
Donald08, Gupta06] have trouble with convergence and there is a trade-off between
provable convergence and size of circuits that can be minimized. A challenge thus still
exists to create an algorithm that could trade-off quality for time, but with a provable
convergence for every function. In this chapter we will present a new algorithm of this
type.
After many failed attempts at creating better minimizers (in the sense of cost and size of
function to be synthesized) based on other search strategies [Kumar08, Mishchenko02]
138 weakness of MMD is that it is limited to functions of the size that their truth table
(exponential size) can fit in memory. This limits practically MMD's approach to about 13
variables. Because of its design principle, even with big speed penalty MMD just cannot
minimize larger functions. Thus an improved algorithm has to use an entirely different
representation. When it was decided to use an internal representation other than a truth
table or a spectrum with 2n minterms, the problem was “what is the best representation
that would still guarantee convergence?”
Here we present a search algorithm MP that is both convergent, allows for synthesis of
large functions, and produces near minimal solutions. This algorithm is based on various
generalizations of MMD.