_dagcircuit.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:qiskit-sdk-py 作者: QISKit 项目源码 文件源码
def get_named_nodes(self, name):
        """Return a list of "op" nodes with the given name."""
        nlist = []
        if name not in self.basis:
            raise DAGCircuitError("%s is not in the list of basis operations"
                                  % name)

        # Iterate through the nodes of self in topological order
        ts = nx.topological_sort(self.multi_graph)
        for n in ts:
            nd = self.multi_graph.node[n]
            if nd["type"] == "op" and nd["name"] == name:
                nlist.append(n)
        return nlist
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号