1.7K Star 3K Fork 4.3K

GVPMindSpore/mindquantum

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
mindquantum.algorithm.library.amplitude_encoder.rst 679 Bytes
Copy Edit Raw Blame History
donghufeng authored 2 years ago . 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.10

Search