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 ⊆ G可在O(|V(G)| · |V(H)|)时间内求解。我们进一步证明,若图具有有向无环性,则可同时求解无界数量的模式子图同构问题。所有m个模式匹配的枚举时间为O(P)^{P+3/2} · |V(G)| + O(m),其中P为最大模式的顶点数。针对量子电路,该上界可表示为模式最大量子比特数N与深度δ的函数:O(N)^{N+1/2} · δ log δ · |V(G)| + O(m)。