# Strongly Universal Reversible Gate Sets

## Abstract

It is well-known that the Toffoli gate and the negation gate together yield a universal gate set, in the sense that every permutation of \(\{0,1\}^n\) can be implemented as a composition of these gates. Since every bit operation that does not use all of the bits performs an even permutation, we need to use at least one auxiliary bit to perform every permutation, and it is known that one bit is indeed enough. Without auxiliary bits, all even permutations can be implemented. We generalize these results to non-binary logic: For any finite set *A*, a finite gate set can generate all even permutations of \(A^n\) for all *n*, without any auxiliary symbols. This directly implies the previously published result that a finite gate set can generate all permutations of \(A^n\) when the cardinality of *A* is odd, and that one auxiliary symbol is necessary and sufficient to obtain all permutations when the cardinality of *A* is even. We also consider the conservative case, that is, those permutations of \(A^n\) that preserve the weight of the input word. The weight is the vector that records how many times each symbol occurs in the word. It turns out that no finite conservative gate set can, for all *n*, implement all conservative even permutations of \(A^n\) without auxiliary bits. But we provide a finite gate set that can implement all those conservative permutations that are even within each weight class of \(A^n\).

## References

- 1.Aaronson, S., Grier, D., Schaeffer, L.: The classification of reversible bit operations. Electron. Colloq. Comput. Complex. (66) (2015)Google Scholar
- 2.Boykett, T.: Closed systems of invertible maps (2015). http://arxiv.org/abs/1512.06813, submitted
- 3.Fredkin, E., Toffoli, T.: Conservative logic. Int. J. Theor. Phys.
**21**(3), 219–253 (1982). http://dx.doi.org/10.1007/BF01857727 MathSciNetCrossRefMATHGoogle Scholar - 4.LaFont, Y.: Towards an algebraic theory of boolean circuits. J. Pure Appl. Algebra
**184**, 257–310 (2003)MathSciNetCrossRefMATHGoogle Scholar - 5.Musset, J.: Générateurs et relations pour les circuits booléens réversibles. Technical report 97-32, Institut de Mathématiques de Luminy (1997). http://iml.univ-mrs.fr/editions/
- 6.Selinger, P.: Reversible k-ary logic circuits are finitely generated for odd k, April 2016. http://arxiv.org/abs/1604.01646
- 7.Szendrei, Á.: Clones in universal algebra, Séminaire de Mathématiques Supérieures [Seminar on Higher Mathematics], vol. 99. Presses de l’Université de Montréal, Montreal (1986)Google Scholar
- 8.Toffoli, T.: Reversible computing. Technical report MIT/LCS/TM-151, MIT (1980)Google Scholar
- 9.Xu, S.: Reversible Logic Synthesis with Minimal Usage of Ancilla Bits. Master’s thesis, MIT, June 2015. http://arxiv.org/pdf/1506.03777.pdf
- 10.Yang, G., Song, X., Perkowski, M., Wu, J.: Realizing ternary quantum switching networks without ancilla bits. J. Phys. A
**38**(44), 9689–9697 (2005). http://dx.doi.org/10.1088/0305-4470/38/44/006 MathSciNetCrossRefMATHGoogle Scholar