1.8K Star 3.1K Fork 4.3K

GVPMindSpore/mindquantum

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

mindquantum.utils.random_state

.. py:function:: mindquantum.utils.random_state(shapes, norm_axis=0, comp=True, seed=None)

    生成某个随机的量子态。

    参数:
        - **shapes** (tuple) - 想要生成量子态的个数和维度,例如, `(m, n)` 表示m个量子态,每个状态由 :math:`\log_2(n)` 量子比特形成。
        - **norm_axis** (int) - 应用归一化的轴。默认值: ``0``。
        - **comp** (bool) - 如果为 ``True`` ,量子态的每个振幅将是一个复数。默认值: ``True``。
        - **seed** (int) - 随机种子。默认值: ``None``。

    返回:
        numpy.ndarray,一个随机的归一化量子态。
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindquantum.git
git@gitee.com:mindspore/mindquantum.git
mindspore
mindquantum
mindquantum
r0.10

搜索帮助