1.8K Star 3K Fork 4.3K

GVPMindSpore/mindquantum

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mindquantum.algorithm.compiler.u3_decompose.rst 905 Bytes
一键复制 编辑 原始数据 按行查看 历史
dsdsdshe 提交于 5个月前 . update docs of u3 decompose

mindquantum.algorithm.compiler.u3_decompose

.. py:function:: mindquantum.algorithm.compiler.u3_decompose(gate: U3, method: str = 'standard')

    将U3门分解为Z-X-Z-X-Z旋转序列。

    分解可以遵循以下两种方法之一:

    1. 标准方法:U3(θ,φ,λ) = Rz(φ)Rx(-π/2)Rz(θ)Rx(π/2)Rz(λ)
    2. 替代方法:U3(θ,φ,λ) = Rz(φ)Rx(π/2)Rz(π-θ)Rx(π/2)Rz(λ-π)

    当任何旋转角度为常数且等于0时,相应的RZ门将被省略。

    参数:
        - **gate** (:class:`~.core.gates.U3`) - 需要被分解的U3门。
        - **method** (str) - 使用的分解方法,可以是'standard'或'alternative'。默认值:'standard'。

    返回:
        Circuit,使用ZXZXZ序列实现U3门的量子线路。

    异常:
        - **ValueError** - 当method既不是'standard'也不是'alternative'时。
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindquantum.git
git@gitee.com:mindspore/mindquantum.git
mindspore
mindquantum
mindquantum
r0.10

搜索帮助