Hybrid Quantum-Classical Circuit Simplification with the ZX-Calculus

We present a complete optimization procedure for hybrid quantum-classical circuits with classical parity logic. While common optimization techniques for quantum algorithms focus on rewriting solely the pure quantum segments, there is interest in applying a global optimization process for applications such as quantum error correction and quantum assertions. This work, based on the pure-quantum circuit optimization procedure by Duncan et al., uses an extension of the formal graphical ZX-calculus called ZX as an intermediary representation of the hybrid circuits to allow for granular optimizations below the quantum-gate level. We define a translation from hybrid circuits into diagrams that admit the graph-theoretical focused-gFlow property, needed for the final extraction back into a circuit. We then derive a number of gFlow-preserving optimization rules for ZX diagrams that reduce the size of the graph, and devise a strategy to find optimization opportunities by rewriting the diagram guided by a Gauss elimination process. Then, after extracting the circuit, we present a general procedure for detecting segments of circuit-like ZX diagrams which can be implemented with classical gates in the extracted circuit. We have implemented our optimization procedure as an extension to the open-source python library PyZX.

[1]  Peter Selinger,et al.  Dagger Compact Closed Categories and Completely Positive Maps: (Extended Abstract) , 2007, QPL.

[2]  Dominic Horsman,et al.  The ZX calculus is a language for surface code lattice surgery , 2017, Quantum.

[3]  K. Bertels,et al.  cQASM v1.0: Towards a Common Quantum Assembly Language , 2018, 1805.09607.

[4]  Finite Verification of Infinite Families of Diagram Equations , 2019, Electronic Proceedings in Theoretical Computer Science.

[5]  R. Jozsa An introduction to measurement based quantum computation , 2005, quant-ph/0508124.

[6]  J. V. D. Wetering ZX-calculus for the working quantum computer scientist , 2020, 2012.13966.

[7]  Aleks Kissinger,et al.  Picturing Quantum Processes , 2017 .

[8]  Mehdi Mhalla,et al.  Which Graph States are Useful for Quantum Information Processing? , 2010, TQC.

[9]  Earl T. Campbell,et al.  An efficient quantum compiler that reduces T count , 2017, Quantum Science and Technology.

[10]  Peter Selinger,et al.  Quantum circuits of T-depth one , 2012, ArXiv.

[11]  Aleks Kissinger,et al.  PyZX: Large Scale Automated Diagrammatic Reasoning , 2019, Electronic Proceedings in Theoretical Computer Science.

[12]  Aleks Kissinger,et al.  Picturing Quantum Processes - A First Course on Quantum Theory and Diagrammatic Reasoning , 2018, Diagrams.

[13]  Dmitri Maslov,et al.  Polynomial-Time T-Depth Optimization of Clifford+T Circuits Via Matroid Partitioning , 2013, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems.

[14]  Simon Perdrix,et al.  Rewriting Measurement-Based Quantum Computations with Generalised Flow , 2010, ICALP.

[15]  Bob Coecke,et al.  Interacting Quantum Observables , 2008, ICALP.

[16]  Matthias Troyer,et al.  ProjectQ: An Open Source Software Framework for Quantum Computing , 2016, ArXiv.

[17]  Gushu Li,et al.  Projection-based runtime assertions for testing and debugging Quantum programs , 2020, Proc. ACM Program. Lang..

[18]  Aleks Kissinger,et al.  Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus , 2019, Quantum.

[19]  Ross Duncan,et al.  Verifying the Steane code with Quantomatic , 2013, QPL.

[20]  Benoît Valiron,et al.  Quipper: a scalable quantum programming language , 2013, PLDI.

[21]  Simon Perdrix,et al.  Completeness of Graphical Languages for Mixed States Quantum Mechanics , 2019, ICALP.

[22]  Simon Perdrix,et al.  Completeness of the ZX-Calculus , 2019, Log. Methods Comput. Sci..

[23]  Quipper: a scalable quantum programming language , 2013, PLDI.

[24]  Stefan Zohren,et al.  Graphical structures for design and verification of quantum error correction , 2016, Quantum Science and Technology.

[25]  Aleks Kissinger,et al.  Reducing T-count with the ZX-calculus , 2019, 1903.10477.

[26]  Huiyang Zhou,et al.  Quantum Circuits for Dynamic Runtime Assertions in Quantum Computation , 2019, IEEE Computer Architecture Letters.