1.7K Star 3K Fork 4.3K

GVPMindSpore/mindquantum

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

mindquantum.algorithm.library.amplitude_encoder

.. py:function:: mindquantum.algorithm.library.amplitude_encoder(x, n_qubits)

    用于振幅编码的量子线路。

    .. note::
        经典数据的长度应该是2的幂,否则将用0填充。
        向量应该归一化。

    参数:
        - **x** (list[float] or numpy.array(list[float])) - 需要编码的数据向量,应该归一化。
        - **n_qubits** (int) - 编码线路的量子比特数。

    返回:
        Circuit,能够完成振幅编码的量子线路。
        ParameterResolver,用于完成振幅编码量子线路的参数。
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindquantum.git
git@gitee.com:mindspore/mindquantum.git
mindspore
mindquantum
mindquantum
r0.9

搜索帮助