Constructing $\mathrm{NP}^{\mathord{\#}\mathrm P}$-complete problems and ${\mathord{\#}\mathrm P}$-hardness of circuit extraction in phase-free ZH
Piotr Mitosek
TL;DR
The paper investigates the complexity of phase-free ZH diagrams, proving that StateEq and ContainsEntry_k are NP^{#P}-complete and that circuit extraction remains #P-hard for phase-free ZH. It achieves this by establishing NP^{#P} = NP^{C_=P[1]} and constructing an NP^{C_=P[1]}-complete problem SAT&Compare#SAT to drive reductions from counting-SAT to diagram problems via ZH encodings. The results extend known hardness from ZX calculus to phase-free ZH and illuminate the complexity of diagram equivalence, comparison, and extraction in graphical calculi. By connecting diagrammatic reasoning to counting complexity and oracle-based classes, the work provides foundational insights with potential implications for graphical languages, MBQC, and circuit optimization frameworks.
Abstract
The ZH calculus is a graphical language for quantum computation reasoning. The phase-free variant offers a simple set of generators that guarantee universality. ZH calculus is effective in MBQC and analysis of quantum circuits constructed with the universal gate set Toffoli+H. While circuits naturally translate to ZH diagrams, finding an ancilla-free circuit equivalent to a given diagram is hard. Here, we show that circuit extraction for phase-free ZH calculus is ${\mathord{\#}\mathrm P}$-hard, extending the existing result for ZX calculus. Another problem believed to be hard is comparing whether two diagrams represent the same process. We show that two closely related problems are $\mathrm{NP}^{\mathord{\#}\mathrm P}$-complete. The first problem is: given two processes represented as diagrams, determine the existence of a computational basis state on which they equalize. The second problem is checking whether the matrix representation of a given diagram contains an entry equal to a given number. Our proof adapts the proof of Cook-Levin theorem to a reduction from a non-deterministic Turing Machine with access to ${\mathord{\#}\mathrm P}$ oracle.
