We study a variant of the subgraph isomorphism problem that is of high interest to the quantum computing community. Our results give an algorithm to perform pattern matching in quantum circuits for many patterns simultaneously, independently of the number of patterns. After a pre-computation step in which the patterns are compiled into a decision tree, the running time is linear in the size of the input quantum circuit. More generally, we consider connected port graphs, in which every edge $e$ incident to $v$ has a label $L_v(e)$ unique in $v$. Jiang and Bunke showed that the subgraph isomorphism problem $H \subseteq G$ for such graphs can be solved in time $O(|V(G)| \cdot |V(H)|)$. We show that if in addition the graphs are directed acyclic, then the subgraph isomorphism problem can be solved for an unbounded number of patterns simultaneously. We enumerate all $m$ pattern matches in time $O(P)^{P+3/2} \cdot |V(G)| + O(m)$, where $P$ is the number of vertices of the largest pattern. In the case of quantum circuits, we can express the bound obtained in terms of the maximum number of qubits $N$ and depth $\delta$ of the patterns : $O(N)^{N + 1/2} \cdot \delta \log \delta \cdot |V(G)| + O(m)$.
翻译:我们研究了一个对量子计算领域具有高度重要性的子图同构问题变体。我们的成果提出了一种算法,能够同时针对量子电路中的多个模式进行模式匹配,且其性能与模式数量无关。在将模式编译成决策树的预处理步骤之后,运行时间与输入量子电路的规模呈线性关系。更一般地,我们考虑连通端口图,其中每条与顶点$v$关联的边$e$都有一个在$v$中唯一的标签$L_v(e)$。Jiang和Bunke证明,此类图的子图同构问题$H \subseteq G$可在$O(|V(G)| \cdot |V(H)|)$时间内求解。我们证明,若图额外具有有向无环性质,则子图同构问题可同时对无界数量的模式求解。我们枚举所有$m$个模式匹配,所需时间为$O(P)^{P+3/2} \cdot |V(G)| + O(m)$,其中$P$为最大模式的顶点数。在量子电路场景下,我们可用模式的最大量子比特数$N$和深度$\delta$表达该上界:$O(N)^{N + 1/2} \cdot \delta \log \delta \cdot |V(G)| + O(m)$。