1.8K Star 3.1K Fork 4.3K

GVPMindSpore/mindquantum

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.github
.gitlab
.jenkins
_build
ccsrc
cmake
docs
api_python
algorithm
compiler
error_mitigation
library
mapping
nisq
ansatz_images
mindquantum.algorithm.nisq.ASWAP.rst
mindquantum.algorithm.nisq.Ansatz.rst
mindquantum.algorithm.nisq.Ansatz1.rst
mindquantum.algorithm.nisq.Ansatz10.rst
mindquantum.algorithm.nisq.Ansatz11.rst
mindquantum.algorithm.nisq.Ansatz12.rst
mindquantum.algorithm.nisq.Ansatz13.rst
mindquantum.algorithm.nisq.Ansatz14.rst
mindquantum.algorithm.nisq.Ansatz15.rst
mindquantum.algorithm.nisq.Ansatz16.rst
mindquantum.algorithm.nisq.Ansatz17.rst
mindquantum.algorithm.nisq.Ansatz18.rst
mindquantum.algorithm.nisq.Ansatz19.rst
mindquantum.algorithm.nisq.Ansatz2.rst
mindquantum.algorithm.nisq.Ansatz3.rst
mindquantum.algorithm.nisq.Ansatz4.rst
mindquantum.algorithm.nisq.Ansatz5.rst
mindquantum.algorithm.nisq.Ansatz6.rst
mindquantum.algorithm.nisq.Ansatz7.rst
mindquantum.algorithm.nisq.Ansatz8.rst
mindquantum.algorithm.nisq.Ansatz9.rst
mindquantum.algorithm.nisq.HardwareEfficientAnsatz.rst
mindquantum.algorithm.nisq.IQPEncoding.rst
mindquantum.algorithm.nisq.Max2SATAnsatz.rst
mindquantum.algorithm.nisq.MaxCutAnsatz.rst
mindquantum.algorithm.nisq.PCHeaXYZ1F.rst
mindquantum.algorithm.nisq.PCHeaXYZ2F.rst
mindquantum.algorithm.nisq.QuantumNeuron.rst
mindquantum.algorithm.nisq.QubitUCCAnsatz.rst
mindquantum.algorithm.nisq.RYCascade.rst
mindquantum.algorithm.nisq.RYFull.rst
mindquantum.algorithm.nisq.RYLinear.rst
mindquantum.algorithm.nisq.RYRZFull.rst
mindquantum.algorithm.nisq.SGAnsatz.rst
mindquantum.algorithm.nisq.SGAnsatz2D.rst
mindquantum.algorithm.nisq.StronglyEntangling.rst
mindquantum.algorithm.nisq.Transform.rst
mindquantum.algorithm.nisq.UCCAnsatz.rst
mindquantum.algorithm.nisq.ansatz_variance.rst
mindquantum.algorithm.nisq.generate_uccsd.rst
mindquantum.algorithm.nisq.get_qubit_hamiltonian.rst
mindquantum.algorithm.nisq.get_reference_circuit.rst
mindquantum.algorithm.nisq.quccsd_generator.rst
mindquantum.algorithm.nisq.uccsd0_singlet_generator.rst
mindquantum.algorithm.nisq.uccsd_singlet_generator.rst
mindquantum.algorithm.nisq.uccsd_singlet_get_packed_amplitudes.rst
qaia
mindquantum.algorithm.compiler.rst
mindquantum.algorithm.error_mitigation.rst
mindquantum.algorithm.library.rst
mindquantum.algorithm.mapping.rst
mindquantum.algorithm.nisq.rst
mindquantum.algorithm.qaia.rst
core
device
dtype
engine
framework
io
simulator
utils
mindquantum.algorithm.rst
mindquantum.core.rst
mindquantum.device.rst
mindquantum.dtype.rst
mindquantum.engine.rst
mindquantum.framework.rst
mindquantum.io.rst
mindquantum.simulator.rst
mindquantum.utils.rst
overview.rst
api_python_en
source
CMakeLists.txt
Doxyfile
Makefile
MindQuantum-architecture.png
MindQuantum-architecture_EN.png
README.md
circuit_svg.png
index.html.in
example
mindquantum
mindquantum_config
scripts
tests
third_party
.clang-format
.clangd
.cmake-format.yaml
.codespell.allow
.cppcheck.suppressions
.gitignore
.gitlab-ci.yml
.pre-commit-config-format-gitee.yml
.pre-commit-config-format.yml
.pre-commit-config-gitee.yaml
.pre-commit-config.yaml
.readthedocs.yaml
.whitelizard.txt
.yamllint
CMakeLists.txt
CONTRIBUTING.md
CONTRIBUTING_CN.md
CPPLINT.cfg
INSTALL.md
INSTALL_cn.md
LICENSE
MANIFEST.in
NOTICE
README.md
README_CN.md
RELEASE.md
RELEASE_CN.md
VERSION.txt
build.bat
build.ps1
build.sh
build_locally.bat
build_locally.ps1
build_locally.sh
install_with_docker.md
install_with_docker_en.md
pyproject.toml
requirements.txt
requirements_test.txt
setup.cfg
setup.py
克隆/下载
mindquantum.algorithm.nisq.ansatz_variance.rst 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
donghufeng 提交于 2年前 . re-organize docs

mindquantum.algorithm.nisq.ansatz_variance

.. py:function:: mindquantum.algorithm.nisq.ansatz_variance(ansatz: Circuit, ham: Hamiltonian, focus: str, var_range: typing.Tuple[float, float] = (0, np.pi * 2), other_var: np.array = None, atol: float = 0.1, init_batch: int = 20, sim: typing.Union[Simulator, str] = 'mqvector')

    计算变分量子线路中的某个参数的梯度的方差。

    参数:
        - **ansatz** (:class:`~.core.circuit.Circuit`) - 输入的变分量子线路。
        - **ham** (:class:`~.core.operators.Hamiltonian`) - 输入的可观察量哈密顿量。
        - **focus** (str) - 需要检查哪个参数。
        - **var_range** (Tuple[float, float]) - 参数的随机变化范围。默认值: ``(0, 2*np.pi)``。
        - **other_var** (numpy.array) - 其他变量的数值。如果为 ``None``,则每次采样是都是随机数。默认值: ``None``。
        - **atol** (float) - 方差浮动的容忍度。默认值 ``0.1``。
        - **init_batch** (int) - 初始采样时样本点的个数。默认值: ``20``。
        - **sim** (Union[:class:`~.simulator.Simulator`, str]) - 用哪种模拟器来完成任务。默认值: ``mqvector``。
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindquantum.git
git@gitee.com:mindspore/mindquantum.git
mindspore
mindquantum
mindquantum
r0.10

搜索帮助