1.8K Star 3K Fork 4.3K

GVPMindSpore/mindquantum

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mindquantum.algorithm.compiler.try_merge.rst 821 Bytes
一键复制 编辑 原始数据 按行查看 历史
donghufeng 提交于 2年前 . re-organize docs

mindquantum.algorithm.compiler.try_merge

.. py:function:: mindquantum.algorithm.compiler.try_merge(father_node: GateNode, child_node: GateNode)

    尝试将两个节点融合起来。

    通过本方法,我们将两个互为共轭的量子门融合成一个单位门,或者将两个同类的参数门融合到一起。

    参数:
        - **father_node** (:class:`~.algorithm.compiler.GateNode`) - 想要融合的父 DAG 节点。
        - **child_node** (:class:`~.algorithm.compiler.GateNode`) - 想要融合的子 DAG 节点。

    返回:
        - bool,是否融合成功。
        - List[:class:`~.algorithm.compiler.GateNode`],融合之后的父节点.
        - :class:`~.core.gates.GlobalPhase`,合并两个给定节点后的global phase gate。
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindquantum.git
git@gitee.com:mindspore/mindquantum.git
mindspore
mindquantum
mindquantum
r0.9

搜索帮助