Ricercar: A Language for Describing and Rewriting Reversible Circuits with Ancillae and Its Permutation Semantics

  • Michael Kirkedal ThomsenEmail author
  • Robin Kaarsgaard
  • Mathias Soeken
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9138)


Previously, Soeken and Thomsen presented six basic semantics-preserving rules for rewriting reversible logic circuits, defined using the well-known diagrammatic notation of Feynman. While this notation is both useful and intuitive for describing reversible circuits, its shortcomings in generality complicates the specification of more sophisticated and abstract rewriting rules.

In this paper, we introduce Ricercar, a general textual description language for reversible logic circuits designed explicitly to support rewriting.

Taking the not gate and the identity gate as primitives, this language allows circuits to be constructed using control gates, sequential composition, and ancillae, through a notion of ancilla scope. We show how the above-mentioned rewriting rules are defined in this language, and extend the rewriting system with five additional rules to introduce and modify ancilla scope. This treatment of ancillae addresses the limitations of the original rewriting system in rewriting circuits with ancillae in the general case.

To set Ricercar on a theoretical foundation, we also define a permutation semantics over symmetric groups and show how the operations over permutations as transposition relate to the semantics of the language.


Reversible logic Term rewriting Ancillae Circuit equivalence Permutation 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Abdessaied, N., Soeken, M., Thomsen, M.K., Drechsler, R.: Upper bounds for reversible circuits based on Young subgroups. Information Processing Letters 114(6), 282–286 (2014)zbMATHMathSciNetCrossRefGoogle Scholar
  2. 2.
    Bennett, C.H.: Time/Space Trade-Offs for reversible computation. SIAM Journal on Computing 18(4), 766–776 (1989)zbMATHMathSciNetCrossRefGoogle Scholar
  3. 3.
    Buhrman, H., Tromp, J., Vitányi, P.: Time and space bounds for reversible simulation. Journal of Physics A: Mathematical and General 34(35), 6821–6830 (2001)zbMATHMathSciNetCrossRefGoogle Scholar
  4. 4.
    Chan, T., Munro, J.I., Raman, V.: Selection and sorting in the “restore” model. In: Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 995–1004 (2014)Google Scholar
  5. 5.
    Cuccaro, S.A., Draper, T.G., Kutin, S.A., Moulton, D.P.: A new quantum ripple-carry addition circuit. arXiv:quant-ph/0410184v1 (2005)
  6. 6.
    De Vos, A., Rentergem, Y.V.: Reversible computing: from mathematical group theory to electronical circuit experiment. In: Proceedings of the Second Conference on Computing Frontiers, 2005, Ischia, Italy, May 4–6, 2005, pp. 35–44 (2005)Google Scholar
  7. 7.
    Draper, T.G., Kutin, S.A., Rains, E.M., Svore, K.M.: A logarithmic-depth quantum carry-lookahead adder. arXiv:quant-ph/0406142 (2008)
  8. 8.
    Green, A.S., Lumsdaine, P.L.F., Ross, N.J., Selinger, P., Valiron, B.: An introduction to quantum programming in quipper. In: Dueck, G.W., Miller, D.M. (eds.) RC 2013. LNCS, vol. 7948, pp. 110–124. Springer, Heidelberg (2013) CrossRefGoogle Scholar
  9. 9.
    Green, A.S., Lumsdaine, P.L., Ross, N.J., Selinger, P., Valiron, B.: Quipper: a scalable quantum programming language. In: Conference on Programming Language Design and Implementation, PLDI 2013, pp. 333–342. ACM (2013)Google Scholar
  10. 10.
    Jordan, S.P.: Strong equivalence of reversible circuits is \({\sf coNP}\)-complete. Quantum Information & Computation 14(15–16), 1302–1307 (2014)MathSciNetGoogle Scholar
  11. 11.
    Kaarsgaard, R.: Towards a propositional logic for reversible logic circuits. In: de Haan, R. (ed.) Proceedings of the ESSLLI 2014 Student Session, pp. 33–41 (2014).
  12. 12.
    Miller, D.M., Maslov, D., Dueck, G.W.: A transformation based algorithm for reversible logic synthesis. In: Design Automation Conference, DAC, pp. 318–323 (2003)Google Scholar
  13. 13.
    Shende, V.V., Prasad, A.K., Markov, I.L., Hayes, J.P.: Synthesis of reversible logic circuits. IEEE Trans. on CAD of Integrated Circuits and Systems 22(6), 710–722 (2003)CrossRefGoogle Scholar
  14. 14.
    Soeken, M., Thomsen, M.K.: White dots do matter: rewriting reversible logic circuits. In: Dueck, G.W., Miller, D.M. (eds.) RC 2013. LNCS, vol. 7948, pp. 196–208. Springer, Heidelberg (2013) CrossRefGoogle Scholar
  15. 15.
    Soeken, M., Thomsen, M.K., Dueck, G.W., Miller, D.M.: Self-inverse functions and palindromic circuits. arXiv 1502.05825 (2015)Google Scholar
  16. 16.
    Storme, L., De Vos, A., Jacobs, G.: Group theoretical aspects of reversible logic gates. J. UCS 5(5), 307–321 (1999)zbMATHGoogle Scholar
  17. 17.
    Takahashi, Y., Kunihiro, N.: A fast quantum circuit for addition with few qubits. Quantum Info. Comput. 8(6), 636–649 (2008)zbMATHMathSciNetGoogle Scholar
  18. 18.
    Thomsen, M.K.: Describing and optimising reversible logic using a functional language. In: Gill, A., Hage, J. (eds.) IFL 2011. LNCS, vol. 7257, pp. 148–163. Springer, Heidelberg (2012) CrossRefGoogle Scholar
  19. 19.
    Thomsen, M.K., Axelsen, H.B.: Parallelization of reversible ripple-carry adders. Parallel Processing Letters 19(1), 205–222 (2009)MathSciNetCrossRefGoogle Scholar
  20. 20.
    Vedral, V., Barenco, A., Ekert, A.: Quantum networks for elementary arithmetic operations. Physical Review A 54(1), 147–153 (1996)MathSciNetCrossRefGoogle Scholar
  21. 21.
    Wille, R., Soeken, M., Miller, D.M., Drechsler, R.: Trading off circuit lines and gate costs in the synthesis of reversible logic. Integration, the VLSI Journal 47(2), 284–294 (2014)CrossRefGoogle Scholar
  22. 22.
    Yokoyama, T., Axelsen, H.B., Glück, R.: Principles of a reversible programming language. In: Conference on Computing Frontiers, CF, pp. 43–54. ACM Press (2008)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  • Michael Kirkedal Thomsen
    • 1
    Email author
  • Robin Kaarsgaard
    • 2
  • Mathias Soeken
    • 1
  1. 1.Group of Computer ArchitectureUniversity of BremenBremenGermany
  2. 2.DIKU, Department of Computer ScienceUniversity of CopenhagenCopenhagenDenmark

Personalised recommendations