1.8K Star 3.1K Fork 4.3K

GVPMindSpore/mindquantum

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

mindquantum.algorithm.qaia.DSB

.. py:class:: mindquantum.algorithm.qaia.DSB(J, h=None, x=None, n_iter=1000, batch_size=1, dt=1, xi=None, backend='cpu-float32')

    离散模拟分叉算法。

    参考文献:`High-performance combinatorial optimization based on classical mechanics <https://www.science.org/doi/10.1126/sciadv.abe7953>`_。

    .. note::
        为了内存效率,输入数组 'x' 不会被复制,并且会在优化过程中被原地修改。
        如果需要保留原始数据,请使用 `x.copy()` 传入副本。

        当使用backend='gpu-int8'时,请注意该后端可能在稠密图或具有连续系数的图上表现不佳。
        在这些情况下,可以尝试调整参数或考虑使用'cpu-float32'或'gpu-float16'后端。

    参数:
        - **J** (Union[numpy.array, scipy.sparse.spmatrix]) - 耦合矩阵,维度为 :math:`(N \times N)`。
        - **h** (numpy.array) - 外场强度,维度为 :math:`(N, )`。
        - **x** (numpy.array) - 自旋初始化配置,维度为 :math:`(N \times batch\_size)`。会在优化过程中被修改。如果不提供(``None``),将被初始化为在 [-0.01, 0.01] 范围内均匀分布的随机值。默认值: ``None``。
        - **n_iter** (int) - 迭代步数。默认值: ``1000``。
        - **batch_size** (int) - 样本个数。默认值: ``1``。
        - **dt** (float) - 迭代步长。默认值: ``1``。
        - **xi** (float) - 频率维数,正的常数。默认值: ``None``。
        - **backend** (str) - 计算后端和精度:'cpu-float32'、'gpu-float32'、'gpu-float16'、'gpu-int8' 或 'npu-float32'。默认值: ``'cpu-float32'``。

    .. py:method:: update()

        基于修改的显式辛欧拉方法的动力学演化。
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindquantum.git
git@gitee.com:mindspore/mindquantum.git
mindspore
mindquantum
mindquantum
master

搜索帮助