1.4K Star 2.3K Fork 3.7K

GVPMindSpore/mindquantum

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

mindquantum.algorithm.compiler.GateReplacer

.. py:class:: mindquantum.algorithm.compiler.GateReplacer(ori_example_gate: BasicGate, wanted_example_circ: Circuit)

    将给定的量子门替换成给定的量子线路。

    参数:
        - **ori_example_gate** (:class:`~.core.gates.BasicGate`) - 想要替换的量子门。请注意,相同类型且拥有相同个数的作用为和控制为的量子门会被替换。
        - **wanted_example_circ** (:class:`~.core.circuit.Circuit`) - 想要的量子线路。

    .. py:method:: do(dag_circuit: DAGCircuit)

        执行门替换规则。

        参数:
            - **dag_circuit** (:class:`~.algorithm.compiler.DAGCircuit`) - 想要编译的量子线路的 DAG 图。
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindquantum.git
git@gitee.com:mindspore/mindquantum.git
mindspore
mindquantum
mindquantum
r0.9

搜索帮助