代码拉取完成,页面将自动刷新
.. py:class:: mindquantum.algorithm.compiler.DAGCircuit(circuit: Circuit) 量子线路的有向无环图表示(Directed acyclic graph, DAG)。 参数: - **circuit** (:class:`~.core.circuit.Circuit`) - 输入的量子线路。 .. py:method:: append_node(node: DAGNode) 添加一个量子门 DAG 节点。 参数: - **node** (:class:`~.algorithm.compiler.DAGNode`) - 想要添加的 DAG 节点。 .. py:method:: depth() 返回量子线路的层数。 .. py:method:: find_all_gate_node() 查找 :class:`~.algorithm.compiler.DAGCircuit` 图中的所有量子门节点。 返回: List[:class:`~.algorithm.compiler.GateNode`],:class:`~.algorithm.compiler.DAGCircuit` 中所有 :class:`~.algorithm.compiler.GateNode` 的列表。 .. py:method:: layering() 将量子线路进行分层。 返回: List[:class:`~.core.circuit.Circuit`],分层后的量子线路列表。 .. py:method:: replace_node_with_dag_circuit(node: DAGNode, coming: "DAGCircuit") :abstractmethod: 用一个 DAG 图来替换给定的节点。 参数: - **node** (:class:`~.algorithm.compiler.DAGNode`) - 原始的节点。 - **coming** (:class:`~.algorithm.compiler.DAGCircuit`) - 新的 DAG 图。 .. py:method:: to_circuit() 将 :class:`~.algorithm.compiler.DAGCircuit` 转化为量子线路。 返回: :class:`~.core.circuit.Circuit` , DAG 图对应的量子线路。 .. py:method:: topological_sort() 执行有向无环图(DAG)的拓扑排序,并返回拓扑排序后的节点顺序。 返回: List[:class:`~.algorithm.compiler.DAGNode`],拓扑排序后的节点列表。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。