├── .clang-format ├── .clangd ├── .cmake-format.yaml ├── .codespell.allow ├── .cppcheck.suppressions ├── .github ├── dependabot.yml └── workflows │ └── ci.yml ├── .gitignore ├── .gitlab-ci.yml ├── .gitlab ├── gen_hashes.sh └── hashes.yml ├── .jenkins ├── check │ └── config │ │ ├── filter_cmakelint.txt │ │ ├── filter_cppcheck.txt │ │ ├── filter_cpplint.txt │ │ ├── filter_linklint.txt │ │ ├── filter_pylint.txt │ │ ├── gen_cppcheck.bash │ │ ├── gen_lizard.bash │ │ └── whitelizard.txt ├── rules │ └── codespell │ │ └── codespell.allow └── test │ └── config │ └── dependent_packages.yaml ├── .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 ├── __init__.py ├── backend.py └── utils.py ├── build.bat ├── build.ps1 ├── build.sh ├── build_locally.bat ├── build_locally.ps1 ├── build_locally.sh ├── ccsrc ├── CMakeLists.txt ├── CPPLINT.cfg ├── include │ ├── CMakeLists.txt │ ├── config │ │ ├── CPPLINT.cfg │ │ ├── common_type.h │ │ ├── complex_cast.h │ │ ├── concepts.h │ │ ├── config.h │ │ ├── constexpr_type_name.h │ │ ├── conversion.h │ │ ├── details │ │ │ ├── CPPLINT.cfg │ │ │ ├── clang_version.h │ │ │ ├── cxx20_compatibility.h │ │ │ └── macros.h │ │ ├── detected.h │ │ ├── format │ │ │ ├── CPPLINT.cfg │ │ │ ├── std_complex.h │ │ │ └── std_optional.h │ │ ├── libc_compat.h │ │ ├── logging.h │ │ ├── openmp.h │ │ ├── parser │ │ │ └── boost_x3_error_handler.h │ │ ├── popcnt.h │ │ ├── real_cast.h │ │ ├── tsl_ordered_map.h │ │ ├── type_promotion.h │ │ └── type_traits.h │ ├── core │ │ ├── CPPLINT.cfg │ │ ├── mq_base_types.h │ │ ├── numba_wrapper.h │ │ ├── sparse │ │ │ ├── algo.h │ │ │ ├── csrhdmatrix.h │ │ │ ├── paulimat.h │ │ │ └── sparse_utils.h │ │ └── utils.h │ ├── device │ │ ├── CPPLINT.cfg │ │ ├── mapping.h │ │ └── topology.h │ ├── math │ │ ├── longbits │ │ │ └── longbits.h │ │ ├── operators │ │ │ ├── CPPLINT.cfg │ │ │ ├── fermion_operator_view.h │ │ │ ├── qubit_operator_view.h │ │ │ ├── sparsing.h │ │ │ ├── transform.h │ │ │ └── utils.h │ │ ├── pr │ │ │ └── parameter_resolver.h │ │ └── tensor │ │ │ ├── csr_matrix.h │ │ │ ├── matrix.h │ │ │ ├── ops.h │ │ │ ├── ops │ │ │ ├── advance_math.h │ │ │ ├── basic_math.h │ │ │ ├── concrete_tensor.h │ │ │ └── memory_operator.h │ │ │ ├── ops_cpu │ │ │ ├── advance_math.h │ │ │ ├── basic_math.h │ │ │ ├── concrete_tensor.h │ │ │ ├── memory_operator.h │ │ │ └── utils.h │ │ │ ├── tensor.h │ │ │ └── traits.h │ ├── ops │ │ ├── basic_gate.h │ │ ├── gate_id.h │ │ ├── gates.h │ │ ├── gates │ │ │ └── traits.h │ │ ├── hamiltonian.h │ │ └── projector.h │ └── simulator │ │ ├── cintrin.h │ │ ├── densitymatrix │ │ ├── densitymatrix_state.h │ │ ├── densitymatrix_state.tpp │ │ └── detail │ │ │ ├── cpu_densitymatrix_arm_double_policy.h │ │ │ ├── cpu_densitymatrix_arm_float_policy.h │ │ │ ├── cpu_densitymatrix_avx_double_policy.h │ │ │ ├── cpu_densitymatrix_avx_float_policy.h │ │ │ └── cpu_densitymatrix_policy.h │ │ ├── stabilizer │ │ ├── query_element.h │ │ ├── random_benchmarking.h │ │ └── stabilizer.h │ │ ├── timer.h │ │ ├── utils.h │ │ └── vector │ │ ├── blas.h │ │ ├── detail │ │ ├── CPPLINT.cfg │ │ ├── cpu_vector_arm_double_policy.h │ │ ├── cpu_vector_arm_float_policy.h │ │ ├── cpu_vector_avx_double_policy.h │ │ ├── cpu_vector_avx_float_policy.h │ │ ├── cpu_vector_policy.h │ │ ├── gpu_vector_double_policy.cuh │ │ ├── gpu_vector_float_policy.cuh │ │ └── gpu_vector_policy.cuh │ │ ├── gradient.h │ │ ├── runtime │ │ ├── cmd.h │ │ ├── rt_gate.h │ │ └── utils.h │ │ ├── vector_state.h │ │ └── vector_state.tpp ├── lib │ ├── CMakeLists.txt │ ├── device │ │ ├── CMakeLists.txt │ │ ├── mapping.cpp │ │ └── topology.cpp │ ├── math │ │ ├── CMakeLists.txt │ │ ├── longbits │ │ │ ├── CMakeLists.txt │ │ │ └── longbits.cpp │ │ ├── operators │ │ │ ├── CMakeLists.txt │ │ │ ├── fermion_operator_view.cpp │ │ │ ├── qubit_operator_view.cpp │ │ │ ├── sparsing.cpp │ │ │ ├── transform │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── bravyi_kitaev.cpp │ │ │ │ ├── bravyi_kitaev_superfast.cpp │ │ │ │ ├── fermion_number_operator.cpp │ │ │ │ ├── jordan_wigner.cpp │ │ │ │ ├── parity.cpp │ │ │ │ ├── ternary_tree.cpp │ │ │ │ └── transform_ladder_operator.cpp │ │ │ └── utils.cpp │ │ ├── pr │ │ │ ├── CMakeLists.txt │ │ │ └── parameter_resolver.cpp │ │ └── tensor │ │ │ ├── CMakeLists.txt │ │ │ ├── csr_matrix.cpp │ │ │ ├── ops │ │ │ ├── CMakeLists.txt │ │ │ ├── advance_math.cpp │ │ │ ├── basic_math.cpp │ │ │ ├── concrete_tensor.cpp │ │ │ └── memory_operator.cpp │ │ │ ├── ops_cpu │ │ │ ├── CMakeLists.txt │ │ │ ├── advance_math.cpp │ │ │ ├── basic_math.cpp │ │ │ ├── concrete_tensor.cpp │ │ │ └── memory_operator.cpp │ │ │ ├── tensor.cpp │ │ │ └── traits.cpp │ ├── mq_base │ │ ├── CMakeLists.txt │ │ ├── gates │ │ │ ├── CPPLINT.cfg │ │ │ └── gates.cpp │ │ ├── libc_compat.cpp │ │ ├── logging.cpp │ │ └── utils.cc │ └── simulator │ │ ├── CMakeLists.txt │ │ ├── densitymatrix │ │ └── detail │ │ │ ├── CMakeLists.txt │ │ │ └── cpu_common │ │ │ ├── CMakeLists.txt │ │ │ ├── cpu_densitymatrix_core_channel.cpp │ │ │ ├── cpu_densitymatrix_core_condition.cpp │ │ │ ├── cpu_densitymatrix_core_gate_expect.cpp │ │ │ ├── cpu_densitymatrix_core_matrix_gate.cpp │ │ │ ├── cpu_densitymatrix_core_other_gate.cpp │ │ │ ├── cpu_densitymatrix_core_policy.cpp │ │ │ ├── cpu_densitymatrix_core_rot_pauli.cpp │ │ │ ├── cpu_densitymatrix_core_swap_like.cpp │ │ │ ├── cpu_densitymatrix_core_utils.cpp │ │ │ ├── cpu_densitymatrix_core_x_like.cpp │ │ │ └── cpu_densitymatrix_core_z_like.cpp │ │ ├── stabilizer │ │ ├── CMakeLists.txt │ │ ├── query_element.cpp │ │ ├── random_benchmarking.cpp │ │ └── stabilizer.cpp │ │ ├── timer.cpp │ │ ├── utils.cpp │ │ └── vector │ │ └── detail │ │ ├── CMakeLists.txt │ │ ├── cpu_avx_double │ │ ├── CMakeLists.txt │ │ ├── cpu_vector_core_gate_expect.cpp │ │ └── cpu_vector_core_matrix_gate.cpp │ │ ├── cpu_common │ │ ├── CMakeLists.txt │ │ ├── CPPLINT.cfg │ │ ├── cpu_vector_core_condition.cpp │ │ ├── cpu_vector_core_dot_like.cpp │ │ ├── cpu_vector_core_gate_expect.cpp │ │ ├── cpu_vector_core_matrix_gate.cpp │ │ ├── cpu_vector_core_other_gate.cpp │ │ ├── cpu_vector_core_policy.cpp │ │ ├── cpu_vector_core_rot_pauli.cpp │ │ ├── cpu_vector_core_swap_like.cpp │ │ ├── cpu_vector_core_x_like.cpp │ │ └── cpu_vector_core_z_like.cpp │ │ ├── gpu │ │ ├── CMakeLists.txt │ │ ├── gpu_vector_core_condition.cu │ │ ├── gpu_vector_core_dot_like.cu │ │ ├── gpu_vector_core_gate_expect.cu │ │ ├── gpu_vector_core_matrix_gate.cu │ │ ├── gpu_vector_core_other_gate.cu │ │ ├── gpu_vector_core_policy.cu │ │ ├── gpu_vector_core_rot_pauli.cu │ │ ├── gpu_vector_core_swap_like.cu │ │ ├── gpu_vector_core_x_like.cu │ │ └── gpu_vector_core_z_like.cu │ │ └── runtime │ │ ├── CMakeLists.txt │ │ ├── cmd.cpp │ │ ├── mqrt.cpp │ │ └── utils.cpp └── python │ ├── CMakeLists.txt │ ├── core │ ├── CMakeLists.txt │ └── include │ │ └── python │ │ └── core │ │ └── sparse │ │ └── csrhdmatrix.h │ ├── device │ ├── CMakeLists.txt │ └── include │ │ └── python │ │ └── device │ │ └── binding.h │ ├── math │ ├── CMakeLists.txt │ ├── include │ │ └── python │ │ │ └── python_tensor.h │ └── lib │ │ └── bind_math.cpp │ ├── mqbackend │ ├── CMakeLists.txt │ ├── include │ │ └── python │ │ │ └── ops │ │ │ ├── basic_gate.h │ │ │ └── build_env.h │ └── lib │ │ ├── CPPLINT.cfg │ │ ├── binding.cc │ │ ├── build_env.cpp │ │ └── logging.cpp │ └── simulator │ ├── CMakeLists.txt │ ├── include │ ├── CMakeLists.txt │ └── python │ │ ├── densitymatrix │ │ └── bind_mat_state.h │ │ └── vector │ │ └── bind_vec_state.h │ └── lib │ ├── _mq_matrix.cpp │ ├── _mq_vector.cpp │ └── _mq_vector_gpu.cu ├── cmake ├── Modules │ ├── CheckCUDASourceCompiles.cmake │ ├── CheckCompilerFlag.cmake │ ├── CheckLanguage.cmake │ ├── CheckLinkerFlag.cmake │ ├── CheckSourceCompilesLocal.cmake │ ├── FindEigen3.cmake │ ├── FindSphinx.cmake │ ├── FindTBB.cmake │ ├── FindTemplate.cmake │ ├── Findabsl.cmake │ ├── Findcereal.cmake │ ├── Findfmt.cmake │ ├── Findgmp.cmake │ ├── Findnlohmann_json.cmake │ ├── Findpybind11.cmake │ ├── Findtweedledum.cmake │ ├── _find_utils_begin.cmake │ ├── _find_utils_end.cmake │ ├── absl │ │ └── 20220623.cmake │ ├── apple │ │ └── FindOpenMP.cmake │ └── try_compile │ │ └── CMakeLists.txt.in ├── NVCXX │ ├── CMakeDetermineNVCXXCompiler.cmake │ ├── CMakeNVCXXCompiler.cmake.in │ ├── CMakeNVCXXCompilerABI.nvcpp │ ├── CMakeNVCXXCompilerId.cpp.in │ ├── CMakeNVCXXInformation.cmake │ ├── CMakeTestNVCXXCompiler.cmake │ └── NVHPC-NVCXX.cmake ├── binscope.cmake ├── cmake_config.h.in ├── cmake_configuration.cmake ├── commands │ ├── _protect_arguments.cmake │ ├── debug_print.cmake │ ├── find_python_module.cmake │ ├── is_language_enabled.cmake │ ├── mq_config_macros.cmake │ ├── mq_link_libraries.cmake │ ├── nvhpc_helpers.cmake │ ├── target_cuda_architectures.cmake │ └── to_cmake_path.cmake ├── compiler_flags.cmake ├── compiler_test.cmake ├── install.cmake ├── lang20_config.h.in.in ├── linker_flags.cmake ├── macros.cmake ├── macros_more.cmake ├── mindquantumConfig.cmake.in ├── mindspore_ci.cmake ├── options.cmake ├── os_detection.cmake └── packages.cmake ├── docs ├── CMakeLists.txt ├── Doxyfile ├── Makefile ├── MindQuantum-architecture.png ├── MindQuantum-architecture_EN.png ├── README.md ├── api_python │ ├── algorithm │ │ ├── compiler │ │ │ ├── mindquantum.algorithm.compiler.BasicCompilerRule.rst │ │ │ ├── mindquantum.algorithm.compiler.BasicDecompose.rst │ │ │ ├── mindquantum.algorithm.compiler.CXToCZ.rst │ │ │ ├── mindquantum.algorithm.compiler.CZBasedChipCompiler.rst │ │ │ ├── mindquantum.algorithm.compiler.CZToCX.rst │ │ │ ├── mindquantum.algorithm.compiler.DAGCircuit.rst │ │ │ ├── mindquantum.algorithm.compiler.DAGNode.rst │ │ │ ├── mindquantum.algorithm.compiler.DAGQubitNode.rst │ │ │ ├── mindquantum.algorithm.compiler.FullyNeighborCanceler.rst │ │ │ ├── mindquantum.algorithm.compiler.GateNode.rst │ │ │ ├── mindquantum.algorithm.compiler.GateReplacer.rst │ │ │ ├── mindquantum.algorithm.compiler.KroneckerSeqCompiler.rst │ │ │ ├── mindquantum.algorithm.compiler.SequentialCompiler.rst │ │ │ ├── mindquantum.algorithm.compiler.SimpleNeighborCanceler.rst │ │ │ ├── mindquantum.algorithm.compiler.abc_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.ccx_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.ch_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.compile_circuit.rst │ │ │ ├── mindquantum.algorithm.compiler.connect_two_node.rst │ │ │ ├── mindquantum.algorithm.compiler.crx_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.crxx_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.cry_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.cryy_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.cs_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.cswap_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.ct_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.cu_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.cy_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.cz_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.euler_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.kak_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.qs_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.rxx_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.ryy_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.rzz_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.swap_decompose.rst │ │ │ ├── mindquantum.algorithm.compiler.tensor_product_decompose.rst │ │ │ └── mindquantum.algorithm.compiler.try_merge.rst │ │ ├── error_mitigation │ │ │ ├── mindquantum.algorithm.error_mitigation.fold_at_random.rst │ │ │ ├── mindquantum.algorithm.error_mitigation.generate_double_qubits_rb_circ.rst │ │ │ ├── mindquantum.algorithm.error_mitigation.generate_single_qubit_rb_circ.rst │ │ │ ├── mindquantum.algorithm.error_mitigation.query_double_qubits_clifford_elem.rst │ │ │ ├── mindquantum.algorithm.error_mitigation.query_single_qubit_clifford_elem.rst │ │ │ └── mindquantum.algorithm.error_mitigation.zne.rst │ │ ├── library │ │ │ ├── mindquantum.algorithm.library.amplitude_encoder.rst │ │ │ ├── mindquantum.algorithm.library.bitphaseflip_operator.rst │ │ │ ├── mindquantum.algorithm.library.general_ghz_state.rst │ │ │ ├── mindquantum.algorithm.library.general_w_state.rst │ │ │ ├── mindquantum.algorithm.library.mat_to_op.rst │ │ │ ├── mindquantum.algorithm.library.qft.rst │ │ │ ├── mindquantum.algorithm.library.qudit_symmetric_decoding.rst │ │ │ ├── mindquantum.algorithm.library.qudit_symmetric_encoding.rst │ │ │ └── mindquantum.algorithm.library.qutrit_symmetric_ansatz.rst │ │ ├── mapping │ │ │ ├── mindquantum.algorithm.mapping.MQSABRE.rst │ │ │ └── mindquantum.algorithm.mapping.SABRE.rst │ │ ├── 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 │ │ ├── nisq │ │ │ ├── ansatz_images │ │ │ │ ├── ASWAP.png │ │ │ │ ├── PCHeaXYZ1F.png │ │ │ │ ├── PCHeaXYZ2F.png │ │ │ │ ├── RYCascade.png │ │ │ │ ├── RYFull.png │ │ │ │ ├── RYLinear.png │ │ │ │ ├── RYRZFull.png │ │ │ │ ├── ansatz1.png │ │ │ │ ├── ansatz10.png │ │ │ │ ├── ansatz11.png │ │ │ │ ├── ansatz12.png │ │ │ │ ├── ansatz13.png │ │ │ │ ├── ansatz14.png │ │ │ │ ├── ansatz15.png │ │ │ │ ├── ansatz16.png │ │ │ │ ├── ansatz17.png │ │ │ │ ├── ansatz18.png │ │ │ │ ├── ansatz19.png │ │ │ │ ├── ansatz2.png │ │ │ │ ├── ansatz3.png │ │ │ │ ├── ansatz4.png │ │ │ │ ├── ansatz5.png │ │ │ │ ├── ansatz6.png │ │ │ │ ├── ansatz7.png │ │ │ │ ├── ansatz8.png │ │ │ │ └── ansatz9.png │ │ │ ├── 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.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.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.qaia.ASB.rst │ │ │ ├── mindquantum.algorithm.qaia.BSB.rst │ │ │ ├── mindquantum.algorithm.qaia.CAC.rst │ │ │ ├── mindquantum.algorithm.qaia.CFC.rst │ │ │ ├── mindquantum.algorithm.qaia.DSB.rst │ │ │ ├── mindquantum.algorithm.qaia.LQA.rst │ │ │ ├── mindquantum.algorithm.qaia.NMFA.rst │ │ │ ├── mindquantum.algorithm.qaia.QAIA.rst │ │ │ ├── mindquantum.algorithm.qaia.SFC.rst │ │ │ └── mindquantum.algorithm.qaia.SimCIM.rst │ ├── core │ │ ├── circuit │ │ │ ├── mindquantum.core.circuit.BitFlipAdder.rst │ │ │ ├── mindquantum.core.circuit.ChannelAdderBase.rst │ │ │ ├── mindquantum.core.circuit.Circuit.rst │ │ │ ├── mindquantum.core.circuit.DepolarizingChannelAdder.rst │ │ │ ├── mindquantum.core.circuit.GateSelector.rst │ │ │ ├── mindquantum.core.circuit.MeasureAccepter.rst │ │ │ ├── mindquantum.core.circuit.MixerAdder.rst │ │ │ ├── mindquantum.core.circuit.NoiseChannelAdder.rst │ │ │ ├── mindquantum.core.circuit.NoiseExcluder.rst │ │ │ ├── mindquantum.core.circuit.QubitIDConstrain.rst │ │ │ ├── mindquantum.core.circuit.QubitNumberConstrain.rst │ │ │ ├── mindquantum.core.circuit.ReverseAdder.rst │ │ │ ├── mindquantum.core.circuit.SequentialAdder.rst │ │ │ ├── mindquantum.core.circuit.SwapParts.rst │ │ │ ├── mindquantum.core.circuit.UN.rst │ │ │ ├── mindquantum.core.circuit.add_prefix.rst │ │ │ ├── mindquantum.core.circuit.add_suffix.rst │ │ │ ├── mindquantum.core.circuit.apply.rst │ │ │ ├── mindquantum.core.circuit.as_ansatz.rst │ │ │ ├── mindquantum.core.circuit.as_encoder.rst │ │ │ ├── mindquantum.core.circuit.change_param_name.rst │ │ │ ├── mindquantum.core.circuit.controlled.rst │ │ │ ├── mindquantum.core.circuit.dagger.rst │ │ │ ├── mindquantum.core.circuit.decompose_single_term_time_evolution.rst │ │ │ ├── mindquantum.core.circuit.partial_psi_partial_psi.rst │ │ │ ├── mindquantum.core.circuit.partial_psi_psi.rst │ │ │ ├── mindquantum.core.circuit.pauli_word_to_circuits.rst │ │ │ ├── mindquantum.core.circuit.qfi.rst │ │ │ └── mindquantum.core.circuit.shift.rst │ │ ├── gates │ │ │ ├── mindquantum.core.gates.AmplitudeDampingChannel.rst │ │ │ ├── mindquantum.core.gates.BarrierGate.rst │ │ │ ├── mindquantum.core.gates.BasicGate.rst │ │ │ ├── mindquantum.core.gates.BitFlipChannel.rst │ │ │ ├── mindquantum.core.gates.BitPhaseFlipChannel.rst │ │ │ ├── mindquantum.core.gates.CNOTGate.rst │ │ │ ├── mindquantum.core.gates.DepolarizingChannel.rst │ │ │ ├── mindquantum.core.gates.FSim.rst │ │ │ ├── mindquantum.core.gates.Givens.rst │ │ │ ├── mindquantum.core.gates.GlobalPhase.rst │ │ │ ├── mindquantum.core.gates.GroupedPauli.rst │ │ │ ├── mindquantum.core.gates.GroupedPauliChannel.rst │ │ │ ├── mindquantum.core.gates.HGate.rst │ │ │ ├── mindquantum.core.gates.IGate.rst │ │ │ ├── mindquantum.core.gates.ISWAPGate.rst │ │ │ ├── mindquantum.core.gates.KrausChannel.rst │ │ │ ├── mindquantum.core.gates.Measure.rst │ │ │ ├── mindquantum.core.gates.MeasureResult.rst │ │ │ ├── mindquantum.core.gates.NoiseGate.rst │ │ │ ├── mindquantum.core.gates.NoneParameterGate.rst │ │ │ ├── mindquantum.core.gates.ParameterGate.rst │ │ │ ├── mindquantum.core.gates.PauliChannel.rst │ │ │ ├── mindquantum.core.gates.PhaseDampingChannel.rst │ │ │ ├── mindquantum.core.gates.PhaseFlipChannel.rst │ │ │ ├── mindquantum.core.gates.PhaseShift.rst │ │ │ ├── mindquantum.core.gates.Power.rst │ │ │ ├── mindquantum.core.gates.QuantumGate.rst │ │ │ ├── mindquantum.core.gates.RX.rst │ │ │ ├── mindquantum.core.gates.RY.rst │ │ │ ├── mindquantum.core.gates.RZ.rst │ │ │ ├── mindquantum.core.gates.Rn.rst │ │ │ ├── mindquantum.core.gates.RotPauliString.rst │ │ │ ├── mindquantum.core.gates.Rxx.rst │ │ │ ├── mindquantum.core.gates.Rxy.rst │ │ │ ├── mindquantum.core.gates.Rxz.rst │ │ │ ├── mindquantum.core.gates.Ryy.rst │ │ │ ├── mindquantum.core.gates.Ryz.rst │ │ │ ├── mindquantum.core.gates.Rzz.rst │ │ │ ├── mindquantum.core.gates.SGate.rst │ │ │ ├── mindquantum.core.gates.SWAPGate.rst │ │ │ ├── mindquantum.core.gates.SWAPalpha.rst │ │ │ ├── mindquantum.core.gates.SXGate.rst │ │ │ ├── mindquantum.core.gates.TGate.rst │ │ │ ├── mindquantum.core.gates.ThermalRelaxationChannel.rst │ │ │ ├── mindquantum.core.gates.U3.rst │ │ │ ├── mindquantum.core.gates.UnivMathGate.rst │ │ │ ├── mindquantum.core.gates.XGate.rst │ │ │ ├── mindquantum.core.gates.YGate.rst │ │ │ ├── mindquantum.core.gates.ZGate.rst │ │ │ └── mindquantum.core.gates.gene_univ_parameterized_gate.rst │ │ ├── mindquantum.core.circuit.rst │ │ ├── mindquantum.core.gates.rst │ │ ├── mindquantum.core.operators.rst │ │ ├── mindquantum.core.parameterresolver.rst │ │ ├── operators │ │ │ ├── mindquantum.core.operators.FermionOperator.rst │ │ │ ├── mindquantum.core.operators.Hamiltonian.rst │ │ │ ├── mindquantum.core.operators.InteractionOperator.rst │ │ │ ├── mindquantum.core.operators.PolynomialTensor.rst │ │ │ ├── mindquantum.core.operators.Projector.rst │ │ │ ├── mindquantum.core.operators.QubitExcitationOperator.rst │ │ │ ├── mindquantum.core.operators.QubitOperator.rst │ │ │ ├── mindquantum.core.operators.TimeEvolution.rst │ │ │ ├── mindquantum.core.operators.commutator.rst │ │ │ ├── mindquantum.core.operators.count_qubits.rst │ │ │ ├── mindquantum.core.operators.down_index.rst │ │ │ ├── mindquantum.core.operators.get_fermion_operator.rst │ │ │ ├── mindquantum.core.operators.ground_state_of_sum_zz.rst │ │ │ ├── mindquantum.core.operators.hermitian_conjugated.rst │ │ │ ├── mindquantum.core.operators.normal_ordered.rst │ │ │ ├── mindquantum.core.operators.number_operator.rst │ │ │ ├── mindquantum.core.operators.sz_operator.rst │ │ │ └── mindquantum.core.operators.up_index.rst │ │ └── parameterresolver │ │ │ ├── mindquantum.core.parameterresolver.PRGenerator.rst │ │ │ └── mindquantum.core.parameterresolver.ParameterResolver.rst │ ├── device │ │ ├── mindquantum.device.GridQubits.rst │ │ ├── mindquantum.device.LinearQubits.rst │ │ ├── mindquantum.device.QubitNode.rst │ │ └── mindquantum.device.QubitsTopology.rst │ ├── dtype │ │ ├── mindquantum.dtype.is_double_precision.rst │ │ ├── mindquantum.dtype.is_same_precision.rst │ │ ├── mindquantum.dtype.is_single_precision.rst │ │ ├── mindquantum.dtype.precision_str.rst │ │ ├── mindquantum.dtype.to_complex_type.rst │ │ ├── mindquantum.dtype.to_double_precision.rst │ │ ├── mindquantum.dtype.to_mq_type.rst │ │ ├── mindquantum.dtype.to_np_type.rst │ │ ├── mindquantum.dtype.to_precision_like.rst │ │ ├── mindquantum.dtype.to_real_type.rst │ │ └── mindquantum.dtype.to_single_precision.rst │ ├── engine │ │ ├── mindquantum.engine.BasicQubit.rst │ │ ├── mindquantum.engine.CircuitEngine.rst │ │ └── mindquantum.engine.circuit_generator.rst │ ├── framework │ │ ├── layer │ │ │ ├── mindquantum.framework.MQAnsatzOnlyLayer.rst │ │ │ ├── mindquantum.framework.MQLayer.rst │ │ │ ├── mindquantum.framework.MQN2AnsatzOnlyLayer.rst │ │ │ ├── mindquantum.framework.MQN2Layer.rst │ │ │ └── mindquantum.framework.QRamVecLayer.rst │ │ └── operations │ │ │ ├── mindquantum.framework.MQAnsatzOnlyOps.rst │ │ │ ├── mindquantum.framework.MQEncoderOnlyOps.rst │ │ │ ├── mindquantum.framework.MQN2AnsatzOnlyOps.rst │ │ │ ├── mindquantum.framework.MQN2EncoderOnlyOps.rst │ │ │ ├── mindquantum.framework.MQN2Ops.rst │ │ │ ├── mindquantum.framework.MQOps.rst │ │ │ └── mindquantum.framework.QRamVecOps.rst │ ├── io │ │ ├── mindquantum.io.BlochScene.rst │ │ ├── mindquantum.io.HiQASM.rst │ │ ├── mindquantum.io.OpenQASM.rst │ │ ├── mindquantum.io.bprint.rst │ │ ├── mindquantum.io.draw_topology.rst │ │ ├── mindquantum.io.draw_topology_plt.rst │ │ └── mindquantum.io.random_hiqasm.rst │ ├── 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 │ ├── simulator │ │ ├── mindquantum.simulator.GradOpsWrapper.rst │ │ ├── mindquantum.simulator.NoiseBackend.rst │ │ ├── mindquantum.simulator.Simulator.rst │ │ ├── mindquantum.simulator.decompose_stabilizer.rst │ │ ├── mindquantum.simulator.fidelity.rst │ │ ├── mindquantum.simulator.get_stabilizer_string.rst │ │ ├── mindquantum.simulator.get_supported_simulator.rst │ │ ├── mindquantum.simulator.get_tableau_string.rst │ │ └── mindquantum.simulator.inner_product.rst │ └── utils │ │ ├── mindquantum.utils.SingleLoopProgress.rst │ │ ├── mindquantum.utils.TwoLoopsProgress.rst │ │ ├── mindquantum.utils.fdopen.rst │ │ ├── mindquantum.utils.ket_string.rst │ │ ├── mindquantum.utils.mod.rst │ │ ├── mindquantum.utils.normalize.rst │ │ ├── mindquantum.utils.random_circuit.rst │ │ ├── mindquantum.utils.random_insert_gates.rst │ │ └── mindquantum.utils.random_state.rst ├── api_python_en │ ├── algorithm │ │ ├── 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 │ │ └── nisq │ │ │ ├── ansatz_images │ │ │ ├── ASWAP.png │ │ │ ├── PCHeaXYZ1F.png │ │ │ ├── PCHeaXYZ2F.png │ │ │ ├── RYCascade.png │ │ │ ├── RYFull.png │ │ │ ├── RYLinear.png │ │ │ ├── RYRZFull.png │ │ │ ├── ansatz1.png │ │ │ ├── ansatz10.png │ │ │ ├── ansatz11.png │ │ │ ├── ansatz12.png │ │ │ ├── ansatz13.png │ │ │ ├── ansatz14.png │ │ │ ├── ansatz15.png │ │ │ ├── ansatz16.png │ │ │ ├── ansatz17.png │ │ │ ├── ansatz18.png │ │ │ ├── ansatz19.png │ │ │ ├── ansatz2.png │ │ │ ├── ansatz3.png │ │ │ ├── ansatz4.png │ │ │ ├── ansatz5.png │ │ │ ├── ansatz6.png │ │ │ ├── ansatz7.png │ │ │ ├── ansatz8.png │ │ │ └── ansatz9.png │ │ │ ├── mindquantum.algorithm.nisq.ASWAP.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.PCHeaXYZ1F.rst │ │ │ ├── mindquantum.algorithm.nisq.PCHeaXYZ2F.rst │ │ │ ├── mindquantum.algorithm.nisq.RYCascade.rst │ │ │ ├── mindquantum.algorithm.nisq.RYFull.rst │ │ │ ├── mindquantum.algorithm.nisq.RYLinear.rst │ │ │ └── mindquantum.algorithm.nisq.RYRZFull.rst │ ├── core │ │ ├── mindquantum.core.circuit.rst │ │ ├── mindquantum.core.gates.rst │ │ ├── mindquantum.core.operators.rst │ │ └── mindquantum.core.parameterresolver.rst │ ├── 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 ├── circuit_svg.png ├── index.html.in └── source │ ├── api.rst │ ├── api │ ├── cxx.rst │ └── python.rst │ ├── cmake_reference.rst │ ├── conf.py │ ├── index.rst │ ├── installation.rst │ └── tutorial.md ├── install_with_docker.md ├── install_with_docker_en.md ├── mindquantum ├── __init__.py ├── __main__.py ├── algorithm │ ├── __init__.py │ ├── compiler │ │ ├── __init__.py │ │ ├── dag │ │ │ ├── __init__.py │ │ │ └── dag.py │ │ ├── decompose │ │ │ ├── __init__.py │ │ │ ├── fixed_decompose │ │ │ │ ├── __init__.py │ │ │ │ ├── h_related.py │ │ │ │ ├── rx_related.py │ │ │ │ ├── rxx_related.py │ │ │ │ ├── ry_related.py │ │ │ │ ├── ryy_related.py │ │ │ │ ├── rz_related.py │ │ │ │ ├── rzz_related.py │ │ │ │ ├── s_related.py │ │ │ │ ├── swap_related.py │ │ │ │ ├── t_related.py │ │ │ │ ├── x_related.py │ │ │ │ ├── y_related.py │ │ │ │ └── z_related.py │ │ │ ├── universal_decompose │ │ │ │ ├── __init__.py │ │ │ │ ├── one_qubit_decompose.py │ │ │ │ ├── qs_and_cu_decompose.py │ │ │ │ └── two_qubit_decompose.py │ │ │ └── utils.py │ │ └── rules │ │ │ ├── __init__.py │ │ │ ├── basic_decompose.py │ │ │ ├── basic_rule.py │ │ │ ├── compiler_logger.py │ │ │ ├── device_based.py │ │ │ ├── gate_replacer.py │ │ │ └── neighbor_canceler.py │ ├── error_mitigation │ │ ├── __init__.py │ │ ├── folding_circuit.py │ │ ├── mitigation.py │ │ └── random_benchmarking.py │ ├── library │ │ ├── __init__.py │ │ ├── amplitude_encoder.py │ │ ├── bitphaseflip_operator.py │ │ ├── general_ghz_state.py │ │ ├── general_w_state.py │ │ ├── quantum_fourier.py │ │ └── qudit_mapping.py │ ├── mapping │ │ ├── __init__.py │ │ ├── mq_sabre.py │ │ └── sabre.py │ ├── nisq │ │ ├── __init__.py │ │ ├── _ansatz.py │ │ ├── barren_plateau.py │ │ ├── chem │ │ │ ├── __init__.py │ │ │ ├── hardware_efficient_ansatz.py │ │ │ ├── more_hardware_efficient_ansatz.py │ │ │ ├── qubit_hamiltonian.py │ │ │ ├── qubit_ucc_ansatz.py │ │ │ ├── quccsd.py │ │ │ ├── reference_state.py │ │ │ ├── transform.py │ │ │ ├── uccsd.py │ │ │ ├── uccsd0.py │ │ │ └── unitary_cc.py │ │ ├── qaoa │ │ │ ├── __init__.py │ │ │ ├── max_2_sat_ansatz.py │ │ │ ├── max_cut_ansatz.py │ │ │ ├── max_cut_rqaoa_ansatz.py │ │ │ ├── qaoa_ansatz.py │ │ │ └── rqaoa_ansatz.py │ │ └── qnn │ │ │ ├── __init__.py │ │ │ ├── arxiv_1905_10876.py │ │ │ ├── iqp_encoding.py │ │ │ └── strongly_entangling.py │ └── qaia │ │ ├── CAC.py │ │ ├── CFC.py │ │ ├── LQA.py │ │ ├── NMFA.py │ │ ├── QAIA.py │ │ ├── SB.py │ │ ├── SFC.py │ │ ├── SimCIM.py │ │ └── __init__.py ├── config │ ├── __init__.py │ └── config.py ├── core │ ├── __init__.py │ ├── circuit │ │ ├── __init__.py │ │ ├── channel_adder.py │ │ ├── circuit.py │ │ ├── module_circuit.py │ │ ├── qfi.py │ │ └── utils.py │ ├── gates │ │ ├── __init__.py │ │ ├── basic.py │ │ ├── basicgate.py │ │ ├── channel.py │ │ └── measurement.py │ ├── operators │ │ ├── __init__.py │ │ ├── _base_operator.py │ │ ├── _term_value.py │ │ ├── fermion_operator.py │ │ ├── hamiltonian.py │ │ ├── polynomial_tensor.py │ │ ├── projector.py │ │ ├── qubit_excitation_operator.py │ │ ├── qubit_operator.py │ │ ├── time_evolution.py │ │ └── utils.py │ ├── parameterresolver │ │ ├── __init__.py │ │ ├── parameterresolver.py │ │ └── pr_generator.py │ └── third_party │ │ └── __init__.py ├── device │ ├── __init__.py │ ├── chip.py │ ├── topology.py │ └── vigo_property.py ├── dtype │ ├── __init__.py │ └── dtype.py ├── engine │ ├── __init__.py │ └── circuitengine.py ├── framework │ ├── __init__.py │ ├── layer.py │ └── operations.py ├── io │ ├── __init__.py │ ├── beauty_print.py │ ├── display │ │ ├── __init__.py │ │ ├── _config.py │ │ ├── bloch_plt_drawer.py │ │ ├── circuit_svg_drawer.py │ │ ├── circuit_text_drawer.py │ │ ├── circuit_text_drawer_helper.py │ │ ├── measure_res_drawer.py │ │ ├── measure_res_svg_drawer.py │ │ └── topology_drawer.py │ └── qasm │ │ ├── __init__.py │ │ ├── hiqasm.py │ │ └── openqasm.py ├── simulator │ ├── __init__.py │ ├── available_simulator.py │ ├── backend_base.py │ ├── mq_blas.py │ ├── mqsim.py │ ├── noise.py │ ├── simulator.py │ ├── stabilizer.py │ └── utils.py ├── third_party │ ├── __init__.py │ ├── interaction_operator.py │ └── unitary_cc.py └── utils │ ├── __init__.py │ ├── error.py │ ├── f.py │ ├── fdopen.py │ ├── progress.py │ ├── quantifiers.py │ ├── show_info.py │ ├── string_utils.py │ └── type_value_check.py ├── mindquantum_config ├── __init__.py └── __main__.py ├── pyproject.toml ├── requirements.txt ├── requirements_test.txt ├── scripts ├── add_div_for_svg.py ├── bash_compat.sh ├── build │ ├── ci_windows_build.bat │ ├── common_functions.ps1 │ ├── common_functions.sh │ ├── default_values.bat │ ├── default_values.conf │ ├── default_values.ps1 │ ├── default_values.sh │ ├── dos │ │ ├── build_cmake_option.bat │ │ ├── build_locally_cmake_option.bat │ │ ├── call_cmd.bat │ │ └── debug_print.bat │ ├── locate_cmake.bat │ ├── locate_cmake.ps1 │ ├── locate_cmake.sh │ ├── locate_ninja.bat │ ├── locate_ninja.ps1 │ ├── locate_ninja.sh │ ├── locate_python3.bat │ ├── locate_python3.ps1 │ ├── locate_python3.sh │ ├── parse_common_args.ps1 │ ├── parse_common_args.sh │ ├── python_virtualenv_activate.bat │ ├── python_virtualenv_activate.ps1 │ ├── python_virtualenv_activate.sh │ ├── python_virtualenv_update.bat │ ├── python_virtualenv_update.ps1 │ ├── python_virtualenv_update.sh │ └── unset_values.bat ├── cmake │ └── update_cmake_pkg_hashes.cmake ├── generate_vscode_snippets.py ├── macos_delocate.sh ├── parse_ini.ps1 ├── parse_ini.sh ├── parse_toml.ps1 ├── parse_toml.sh ├── update_cmake_pkg_hashes.sh └── update_precommit.sh ├── setup.cfg ├── setup.py ├── tests ├── CMakeLists.txt ├── CPPLINT.cfg ├── README.md ├── cmake-ldtest │ ├── .gitignore │ ├── CMakeLists.txt.in │ ├── CPPLINT.cfg │ ├── shared_lib.cpp │ ├── shared_lib.h │ └── shared_test.cpp ├── config │ ├── CMakeLists.txt │ ├── test_common_type.cpp │ └── test_constexpr_type_name.cpp ├── quick_test.py ├── st │ ├── G1.txt │ ├── H4.hdf5 │ ├── LiH.hdf5 │ ├── __init__.py │ ├── conftest.py │ ├── runtest.sh │ ├── test_algorithm │ │ ├── test_bp.py │ │ ├── test_compiler │ │ │ ├── test_dag │ │ │ │ └── test_dag.py │ │ │ ├── test_decompose │ │ │ │ ├── test_fixed_decompose │ │ │ │ │ ├── test_h_decompose.py │ │ │ │ │ ├── test_rx_decompose.py │ │ │ │ │ ├── test_rxx_decompose.py │ │ │ │ │ ├── test_ry_decompose.py │ │ │ │ │ ├── test_ryy_decompose.py │ │ │ │ │ ├── test_rz_decompose.py │ │ │ │ │ ├── test_rzz_decompose.py │ │ │ │ │ ├── test_s_decompose.py │ │ │ │ │ ├── test_swap_decompose.py │ │ │ │ │ ├── test_t_decompose.py │ │ │ │ │ ├── test_x_decompose.py │ │ │ │ │ ├── test_y_decompose.py │ │ │ │ │ └── test_z_decompose.py │ │ │ │ └── test_universal_decompose │ │ │ │ │ ├── test_basic_decompose.py │ │ │ │ │ └── test_qs_decompose.py │ │ │ └── test_rules │ │ │ │ └── test_rules.py │ │ ├── test_error_mitigation │ │ │ ├── test_folding.py │ │ │ ├── test_random_benchmarking.py │ │ │ └── test_zne.py │ │ ├── test_library │ │ │ ├── test_amplitude_encoder.py │ │ │ ├── test_bitphaseflip_operator.py │ │ │ ├── test_ghz_state.py │ │ │ ├── test_qudit_mapping.py │ │ │ └── test_w_state.py │ │ ├── test_nisq │ │ │ ├── test_chem │ │ │ │ ├── test_hardware_efficient.py │ │ │ │ ├── test_qubit_ucc.py │ │ │ │ ├── test_quccsd.py │ │ │ │ ├── test_transforms.py │ │ │ │ ├── test_ucc.py │ │ │ │ ├── test_uccsd.py │ │ │ │ └── test_uccsd0.py │ │ │ ├── test_qaoa │ │ │ │ ├── test_max_2_sat.py │ │ │ │ └── test_max_cut.py │ │ │ └── test_qnn │ │ │ │ ├── test_arxiv_ansatz.py │ │ │ │ ├── test_hardware_efficient_ansatz.py │ │ │ │ ├── test_iqp_encoding.py │ │ │ │ └── test_strongly_entangling.py │ │ └── test_qaia │ │ │ └── test_qaia.py │ ├── test_applications │ │ └── test_chem_net.py │ ├── test_core │ │ ├── test_circuit │ │ │ ├── test_channel_adder.py │ │ │ ├── test_circuit.py │ │ │ ├── test_circuit_utils.py │ │ │ ├── test_module_circuit.py │ │ │ └── test_qfi.py │ │ ├── test_gates │ │ │ ├── test_channel.py │ │ │ └── test_gate.py │ │ ├── test_operators │ │ │ ├── test_fermion_ops.py │ │ │ ├── test_hamiltonian.py │ │ │ ├── test_operators_utils.py │ │ │ ├── test_polynomial_tensor.py │ │ │ ├── test_qubit_excitation_ops.py │ │ │ ├── test_qubit_ops.py │ │ │ ├── test_sparse.py │ │ │ └── test_time_evolution.py │ │ └── test_parameterresolver │ │ │ └── test_parameter_resolver.py │ ├── test_device │ │ └── test_topology.py │ ├── test_dtype │ │ └── test_dtype.py │ ├── test_engine │ │ └── test_circuitengine.py │ ├── test_framework │ │ ├── test_layer.py │ │ └── test_operations.py │ ├── test_io │ │ ├── test_beauty_print.py │ │ ├── test_qasm │ │ │ ├── test_hiqasm.py │ │ │ └── test_openqasm.py │ │ └── test_svg.py │ ├── test_simulator │ │ ├── test_basic_gate_with_simulator.py │ │ ├── test_channel_with_simulator.py │ │ ├── test_method_of_mqmatrix.py │ │ ├── test_method_of_mqvector.py │ │ ├── test_simulator.py │ │ └── test_stabilizer.py │ └── test_utils │ │ └── test_f.py ├── ut │ ├── __init__.py │ ├── runtest.sh │ └── test_mindquantum.py └── utils │ ├── CMakeLists.txt │ ├── catch2_main.cpp │ └── mindquantum │ └── catch2 │ ├── catch2_fmt_formatter.h │ └── complex.h └── third_party ├── CMakeLists.txt ├── abseil_cpp └── abseil_cpp.cmake ├── catch2 ├── catch2.cmake └── patch │ └── windows-fix-strnlen.patch001 ├── cereal └── cereal.cmake ├── cmake ├── external_targets.cmake ├── mindquantumTargetsExternal.cmake.in ├── modules │ └── Findm4.cmake └── utils.cmake ├── eigen3 └── eigen3.cmake ├── fmt └── fmt.cmake ├── gmp └── gmp.cmake ├── lru_cache ├── lru_cache.cmake └── patch │ ├── fix-memory-leak-node-deletion-callback.patch001 │ └── optional-abseil-dependency.patch002 ├── nlohmann_json └── nlohmann_json.cmake ├── pybind11 └── pybind11.cmake └── spdlog └── spdlog.cmake /.clangd: -------------------------------------------------------------------------------- 1 | CompileFlags: 2 | Remove: [--generate-code*, -forward-unknown-to-host-compiler, --extended-lambda] 3 | Diagnostics: 4 | Suppress: pp_including_mainfile_in_preamble 5 | -------------------------------------------------------------------------------- /.codespell.allow: -------------------------------------------------------------------------------- 1 | Aline 2 | ApplyS 3 | TBE 4 | ans 5 | claus 6 | crate 7 | dout 8 | followings 9 | functionAble 10 | imBED 11 | ket 12 | lamda 13 | nd 14 | noe 15 | noone 16 | outputOf 17 | rouge 18 | tbe 19 | te 20 | eles 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: 2 4 | updates: 5 | - package-ecosystem: "github-actions" 6 | directory: "/" 7 | schedule: 8 | interval: "weekly" 9 | ignore: 10 | # Optional: Official actions have moving tags like v1; 11 | # if you use those, you don't need updates. 12 | - dependency-name: "actions/*" 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Python temp files 2 | *.coverage 3 | *.pdb 4 | *.pyc 5 | *.pyd 6 | *.pyd.manifest 7 | .eggs 8 | .ipynb_checkpoints 9 | requirements.txt 10 | 11 | # Python temp directories 12 | *.egg-info/ 13 | .pytest_cache/ 14 | __pycache__/ 15 | 16 | # Local editor config 17 | /.idea 18 | /.vscode 19 | 20 | # Binary files 21 | *.dll 22 | *.dylib 23 | *.gch 24 | *.o 25 | *.out 26 | *.so 27 | *.so.* 28 | 29 | # Python venv 30 | /venv/ 31 | 32 | # Local build directories 33 | /build/ 34 | /clang*/ 35 | /cmake-build-debug/ 36 | /docs/build/ 37 | /gcc*/ 38 | /install/ 39 | /ninja/ 40 | 41 | # Temp or local directories 42 | /.cache 43 | /dist/ 44 | /docs/doxygen 45 | /local_script/ 46 | /output/ 47 | /tmp/ 48 | Testing/ 49 | somas_meta/ 50 | stat/ 51 | 52 | # Misc. temp or local files 53 | /.dir-locals.el 54 | /analyze_fail.dat 55 | /build.conf 56 | /settings.json 57 | /test*.* 58 | /tmp* 59 | 60 | # macOS temp files 61 | **/.DS_Store 62 | -------------------------------------------------------------------------------- /.gitlab/hashes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | variables: 4 | BUILD_SCRIPT_HASH: 0a762caaa3b4270fa2794a181510dfb9 5 | THIRD_PARTY_HASH: 2f4ec0f22dff88d3793d6446679353e1 6 | OVERALL_HASH: 5c1bee8d3a39793965b6965e5adc7afc 7 | -------------------------------------------------------------------------------- /.jenkins/check/config/filter_cmakelint.txt: -------------------------------------------------------------------------------- 1 | # MindQuantum 2 | "mindquantum/cmake" "whitespace/indent" 3 | "mindquantum/cmake/Modules" "whitespace/indent" 4 | "mindquantum/cmake/Modules/apple" "whitespace/indent" 5 | "mindquantum/ccsrc/lib/simulator/stabilizer/CMakeLists.txt" "whitespace/indent" 6 | -------------------------------------------------------------------------------- /.jenkins/check/config/filter_linklint.txt: -------------------------------------------------------------------------------- 1 | https://apt.repos.intel.com/oneapi 2 | https://github.com/Kitware/CMake/releases/download 3 | https://github.com/ccache/ccache/releases/download/ 4 | https://github.com/ccache/ccache/releases/download/v 5 | https://mirror.baidu.com/pypi/simple 6 | -------------------------------------------------------------------------------- /.jenkins/check/config/gen_lizard.bash: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | BASEPATH=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd ) 4 | 5 | # ============================================================================== 6 | 7 | SRC_FILE="$BASEPATH/../../../.whitelizard.txt" 8 | DST_FILE="$BASEPATH/whitelizard.txt" 9 | 10 | # ------------------------------------------------------------------------------ 11 | 12 | while read -r line; do 13 | if [ -z "$line" ]; then 14 | echo '' 15 | elif [[ "$line" =~ ^#.* ]]; then 16 | echo "$line" 17 | elif [[ "$line" =~ ^(mindquantum|ccsrc|tests)/(.*) ]]; then 18 | printf "mindquantum/%s/%s\n" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" 19 | else 20 | echo "$line" 21 | fi 22 | done < "$SRC_FILE" > "$DST_FILE" 23 | 24 | # ============================================================================== 25 | -------------------------------------------------------------------------------- /.jenkins/rules/codespell/codespell.allow: -------------------------------------------------------------------------------- 1 | Aline 2 | ApplyS 3 | TBE 4 | ans 5 | claus 6 | crate 7 | dout 8 | followings 9 | functionAble 10 | imBED 11 | ket 12 | lamda 13 | nd 14 | noe 15 | noone 16 | outputOf 17 | rouge 18 | tbe 19 | te 20 | -------------------------------------------------------------------------------- /.jenkins/test/config/dependent_packages.yaml: -------------------------------------------------------------------------------- 1 | mindspore: 2 | 'mindspore/mindspore/version/202307/20230706/master_20230706194236_f2e810137f8702a39fa6d3920515edf9a0776980/' 3 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # .readthedocs.yaml 4 | # Read the Docs configuration file 5 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 6 | 7 | # Required 8 | version: 2 9 | 10 | sphinx: 11 | configuration: docs/source/conf.py 12 | 13 | formats: all 14 | 15 | python: 16 | version: 3.8 17 | install: 18 | - method: pip 19 | path: . 20 | extra_requirements: 21 | - docs 22 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | extends: default 4 | 5 | rules: 6 | line-length: 7 | max: 120 8 | level: error 9 | -------------------------------------------------------------------------------- /CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | set noparent 2 | root=ccsrc/ 3 | headers=cuh,h,h++,hh,hpp,hxx,tpp 4 | linelength=120 5 | filter=-build/header_guard,-build/c++11 6 | exclude_files=build/*|venv/* 7 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt 2 | include NOTICE 3 | 4 | recursive-include _build *.py 5 | recursive-include cmake *.cmake 6 | recursive-include tests *.txt* *.py *.hpp *.cpp *.hdf5 *.sh 7 | recursive-include third_party *.patch* 8 | recursive-include mindquantum *.txt *.h *.hpp *.cc *.cpp 9 | 10 | 11 | exclude .clang-format *.yaml *.allow *.bat *.md *.sh *.suppressions 12 | prune docs 13 | prune .jenkins 14 | prune tutorials 15 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | MindSpore MindQuantum 2 | Copyright 2019-2021 Huawei Technologies Co., Ltd 3 | -------------------------------------------------------------------------------- /VERSION.txt: -------------------------------------------------------------------------------- 1 | 0.10.0 2 | -------------------------------------------------------------------------------- /_build/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /ccsrc/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-build/include_subdir,-build/include_order,-readability/nolint 2 | -------------------------------------------------------------------------------- /ccsrc/include/config/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-whitespace/braces,-runtime/references 2 | -------------------------------------------------------------------------------- /ccsrc/include/config/details/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-readability/braces 2 | -------------------------------------------------------------------------------- /ccsrc/include/config/format/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-runtime/references 2 | -------------------------------------------------------------------------------- /ccsrc/include/core/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-build/include 2 | -------------------------------------------------------------------------------- /ccsrc/include/device/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-runtime/references 2 | -------------------------------------------------------------------------------- /ccsrc/include/math/operators/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-runtime/references 2 | -------------------------------------------------------------------------------- /ccsrc/include/simulator/vector/detail/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-runtime/reference 2 | -------------------------------------------------------------------------------- /ccsrc/lib/math/longbits/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================== 2 | # 3 | # Copyright 2023 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # ============================================================================== 18 | # lint_cmake: -whitespace/indent 19 | 20 | target_sources(mq_math PRIVATE ${CMAKE_CURRENT_LIST_DIR}/longbits.cpp) 21 | -------------------------------------------------------------------------------- /ccsrc/lib/math/pr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================== 2 | # 3 | # Copyright 2023 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # ============================================================================== 18 | 19 | target_sources(mq_math PRIVATE ${CMAKE_CURRENT_LIST_DIR}/parameter_resolver.cpp) 20 | -------------------------------------------------------------------------------- /ccsrc/lib/mq_base/gates/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-build/namespaces 2 | -------------------------------------------------------------------------------- /ccsrc/lib/simulator/vector/detail/cpu_common/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-runtime/reference 2 | -------------------------------------------------------------------------------- /ccsrc/python/mqbackend/lib/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-build/namespaces_literals,-runtime/references 2 | -------------------------------------------------------------------------------- /ccsrc/python/simulator/lib/_mq_vector_gpu.cu: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #define _mq_vector _mq_vector_gpu 18 | 19 | #include "_mq_vector.cpp" // NOLINT 20 | -------------------------------------------------------------------------------- /cmake/cmake_config.h.in: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef CMAKE_CONFIG_HPP_IN 18 | #define CMAKE_CONFIG_HPP_IN 19 | 20 | #define VERSION_INFO @VERSION_INFO @ 21 | 22 | #cmakedefine01 MQ_HAS_ABSEIL_CPP 23 | 24 | #cmakedefine01 MQ_HAS_LONG_DOUBLE 25 | 26 | #endif /* CMAKE_CONFIG_HPP_IN */ 27 | -------------------------------------------------------------------------------- /cmake/commands/_protect_arguments.cmake: -------------------------------------------------------------------------------- 1 | include_guard() 2 | 3 | # ~~~ 4 | # Protect each element of list against expansion by using [==[${el}]==] 5 | # 6 | # _protect_arguments() 7 | # ~~~ 8 | macro(_protect_arguments name) 9 | set(_tmp ${${name}}) 10 | set(${name}) 11 | foreach(_el ${_tmp}) 12 | list(APPEND ${name} "[==[${_el}]==]") 13 | endforeach() 14 | unset(_tmp) 15 | endmacro() 16 | -------------------------------------------------------------------------------- /docs/MindQuantum-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/MindQuantum-architecture.png -------------------------------------------------------------------------------- /docs/MindQuantum-architecture_EN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/MindQuantum-architecture_EN.png -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # MindQuantum 中文英文文档编写注意事项 2 | 3 | 需翻译专业词汇 4 | 5 | |English|中文| 6 | |-|-| 7 | |Hermitian|厄米| 8 | |Hermitian conjugate|厄米共轭| 9 | |Qubit|量子比特| 10 | |Quantum Circuit|量子线路| 11 | |Hamiltonian|哈密顿量| 12 | |Fermion|费米子| 13 | |Pauli|泡利算符| 14 | |Pauli word|泡利词| 15 | |Pauli string|泡利句| 16 | 17 | 可以不翻译的词汇 18 | 19 | |英文词汇| 20 | |-| 21 | |ansatz| 22 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.BasicDecompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.BasicDecompose 2 | ============================================= 3 | 4 | .. py:class:: mindquantum.algorithm.compiler.BasicDecompose(prefer_u3=False) 5 | 6 | 将量子线路编译成简单的量子门。 7 | 8 | 本编译规则可编译多控制的量子门、自定义量子门和多泡利旋转门。 9 | 10 | 参数: 11 | - **prefer_u3** (bool) - 是否优先选择 :class:`~.core.gates.U3` 来进行分解。默认值: ``False``。 12 | 13 | .. py:method:: do(dag_circuit: DAGCircuit) 14 | 15 | 原位的将该多控制和自定义量子门编译规则运用到 :class:`~.algorithm.compiler.DAGCircuit` 上。 16 | 17 | 参数: 18 | - **dag_circuit** (:class:`~.algorithm.compiler.DAGCircuit`) - 量子线路的 DAG 图。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.CXToCZ.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.CXToCZ 2 | ===================================== 3 | 4 | .. py:class:: mindquantum.algorithm.compiler.CXToCZ() 5 | 6 | 将 ``cx`` 门编译为 ``cz`` 门。 7 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.CZBasedChipCompiler.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.CZBasedChipCompiler 2 | ================================================== 3 | 4 | .. py:class:: mindquantum.algorithm.compiler.CZBasedChipCompiler(log_level=0) 5 | 6 | 适用于支持 `cz` 量子门的量子芯片的编译规则。 7 | 8 | 参数: 9 | - **log_level** (int) - log信息展示级别。可以为 ``0`` 、 ``1`` 或者 ``2`` 。默认值: ``0`` 。关于log级别的更多信息,请参考 :class:`~.algorithm.compiler.BasicCompilerRule` 。 10 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.CZToCX.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.CZToCX 2 | ===================================== 3 | 4 | .. py:class:: mindquantum.algorithm.compiler.CZToCX() 5 | 6 | 将 ``cz`` 门编译为 ``cx`` 门。 7 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.DAGNode.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.DAGNode 2 | ====================================== 3 | 4 | .. py:class:: mindquantum.algorithm.compiler.DAGNode() 5 | 6 | DAG 图中的节点。 7 | 8 | 一个 DAG 图节点由局域腿标签、子节点和父节点构成。 9 | 10 | .. py:method:: clean() 11 | 12 | 清除节点,将节点中的信息删除。 13 | 14 | .. py:method:: insert_after(other_node: "DAGNode") 15 | 16 | 将其他节点插入到本节点后面。 17 | 18 | 参数: 19 | - **other_node** (:class:`~.algorithm.compiler.DAGNode`) - 另外一个 DAG 节点。 20 | 21 | .. py:method:: insert_before(other_node: "DAGNode") 22 | 23 | 将其他节点插入到本节点前面。 24 | 25 | 参数: 26 | - **other_node** (:class:`~.algorithm.compiler.DAGNode`) - 另外一个 DAG 节点。 27 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.DAGQubitNode.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.DAGQubitNode 2 | =========================================== 3 | 4 | .. py:class:: mindquantum.algorithm.compiler.DAGQubitNode(qubit: int) 5 | 6 | DAG 图中作为量子比特的节点。 7 | 8 | 参数: 9 | - **qubit** (int) - 量子比特的编号。 10 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.FullyNeighborCanceler.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.FullyNeighborCanceler 2 | ==================================================== 3 | 4 | .. py:class:: mindquantum.algorithm.compiler.FullyNeighborCanceler() 5 | 6 | 全量线路融合规则,会融合可能的临近量子门,直到不能融合为止。 7 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.GateNode.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.GateNode 2 | ======================================= 3 | 4 | .. py:class:: mindquantum.algorithm.compiler.GateNode(gate: gates.BasicGate) 5 | 6 | DAG 图中作为量子门的节点。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.BasicGate`) - 量子门。 10 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.GateReplacer.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.GateReplacer 2 | =========================================== 3 | 4 | .. py:class:: mindquantum.algorithm.compiler.GateReplacer(ori_example_gate: BasicGate, wanted_example_circ: Circuit) 5 | 6 | 将给定的量子门替换成给定的量子线路。 7 | 8 | 参数: 9 | - **ori_example_gate** (:class:`~.core.gates.BasicGate`) - 想要替换的量子门。请注意,相同类型且拥有相同个数的作用为和控制为的量子门会被替换。 10 | - **wanted_example_circ** (:class:`~.core.circuit.Circuit`) - 想要的量子线路。 11 | 12 | .. py:method:: do(dag_circuit: DAGCircuit) 13 | 14 | 执行门替换规则。 15 | 16 | 参数: 17 | - **dag_circuit** (:class:`~.algorithm.compiler.DAGCircuit`) - 想要编译的量子线路的 DAG 图。 18 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.SimpleNeighborCanceler.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.SimpleNeighborCanceler 2 | ===================================================== 3 | 4 | .. py:class:: mindquantum.algorithm.compiler.SimpleNeighborCanceler() 5 | 6 | 如果可能,该编译规则会融合临近的量子门。 7 | 8 | .. py:method:: do(dag_circuit: DAGCircuit) 9 | 10 | 原位的将该编译规则运用到 :class:`~.algorithm.compiler.DAGCircuit` 上。 11 | 12 | 参数: 13 | - **dag_circuit** (:class:`~.algorithm.compiler.DAGCircuit`) - 想要编译的量子线路。 14 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.abc_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.abc_decompose 2 | ============================================ 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.abc_decompose(gate: QuantumGate, return_u3: bool = True) 5 | 6 | 通过abc分解来分解量子门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.QuantumGate`) - 只有一个控制为的单比特量子门。 10 | - **return_u3** (bool) - 如果为 ``True``,则返回 :class:`~.core.gates.U3` 形式的分解,否则返回 :class:`~.core.gates.UnivMathGate` 形式的分解。默认值: ``True``。 11 | 12 | 返回: 13 | :class:`~.core.circuit.Circuit`,由单比特门和CNOT门构成的量子线路。 14 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.ccx_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.ccx_decompose 2 | ============================================ 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.ccx_decompose(gate: gates.XGate) 5 | 6 | 分解一个 `toffoli` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.XGate`) - 一个有两个控制位的 :class:`~.core.gates.XGate` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.ch_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.ch_decompose 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.ch_decompose(gate: gates.HGate) 5 | 6 | 分解一个受控的 :class:`~.core.gates.HGate` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.HGate`) - 有一个控制位的 :class:`~.core.gates.HGate` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.compile_circuit.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.compile_circuit 2 | ============================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.compile_circuit(compiler: BasicCompilerRule, circ: Circuit) 5 | 6 | 直接根据给定的编译规则,编译一个量子线路。 7 | 8 | 参数: 9 | - **compiler** (:class:`~.algorithm.compiler.BasicCompilerRule`) - 编译规则。 10 | - **circ** (:class:`~.core.circuit.Circuit`) - 想要编译的量子线路。 11 | 12 | 返回: 13 | :class:`~.core.circuit.Circuit`,编译后的量子线路。 14 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.connect_two_node.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.connect_two_node 2 | =============================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.connect_two_node(father_node: DAGNode, child_node: DAGNode, local_index: int) 5 | 6 | 通过局域的腿编号,将两个节点连接起来。 7 | 8 | 参数: 9 | - **father_node** (:class:`~.algorithm.compiler.DAGNode`) - 父 DAG 节点。 10 | - **child_node** (:class:`~.algorithm.compiler.DAGNode`) - 子 DAG 节点。 11 | - **local_index** (int) - 想要连接的腿的编号。 12 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.crx_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.crx_decompose 2 | ============================================ 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.crx_decompose(gate: gates.RX) 5 | 6 | 分解一个受控的 :class:`~.core.gates.RX` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.RX`) - 有一个控制位的 :class:`~.core.gates.RX` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.crxx_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.crxx_decompose 2 | ============================================= 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.crxx_decompose(gate: gates.Rxx) 5 | 6 | 分解一个受控的 :class:`~.core.gates.Rxx` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.Rxx`) - 有一个控制位的 :class:`~.core.gates.Rxx` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.cry_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.cry_decompose 2 | ============================================ 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.cry_decompose(gate: gates.RY) 5 | 6 | 分解一个受控的 :class:`~.core.gates.RY` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.RY`) - 有一个控制位的 :class:`~.core.gates.RY` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.cryy_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.cryy_decompose 2 | ============================================= 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.cryy_decompose(gate: gates.Ryy) 5 | 6 | 分解一个受控的 :class:`~.core.gates.Ryy` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.Ryy`) - 有一个控制位的 :class:`~.core.gates.Ryy` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.cs_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.cs_decompose 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.cs_decompose(gate: gates.SGate) 5 | 6 | 分解一个受控的 :class:`~.core.gates.SGate` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.SGate`) - 有一个控制位的 :class:`~.core.gates.SGate` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.cswap_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.cswap_decompose 2 | ============================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.cswap_decompose(gate: gates.SWAPGate) 5 | 6 | 分解一个受控的 :class:`~.core.gates.SWAPGate` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.SWAPGate`) - 有一个控制位的 :class:`~.core.gates.SWAPGate` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.ct_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.ct_decompose 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.ct_decompose(gate: gates.TGate) 5 | 6 | 分解一个受控的 :class:`~.core.gates.TGate` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.TGate`) - 有一个控制位的 :class:`~.core.gates.TGate` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.cu_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.cu_decompose 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.cu_decompose(gate: QuantumGate, with_barrier: bool = False) 5 | 6 | 对任意维度的受控幺正门进行分解。 7 | 8 | 该门拥有 :math:`m` 个控制比特和 :math:`n` 个作用比特。 9 | 当迭代的调用函数本身时,:math:`m` 将会逐步减小并保持 :math:`n` 恒定。 10 | 11 | 参数: 12 | - **gate** (:class:`~.core.gates.QuantumGate`) - 量子门实例。 13 | - **with_barrier** (bool) - 是否在分解时加入 :class:`~.core.gates.BarrierGate`。默认值: ``False``。 14 | 15 | 返回: 16 | :class:`~.core.circuit.Circuit`,由单比特门和CNOT门构成的量子线路。 17 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.cy_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.cy_decompose 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.cy_decompose(gate: gates.YGate) 5 | 6 | 分解一个受控的 :class:`~.core.gates.YGate` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.YGate`) - 有一个控制位的 :class:`~.core.gates.YGate` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.cz_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.cz_decompose 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.cz_decompose(gate: gates.ZGate) 5 | 6 | 分解一个受控的 :class:`~.core.gates.ZGate` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.ZGate`) - 有一个控制位的 :class:`~.core.gates.ZGate` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.euler_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.euler_decompose 2 | ============================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.euler_decompose(gate: QuantumGate, basis: str = 'zyz', with_phase: bool = True) 5 | 6 | 单比特门欧拉分解。 7 | 8 | 当前支持 `ZYZ` 和 `U3` 分解。 9 | 10 | 参数: 11 | - **gate** (:class:`~.core.gates.QuantumGate`) - 一个单比特的量子门。 12 | - **basis** (str) - 分解的基,可以是 ``'zyz'`` 或者 ``'u3'`` 中的一个。默认值: ``'zyz'``。 13 | - **with_phase** (bool) - 是否将全局相位以 :class:`~.core.gates.GlobalPhase` 的形式作用在量子线路上。 14 | 15 | 返回: 16 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 17 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.kak_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.kak_decompose 2 | ============================================ 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.kak_decompose(gate: QuantumGate, return_u3: bool = True) 5 | 6 | 通过kak分解来分解任意的两量子比特门。 7 | 8 | 更多信息,请参考论文 `An Introduction to Cartan's KAK Decomposition for QC 9 | Programmers `_. 10 | 11 | 参数: 12 | - **gate** (:class:`~.core.gates.QuantumGate`) - 只有一个控制为的单比特量子门。 13 | - **return_u3** (bool) - 如果为 ``True``,则返回 :class:`~.core.gates.U3` 形式的分解,否则返回 :class:`~.core.gates.UnivMathGate` 形式的分解。默认值: ``True``。 14 | 15 | 返回: 16 | :class:`~.core.circuit.Circuit`,由6个单比特门和最多三个CNOT门构成的量子线路。 17 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.qs_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.qs_decompose 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.qs_decompose(gate: QuantumGate, with_barrier: bool = False) 5 | 6 | 任意维幺正量子门的矩阵的香农分解。 7 | 8 | 该分解方法中的CNOT门数量为: 9 | 10 | .. math:: 11 | 12 | O(4^n) 13 | 14 | 了解更多详细信息,请参考 `Synthesis of Quantum Logic Circuits `_。 15 | 16 | 参数: 17 | - **gate** (:class:`~.core.gates.QuantumGate`) - 量子门实例。 18 | - **with_barrier** (bool) - 是否在分解时加入 :class:`~.core.gates.BarrierGate`。默认值: ``False``。 19 | 20 | 返回: 21 | :class:`~.core.circuit.Circuit`,由单比特门和CNOT门构成的量子线路。 22 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.rxx_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.rxx_decompose 2 | ============================================ 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.rxx_decompose(gate: gates.Rxx) 5 | 6 | 分解一个的 :class:`~.core.gates.Rxx` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.Rxx`) - 一个 :class:`~.core.gates.Rxx` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.ryy_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.ryy_decompose 2 | ============================================ 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.ryy_decompose(gate: gates.Ryy) 5 | 6 | 分解一个的 :class:`~.core.gates.Ryy` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.Ryy`) - 一个 :class:`~.core.gates.Ryy` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.rzz_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.rzz_decompose 2 | ============================================ 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.rzz_decompose(gate: gates.Rzz) 5 | 6 | 分解一个的 :class:`~.core.gates.Rzz` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.Rzz`) - 一个 :class:`~.core.gates.Rzz` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.swap_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.swap_decompose 2 | ============================================= 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.swap_decompose(gate: gates.SWAPGate) 5 | 6 | 分解一个 :class:`~.core.gates.SWAPGate` 门。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.SWAPGate`) - 一个 :class:`~.core.gates.SWAPGate` 门。 10 | 11 | 返回: 12 | List[:class:`~.core.circuit.Circuit`],可能的分解方式。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.tensor_product_decompose.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.tensor_product_decompose 2 | ======================================================= 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.tensor_product_decompose(gate: QuantumGate, return_u3: bool = True) 5 | 6 | 量比特量子门的张量直积分解。 7 | 8 | 参数: 9 | - **gate** (:class:`~.core.gates.QuantumGate`) - 一个两比特量子门。 10 | - **return_u3** (bool) - 如果为 ``True``,则返回 :class:`~.core.gates.U3` 形式的分解,否则返回 :class:`~.core.gates.UnivMathGate` 形式的分解。默认值: ``True``。 11 | 12 | 返回: 13 | :class:`~.core.circuit.Circuit`,包含两个单比特门。 14 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/compiler/mindquantum.algorithm.compiler.try_merge.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.compiler.try_merge 2 | ======================================== 3 | 4 | .. py:function:: mindquantum.algorithm.compiler.try_merge(father_node: GateNode, child_node: GateNode) 5 | 6 | 尝试将两个节点融合起来。 7 | 8 | 通过本方法,我们将两个互为共轭的量子门融合成一个单位门,或者将两个同类的参数门融合到一起。 9 | 10 | 参数: 11 | - **father_node** (:class:`~.algorithm.compiler.GateNode`) - 想要融合的父 DAG 节点。 12 | - **child_node** (:class:`~.algorithm.compiler.GateNode`) - 想要融合的子 DAG 节点。 13 | 14 | 返回: 15 | - bool,是否融合成功。 16 | - List[:class:`~.algorithm.compiler.GateNode`],融合之后的父节点. 17 | - :class:`~.core.gates.GlobalPhase`,合并两个给定节点后的global phase gate。 18 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/error_mitigation/mindquantum.algorithm.error_mitigation.fold_at_random.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.error_mitigation.fold_at_random 2 | ===================================================== 3 | 4 | .. py:function:: mindquantum.algorithm.error_mitigation.fold_at_random(circ: Circuit, factor: float, method='locally') 5 | 6 | 随机的折叠一个量子线路。 7 | 8 | 折叠一个量子线路会增加量子线路的长度,但是仍然保持量子线路的幺正矩阵不变。我们可以通过在某些量子门后添加一个单位量子线路来实现。举一个简单的例子,:math:`RX(1.2 \pi)` 和 :math:`RX(1.2 \pi)RX(-1.2 \pi)RX(1.2 \pi)` 拥有相同的幺正矩阵表示,但是后者的线路长度却增加了三倍。 9 | 10 | 参数: 11 | - **circ** (:class:`~.core.circuit.Circuit`) - 要折叠的量子线路。 12 | - **factor** (float) - 折叠系数,必须大于1。 13 | - **method** (str) - 折叠的方法。 ``method`` 应该是 ``'globally'`` 或者 ``'locally'`` 中的一种。其中 ``'globally'`` 方法表示在整个量子线路后面增加单位量子线路,而 ``'locally'`` 表示随机的在某些量子门后面添加单位量子线路。 14 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/error_mitigation/mindquantum.algorithm.error_mitigation.generate_double_qubits_rb_circ.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.error_mitigation.generate_double_qubits_rb_circ 2 | ===================================================================== 3 | 4 | .. py:function:: mindquantum.algorithm.error_mitigation.generate_double_qubits_rb_circ(length: int, seed: int = None) 5 | 6 | 生成两比特量子随机基准测试线路。 7 | 8 | 参数: 9 | - **length** (int) - 线路中clifford元的个数。 10 | - **seed** (int) - 用于生成随机基准测试线路的随机数种子。如果为 ``None``,将会使用一个随机的种子。默认值: ``None``。 11 | 12 | 返回: 13 | :class:`~.core.circuit.Circuit`,两比特随机基准测试线路,线路的模态为零态。 14 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/error_mitigation/mindquantum.algorithm.error_mitigation.generate_single_qubit_rb_circ.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.error_mitigation.generate_single_qubit_rb_circ 2 | ===================================================================== 3 | 4 | .. py:function:: mindquantum.algorithm.error_mitigation.generate_single_qubit_rb_circ(length: int, seed: int = None) 5 | 6 | 生成单比特量子随机基准测试线路。 7 | 8 | 参数: 9 | - **length** (int) - 线路中clifford元的个数。 10 | - **seed** (int) - 用于生成随机基准测试线路的随机数种子。如果为 ``None``,将会使用一个随机的种子。默认值: ``None``。 11 | 12 | 返回: 13 | :class:`~.core.circuit.Circuit`,单比特随机基准测试线路,线路的模态为零态。 14 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/error_mitigation/mindquantum.algorithm.error_mitigation.query_double_qubits_clifford_elem.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.error_mitigation.query_double_qubits_clifford_elem 2 | ======================================================================== 3 | 4 | .. py:function:: mindquantum.algorithm.error_mitigation.query_double_qubits_clifford_elem(idx: int) 5 | 6 | 输出两比特clifford群中的群元。 7 | 8 | 两比特clifford群的大小为11520。 9 | 10 | 参数: 11 | - **idx** (int) - 两比特clifford群中元素的序号。 12 | 13 | 返回: 14 | :class:`~.simulator.Simulator`,一个表为所获取的clifford元素的stabilizer模拟器。 15 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/error_mitigation/mindquantum.algorithm.error_mitigation.query_single_qubit_clifford_elem.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.error_mitigation.query_single_qubit_clifford_elem 2 | ======================================================================= 3 | 4 | .. py:function:: mindquantum.algorithm.error_mitigation.query_single_qubit_clifford_elem(idx: int) 5 | 6 | 输出单比特clifford群中的群元。 7 | 8 | 单比特clifford群的大小为24。 9 | 10 | 参数: 11 | - **idx** (int) - 单比特clifford群中元素的序号。 12 | 13 | 返回: 14 | :class:`~.simulator.Simulator`,一个表为所获取的clifford元素的stabilizer模拟器。 15 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/library/mindquantum.algorithm.library.amplitude_encoder.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.library.amplitude_encoder 2 | ================================================ 3 | 4 | .. py:function:: mindquantum.algorithm.library.amplitude_encoder(x, n_qubits) 5 | 6 | 用于振幅编码的量子线路。 7 | 8 | .. note:: 9 | 经典数据的长度应该是2的幂,否则将用0填充。 10 | 向量应该归一化。 11 | 12 | 参数: 13 | - **x** (list[float] or numpy.array(list[float])) - 需要编码的数据向量,应该归一化。 14 | - **n_qubits** (int) - 编码线路的量子比特数。 15 | 16 | 返回: 17 | Circuit,能够完成振幅编码的量子线路。 18 | ParameterResolver,用于完成振幅编码量子线路的参数。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/library/mindquantum.algorithm.library.bitphaseflip_operator.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.library.bitphaseflip_operator 2 | ==================================================== 3 | 4 | .. py:function:: mindquantum.algorithm.library.bitphaseflip_operator(phase_inversion_index, n_qubits) 5 | 6 | 此算子生成一个可以翻转任意计算基的符号的电路。 7 | 8 | 参数: 9 | - **phase_inversion_index** (list[int]) - 需要翻转相位的计算基的索引。 10 | - **n_qubits** (int) - 量子比特总数。 11 | 12 | 返回: 13 | Circuit,位相位翻转后的线路。 14 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/library/mindquantum.algorithm.library.general_ghz_state.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.library.general_ghz_state 2 | ================================================ 3 | 4 | .. py:function:: mindquantum.algorithm.library.general_ghz_state(qubits) 5 | 6 | 基于零态制备通用GHZ态的线路。 7 | GHZ态通常定义为三个全零态和三个全一态的均匀叠加: 8 | 9 | .. math:: 10 | 11 | \left|\text{GHZ}\right> = (\left|000\right> + \left|111\right>)/\sqrt{2} 12 | 13 | 在本接口中,我们可以创建出任意量子比特规模下任意部分量子比特之间的GHZ态。 14 | 15 | 参数: 16 | - **qubits** (list[int]) - 需要应用通用GHZ态的量子比特。 17 | 18 | 返回: 19 | Circuit,可以制备GHZ态的线路。 20 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/library/mindquantum.algorithm.library.general_w_state.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.library.general_w_state 2 | ============================================== 3 | 4 | .. py:function:: mindquantum.algorithm.library.general_w_state(qubits) 5 | 6 | 通用W态。 7 | W态通常定义成只有单个比特是 :math:`\left|1\right>` 态的基矢的均匀叠加,而其他态都为 :math:`\left|0\right>` 。举个例子,对于三量子比特系统,W态定义为: 8 | 9 | .. math:: 10 | 11 | \left|\rm W\right> = (\left|001\right> + \left|010\right> + \left|100\right>)/\sqrt(3) 12 | 13 | 在本接口中,我们可以定义任意总量子比特系统中任意部分希尔伯特空间中的W态。 14 | 15 | .. note:: 16 | 请参考 https://quantumcomputing.stackexchange.com/questions/4350/general-construction-of-w-n-state。 17 | 18 | 参数: 19 | - **qubits** (list[int]) - 需要应用通用W态的量子比特。 20 | 21 | 返回: 22 | Circuit,可以制备W态的线路。 23 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/library/mindquantum.algorithm.library.mat_to_op.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.library.mat_to_op 2 | ======================================================= 3 | 4 | .. py:function:: mat_to_op(mat, little_endian: bool = True) 5 | 6 | 将一个基于qubit的矩阵表示转换为对应的泡利算符表示。默认以小端头表示输出QubitOperator。 7 | 8 | 参数: 9 | - **mat** - 基于qubit的矩阵表示。 10 | - **little_endian** - 是否使用小端头表示(默认为True,即小端头表示)。如果为True,则表示最高位Qubit为最左边的位(即小端头表示),否则表示最高位Qubit为最右边的位(即大端头表示) 11 | 12 | 返回: 13 | :class:`~.core.QubitOperator`, 对应的泡利算符表示的QubitOperator。 -------------------------------------------------------------------------------- /docs/api_python/algorithm/library/mindquantum.algorithm.library.qft.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.library.qft 2 | ================================== 3 | 4 | .. py:function:: mindquantum.algorithm.library.qft(qubits) 5 | 6 | 量子傅里叶变换(QFT)。量子傅里叶变换与经典傅里叶变换的功能相似。 7 | 8 | .. note:: 9 | 更多信息请参考Nielsen, M., & Chuang, I. (2010)。 10 | 11 | 参数: 12 | - **qubits** (list[int]) - 需要应用量子傅里叶变换的量子比特。 13 | 14 | 返回: 15 | Circuit,可以进行傅里叶变换的线路。 16 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/library/mindquantum.algorithm.library.qudit_symmetric_decoding.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.library.qudit_symmetric_decoding 2 | ======================================================== 3 | 4 | .. py:function:: qudit_symmetric_decoding(qubit: np.ndarray, n_qubits: int = 1) 5 | 6 | 对称性解码,将qubit对称态或矩阵解码成qudit态或矩阵。 7 | 8 | .. math:: 9 | 10 | \begin{align} 11 | \ket{00\cdots00}&\to\ket{0} \\[.5ex] 12 | \frac{\ket{0\cdots01}+\ket{0\cdots010}+\ket{10\cdots0}}{\sqrt{d-1}}&\to\ket{1} \\ 13 | \frac{\ket{0\cdots011}+\ket{0\cdots0101}+\ket{110\cdots0}}{\sqrt{d-1}}&\to\ket{2} \\ 14 | \vdots&\qquad\vdots \\[.5ex] 15 | \ket{11\cdots11}&\to\ket{d-1} 16 | \end{align} 17 | 18 | 参数: 19 | - **qubit** (np.ndarray) - 需要解码的qubit对称态或矩阵,qubit态或矩阵需满足对称性。 20 | - **n_qubits** (int) - qubit对称态或矩阵的量子比特数。默认值:``1``。 21 | 22 | 返回: 23 | np.ndarray,对称性解码后的qudit态或矩阵。 -------------------------------------------------------------------------------- /docs/api_python/algorithm/library/mindquantum.algorithm.library.qudit_symmetric_encoding.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.library.qudit_symmetric_encoding 2 | ======================================================== 3 | 4 | .. py:function:: qudit_symmetric_encoding(qudit: np.ndarray, n_qudits: int = 1) 5 | 6 | 对称性编码,将qudit态或矩阵编码成qubit对称态或矩阵。 7 | 8 | .. math:: 9 | 10 | \begin{align} 11 | \ket{0}&\to\ket{00\cdots00} \\[.5ex] 12 | \ket{1}&\to\frac{\ket{0\cdots01}+\ket{0\cdots010}+\ket{10\cdots0}}{\sqrt{d-1}} \\ 13 | \ket{2}&\to\frac{\ket{0\cdots011}+\ket{0\cdots0101}+\ket{110\cdots0}}{\sqrt{d-1}} \\ 14 | \vdots&\qquad\vdots \\[.5ex] 15 | \ket{d-1}&\to\ket{11\cdots11} 16 | \end{align} 17 | 18 | 参数: 19 | - **qudit** (np.ndarray) - 需要编码的qudit态或矩阵。 20 | - **n_qudits** (int) - qudit态或矩阵的量子位个数。默认值:``1``。 21 | 22 | 返回: 23 | np.ndarray,对称性编码后的qubit对称态或矩阵。 -------------------------------------------------------------------------------- /docs/api_python/algorithm/mindquantum.algorithm.error_mitigation.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.error_mitigation 2 | ====================================== 3 | 4 | .. py:module:: mindquantum.algorithm.error_mitigation 5 | 6 | 7 | MindQuantum 的误差缓解模块。 8 | 9 | .. mscnautosummary:: 10 | :toctree: error_mitigation 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | mindquantum.algorithm.error_mitigation.fold_at_random 15 | mindquantum.algorithm.error_mitigation.zne 16 | mindquantum.algorithm.error_mitigation.generate_double_qubits_rb_circ 17 | mindquantum.algorithm.error_mitigation.generate_single_qubit_rb_circ 18 | mindquantum.algorithm.error_mitigation.query_double_qubits_clifford_elem 19 | mindquantum.algorithm.error_mitigation.query_single_qubit_clifford_elem 20 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/mindquantum.algorithm.library.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.library 2 | ============================== 3 | 4 | .. py:module:: mindquantum.algorithm.library 5 | 6 | 7 | MindQuantum常用算法模块。 8 | 9 | .. mscnautosummary:: 10 | :toctree: library 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | mindquantum.algorithm.library.amplitude_encoder 15 | mindquantum.algorithm.library.bitphaseflip_operator 16 | mindquantum.algorithm.library.general_ghz_state 17 | mindquantum.algorithm.library.general_w_state 18 | mindquantum.algorithm.library.qft 19 | mindquantum.algorithm.library.qudit_symmetric_decoding 20 | mindquantum.algorithm.library.qudit_symmetric_encoding 21 | mindquantum.algorithm.library.qutrit_symmetric_ansatz 22 | mindquantum.algorithm.library.mat_to_op -------------------------------------------------------------------------------- /docs/api_python/algorithm/mindquantum.algorithm.mapping.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.mapping 2 | ====================================== 3 | 4 | .. py:module:: mindquantum.algorithm.mapping 5 | 6 | 7 | MindQuantum 比特映射模块。 8 | 9 | .. mscnautosummary:: 10 | :toctree: mapping 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | mindquantum.algorithm.mapping.SABRE 15 | mindquantum.algorithm.mapping.MQSABRE 16 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/mindquantum.algorithm.qaia.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.qaia 2 | ========================== 3 | 4 | .. py:module:: mindquantum.algorithm.qaia 5 | 6 | 7 | 量子退火启发式算法。 8 | 9 | .. mscnautosummary:: 10 | :toctree: qaia 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | mindquantum.algorithm.qaia.QAIA 15 | mindquantum.algorithm.qaia.CAC 16 | mindquantum.algorithm.qaia.CFC 17 | mindquantum.algorithm.qaia.LQA 18 | mindquantum.algorithm.qaia.NMFA 19 | mindquantum.algorithm.qaia.ASB 20 | mindquantum.algorithm.qaia.BSB 21 | mindquantum.algorithm.qaia.DSB 22 | mindquantum.algorithm.qaia.SFC 23 | mindquantum.algorithm.qaia.SimCIM 24 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ASWAP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ASWAP.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/PCHeaXYZ1F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/PCHeaXYZ1F.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/PCHeaXYZ2F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/PCHeaXYZ2F.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/RYCascade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/RYCascade.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/RYFull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/RYFull.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/RYLinear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/RYLinear.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/RYRZFull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/RYRZFull.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz1.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz10.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz11.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz12.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz13.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz14.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz15.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz16.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz17.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz18.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz19.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz2.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz3.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz4.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz5.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz6.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz7.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz8.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/ansatz_images/ansatz9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python/algorithm/nisq/ansatz_images/ansatz9.png -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.ASWAP.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.ASWAP 2 | ================================ 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.ASWAP(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | 类 SWAP 门形式的硬件友好型线路 7 | 8 | .. image:: ./ansatz_images/ASWAP.png 9 | :height: 180px 10 | 11 | 请参考论文 `Efficient symmetry-preserving state preparation circuits for the variational quantum eigensolver algorithm `_. 12 | 13 | 参数: 14 | - **n_qubits** (int) - 量子线路的总比特数。 15 | - **depth** (int) - ansatz 的循环层数。 16 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 17 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 18 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz 2 | ================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz(name, n_qubits, *args, **kwargs) 5 | 6 | Ansatz的基类。 7 | 8 | 参数: 9 | - **name** (str) - ansatz的名字。 10 | - **n_qubits** (int) - ansatz作用于多少个量子比特。 11 | 12 | .. py:method:: circuit 13 | :property: 14 | 15 | 获取ansatz的量子线路。 16 | 17 | 返回: 18 | Circuit,ansatz的量子线路。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz1.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz1 2 | ================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz1(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路1。 7 | 8 | .. image:: ./ansatz_images/ansatz1.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz10.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz10 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz10(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路10。 7 | 8 | .. image:: ./ansatz_images/ansatz10.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz11.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz11 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz11(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路11。 7 | 8 | .. image:: ./ansatz_images/ansatz11.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz12.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz12 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz12(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路12。 7 | 8 | .. image:: ./ansatz_images/ansatz12.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz13.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz13 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz13(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路13。 7 | 8 | .. image:: ./ansatz_images/ansatz13.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz14.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz14 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz14(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路14。 7 | 8 | .. image:: ./ansatz_images/ansatz14.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz15.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz15 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz15(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路15。 7 | 8 | .. image:: ./ansatz_images/ansatz15.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz16.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz16 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz16(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路16。 7 | 8 | .. image:: ./ansatz_images/ansatz16.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz17.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz17 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz17(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路17。 7 | 8 | .. image:: ./ansatz_images/ansatz17.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz18.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz18 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz18(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路18。 7 | 8 | .. image:: ./ansatz_images/ansatz18.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz19.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz19 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz19(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路19。 7 | 8 | .. image:: ./ansatz_images/ansatz19.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz2.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz2 2 | ================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz2(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路2。 7 | 8 | .. image:: ./ansatz_images/ansatz2.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz3.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz3 2 | ================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz3(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路3。 7 | 8 | .. image:: ./ansatz_images/ansatz3.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz4.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz4 2 | ================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz4(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路4。 7 | 8 | .. image:: ./ansatz_images/ansatz4.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz5.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz5 2 | ================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz5(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路5。 7 | 8 | .. image:: ./ansatz_images/ansatz5.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz6.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz6 2 | ================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz6(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路6。 7 | 8 | .. image:: ./ansatz_images/ansatz6.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz7.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz7 2 | ================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz7(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路7。 7 | 8 | .. image:: ./ansatz_images/ansatz7.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz8.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz8 2 | ================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz8(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路8。 7 | 8 | .. image:: ./ansatz_images/ansatz8.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz9.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.Ansatz9 2 | ================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.Ansatz9(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | Arxiv 论文中所提及的量子线路9。 7 | 8 | .. image:: ./ansatz_images/ansatz9.png 9 | :height: 180px 10 | 11 | 请参考论文 `Expressibility and entangling capability of parameterized quantum circuits for hybrid 12 | quantum-classical algorithms `_. 13 | 14 | 参数: 15 | - **n_qubits** (int) - 量子线路的总比特数。 16 | - **depth** (int) - ansatz 的循环层数。 17 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 18 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.PCHeaXYZ1F.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.PCHeaXYZ1F 2 | ===================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.PCHeaXYZ1F(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | PCHeaXYZ1F 硬件友好型线路。 7 | 8 | .. image:: ./ansatz_images/PCHeaXYZ1F.png 9 | :height: 180px 10 | 11 | 请参考论文 `Physics-Constrained Hardware-Efficient Ansatz on Quantum Computers that is Universal, Systematically Improvable, and Size-consistent `_. 12 | 13 | 参数: 14 | - **n_qubits** (int) - 量子线路的总比特数。 15 | - **depth** (int) - ansatz 的循环层数。 16 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 17 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 18 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.PCHeaXYZ2F.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.PCHeaXYZ2F 2 | ===================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.PCHeaXYZ2F(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | PCHeaXYZ2F 硬件友好型线路。 7 | 8 | .. image:: ./ansatz_images/PCHeaXYZ2F.png 9 | :height: 180px 10 | 11 | 请参考论文 `Physics-Constrained Hardware-Efficient Ansatz on Quantum Computers that is Universal, Systematically Improvable, and Size-consistent `_. 12 | 13 | 参数: 14 | - **n_qubits** (int) - 量子线路的总比特数。 15 | - **depth** (int) - ansatz 的循环层数。 16 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 17 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 18 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.RYCascade.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.RYCascade 2 | ==================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.RYCascade(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | 以 :class:`~.core.gates.RY` 门作为单比特门,以两层线性分布的 CNOT 门作为纠缠门的硬件友好型线路。 7 | 8 | .. image:: ./ansatz_images/RYCascade.png 9 | :height: 180px 10 | 11 | 请参考论文 `Challenges in the Use of Quantum Computing Hardware-Efficient Ansätze in Electronic Structure Theory `_. 12 | 13 | 参数: 14 | - **n_qubits** (int) - 量子线路的总比特数。 15 | - **depth** (int) - ansatz 的循环层数。 16 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 17 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 18 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.RYFull.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.RYFull 2 | ================================= 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.RYFull(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | 以 :class:`~.core.gates.RY` 门作为单比特门,以两两比特都有作用的 CNOT 门作为纠缠门的硬件友好型线路。 7 | 8 | .. image:: ./ansatz_images/RYFull.png 9 | :height: 180px 10 | 11 | 请参考论文 `Challenges in the Use of Quantum Computing Hardware-Efficient Ansätze in Electronic Structure Theory `_. 12 | 13 | 参数: 14 | - **n_qubits** (int) - 量子线路的总比特数。 15 | - **depth** (int) - ansatz 的循环层数。 16 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 17 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 18 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.RYLinear.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.RYLinear 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.RYLinear(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | 以 :class:`~.core.gates.RY` 门作为单比特门,以线性分布的 CNOT 门作为纠缠门的硬件友好型线路。 7 | 8 | .. image:: ./ansatz_images/RYLinear.png 9 | :height: 180px 10 | 11 | 请参考论文 `Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets `_. 12 | 13 | 参数: 14 | - **n_qubits** (int) - 量子线路的总比特数。 15 | - **depth** (int) - ansatz 的循环层数。 16 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 17 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 18 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.RYRZFull.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.RYRZFull 2 | =================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.RYRZFull(n_qubits: int, depth: int, prefix: str = '', suffix: str = '') 5 | 6 | 以 :class:`~.core.gates.RY` 门和 :class:`~.core.gates.RZ` 作为单比特门,以两两比特都有作用的 CNOT 门作为纠缠门的硬件友好型线路。 7 | 8 | .. image:: ./ansatz_images/RYRZFull.png 9 | :height: 180px 10 | 11 | 参数: 12 | - **n_qubits** (int) - 量子线路的总比特数。 13 | - **depth** (int) - ansatz 的循环层数。 14 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 15 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 16 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.StronglyEntangling.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.StronglyEntangling 2 | ============================================== 3 | 4 | .. py:class:: mindquantum.algorithm.nisq.StronglyEntangling(n_qubits: int, depth: int, entangle_gate: BasicGate, prefix: str = '', suffix: str = '') 5 | 6 | 强纠缠ansatz。请参考 `Circuit-centric quantum classifiers `_。 7 | 8 | 参数: 9 | - **n_qubits** (int) - ansatz作用于多少个量子比特。 10 | - **depth** (int) - ansatz的深度。 11 | - **entangle_gate** (BasicGate) - 产生纠缠的量子门。 12 | 如果传入单量子比特门,则会添加一个控制量子比特, 13 | 如果传入双量子比特门,则该双量子比特门将作用于不同的量子比特。 14 | - **prefix** (str) - 参数的前缀。默认值: ``''``。 15 | - **suffix** (str) - 参数的后缀。默认值: ``''``。 16 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.generate_uccsd.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.generate_uccsd 2 | ========================================== 3 | 4 | .. py:function:: mindquantum.algorithm.nisq.generate_uccsd(molecular, threshold=0) 5 | 6 | 使用OpenFermion生成的分子数据生成uccsd量子线路。 7 | 8 | 参数: 9 | - **molecular** (Union[str, MolecularData]) - 分子数据文件的名称,或openfermion中的 `MolecularData` 。 10 | - **threshold** (float) - 过滤uccsd中组态幅度的阈值。我们将保留那些组态振幅绝对值比 `threshold` 大的组态,因此,当 `threshold=0` 时,只会保留非零振幅的组态。默认值: ``0``。 11 | 12 | 返回: 13 | - **uccsd_circuit** (Circuit) - 由uccsd方法生成的ansatz电路。 14 | - **initial_amplitudes** (numpy.ndarray) - uccsd电路的初始参数值。 15 | - **parameters_name** (list[str]) - 初始参数的名称。 16 | - **qubit_hamiltonian** (QubitOperator) - 分子的哈密顿量。 17 | - **n_qubits** (int) - 模拟中使用的量子比特数。 18 | - **n_electrons** (int) - 分子的电子数。 19 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.get_qubit_hamiltonian.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.get_qubit_hamiltonian 2 | ================================================= 3 | 4 | .. py:function:: mindquantum.algorithm.nisq.get_qubit_hamiltonian(mol) 5 | 6 | 获取分子数据的哈密顿量。 7 | 8 | 参数: 9 | - **mol** (MolecularData) - 分子数据。 10 | 11 | 返回: 12 | QubitOperator,此分子的玻色子算符。 13 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.quccsd_generator.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.quccsd_generator 2 | ============================================ 3 | 4 | .. py:function:: mindquantum.algorithm.nisq.quccsd_generator(n_qubits=None, n_electrons=None, anti_hermitian=True, occ_orb=None, vir_orb=None, generalized=False) 5 | 6 | 使用比特激发算符生成 `qubit-UCCSD` (qUCCSD) ansatz。 7 | 8 | .. note:: 9 | 当前版本为无限制版本,即同一空间轨道但具有不同自旋的激发算符使用不同的变分参数。 10 | 11 | 参数: 12 | - **n_qubits** (int) - 量子比特(自旋轨道)的数量。默认值: ``None``。 13 | - **n_electrons** (int) - 电子的数量(占据自旋轨道)。默认值: ``None``。 14 | - **anti_hermitian** (bool) - 是否减去厄米共轭以形成反厄米算符。默认值: ``True``。 15 | - **occ_orb** (list) - 手动分配的占据空间轨道的序号。默认值: ``None``。 16 | - **vir_orb** (list) - 手动分配的虚空间轨道的序号。默认值: ``None``。 17 | - **generalized** (bool) - 是否使用不区分占据轨道和虚轨道的广义激发算符(qUCCGSD)。默认值: ``False``。 18 | 19 | 返回: 20 | QubitExcitationOperator,qUCCSD算符。 21 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/nisq/mindquantum.algorithm.nisq.uccsd_singlet_generator.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.nisq.uccsd_singlet_generator 2 | =================================================== 3 | 4 | .. py:function:: mindquantum.algorithm.nisq.uccsd_singlet_generator(n_qubits, n_electrons, anti_hermitian=True) 5 | 6 | 为 `n_electrons` 的系统生成单态UCCSD算子。此函数生成一个由费米子构成的UCCSD算子,该算子作用在一个由 `n_qubits` 的自旋轨道和 `n_electrons` 电子构成的单参考态,也就是自旋单态算符,这也意味着该算符能够保证自旋守恒。 7 | 8 | 参数: 9 | - **n_qubits** (int) - 用于表示系统的自旋轨道数,这也对应于非紧凑映射中的量子比特数。 10 | - **n_electrons** (int) - 物理系统中电子数。 11 | - **anti_hermitian** (bool) - 仅生成普通CCSD运算符而不是幺正的形式,主要用于测试。 12 | 13 | 返回: 14 | FermionOperator,构建UCCSD波函数的UCCSD算子。 15 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/qaia/mindquantum.algorithm.qaia.BSB.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.qaia.BSB 2 | =============================== 3 | 4 | .. py:class:: mindquantum.algorithm.qaia.BSB(J, h=None, x=None, n_iter=1000, batch_size=1, dt=1, xi=None) 5 | 6 | 弹道模拟分叉算法。 7 | 8 | 参考文献:`High-performance combinatorial optimization based on classical mechanics `_。 9 | 10 | 参数: 11 | - **J** (Union[numpy.array, csr_matrix]) - 耦合矩阵,维度为 :math:`(N x N)`。 12 | - **h** (numpy.array) - 外场强度,维度为 :math:`(N, )`。 13 | - **x** (numpy.array) - 自旋初始化配置,维度为 :math:`(N x batch_size)`。默认值: ``None``。 14 | - **n_iter** (int) - 迭代步数。默认值: ``1000``。 15 | - **batch_size** (int) - 样本个数。默认值为: ``1``。 16 | - **dt** (float) - 迭代步长。默认值: ``0.1``。 17 | - **xi** (float) - 频率维数,正的常数。默认值: ``None``。 18 | 19 | .. py:method:: update() 20 | 21 | 基于修改的显式辛欧拉方法的动力学演化。 22 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/qaia/mindquantum.algorithm.qaia.CAC.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.qaia.CAC 2 | ============================== 3 | 4 | .. py:class:: mindquantum.algorithm.qaia.CAC(J, h=None, x=None, n_iter=1000, batch_size=1, dt=0.075) 5 | 6 | 混沌振幅控制算法。 7 | 8 | 参考文献:`Coherent Ising machines with optical error correction circuits `_。 9 | 10 | 参数: 11 | - **J** (Union[numpy.array, csr_matrix]) - 耦合矩阵,维度为 :math:`(N x N)`。 12 | - **h** (numpy.array) - 外场强度,维度为 :math:`(N, )`。 13 | - **x** (numpy.array) - 自旋初始化配置,维度为 :math:`(N x batch_size)`。默认值: ``None``。 14 | - **n_iter** (int) - 迭代步数。默认值: ``1000``。 15 | - **batch_size** (int) - 样本个数。默认值为: ``1``。 16 | - **dt** (float) - 迭代步长。默认值: ``0.075``。 17 | 18 | .. py:method:: initialize() 19 | 20 | 初始化自旋和错误变量。 21 | 22 | .. py:method:: update() 23 | 24 | 动力学演化。 25 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/qaia/mindquantum.algorithm.qaia.CFC.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.qaia.CFC 2 | ============================== 3 | 4 | .. py:class:: mindquantum.algorithm.qaia.CFC(J, h=None, x=None, n_iter=1000, batch_size=1, dt=0.1) 5 | 6 | 混沌振幅反馈算法。 7 | 8 | 参考文献:`Coherent Ising machines with optical error correction circuits `_。 9 | 10 | 参数: 11 | - **J** (Union[numpy.array, csr_matrix]) - 耦合矩阵,维度为 :math:`(N x N)`。 12 | - **h** (numpy.array) - 外场强度,维度为 :math:`(N, )`。 13 | - **x** (numpy.array) - 自旋初始化配置,维度为 :math:`(N x batch_size)`。默认值: ``None``。 14 | - **n_iter** (int) - 迭代步数。默认值: ``1000``。 15 | - **batch_size** (int) - 样本个数。默认值为: ``1``。 16 | - **dt** (float) - 迭代步长。默认值: ``0.1``。 17 | 18 | .. py:method:: initialize() 19 | 20 | 初始化自旋和错误变量。 21 | 22 | .. py:method:: update() 23 | 24 | 动力学演化。 25 | -------------------------------------------------------------------------------- /docs/api_python/algorithm/qaia/mindquantum.algorithm.qaia.DSB.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.qaia.DSB 2 | =============================== 3 | 4 | .. py:class:: mindquantum.algorithm.qaia.DSB(J, h=None, x=None, n_iter=1000, batch_size=1, dt=1, xi=None) 5 | 6 | 离散模拟分叉算法。 7 | 8 | 参考文献:`High-performance combinatorial optimization based on classical mechanics `_。 9 | 10 | 参数: 11 | - **J** (Union[numpy.array, csr_matrix]) - 耦合矩阵,维度为 :math:`(N x N)`。 12 | - **h** (numpy.array) - 外场强度,维度为 :math:`(N, )`。 13 | - **x** (numpy.array) - 自旋初始化配置,维度为 :math:`(N x batch_size)`。默认值: ``None``。 14 | - **n_iter** (int) - 迭代步数。默认值: ``1000``。 15 | - **batch_size** (int) - 样本个数。默认值为: ``1``。 16 | - **dt** (float) - 迭代步长。默认值: ``0.1``。 17 | - **xi** (float) - 频率维数,正的常数。默认值: ``None``。 18 | 19 | .. py:method:: update() 20 | 21 | 基于修改的显式辛欧拉方法的动力学演化。 22 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.BitFlipAdder.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.BitFlipAdder 2 | ===================================== 3 | 4 | .. py:class:: mindquantum.core.circuit.BitFlipAdder(flip_rate: float, with_ctrl=True, focus_on: int = None, add_after: bool = True) 5 | 6 | 在量子门前面或者后面添加一个比特翻转信道。 7 | 8 | 参数: 9 | - **flip_rate** (float) - 比特翻转信道的翻转概率。具体请参考 :class:`~.core.gates.BitFlipChannel`。 10 | - **with_ctrl** (bool) - 是否在控制为上添加比特。默认值: ``True``。 11 | - **focus_on** (int) - 只讲该噪声信道作用在 ``focus_on`` 比特上。如果为 ``None``,则作用在量子门的所有比特上。默认值: ``None``。 12 | - **add_after** (bool) - 是否在量子门后面添加信道。如果为 ``False``,信道将会加在量子门前面。默认值: ``True``。 13 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.ChannelAdderBase.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.ChannelAdderBase 2 | ========================================= 3 | 4 | .. py:class:: mindquantum.core.circuit.ChannelAdderBase(add_after=True) 5 | 6 | 在量子门前面或者后面添加信道。 7 | 8 | 本方法为所有信道添加器的基类。在所有的派生类中,你需要定义 `_accepter`、 `_excluder` 和 `_handler` 方法。 `_accepter` 方法是一些接受规则的集合,每一个想要添加噪声的量子门都需要满足这些接受规则。 `_excluder` 方法是一些拒绝规则的集合,每一个想要添加噪声的量子信道都需要不被这些规则接受。 `_handler` 是在满足接受规则和拒绝拒绝规则时对量子门的具体操作。 9 | 10 | 参数: 11 | - **add_after** (bool) - 在量子门前面或者后面添加量子信道。默认值: ``True``。 12 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.DepolarizingChannelAdder.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.DepolarizingChannelAdder 2 | ================================================= 3 | 4 | .. py:class:: mindquantum.core.circuit.DepolarizingChannelAdder(p: float, n_qubits: int, add_after: bool = True) 5 | 6 | 去极化信道添加器。 7 | 8 | 参数: 9 | - **p** (float) - 去极化信道概率。 10 | - **n_qubits** (int) - 去极化信道的比特数。 11 | - **add_after** (bool) - 在量子门前面或者后面添加量子信道。默认值: ``True``。 12 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.GateSelector.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.GateSelector 2 | ===================================== 3 | 4 | .. py:class:: mindquantum.core.circuit.GateSelector(gate: str) 5 | 6 | 挑选量子门来添加噪声信道。 7 | 8 | 参数: 9 | - **gate** (str) - 想要添加信道的量子门。当前可以是 'H','X','Y', 'Z','RX','RY','RZ','CX','CZ','SWAP'。 10 | 11 | .. py:method:: supported_gate() 12 | :property: 13 | 14 | 获取门选择器支持的门。 15 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.MeasureAccepter.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.MeasureAccepter 2 | ======================================== 3 | 4 | .. py:class:: mindquantum.core.circuit.MeasureAccepter() 5 | 6 | 选取测量门。 7 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.MixerAdder.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.MixerAdder 2 | =================================== 3 | 4 | .. py:class:: mindquantum.core.circuit.MixerAdder(adders: typing.List[ChannelAdderBase], add_after=True) 5 | 6 | 在子添加器的接受集被满足、拒绝集被拒绝时依次执行所有的添加器。 7 | 8 | 参数: 9 | - **adders** (List[:class:`~.core.gates.BitFlipChannel`]) - 想要混合的噪声添加器。 10 | - **add_after** (bool) - 是否在量子门后面添加信道。如果为 ``False``,信道将会加在量子门前面。默认值: ``True``。 11 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.NoiseChannelAdder.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.NoiseChannelAdder 2 | ========================================== 3 | 4 | .. py:class:: mindquantum.core.circuit.NoiseChannelAdder(channel: NoiseGate, with_ctrl=True, focus_on: int = None, add_after: bool = True) 5 | 6 | 添加一个单比特量子信道。 7 | 8 | 参数: 9 | - **channel** (:class:`~.core.gates.NoiseGate`) - 一个单比特量子信道。 10 | - **with_ctrl** (bool) - 是否在控制为上添加比特。默认值: ``True``。 11 | - **focus_on** (int) - 只讲该噪声信道作用在 ``focus_on`` 比特上。如果为 ``None``,则作用在量子门的所有比特上。默认值: ``None``。 12 | - **add_after** (bool) - 是否在量子门后面添加信道。如果为 ``False``,信道将会加在量子门前面。默认值: ``True``。 13 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.NoiseExcluder.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.NoiseExcluder 2 | ======================================== 3 | 4 | .. py:class:: mindquantum.core.circuit.NoiseExcluder(add_after=True) 5 | 6 | 排除噪声门。 7 | 8 | 参数: 9 | - **add_after** (bool) - 在量子门前面或者后面添加量子信道。默认值: ``True``。 10 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.QubitIDConstrain.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.QubitIDConstrain 2 | ========================================= 3 | 4 | .. py:class:: mindquantum.core.circuit.QubitIDConstrain(qubit_ids: typing.Union[int, typing.List[int]], add_after: bool = True) 5 | 6 | 只将噪声信道作用在给定比特序号的量子门上。 7 | 8 | 参数: 9 | - **qubit_ids** (Union[int, List[int]]) - 想要选择的比特序号的列表。 10 | - **add_after** (bool) - 在量子门前面或者后面添加量子信道。默认值: ``True``。 11 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.QubitNumberConstrain.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.QubitNumberConstrain 2 | ============================================= 3 | 4 | .. py:class:: mindquantum.core.circuit.QubitNumberConstrain(n_qubits: int, with_ctrl: bool = True, add_after: bool = True) 5 | 6 | 只将噪声信道作用在比特数为 ``n_qubits`` 的量子门上。 7 | 8 | 参数: 9 | - **n_qubits** (int) - 量子门的比特数目。 10 | - **with_ctrl** (bool) - 控制比特是否算在总比特数目之内。默认值: ``True`` 。 11 | - **add_after** (bool) - 在量子门前面或者后面添加量子信道。默认值: ``True``。 12 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.ReverseAdder.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.ReverseAdder 2 | ===================================== 3 | 4 | .. py:class:: mindquantum.core.circuit.ReverseAdder(adder: ChannelAdderBase) 5 | 6 | 翻转给定信道添加器的接受和拒绝规则。 7 | 8 | 参数: 9 | - **adder** (:class:`~.core.circuit.ChannelAdderBase`) - 一个信道添加器。 10 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.SequentialAdder.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.SequentialAdder 2 | ======================================== 3 | 4 | .. py:class:: mindquantum.core.circuit.SequentialAdder(adders: typing.List[ChannelAdderBase]) 5 | 6 | 依次执行每一个添加器。 7 | 8 | 参数: 9 | - **adders** (List[:class:`~.core.circuit.ChannelAdderBase`]) - 想要执行的 adder 。 10 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.SwapParts.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.SwapParts 2 | =================================== 3 | 4 | .. py:class:: mindquantum.core.circuit.SwapParts(a: Iterable, b: Iterable, maps_ctrl=None) 5 | 6 | 交换量子线路中两个不同的部分,可以增加控制比特,也可以不加。 7 | 8 | 参数: 9 | - **a** (Iterable) - 您需要交换的第一部分。 10 | - **b** (Iterable) - 您需要交换的第二部分。 11 | - **maps_ctrl** (int, Iterable) - 通过单个量子比特或不同量子比特来控制交换,或者不加控制量子比特。默认值: ``None``。 12 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.UN.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.UN 2 | ============================ 3 | 4 | .. py:class:: mindquantum.core.circuit.UN(gate: BasicGate, maps_obj, maps_ctrl=None) 5 | 6 | 将量子门映射到多个目标量子位和控制量子位。 7 | 8 | 参数: 9 | - **gate** (BasicGate) - 量子门。 10 | - **maps_obj** (Union[int, list[int]]) - 目标量子比特。 11 | - **maps_ctrl** (Union[int, list[int]]) - 控制量子比特。默认值: ``None`` 。 12 | 13 | 返回: 14 | Circuit,返回一个量子线路。 15 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.add_prefix.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.add_prefix 2 | ==================================== 3 | 4 | .. py:function:: mindquantum.core.circuit.add_prefix(circuit_fn, prefix: str) 5 | 6 | 在含参量子线路或含参量子算子(可以生成含参量子线路的函数)的参数上添加前缀。 7 | 8 | 参数: 9 | - **circuit_fn** (Union[Circuit, FunctionType, MethodType]) - 量子线路,或可以生成量子线路的函数。 10 | - **prefix** (str) - 添加到每个参数中的前缀。 11 | 12 | 返回: 13 | Circuit,或可以生成Circuit的函数。 14 | 15 | 异常: 16 | - **TypeError** - 如果前缀不是字符串。 17 | - **TypeError** - `circuit_fn` 不是Circuit或者未返回Circuit。 18 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.add_suffix.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.add_suffix 2 | ==================================== 3 | 4 | .. py:function:: mindquantum.core.circuit.add_suffix(circuit_fn, suffix: str) 5 | 6 | 在含参量子线路或含参量子算子(可以生成含参量子线路的函数)的参数上添加后缀。 7 | 8 | 参数: 9 | - **circuit_fn** (Union[Circuit, FunctionType, MethodType]) - 量子线路,或可以生成量子线路的函数。 10 | - **suffix** (str) - 添加到每个参数中的后缀。 11 | 12 | 返回: 13 | Circuit,或可以生成Circuit的函数。 14 | 15 | 异常: 16 | - **TypeError** - 如果后缀不是字符串。 17 | - **TypeError** - `circuit_fn` 不是Circuit或者未返回Circuit。 18 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.apply.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.apply 2 | =============================== 3 | 4 | .. py:function:: mindquantum.core.circuit.apply(circuit_fn, qubits) 5 | 6 | 将量子线路或量子算子(可以生成量子线路的函数)作用到不同的量子比特上。 7 | 8 | 参数: 9 | - **circuit_fn** (Union[Circuit, FunctionType, MethodType]) - 量子线路,或可以生成量子线路的函数。 10 | - **qubits** (list[int]) - 要应用的新量子比特。 11 | 12 | 返回: 13 | Circuit,或可以生成Circuit的函数。 14 | 15 | 异常: 16 | - **TypeError** - 如果量子比特不是list。 17 | - **ValueError** - 如果量子比特的任何元素为负数。 18 | - **TypeError** - 如果 `circuit_fn` 不是Circuit或不返回Circuit。 19 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.as_ansatz.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.as_ansatz 2 | =================================== 3 | 4 | .. py:function:: mindquantum.core.circuit.as_ansatz(circuit_fn) 5 | 6 | 将线路转化为ansatz线路的装饰器。 7 | 8 | 参数: 9 | - **circuit_fn** (Union[Circuit, FunctionType, MethodType]) - 量子线路,或可以生成量子线路的函数。 10 | 11 | 返回: 12 | - Function, 如果 `circuit_fn` 是一个返回值为 `Circuit` 的函数。 13 | - Circuit,如果 `circuit_fn` 本身就是 `Circuit` 。 14 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.as_encoder.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.as_encoder 2 | ==================================== 3 | 4 | .. py:function:: mindquantum.core.circuit.as_encoder(circuit_fn) 5 | 6 | 将线路转化为编码线路的装饰器。 7 | 8 | 参数: 9 | - **circuit_fn** (Union[Circuit, FunctionType, MethodType]) - 量子线路,或可以生成量子线路的函数。 10 | 11 | 返回: 12 | - Function,如果 `circuit_fn` 是一个返回值为线路的函数。 13 | - Circuit,如果 `circuit_fn` 本身就是线路。 14 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.change_param_name.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.change_param_name 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.core.circuit.change_param_name(circuit_fn, name_map) 5 | 6 | 更改含参量子线路或含参量子算子(可以生成含参量子线路的函数)里的参数名称。 7 | 8 | 参数: 9 | - **circuit_fn** (Union[Circuit, FunctionType, MethodType]) - 量子线路,或可以生成量子线路的函数。 10 | - **name_map** (dict) - 参数名称映射的dict。 11 | 12 | 返回: 13 | Circuit,或可以生成Circuit的函数。 14 | 15 | 异常: 16 | - **TypeError** - 如果 `name_map` 不是映射。 17 | - **TypeError** - 如果 `name_map` 的 `key` 不是字符串。 18 | - **TypeError** - 如果 `name_map` 的 `value` 不是字符串。 19 | - **TypeError** - 如果 `circuit_fn` 不是Circuit或不能返回Circuit。 20 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.controlled.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.controlled 2 | ==================================== 3 | 4 | .. py:function:: mindquantum.core.circuit.controlled(circuit_fn) 5 | 6 | 在量子线路或量子算子(可以生成量子线路的函数)上添加控制量子比特。 7 | 8 | 参数: 9 | - **circuit_fn** (Union[Circuit, FunctionType, MethodType]) - 量子线路,或可以生成量子线路的函数。 10 | 11 | 返回: 12 | 可以生成Circuit的函数。 13 | 14 | 异常: 15 | - **TypeError** - `circuit_fn` 不是Circuit或无法返回Circuit。 16 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.dagger.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.dagger 2 | ================================ 3 | 4 | .. py:function:: mindquantum.core.circuit.dagger(circuit_fn) 5 | 6 | 获取量子线路或量子算子(可以生成量子线路的函数)的共轭转置。 7 | 8 | 参数: 9 | - **circuit_fn** (Union[Circuit, FunctionType, MethodType]) - 量子线路,或可以生成量子线路的函数。 10 | 11 | 返回: 12 | Circuit,或可以生成Circuit的函数。 13 | 14 | 异常: 15 | - **TypeError** - 如果 `circuit_fn` 不是Circuit或无法返回Circuit。 16 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.decompose_single_term_time_evolution.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.decompose_single_term_time_evolution 2 | ============================================================== 3 | 4 | .. py:function:: mindquantum.core.circuit.decompose_single_term_time_evolution(term, para) 5 | 6 | 将时间演化门分解成基本的量子门。 7 | 8 | 这个函数只适用于只有单个泡利词的哈密顿量。 9 | 例如, :math:`exp^{-it\text{ham}}` , :math:`\text{ham}` 只能是一个泡利词,如 :math:`\text{ham}=X_0 Y_1 Z_2` 。此时,结果是 `((0, 'X'), (1, 'Y'), (2, 'Z'))`。 10 | 当演化时间被表示成 :math:`t=ax+by` 时,参数将是 `{'x':a, 'y':b}`。 11 | 12 | 参数: 13 | - **term** (tuple, QubitOperator) - 仅演化量子算子的哈密顿量项。 14 | - **para** (Union[dict, numbers.Number]) - 演化算子的参数。 15 | 16 | 返回: 17 | Circuit,量子线路。 18 | 19 | 异常: 20 | - **ValueError** - 如果 `term` 里有多个泡利句。 21 | - **TypeError** - 如果 `term` 不是 `map`。 22 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.partial_psi_partial_psi.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.partial_psi_partial_psi 2 | ================================================= 3 | 4 | .. py:function:: mindquantum.core.circuit.partial_psi_partial_psi(circuit: Circuit, backend='mqvector') 5 | 6 | 根据给定参数化量子线路,计算矩阵 :math:`A_{i,j}` 。 7 | 8 | .. math:: 9 | 10 | A_{i,j} = \frac{\partial \left<\psi\right| }{\partial x_{i}} 11 | \frac{\partial \left|\psi\right> }{\partial x_{j}} 12 | 13 | 参数: 14 | - **circuit** (Circuit) - 一个给定的参数化量子线路。 15 | - **backend** (str) - 一个受支持的量子模拟器后端。请参考 :class:`~.simulator.Simulator` 的描述。默认值: ``'mqvector'``。 16 | 17 | 返回: 18 | Function,一个函数,该函数输入参数化量子线路的值,返回量子态对不同参数的导数之间的内积。 19 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.partial_psi_psi.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.partial_psi_psi 2 | ========================================= 3 | 4 | .. py:function:: mindquantum.core.circuit.partial_psi_psi(circuit: Circuit, backend='mqvector') 5 | 6 | 根据给定参数化量子线路,计算矩阵 :math:`B_i` 。 7 | 8 | .. math:: 9 | 10 | B_i = \frac{\partial \left<\psi\right| }{\partial x_i}\left|\psi\right> 11 | 12 | 参数: 13 | - **circuit** (Circuit) - 一个给定的参数化量子线路。 14 | - **backend** (str) - 一个受支持的量子模拟器后端。请参考 :class:`~.simulator.Simulator` 的描述。默认值: ``'mqvector'``。 15 | 16 | 返回: 17 | Function,一个函数,该函数输入参数化量子线路的值,返回量子态对不同参数的导数与量子态本身的内积。 18 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.pauli_word_to_circuits.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.pauli_word_to_circuits 2 | ================================================ 3 | 4 | .. py:function:: mindquantum.core.circuit.pauli_word_to_circuits(qubitops) 5 | 6 | 将单泡利词的量子算子转换成量子线路。 7 | 8 | 参数: 9 | - **qubitops** (QubitOperator, Hamiltonian) - 单泡利词的量子算子。 10 | 11 | 返回: 12 | Circuit,量子线路。 13 | 14 | 异常: 15 | - **TypeError** - 如果 `qubitops` 不是 `Hamiltonian` 或 `QubitOperator` 。 16 | - **ValueError** - 如果 `qubitops` 是 `QubitOperator`,但不是在 ``'origin'`` 模式下。 17 | - **ValueError** - 如果 `qubitops` 有多个泡利词。 18 | -------------------------------------------------------------------------------- /docs/api_python/core/circuit/mindquantum.core.circuit.shift.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.circuit.shift 2 | =============================== 3 | 4 | .. py:function:: mindquantum.core.circuit.shift(circ, inc) 5 | 6 | 移动给定线路的量子比特范围。 7 | 8 | 参数: 9 | - **circ** (circuit) - 进行移位操作的电路。 10 | - **inc** (int) - 移动量子比特位的距离。 11 | 12 | 返回: 13 | Circuit,移位后的线路。 14 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.BarrierGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.BarrierGate 2 | =================================== 3 | 4 | .. py:class:: mindquantum.core.gates.BarrierGate(show=True) 5 | 6 | 栅栏门会将两个量子门分开在不同的层级上。 7 | 8 | 参数: 9 | - **show** (bool) - 是否展示栅栏门。默认值: ``True``. 10 | 11 | .. py:method:: get_cpp_obj() 12 | 13 | 返回该门的c++对象。 14 | 15 | .. py:method:: on(obj_qubits, ctrl_qubits=None) 16 | 17 | 定义该门作用在哪些量子比特上。受控位必须为 ``None``,应为栅栏门不能被其他比特控制。 18 | 19 | 参数: 20 | - **obj_qubits** (int, list[int]) - 指明量子门作用在哪些量子比特上,可以是单个比特,也可以是一连串的连续比特。 21 | - **ctrl_qubits** (int, list[int]) - 指明量子门受哪些量子比特控制。默认值: ``None``。 22 | 23 | 返回: 24 | 量子门,返回一个新的量子门。 25 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.BitFlipChannel.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.BitFlipChannel 2 | ====================================== 3 | 4 | .. py:class:: mindquantum.core.gates.BitFlipChannel(p: float, **kwargs) 5 | 6 | 比特翻转信道。描述的噪声体现为:以 :math:`P` 的概率翻转量子比特(作用 :math:`X` 门),或以 :math:`1-P` 的概率保持不变(作用 :math:`I` 门)。 7 | 8 | 比特翻转信道的数学表示如下: 9 | 10 | .. math:: 11 | 12 | \epsilon(\rho) = (1 - P)\rho + P X \rho X 13 | 14 | 其中 :math:`\rho` 是密度矩阵形式的量子态; :math:`P` 是作用额外 :math:`X` 门的概率。 15 | 16 | 参数: 17 | - **p** (int, float) - 发生错误的概率。 18 | 19 | .. py:method:: matrix() 20 | 21 | 返回该噪声信道的Kraus算符。 22 | 23 | 返回: 24 | list,包含了该噪声信道的Kraus算符。 25 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.BitPhaseFlipChannel.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.BitPhaseFlipChannel 2 | =========================================== 3 | 4 | .. py:class:: mindquantum.core.gates.BitPhaseFlipChannel(p: float, **kwargs) 5 | 6 | 比特相位翻转信道。描述的噪声体现为:以 :math:`P` 的概率翻转比特的量子态和相位(作用 :math:`Y` 门),或以 :math:`1-P` 的概率保持不变(作用 :math:`I` 门)。 7 | 8 | 比特相位翻转通道的数学表示如下: 9 | 10 | .. math:: 11 | 12 | \epsilon(\rho) = (1 - P)\rho + P Y \rho Y 13 | 14 | 其中, :math:`\rho` 是密度矩阵形式的量子态; :math:`P` 是作用额外 :math:`Y` 门的概率。 15 | 16 | 参数: 17 | - **p** (int, float) - 发生错误的概率。 18 | 19 | .. py:method:: matrix() 20 | 21 | 返回该噪声信道的Kraus算符。 22 | 23 | 返回: 24 | list,包含了该噪声信道的Kraus算符。 25 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.CNOTGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.CNOTGate 2 | ================================ 3 | 4 | .. py:class:: mindquantum.core.gates.CNOTGate 5 | 6 | 控制X门。 7 | 8 | 更多用法,请参见 :class:`~.core.gates.XGate` 。 9 | 10 | .. py:method:: get_cpp_obj() 11 | 12 | 返回该门的c++对象。 13 | 14 | .. py:method:: on(obj_qubits, ctrl_qubits=None) 15 | 16 | 定义量子门作用在哪些量子别上,并受哪些量子比特控制。 17 | 18 | .. note:: 19 | 在本框架中,接口中的第一个参数是量子门作用在哪些比特上,第二个参数是控制比特,即使对于控制门也是如此,例如CNOT门。 20 | 21 | 参数: 22 | - **obj_qubits** (int, list[int]) - 指明量子门作用在哪些量子比特上。 23 | - **ctrl_qubits** (int, list[int]) - 指明量子门受哪些量子比特控制。默认值: ``None``。 24 | 25 | 返回: 26 | 量子门,返回一个新的量子门。 27 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.GroupedPauli.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.GroupedPauli 2 | =================================== 3 | 4 | .. py:class:: mindquantum.core.gates.GroupedPauli(pauli_string: str) 5 | 6 | 多比特泡利串旋转门。 7 | 8 | 组合的泡利串门可以将泡利算符同时作用到量子态上,这将会加速量子线路的演化。 9 | 10 | .. math:: 11 | 12 | U =\otimes_i\sigma_i, \text{where } \sigma \in \{I, X, Y, Z\} 13 | 14 | 参数: 15 | - **pauli_string** (str) - 泡利串。泡利串中的元素只能是 ``['i', 'x', 'y', 'z', 'I', 'X', 'Y', 'Z']``。 16 | 17 | .. py:method:: get_cpp_obj() 18 | 19 | 返回该门的c++对象。 20 | 21 | .. py:method:: matrix(full=False) 22 | 23 | 返回该量子门的矩阵。 24 | 25 | 参数: 26 | - **full** (bool) - 是否获取完整的矩阵(受控制比特和作用比特影响)。默认值: ``False``。 27 | 28 | 返回: 29 | numpy.ndarray,该量子门的矩阵形式。 30 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.GroupedPauliChannel.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.GroupedPauliChannel 2 | ========================================== 3 | 4 | .. py:class:: mindquantum.core.gates.GroupedPauliChannel(probs: npt.NDArray[np.float64], **kwargs) 5 | 6 | 组合泡利信道。 7 | 8 | 该信道等价与一组泡利信道,但是在模拟时,会比一个一个作用泡利信道快很多。关于泡利信道的更多细节,请参考 :class:`~.core.gates.PauliChannel`。 9 | 10 | 泡利信道的数学表示如下: 11 | 12 | .. math:: 13 | 14 | \epsilon(\rho) = \otimes_i \epsilon_\text{pauli}^i(\rho) 15 | 16 | 参数: 17 | - **probs** (numpy.ndarray) - 所有泡利信道的误差概率。该参数的维度是 `(n, 3)`,其中第一个维度 `n` 表示该组合泡利信道的比特数。第二个维度 `3` 表示每个信道分别发生 :math:`X`, :math:`Y` 或 :math:`Z` 翻转的概率。 18 | 19 | 20 | .. py:method:: get_cpp_obj() 21 | 22 | 返回量子门的c++对象。 23 | 24 | .. py:method:: matrix() 25 | 26 | 返回该噪声信道的Kraus算符。 27 | 28 | 返回: 29 | list,包含了所有泡利信道的Kraus算符。 30 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.HGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.HGate 2 | ============================= 3 | 4 | .. py:class:: mindquantum.core.gates.HGate 5 | 6 | Hadamard门。矩阵为: 7 | 8 | .. math:: 9 | 10 | {\rm H}=\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix} 11 | 12 | 更多用法,请参见 :class:`~.core.gates.XGate`。 13 | 14 | .. py:method:: get_cpp_obj() 15 | 16 | 返回该门的c++对象。 17 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.IGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.IGate 2 | ============================= 3 | 4 | .. py:class:: mindquantum.core.gates.IGate 5 | 6 | Identity门。矩阵为: 7 | 8 | .. math:: 9 | 10 | {\rm I}=\begin{pmatrix}1&0\\0&1\end{pmatrix} 11 | 12 | 更多用法,请参见 :class:`~.core.gates.XGate`。 13 | 14 | .. py:method:: get_cpp_obj() 15 | 16 | 返回该门的c++对象。 17 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.ISWAPGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.ISWAPGate 2 | ================================= 3 | 4 | .. py:class:: mindquantum.core.gates.ISWAPGate 5 | 6 | ISWAP门会交换两个不同的量子比特并且为 :math:`\left|01\right>` 和 :math:`\left|10\right>` 的振幅增加相位 :math:`i`。 7 | 8 | 更多用法,请参见 :class:`~.core.gates.XGate`。 9 | 10 | .. py:method:: get_cpp_obj() 11 | 12 | 返回该门的c++对象。 13 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.Measure.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.Measure 2 | =============================== 3 | 4 | .. py:class:: mindquantum.core.gates.Measure(name='', reset_to=None) 5 | 6 | 测量量子比特的测量门。 7 | 8 | 参数: 9 | - **name** (str) - 此测量门的键。在量子线路中,不同测量门的键应该是唯一的。默认值: ``''``。 10 | - **reset_to** (Union[int, None]) - 将量子比特重置为0态或者1态。如果是 ``None``,则不重置量子比特。默认值: ``None``。 11 | 12 | .. py:method:: get_cpp_obj() 13 | 14 | 获取测量门的底层c++对象。 15 | 16 | .. py:method:: hermitian() 17 | 18 | 测量门的厄米形式,返回其自身。 19 | 20 | .. py:method:: on(obj_qubits, ctrl_qubits=None) 21 | 22 | 定义测量门作用在什么量子比特上。 23 | 24 | 参数: 25 | - **obj_qubits** (Union[int, list[int]]) - 对哪个比特进行测量。 26 | - **ctrl_qubits** (Union[int, list[int]]) - 测量门不允许设置控制位。 27 | 28 | 返回: 29 | Measure,以及定义好作用在哪个比特上的测量门。 30 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.NoiseGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.NoiseGate 2 | ================================ 3 | 4 | .. py:class:: mindquantum.core.gates.NoiseGate(name, n_qubits, obj_qubits=None, ctrl_qubits=None) 5 | 6 | 噪声信道。 7 | 8 | 参数: 9 | - **name** (str) - 此门的名称。 10 | - **n_qubits** (int) - 这个门有多少个量子比特。 11 | - **obj_qubits** (int, list[int]) - 具体门作用在哪个量子比特上。 12 | - **ctrl_qubits** (int, list[int]) - 指定控制量子比特。默认值: `None`。 13 | 14 | .. py:method:: on(obj_qubits, ctrl_qubits=None) 15 | 16 | 定义门作用于哪个量子比特和控制量子比特。 17 | 18 | 参数: 19 | - **obj_qubits** (int, list[int]) - 指定门作用在哪个量子比特上。 20 | - **ctrl_qubits** (int, list[int]) - 噪声信道的控制量子比特应该总是 ``None``。 21 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.NoneParameterGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.NoneParameterGate 2 | ========================================= 3 | 4 | .. py:class:: mindquantum.core.gates.NoneParameterGate(name, n_qubits, obj_qubits=None, ctrl_qubits=None) 5 | 6 | 非参数化的门。 7 | 8 | 参数: 9 | - **name** (str) - 此门的名称。 10 | - **n_qubits** (int) - 这个门有多少个量子比特。 11 | - **obj_qubits** (int, list[int]) - 具体门作用在哪个量子比特上。 12 | - **ctrl_qubits** (int, list[int]) - 指定控制量子比特。默认值: `None`。 13 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.PhaseFlipChannel.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.PhaseFlipChannel 2 | ======================================== 3 | 4 | .. py:class:: mindquantum.core.gates.PhaseFlipChannel(p: float, **kwargs) 5 | 6 | 相位翻转信道。描述的噪声体现为:以 :math:`P` 的概率翻转量子比特的相位(应用Z门),或以 :math:`1-P` 的概率保持不变(作用I门)。 7 | 8 | 相位翻转信道的数学表示如下: 9 | 10 | .. math:: 11 | 12 | \epsilon(\rho) = (1 - P)\rho + P Z \rho Z 13 | 14 | 其中,:math:`\rho` 是密度矩阵形式的量子态; :math:`P` 是作用额外Z门的概率。 15 | 16 | 参数: 17 | - **p** (int, float) - 发生错误的概率。 18 | 19 | .. py:method:: matrix() 20 | 21 | 返回该噪声信道的Kraus算符。 22 | 23 | 返回: 24 | list,包含了该噪声信道的Kraus算符。 25 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.Power.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.Power 2 | =============================== 3 | 4 | .. py:class:: mindquantum.core.gates.Power(gate, exponent=0.5) 5 | 6 | 作用在非参数化门上的指数运算符。 7 | 8 | 参数: 9 | - **gates** (:class:`~.core.gates.NoneParameterGate`) - 要作用指数运算符的基本门。 10 | - **exponent** (int, float) - 指数。默认值: ``0.5``。 11 | 12 | .. py:method:: get_cpp_obj() 13 | 14 | 返回量子门的c++对象。 15 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.QuantumGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.QuantumGate 2 | ================================== 3 | 4 | .. py:class:: mindquantum.core.gates.QuantumGate(name, n_qubits, obj_qubits=None, ctrl_qubits=None) 5 | 6 | 非参数化的门。 7 | 8 | 参数: 9 | - **name** (str) - 此门的名称。 10 | - **n_qubits** (int) - 这个门有多少个量子比特。 11 | - **obj_qubits** (int, list[int]) - 具体门作用在哪个量子比特上。 12 | - **ctrl_qubits** (int, list[int]) - 指定控制量子比特。默认值: `None`。 13 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.RX.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.RX 2 | =============================== 3 | 4 | .. py:class:: mindquantum.core.gates.RX(pr) 5 | 6 | 围绕x轴的旋转门。 7 | 8 | .. math:: 9 | 10 | {\rm RX}=\begin{pmatrix}\cos(\theta/2)&-i\sin(\theta/2)\\ 11 | -i\sin(\theta/2)&\cos(\theta/2)\end{pmatrix} 12 | 13 | 该旋转门可以用三种不同的方式初始化。 14 | 15 | 1. 如果用单个数字初始化它,那么它将是一个具有一定旋转角度的非参数化门。 16 | 17 | 2. 如果使用单个str初始化它,那么它将是只有一个参数的参数化门,默认系数为1。 18 | 19 | 3. 如果使用dict初始化它,例如 `{'a':1,'b':2}` ,则此门可以包含多个具有特定系数的参数。在这种情况下,它可以表示为: 20 | 21 | 22 | .. math:: 23 | 24 | RX(a+2b) 25 | 26 | 参数: 27 | - **pr** (Union[int, float, str, dict, ParameterResolver]) - 参数化门的参数,详细解释请参见上文。 28 | 29 | .. py:method:: get_cpp_obj() 30 | 31 | 返回该门的c++对象。 32 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.RY.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.RY 2 | =============================== 3 | 4 | .. py:class:: mindquantum.core.gates.RY(pr) 5 | 6 | 围绕y轴的旋转门。更多用法,请参见 :class:`~.core.gates.RX`。 7 | 8 | .. math:: 9 | 10 | {\rm RY}=\begin{pmatrix}\cos(\theta/2)&-\sin(\theta/2)\\ 11 | \sin(\theta/2)&\cos(\theta/2)\end{pmatrix} 12 | 13 | 参数: 14 | - **pr** (Union[int, float, str, dict, ParameterResolver]) - 参数化门的参数,详细解释请参见上文。 15 | 16 | .. py:method:: get_cpp_obj() 17 | 18 | 返回该门的c++对象。 19 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.RZ.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.RZ 2 | =============================== 3 | 4 | .. py:class:: mindquantum.core.gates.RZ(pr) 5 | 6 | 围绕z轴的旋转门。更多用法,请参见 :class:`~.core.gates.RX`。 7 | 8 | .. math:: 9 | 10 | {\rm RZ}=\begin{pmatrix}\exp(-i\theta/2)&0\\ 11 | 0&\exp(i\theta/2)\end{pmatrix} 12 | 13 | 参数: 14 | - **pr** (Union[int, float, str, dict, ParameterResolver]) - 参数化门的参数,详细解释请参见上文。 15 | 16 | .. py:method:: get_cpp_obj() 17 | 18 | 返回该门的c++对象。 19 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.SGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.SGate 2 | =============================== 3 | 4 | .. py:class:: mindquantum.core.gates.SGate 5 | 6 | S门。矩阵为: 7 | 8 | .. math:: 9 | {\rm S}=\begin{pmatrix}1&0\\0&i\end{pmatrix} 10 | 11 | 更多用法,请参见 :class:`~.core.gates.XGate`。 12 | 13 | .. py:method:: get_cpp_obj() 14 | 15 | 返回该门的c++对象。 16 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.SWAPGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.SWAPGate 2 | ================================ 3 | 4 | .. py:class:: mindquantum.core.gates.SWAPGate 5 | 6 | SWAP门可以交换两个不同的量子比特。 7 | 8 | 更多用法,请参见 :class:`~.core.gates.XGate`。 9 | 10 | .. py:method:: get_cpp_obj() 11 | 12 | 返回该门的c++对象。 13 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.SXGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.SXGate 2 | =============================== 3 | 4 | .. py:class:: mindquantum.core.gates.SXGate 5 | 6 | SX门。矩阵为: 7 | 8 | .. math:: 9 | {\rm SX}=\frac{1}{2}\begin{pmatrix}1+i&1-i\\1-i&1+i\end{pmatrix} 10 | 11 | 更多用法,请参见 :class:`~.core.gates.XGate`。 12 | 13 | .. py:method:: get_cpp_obj() 14 | 15 | 返回该门的c++对象。 16 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.TGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.TGate 2 | =============================== 3 | 4 | .. py:class:: mindquantum.core.gates.TGate 5 | 6 | T门。矩阵为: 7 | 8 | .. math:: 9 | {\rm T}=\begin{pmatrix}1&0\\0&(1+i)/\sqrt(2)\end{pmatrix} 10 | 11 | 更多用法,请参见 :class:`~.core.gates.XGate`。 12 | 13 | .. py:method:: get_cpp_obj() 14 | 15 | 返回该门的c++对象。 16 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.UnivMathGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.UnivMathGate 2 | ==================================== 3 | 4 | .. py:class:: mindquantum.core.gates.UnivMathGate(name, matrix_value) 5 | 6 | 通用数学门。 7 | 8 | 更多用法,请参见 :class:`~.core.gates.XGate`. 9 | 10 | 参数: 11 | - **name** (str) - 此门的名称。 12 | - **mat** (np.ndarray) - 此门的矩阵值。 13 | 14 | .. py:method:: get_cpp_obj() 15 | 16 | 返回该门的c++对象。 17 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.XGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.XGate 2 | =============================== 3 | 4 | .. py:class:: mindquantum.core.gates.XGate 5 | 6 | 泡利X门。矩阵为: 7 | 8 | .. math:: 9 | 10 | {\rm X}=\begin{pmatrix}0&1\\1&0\end{pmatrix} 11 | 12 | 为了简单起见,我们将 ``X`` 定义为 ``XGate()`` 的实例。有关更多重新定义,请参考下面的功能表。 13 | 14 | .. note:: 15 | 为了简单起见,您可以在泡利门上执行指数运算(目前仅适用于泡利门)。规则如下: 16 | 17 | .. math:: 18 | 19 | X^\theta = RX(\theta\pi) 20 | 21 | .. py:method:: get_cpp_obj() 22 | 23 | 返回该门的c++对象。 24 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.YGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.YGate 2 | =============================== 3 | 4 | .. py:class:: mindquantum.core.gates.YGate 5 | 6 | 泡利Y门。矩阵为: 7 | 8 | .. math:: 9 | 10 | {\rm Y}=\begin{pmatrix}0&-i\\i&0\end{pmatrix} 11 | 12 | 更多用法,请参见 :class:`~.core.gates.XGate`。 13 | 14 | .. py:method:: get_cpp_obj() 15 | 16 | 返回该门的c++对象。 17 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.ZGate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.ZGate 2 | ============================= 3 | 4 | .. py:class:: mindquantum.core.gates.ZGate 5 | 6 | 泡利Z门。矩阵为: 7 | 8 | .. math:: 9 | 10 | {\rm Z}=\begin{pmatrix}1&0\\0&-1\end{pmatrix} 11 | 12 | 更多用法,请参见 :class:`~.core.gates.XGate`。 13 | 14 | .. py:method:: get_cpp_obj() 15 | 16 | 返回该门的c++对象。 17 | -------------------------------------------------------------------------------- /docs/api_python/core/gates/mindquantum.core.gates.gene_univ_parameterized_gate.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.gates.gene_univ_parameterized_gate 2 | ==================================================== 3 | 4 | .. py:function:: mindquantum.core.gates.gene_univ_parameterized_gate(name, matrix_generator, diff_matrix_generator) 5 | 6 | 基于单参数幺正矩阵生成自定义参数化门。 7 | 8 | .. note:: 9 | 矩阵中的元素需要显示的定义为复数,特别时对于多比特门。 10 | 11 | 参数: 12 | - **name** (str) - 此门的名称。 13 | - **matrix_generator** (Union[FunctionType, MethodType]) - 只采用一个参数生成幺正矩阵的函数或方法。 14 | - **diff_matrix_generator** (Union[FunctionType, MethodType]) - 只采用一个参数生成幺正矩阵导数的函数或方法。 15 | 16 | 返回: 17 | _ParamNonHerm,自定义的参数化门。 18 | -------------------------------------------------------------------------------- /docs/api_python/core/mindquantum.core.parameterresolver.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.parameterresolver 2 | ================================== 3 | 4 | .. py:module:: mindquantum.core.parameterresolver 5 | 6 | 7 | 参数解析器模块,用于声明MindSpore Quantum中所使用到的参数。 8 | 9 | Class 10 | --------------- 11 | 12 | .. mscnautosummary:: 13 | :toctree: parameterresolver 14 | :nosignatures: 15 | :template: classtemplate.rst 16 | 17 | mindquantum.core.parameterresolver.ParameterResolver 18 | mindquantum.core.parameterresolver.PRGenerator 19 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.Projector.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.Projector 2 | ===================================== 3 | 4 | .. py:class:: mindquantum.core.operators.Projector(proj) 5 | 6 | 投影算子。 7 | 8 | 对于一个如下所示的投影算子: 9 | 10 | .. math:: 11 | 12 | \left|01\right>\left<01\right|\otimes I^2 13 | 14 | 字符串格式为'01II'。 15 | 16 | .. note:: 17 | 索引小的量子比特位于bra和ket字符串格式的右端。 18 | 19 | 参数: 20 | - **proj** (str) - 投影算子的字符串格式。 21 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.TimeEvolution.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.TimeEvolution 2 | ========================================= 3 | 4 | .. py:class:: mindquantum.core.operators.TimeEvolution(ops: QubitOperator, time=None) 5 | 6 | 可以生成对应线路的时间演化算子。 7 | 8 | 时间演化算子将执行以下演化: 9 | 10 | .. math:: 11 | 12 | \left|\varphi(t)\right> = e^{-iHt}\left|\varphi(0)\right> 13 | 14 | .. note:: 15 | 哈密顿量应该是参数化或非参数化 `QubitOperator`。 16 | 如果 `QubitOperator` 有多项,则将使用一阶Trotter分解。 17 | 18 | 参数: 19 | - **ops** (QubitOperator) - 量子算子哈密顿量,可以参数化,也可以非参数化。 20 | - **time** (Union[numbers.Number, dict, ParameterResolver]) - 演化时间,可以是数字或参数解析器。如果是 ``None``,时间将设置为1。默认值: ``None``。 21 | 22 | .. py:method:: circuit 23 | :property: 24 | 25 | 返回时间演化算符的一阶Trotter分解线路。 26 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.commutator.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.commutator 2 | ====================================== 3 | 4 | .. py:function:: mindquantum.core.operators.commutator(left_operator, right_operator) 5 | 6 | 计算两个算子的对易。 7 | 8 | 参数: 9 | - **left_operator** (Union[FermionOperator, QubitOperator, QubitExcitationOperator]) - 第一个算子,类型是 `FermionOperator` 或者 `QubitOperator`。 10 | - **right_operator** (Union[FermionOperator, QubitOperator, QubitExcitationOperator]) - 第二个算子,类型是 `FermionOperator` 或者 `QubitOperator`。 11 | 12 | 异常: 13 | - **TypeError** - `left_operator` 和 `right_operator` 不是相同的类型。 14 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.count_qubits.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.count_qubits 2 | ======================================== 3 | 4 | .. py:function:: mindquantum.core.operators.count_qubits(operator) 5 | 6 | 计算未使用的量子比特被删除之前的量子比特数目。 7 | 8 | .. note:: 9 | 在某些情况下,我们需要删除未使用的索引。 10 | 11 | 参数: 12 | - **operator** (Union[FermionOperator, QubitOperator, QubitExcitationOperator]) - `operator` 算子类型为FermionOperator、QubitOperator或QubitExcitationOperator。 13 | 14 | 返回: 15 | int,运算符作用的最小量子比特数。 16 | 17 | 异常: 18 | - **TypeError** - 类型无效的运算符。 19 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.down_index.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.down_index 2 | ====================================== 3 | 4 | .. py:function:: mindquantum.core.operators.down_index(index) 5 | 6 | 索引顺序,默认情况下,我们将无自旋轨道设置为偶数-奇数-偶数-奇数(0,1,2,3,...)。自旋向下的轨道(β轨道)索引是奇数。 7 | 8 | 参数: 9 | - **index** (int) - 空间轨道索引。 10 | 11 | 返回: 12 | int,关联的自旋向下的轨道索引序号。 13 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.get_fermion_operator.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.get_fermion_operator 2 | =============================================== 3 | 4 | .. py:function:: mindquantum.core.operators.get_fermion_operator(operator) 5 | 6 | 将张量(多项式张量)转换为费米子运算符。 7 | 8 | 参数: 9 | - **operator** (PolynomialTensor) - 要转换为 `FermionOperator` 的 `PolynomialTensor` 。 10 | 11 | 返回: 12 | FermionOperator,FermionOperator类的实例。 13 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.ground_state_of_sum_zz.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.ground_state_of_sum_zz 2 | ================================================= 3 | 4 | .. py:function:: mindquantum.core.operators.ground_state_of_sum_zz(ops: QubitOperator, sim='mqvector') 5 | 6 | 计算只有泡利 :math:`Z` 项的哈密顿量的基态能量。 7 | 8 | 参数: 9 | - **ops** (QubitOperator) - 只有泡利 :math:`Z` 项的哈密顿量。 10 | - **sim** (str) - 所使用模拟器的类型,当前支持 ``'mqvector'`` 和 ``'mqvector_gpu'``。默认值: ``'mqvector'``。 11 | 12 | 返回: 13 | float,给定哈密顿量的基态能量。 14 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.hermitian_conjugated.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.hermitian_conjugated 2 | ================================================ 3 | 4 | .. py:function:: mindquantum.core.operators.hermitian_conjugated(operator) 5 | 6 | 返回FermionOperator或QubitOperator的厄米共轭。 7 | 8 | 参数: 9 | - **operator** (Union[FermionOperator, QubitOperator, QubitExcitationOperator]) - 输入的算子。 10 | 11 | 返回: 12 | operator(Union[FermionOperator, QubitOperator, QubitExcitationOperator]), 输入算子的厄米共轭。 13 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.normal_ordered.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.normal_ordered 2 | ========================================== 3 | 4 | .. py:function:: mindquantum.core.operators.normal_ordered(fermion_operator) 5 | 6 | 计算并返回FermionOperator的规范顺序。 7 | 根据惯例,规范顺序意味着项从最高模式索引(左侧)到最低(右侧)排序。 8 | 此外,创建运算符首先出现,然后跟随湮灭运算符。 9 | 例如 '3 4^' :math:`\rightarrow` '- 4^ 3' 。 10 | 11 | 参数: 12 | - **fermion_operator** (FermionOperator) - 此参数只能为费米子类型运算符。 13 | 14 | 返回: 15 | FermionOperator, 规范有序的FermionOperator。 16 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.number_operator.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.number_operator 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.core.operators.number_operator(n_modes=None, mode=None, coefficient=1.0) 5 | 6 | 返回 `reverse_jordan_wigner` 变换的费米数运算符。 7 | 8 | 参数: 9 | - **n_modes** (int) - 系统中模式的数量。默认值: ``None``。 10 | - **mode** (int, optional) - 返回数运算符的模式。如果是None,则返回所有点上的总数运算符。默认值: ``None``。 11 | - **coefficient** (float) - 项的系数。默认值: ``1.0``。 12 | 13 | 返回: 14 | FermionOperator,reverse_jordan_wigner变换的费米数运算符。 15 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.sz_operator.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.sz_operator 2 | ======================================= 3 | 4 | .. py:function:: mindquantum.core.operators.sz_operator(n_spatial_orbitals) 5 | 6 | 返回sz运算符。 7 | 8 | .. note:: 9 | 默认索引顺序自旋向上(α)对应于偶数索引,而自旋向下(β)对应于奇数索引。 10 | 11 | 参数: 12 | - **n_spatial_orbitals** (int) - 空间轨道数( `n_qubits // 2` )。 13 | 14 | 返回: 15 | `FermionOperator` ,对应于 `n_spatial_orbitals` 轨道上的sz运算符。 16 | -------------------------------------------------------------------------------- /docs/api_python/core/operators/mindquantum.core.operators.up_index.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.operators.up_index 2 | ==================================== 3 | 4 | .. py:function:: mindquantum.core.operators.up_index(index) 5 | 6 | 索引顺序,默认情况下,我们将无自旋轨道设置为偶数-奇数-偶数-奇数(0,1,2,3,...)。 7 | 自旋向上的自旋轨道(α轨道)索引为偶数。 8 | 9 | 参数: 10 | - **index** (int) - 空间轨道索引。 11 | 12 | 返回: 13 | int,关联的自旋向上的轨道的索引序号。 14 | -------------------------------------------------------------------------------- /docs/api_python/device/mindquantum.device.GridQubits.rst: -------------------------------------------------------------------------------- 1 | mindquantum.device.GridQubits 2 | ============================= 3 | 4 | .. py:class:: mindquantum.device.GridQubits(n_row: int, n_col: int) 5 | 6 | 格点形式的量子比特拓扑结构。 7 | 8 | 参数: 9 | - **n_row** (int) - 格点有多少行。 10 | - **n_col** (int) - 格点有多少列。 11 | 12 | .. py:method:: n_col() 13 | 14 | 获取列数。 15 | 16 | 返回: 17 | int,列数。 18 | 19 | .. py:method:: n_row() 20 | 21 | 获取行数。 22 | 23 | 返回: 24 | int,行数。 25 | -------------------------------------------------------------------------------- /docs/api_python/device/mindquantum.device.LinearQubits.rst: -------------------------------------------------------------------------------- 1 | mindquantum.device.LinearQubits 2 | =============================== 3 | 4 | .. py:class:: mindquantum.device.LinearQubits(n_qubits: int) 5 | 6 | 线性的量子比特拓扑结构。 7 | 8 | 参数: 9 | - **n_qubits** (int) - 总的比特数。 10 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.is_double_precision.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.is_double_precision 2 | ===================================== 3 | 4 | .. py:function:: mindquantum.dtype.is_double_precision(dtype) 5 | 6 | 判断一个类型是不是双精度类型。 7 | 8 | 参数: 9 | - **dtype** (mindquantum.dtype) - MindQuantum 支持的类型。 10 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.is_same_precision.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.is_same_precision 2 | =================================== 3 | 4 | .. py:function:: mindquantum.dtype.is_same_precision(dtype1, dtype2) 5 | 6 | 判断两个类型的精度是否相同。 7 | 8 | 参数: 9 | - **dtype1** (mindquantum.dtype) - MindQuantum 支持的类型。 10 | - **dtype2** (mindquantum.dtype) - MindQuantum 支持的类型。 11 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.is_single_precision.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.is_single_precision 2 | ===================================== 3 | 4 | .. py:function:: mindquantum.dtype.is_single_precision(dtype) 5 | 6 | 判断一个类型是不是单精度类型。 7 | 8 | 参数: 9 | - **dtype** (mindquantum.dtype) - MindQuantum 支持的类型。 10 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.precision_str.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.precision_str 2 | =============================== 3 | 4 | .. py:function:: mindquantum.dtype.precision_str(dtype) 5 | 6 | 返回精度的字符串。 7 | 8 | 参数: 9 | - **dtype** (mindquantum.dtype) - MindQuantum 支持的类型。 10 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.to_complex_type.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.to_complex_type 2 | ================================= 3 | 4 | .. py:function:: mindquantum.dtype.to_complex_type(dtype) 5 | 6 | 将一个类型转化为复数类型,并保持精度不变。 7 | 8 | 参数: 9 | - **dtype** (mindquantum.dtype) - MindQuantum 支持的类型。 10 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.to_double_precision.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.to_double_precision 2 | ===================================== 3 | 4 | .. py:function:: mindquantum.dtype.to_double_precision(dtype) 5 | 6 | 将一个类型转化为双精度类型。 7 | 8 | 参数: 9 | - **dtype** (mindquantum.dtype) - MindQuantum 支持的类型。 10 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.to_mq_type.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.to_mq_type 2 | ============================ 3 | 4 | .. py:function:: mindquantum.dtype.to_mq_type(dtype) 5 | 6 | 将一个类型转化为mindquantum中支持的类型。 7 | 8 | 参数: 9 | - **dtype** (Union[mindquantum.dtype, mindspore.dtype, numpy.dtype]) - MindQuantum 或 MindSpore 或 numpy 支持的类型。 10 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.to_np_type.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.to_np_type 2 | ============================ 3 | 4 | .. py:function:: mindquantum.dtype.to_np_type(dtype) 5 | 6 | 将一个类型转化为numpy中的类型。 7 | 8 | 参数: 9 | - **dtype** (mindquantum.dtype) - MindQuantum 支持的类型。 10 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.to_precision_like.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.to_precision_like 2 | =================================== 3 | 4 | .. py:function:: mindquantum.dtype.to_precision_like(dtype_src, dtype_des) 5 | 6 | 将一个类型转为跟目标类型精度相同的类型。 7 | 8 | 参数: 9 | - **dtype_src** (mindquantum.dtype) - MindQuantum 支持的类型。 10 | - **dtype_des** (mindquantum.dtype) - MindQuantum 支持的类型。 11 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.to_real_type.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.to_real_type 2 | ============================== 3 | 4 | .. py:function:: mindquantum.dtype.to_real_type(dtype) 5 | 6 | 将一个类型转化为实数类型,并保持精度不变。 7 | 8 | 参数: 9 | - **dtype** (mindquantum.dtype) - MindQuantum 支持的类型。 10 | -------------------------------------------------------------------------------- /docs/api_python/dtype/mindquantum.dtype.to_single_precision.rst: -------------------------------------------------------------------------------- 1 | mindquantum.dtype.to_single_precision 2 | ===================================== 3 | 4 | .. py:function:: mindquantum.dtype.to_single_precision(dtype) 5 | 6 | 将一个类型转化为单精度类型。 7 | 8 | 参数: 9 | - **dtype** (mindquantum.dtype) - MindQuantum 支持的类型。 10 | -------------------------------------------------------------------------------- /docs/api_python/engine/mindquantum.engine.BasicQubit.rst: -------------------------------------------------------------------------------- 1 | .. py:class:: mindquantum.engine.BasicQubit(qubit_id, circuit=None) 2 | 3 | 量子比特。 4 | 5 | 参数: 6 | - **qubit_id** (int) - 此量子比特的ID。 7 | - **circuit** (Circuit) - 此量子比特所属的量子线路,默认值: ``None``。 8 | 9 | .. py:method:: circuit 10 | :property: 11 | 12 | 得到此量子比特所属的量子线路。 13 | -------------------------------------------------------------------------------- /docs/api_python/engine/mindquantum.engine.CircuitEngine.rst: -------------------------------------------------------------------------------- 1 | .. py:class:: mindquantum.engine.CircuitEngine 2 | 3 | 一个简单的线路引擎,生成projectq格式的量子线路。 4 | 5 | .. py:method:: allocate_qubit() 6 | 7 | 分配一个量子比特。 8 | 9 | .. py:method:: allocate_qureg(n) 10 | 11 | 分配量子寄存器。 12 | 13 | 参数: 14 | - **n** (int) - 量子比特的数目。 15 | 16 | .. py:method:: circuit 17 | :property: 18 | 19 | 获取这个引擎构造的量子线路。 20 | 21 | .. py:method:: generator(n_qubits, *args, **kwds) 22 | :staticmethod: 23 | 24 | 量子线路寄存器。 25 | 26 | 参数: 27 | - **n_qubits** (int) - 量子线路的量子比特数。 28 | -------------------------------------------------------------------------------- /docs/api_python/engine/mindquantum.engine.circuit_generator.rst: -------------------------------------------------------------------------------- 1 | .. py:function:: mindquantum.engine.circuit_generator(n_qubits, *args, **kwds) 2 | 3 | 生成projectq格式的量子线路。 4 | 5 | 参数: 6 | - **n_qubits** (int) - 量子线路的量子比特数。 7 | -------------------------------------------------------------------------------- /docs/api_python/framework/layer/mindquantum.framework.MQAnsatzOnlyLayer.rst: -------------------------------------------------------------------------------- 1 | mindquantum.framework.MQAnsatzOnlyLayer 2 | ======================================= 3 | 4 | .. py:class:: mindquantum.framework.MQAnsatzOnlyLayer(expectation_with_grad, weight='normal') 5 | 6 | 仅包含ansatz线路的量子神经网络,ansatz线路的参数是可训练的参数。 7 | 8 | 参数: 9 | - **expectation_with_grad** (GradOpsWrapper) - 梯度算子,接收encoder数据和ansatz数据,并返回期望值和参数相对于期望的梯度值。 10 | - **weight** (Union[Tensor, str, Initializer, numbers.Number]) - 卷积核的初始化器。它可以是Tensor、字符串、Initializer或数字。指定字符串时,可以使用 ``'TruncatedNormal'``、 ``'Normal'``、 ``'Uniform'``、 ``'HeUniform'`` 和 ``'XavierUniform'`` 分布以及常量'One'和'Zero'分布中的值。支持别名 ``'xavier_uniform'``、 ``'he_uniform'``、 ``'ones'`` 和 ``'zeros'``。同时支持大写和小写。有关更多详细信息,请参阅Initializer的值。默认值: ``'normal'``。 11 | 12 | 输出: 13 | Tensor,hamiltonian的期望值。 14 | 15 | 异常: 16 | - **ValueError** - 如果 `weight` 的shape长度不等于1,并且 `weight` 的shape[0]不等于 `weight_size`。 17 | -------------------------------------------------------------------------------- /docs/api_python/framework/operations/mindquantum.framework.MQAnsatzOnlyOps.rst: -------------------------------------------------------------------------------- 1 | mindquantum.framework.MQAnsatzOnlyOps 2 | ===================================== 3 | 4 | .. py:class:: mindquantum.framework.MQAnsatzOnlyOps(expectation_with_grad) 5 | 6 | 仅包含ansatz线路的量子线路演化算子。通过参数化量子线路 (PQC) 获得对量子态的哈密顿期望。此算子只能在 `PYNATIVE_MODE` 下执行。 7 | 8 | 参数: 9 | - **expectation_with_grad** (GradOpsWrapper) - 接收encoder数据和ansatz数据,并返回期望值和参数相对于期望的梯度值。 10 | 11 | 输入: 12 | - **ans_data** (Tensor) - shape为 :math:`N` 的Tensor,用于ansatz电路,其中 :math:`N` 表示ansatz参数的数量。 13 | 14 | 输出: 15 | Tensor,hamiltonian的期望值。 16 | -------------------------------------------------------------------------------- /docs/api_python/framework/operations/mindquantum.framework.MQEncoderOnlyOps.rst: -------------------------------------------------------------------------------- 1 | mindquantum.framework.MQEncoderOnlyOps 2 | ====================================== 3 | 4 | .. py:class:: mindquantum.framework.MQEncoderOnlyOps(expectation_with_grad) 5 | 6 | 仅包含encoder线路的量子线路演化算子。通过参数化量子线路(PQC)获得对量子态的哈密顿期望。此算子只能在 `PYNATIVE_MODE` 下执行。 7 | 8 | 参数: 9 | - **expectation_with_grad** (GradOpsWrapper) - 接收encoder数据和ansatz数据,并返回期望值和参数相对于期望的梯度值。 10 | 11 | 输入: 12 | - **enc_data** (Tensor) - 希望编码为量子态的Tensor,其shape为 :math:`(N, M)` ,其中 :math:`N` 表示batch大小, :math:`M` 表示encoder数量。 13 | 14 | 输出: 15 | Tensor,hamiltonian的期望值。 16 | -------------------------------------------------------------------------------- /docs/api_python/framework/operations/mindquantum.framework.MQN2AnsatzOnlyOps.rst: -------------------------------------------------------------------------------- 1 | mindquantum.framework.MQN2AnsatzOnlyOps 2 | ======================================= 3 | 4 | .. py:class:: mindquantum.framework.MQN2AnsatzOnlyOps(expectation_with_grad) 5 | 6 | 仅包含ansatz线路的量子线路演化算子,算子返回在参数化量子线路(PQC)演化出的量子态上哈密顿量期望值绝对值的平方。此算子只能在 `PYNATIVE_MODE` 下执行。 7 | 8 | 参数: 9 | - **expectation_with_grad** (GradOpsWrapper) - 接收encoder数据和ansatz数据,并返回期望值和参数相对于期望的梯度值。 10 | 11 | 输入: 12 | - **ans_data** (Tensor) - shape为 :math:`N` 的Tensor,用于ansatz电路,其中 :math:`N` 表示ansatz参数的数量。 13 | 14 | 输出: 15 | Tensor,hamiltonian期望绝对值的平方。 16 | -------------------------------------------------------------------------------- /docs/api_python/framework/operations/mindquantum.framework.MQN2EncoderOnlyOps.rst: -------------------------------------------------------------------------------- 1 | mindquantum.framework.MQN2EncoderOnlyOps 2 | ======================================== 3 | 4 | .. py:class:: mindquantum.framework.MQN2EncoderOnlyOps(expectation_with_grad) 5 | 6 | 仅包含encoder线路的量子线路演化算子,算子返回参数化量子线路(PQC)演化出的量子态上哈密顿量期望绝对值的平方。此算子只能在 `PYNATIVE_MODE` 下执行。 7 | 8 | 参数: 9 | - **expectation_with_grad** (GradOpsWrapper) - 接收encoder数据和ansatz数据,并返回期望值和参数相对于期望的梯度值。 10 | 11 | 输入: 12 | - **ans_data** (Tensor) - shape为 :math:`N` 的Tensor,用于ansatz电路,其中 :math:`N` 表示ansatz参数的数量。 13 | 14 | 输出: 15 | Tensor,hamiltonian期望绝对值的平方。 16 | -------------------------------------------------------------------------------- /docs/api_python/framework/operations/mindquantum.framework.MQN2Ops.rst: -------------------------------------------------------------------------------- 1 | mindquantum.framework.MQN2Ops 2 | ============================= 3 | 4 | .. py:class:: mindquantum.framework.MQN2Ops(expectation_with_grad) 5 | 6 | 包含encoder和ansatz线路的量子线路演化算子,算子返回在参数化量子线路(PQC)演化出的量子态上哈密顿量期望绝对值的平方。此算子只能在 `PYNATIVE_MODE` 下执行。 7 | 8 | .. math:: 9 | 10 | O = \left|\left<\varphi\right| U^\dagger_l H U_r\left|\psi\right>\right|^2 11 | 12 | 参数: 13 | - **expectation_with_grad** (GradOpsWrapper) - 接收encoder数据和ansatz数据,并返回期望值和参数相对于期望的梯度值。 14 | 15 | 输入: 16 | - **enc_data** (Tensor) - 希望编码为量子态的Tensor,其shape为 :math:`(N, M)` ,其中 :math:`N` 表示batch大小, :math:`M` 表示encoder参数的数量。 17 | - **ans_data** (Tensor) - shape为 :math:`N` 的Tensor,用于ansatz电路,其中 :math:`N` 表示ansatz参数的数量。 18 | 19 | 输出: 20 | Tensor,hamiltonian期望绝对值的平方。 21 | -------------------------------------------------------------------------------- /docs/api_python/framework/operations/mindquantum.framework.MQOps.rst: -------------------------------------------------------------------------------- 1 | mindquantum.framework.MQOps 2 | =========================== 3 | 4 | .. py:class:: mindquantum.framework.MQOps(expectation_with_grad) 5 | 6 | 包含encoder和ansatz线路的量子线路演化算子,算子返回在参数化量子线路(PQC)演化出的量子态上哈密顿量期望值。此算子只能在 `PYNATIVE_MODE` 下执行。 7 | 8 | 参数: 9 | - **expectation_with_grad** (GradOpsWrapper) - 接收encoder数据和ansatz数据,并返回期望值和参数相对于期望的梯度值。 10 | 11 | 输入: 12 | - **enc_data** (Tensor) - 希望编码为量子态的Tensor,其shape为 :math:`(N, M)` ,其中 :math:`N` 表示batch大小, :math:`M` 表示encoder参数的数量。 13 | - **ans_data** (Tensor) - shape为 :math:`N` 的Tensor,用于ansatz电路,其中 :math:`N` 表示ansatz参数的数量。 14 | 15 | 输出: 16 | Tensor,hamiltonian的期望值。 17 | -------------------------------------------------------------------------------- /docs/api_python/io/mindquantum.io.bprint.rst: -------------------------------------------------------------------------------- 1 | mindquantum.io.bprint 2 | ====================== 3 | 4 | .. py:function:: mindquantum.io.bprint(strings: list, align=':', title='', v_around='=', h_around='|', fill_char=' ') 5 | 6 | 以block形状打印信息。 7 | 8 | 参数: 9 | - **strings** (list[str]) - 需要输出的信息。 10 | - **align** (str) - 仅对齐字符的垂直方向,默认值: ``":"``。 11 | - **title** (str) - 此信息块的标题,默认值: ``""``。 12 | - **v_around** (str) - 垂直边界字符,默认值: ``"="``。 13 | - **h_around** (str) - 水平边界字符,默认值: ``"|"``。 14 | - **fill_char** (str) - 用该字符填充空格。默认值: ``""``。 15 | 16 | 返回: 17 | 列表,格式化字符串的列表。 18 | -------------------------------------------------------------------------------- /docs/api_python/io/mindquantum.io.draw_topology.rst: -------------------------------------------------------------------------------- 1 | mindquantum.io.draw_topology 2 | ============================ 3 | 4 | .. py:function:: mindquantum.io.draw_topology(topo: QubitsTopology, circuit: Circuit = None, style: Dict = None) 5 | 6 | 以svg图的形式打印量子拓扑结构。 7 | 8 | 参数: 9 | - **topo** (:class:`.device.QubitsTopology`) - 量子比特拓扑结构。 10 | - **circuit** (:class:`~.core.circuit.Circuit`) - 想要在指定拓扑结构上执行的量子线路。默认值: ``None``。 11 | - **style** (Dict) - 绘制的格式配置字典。默认值: ``None``。 12 | -------------------------------------------------------------------------------- /docs/api_python/io/mindquantum.io.draw_topology_plt.rst: -------------------------------------------------------------------------------- 1 | mindquantum.io.draw_topology_plt 2 | ================================ 3 | 4 | .. py:function:: mindquantum.io.draw_topology_plt(topo: QubitsTopology, circuit: Circuit = None, style: Dict = None) 5 | 6 | 用 matplotlib 打印量子拓扑结构。 7 | 8 | 参数: 9 | - **topo** (:class:`.device.QubitsTopology`) - 量子比特拓扑结构。 10 | - **circuit** (:class:`~.core.circuit.Circuit`) - 想要在指定拓扑结构上执行的量子线路。默认值: ``None``。 11 | - **style** (Dict) - 绘制的格式配置字典。默认值: ``None``。 12 | -------------------------------------------------------------------------------- /docs/api_python/io/mindquantum.io.random_hiqasm.rst: -------------------------------------------------------------------------------- 1 | mindquantum.io.random_hiqasm 2 | ============================= 3 | 4 | .. py:function:: mindquantum.io.random_hiqasm(n_qubits, gate_num, version='0.1', seed=42) 5 | 6 | 生成随机的hiqasm格式支持的量子线路。 7 | 8 | 参数: 9 | - **n_qubits** (int) - 此量子线路中的量子比特总数。 10 | - **gate_num** (int) - 此量子线路中的门总数。 11 | - **version** (str) - HIQASM的版本。默认值: ``"0.1"``。 12 | - **seed** (int) - 生成此随机量子线路的随机种子。默认值: ``42``。 13 | 14 | 返回: 15 | str,HIQASM格式的量子线路。 16 | -------------------------------------------------------------------------------- /docs/api_python/mindquantum.algorithm.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm 2 | ===================== 3 | 4 | .. py:module:: mindquantum.algorithm 5 | 6 | 7 | 量子算法。 8 | 9 | .. mscnautosummary:: 10 | :toctree: algorithm 11 | 12 | mindquantum.algorithm.compiler 13 | mindquantum.algorithm.library 14 | mindquantum.algorithm.nisq 15 | mindquantum.algorithm.error_mitigation 16 | mindquantum.algorithm.mapping 17 | mindquantum.algorithm.qaia 18 | -------------------------------------------------------------------------------- /docs/api_python/mindquantum.core.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core 2 | ================ 3 | 4 | .. py:module:: mindquantum.core 5 | 6 | 7 | MindQuantum的核心特性(eDSL) 8 | 9 | .. mscnautosummary:: 10 | :toctree: core 11 | 12 | mindquantum.core.gates 13 | mindquantum.core.circuit 14 | mindquantum.core.operators 15 | mindquantum.core.parameterresolver 16 | -------------------------------------------------------------------------------- /docs/api_python/mindquantum.device.rst: -------------------------------------------------------------------------------- 1 | mindquantum.device 2 | ================== 3 | 4 | .. py:module:: mindquantum.device 5 | 6 | 7 | MindQuantum 硬件模块。 8 | 9 | Class 10 | ----- 11 | 12 | .. mscnautosummary:: 13 | :toctree: device 14 | :nosignatures: 15 | :template: classtemplate.rst 16 | 17 | mindquantum.device.QubitNode 18 | mindquantum.device.QubitsTopology 19 | mindquantum.device.GridQubits 20 | mindquantum.device.LinearQubits 21 | -------------------------------------------------------------------------------- /docs/api_python/mindquantum.engine.rst: -------------------------------------------------------------------------------- 1 | mindquantum.engine 2 | ================== 3 | 4 | .. py:module:: mindquantum.engine 5 | 6 | 7 | MindQuantum引擎模块。 8 | 9 | .. include:: engine/mindquantum.engine.BasicQubit.rst 10 | 11 | .. include:: engine/mindquantum.engine.CircuitEngine.rst 12 | 13 | .. include:: engine/mindquantum.engine.circuit_generator.rst 14 | 15 | .. automodule:: mindquantum.engine 16 | :members: 17 | -------------------------------------------------------------------------------- /docs/api_python/mindquantum.io.rst: -------------------------------------------------------------------------------- 1 | mindquantum.io 2 | ============== 3 | 4 | .. py:module:: mindquantum.io 5 | 6 | 7 | MindQuantum的输入/输出模块。 8 | 9 | Class 10 | ------ 11 | 12 | .. mscnautosummary:: 13 | :toctree: io 14 | :nosignatures: 15 | :template: classtemplate.rst 16 | 17 | mindquantum.io.BlochScene 18 | mindquantum.io.HiQASM 19 | mindquantum.io.OpenQASM 20 | 21 | Function 22 | --------- 23 | 24 | .. mscnautosummary:: 25 | :toctree: io 26 | :nosignatures: 27 | :template: classtemplate.rst 28 | 29 | mindquantum.io.bprint 30 | mindquantum.io.random_hiqasm 31 | mindquantum.io.draw_topology 32 | mindquantum.io.draw_topology_plt 33 | -------------------------------------------------------------------------------- /docs/api_python/mindquantum.simulator.rst: -------------------------------------------------------------------------------- 1 | mindquantum.simulator 2 | ===================== 3 | 4 | .. py:module:: mindquantum.simulator 5 | 6 | 7 | 模拟量子系统演化的量子模拟器。 8 | 9 | Class 10 | ------- 11 | 12 | .. mscnautosummary:: 13 | :toctree: simulator 14 | :nosignatures: 15 | :template: classtemplate.rst 16 | 17 | mindquantum.simulator.GradOpsWrapper 18 | mindquantum.simulator.Simulator 19 | mindquantum.simulator.NoiseBackend 20 | 21 | Function 22 | --------- 23 | 24 | .. mscnautosummary:: 25 | :toctree: simulator 26 | :nosignatures: 27 | :template: classtemplate.rst 28 | 29 | mindquantum.simulator.fidelity 30 | mindquantum.simulator.get_supported_simulator 31 | mindquantum.simulator.inner_product 32 | mindquantum.simulator.get_stabilizer_string 33 | mindquantum.simulator.get_tableau_string 34 | mindquantum.simulator.decompose_stabilizer 35 | -------------------------------------------------------------------------------- /docs/api_python/mindquantum.utils.rst: -------------------------------------------------------------------------------- 1 | mindquantum.utils 2 | ================= 3 | 4 | .. py:module:: mindquantum.utils 5 | 6 | 7 | 实用工具。 8 | 9 | Function 10 | --------- 11 | 12 | .. mscnautosummary:: 13 | :toctree: utils 14 | :nosignatures: 15 | :template: classtemplate.rst 16 | 17 | mindquantum.utils.fdopen 18 | mindquantum.utils.ket_string 19 | mindquantum.utils.mod 20 | mindquantum.utils.normalize 21 | mindquantum.utils.random_circuit 22 | mindquantum.utils.random_state 23 | mindquantum.utils.random_insert_gates 24 | 25 | Progress bar 26 | ------------ 27 | 28 | .. mscnautosummary:: 29 | :toctree: utils 30 | :nosignatures: 31 | :template: classtemplate.rst 32 | 33 | mindquantum.utils.SingleLoopProgress 34 | mindquantum.utils.TwoLoopsProgress 35 | -------------------------------------------------------------------------------- /docs/api_python/overview.rst: -------------------------------------------------------------------------------- 1 | 总览 2 | ================ 3 | 4 | .. mscnautosummary:: 5 | :nosignatures: 6 | 7 | mindquantum.dtype 8 | mindquantum.core 9 | mindquantum.simulator 10 | mindquantum.framework 11 | mindquantum.algorithm 12 | mindquantum.device 13 | mindquantum.io 14 | mindquantum.engine 15 | mindquantum.utils 16 | -------------------------------------------------------------------------------- /docs/api_python/simulator/mindquantum.simulator.NoiseBackend.rst: -------------------------------------------------------------------------------- 1 | mindquantum.simulator.NoiseBackend 2 | ================================== 3 | 4 | .. py:class:: mindquantum.simulator.NoiseBackend(base_sim: str, n_qubits: int, adder: ChannelAdderBase, seed: int = None, dtype=None) 5 | 6 | 基于噪声信道的含噪模拟器。 7 | 8 | 参数: 9 | - **base_sim** (str) - MindQuantum 支持的量子模拟器。 10 | - **n_qubits** (int) - 该噪声模拟器的比特数。 11 | - **adder** (:class:`~.core.circuit.ChannelAdderBase`) - 一个信道添加器,可以将一个量子线路转化为噪声线路。 12 | - **seed** (int) - 一个随机种子。默认值: ``None``。 13 | - **dtype** (mindquantum.dtype) - 模拟器的数据类型。如果为 ``None``,将选取为 mindquantum.complex128。默认值: ``None``。 14 | -------------------------------------------------------------------------------- /docs/api_python/simulator/mindquantum.simulator.decompose_stabilizer.rst: -------------------------------------------------------------------------------- 1 | mindquantum.simulator.decompose_stabilizer 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.simulator.decompose_stabilizer(sim: Simulator | Stabilizer) 5 | 6 | 将一个stabilizer分解为clifford量子线路。 7 | 8 | 参数: 9 | - **sim** (Simulator) - 一个stabilizer模拟器。 10 | -------------------------------------------------------------------------------- /docs/api_python/simulator/mindquantum.simulator.get_stabilizer_string.rst: -------------------------------------------------------------------------------- 1 | mindquantum.simulator.get_stabilizer_string 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.simulator.get_stabilizer_string(sim: Simulator | Stabilizer) 5 | 6 | 获取stabilizer模拟器中stabilizer的字符串形式。 7 | 8 | 参数: 9 | - **sim** (Simulator) - 一个stabilizer模拟器。 10 | -------------------------------------------------------------------------------- /docs/api_python/simulator/mindquantum.simulator.get_supported_simulator.rst: -------------------------------------------------------------------------------- 1 | mindquantum.simulator.get_supported_simulator 2 | ============================================== 3 | 4 | .. py:function:: mindquantum.simulator.get_supported_simulator() 5 | 6 | 获取MindQuantum支持的模拟器名称。 7 | 8 | 返回: 9 | list,支持的模拟器列表。 10 | -------------------------------------------------------------------------------- /docs/api_python/simulator/mindquantum.simulator.get_tableau_string.rst: -------------------------------------------------------------------------------- 1 | mindquantum.simulator.get_tableau_string 2 | =========================================== 3 | 4 | .. py:function:: mindquantum.simulator.get_tableau_string(sim: Simulator | Stabilizer) 5 | 6 | 获取stabilizer模拟器中stabilizer的表的字符串形式。 7 | 8 | 参数: 9 | - **sim** (Simulator) - 一个stabilizer模拟器。 10 | -------------------------------------------------------------------------------- /docs/api_python/simulator/mindquantum.simulator.inner_product.rst: -------------------------------------------------------------------------------- 1 | mindquantum.simulator.inner_product 2 | ==================================== 3 | 4 | .. py:function:: mindquantum.simulator.inner_product(bra_simulator: Simulator, ket_simulator: Simulator) 5 | 6 | 计算给定模拟器中两种状态的内积。 7 | 8 | 参数: 9 | - **bra_simulator** (Simulator) - 提供bra态的模拟器。 10 | - **ket_simulator** (Simulator) - 提供ket态的模拟器。 11 | 12 | 返回: 13 | numbers.Number,两个量子态的内积。 14 | -------------------------------------------------------------------------------- /docs/api_python/utils/mindquantum.utils.SingleLoopProgress.rst: -------------------------------------------------------------------------------- 1 | mindquantum.utils.SingleLoopProgress 2 | ==================================== 3 | 4 | .. py:class:: mindquantum.utils.SingleLoopProgress(n_loop: int, loop_name: str = 'Task') 5 | 6 | 一个用于展示拥有一层循环任务的进度的进度条。 7 | 8 | 参数: 9 | - **n_loop** (int) - 循环的个数。 10 | - **loop_name** (str) - 循环的进度条的标题。默认值: ``"Task"``。 11 | 12 | .. py:method:: update_loop(loop_idx: int) 13 | 14 | 更新循环进度条。 15 | 16 | 参数: 17 | - **loop_idx** (int) - 当前循环的序号。 18 | -------------------------------------------------------------------------------- /docs/api_python/utils/mindquantum.utils.TwoLoopsProgress.rst: -------------------------------------------------------------------------------- 1 | mindquantum.utils.TwoLoopsProgress 2 | ================================== 3 | 4 | .. py:class:: mindquantum.utils.TwoLoopsProgress(n_outer_loop: int, n_inner_loop: int, outer_loop_name: str = 'Epoch', inner_loop_name: str = 'Batch') 5 | 6 | 一个用于展示拥有两层循环任务的进度的进度条。 7 | 8 | 参数: 9 | - **n_outer_loop** (int) - 外层循环的个数。 10 | - **n_inner_loop** (int) - 内层循环的个数。 11 | - **outer_loop_name** (str) - 外层循环的进度条的标题。默认值: ``"Epoch"``。 12 | - **inner_loop_name** (str) - 内层循环的进度条的标题。默认值: ``"Batch"``。 13 | 14 | .. py:method:: update_inner_loop(loop_idx: int) 15 | 16 | 更新内层循环进度条。 17 | 18 | 参数: 19 | - **loop_idx** (int) - 当前内层循环的序号。 20 | 21 | .. py:method:: update_outer_loop(loop_idx: int) 22 | 23 | 更新外层循环进度条。 24 | 25 | 参数: 26 | - **loop_idx** (int) - 当前外层循环的序号。 27 | -------------------------------------------------------------------------------- /docs/api_python/utils/mindquantum.utils.fdopen.rst: -------------------------------------------------------------------------------- 1 | mindquantum.utils.fdopen 2 | ========================= 3 | 4 | .. py:function:: mindquantum.utils.fdopen(fname, mode, perms=0o600, encoding=None) 5 | 6 | 以正确权限打开文件的上下文管理器。 7 | 8 | 参数: 9 | - **fname** (str) - 需要读写的文件的路径。 10 | - **mode** (str) - 以何种方式打开文件(查询内置函数 `open()` 进行更多帮助)。 11 | - **perms** (int) - 权限掩码(查询 `os.open()` 进行更多帮助)。 12 | - **encoding** (str) - 对文件进行编码或者解码的编码器。默认值: ``None``。 13 | -------------------------------------------------------------------------------- /docs/api_python/utils/mindquantum.utils.ket_string.rst: -------------------------------------------------------------------------------- 1 | mindquantum.utils.ket_string 2 | ============================= 3 | 4 | .. py:function:: mindquantum.utils.ket_string(state, tol=1e-7) 5 | 6 | 获取量子态的ket格式。 7 | 8 | 参数: 9 | - **state** (numpy.ndarray) - 输入量子态。 10 | - **tol** (float) - 小幅度的忽略容差。默认值: ``1e-7``。 11 | 12 | 返回: 13 | str,量子态的ket格式。 14 | -------------------------------------------------------------------------------- /docs/api_python/utils/mindquantum.utils.mod.rst: -------------------------------------------------------------------------------- 1 | mindquantum.utils.mod 2 | ====================== 3 | 4 | .. py:function:: mindquantum.utils.mod(vec_in, axis=0) 5 | 6 | 计算输入向量的模。 7 | 8 | 参数: 9 | - **vec_in** (Union[list[numbers.Number], numpy.ndarray]) - 计算模的向量。 10 | - **axis** (int) - 沿着哪个轴计算模。默认值: ``0``。 11 | 12 | 返回: 13 | numpy.ndarray,输入向量的模。 14 | -------------------------------------------------------------------------------- /docs/api_python/utils/mindquantum.utils.normalize.rst: -------------------------------------------------------------------------------- 1 | mindquantum.utils.normalize 2 | ============================ 3 | 4 | .. py:function:: mindquantum.utils.normalize(vec_in, axis=0) 5 | 6 | 根据指定的轴归一化输入向量。 7 | 8 | 参数: 9 | - **vec_in** (Union[list[number], numpy.ndarray]) - 需要归一化的向量。 10 | - **axis** (int) - 沿着哪个轴归一化向量。默认值: ``0``。 11 | 12 | 返回: 13 | numpy.ndarray,归一化后的向量。 14 | -------------------------------------------------------------------------------- /docs/api_python/utils/mindquantum.utils.random_circuit.rst: -------------------------------------------------------------------------------- 1 | mindquantum.utils.random_circuit 2 | ================================= 3 | 4 | .. py:function:: mindquantum.utils.random_circuit(n_qubits, gate_num, sd_rate=0.5, ctrl_rate=0.2, seed=None) 5 | 6 | 生成随机线路。 7 | 8 | 参数: 9 | - **n_qubits** (int) - 随机线路的量子比特数。 10 | - **gate_num** (int) - 随机线路中门的数量。 11 | - **sd_rate** (float) - 单量子门和双量子门的比例。 12 | - **ctrl_rate** (float) - 门具有控制位的可能性。 13 | - **seed** (int) - 生成随机线路的随机种子。 14 | -------------------------------------------------------------------------------- /docs/api_python/utils/mindquantum.utils.random_state.rst: -------------------------------------------------------------------------------- 1 | mindquantum.utils.random_state 2 | =============================== 3 | 4 | .. py:function:: mindquantum.utils.random_state(shapes, norm_axis=0, comp=True, seed=None) 5 | 6 | 生成某个随机的量子态。 7 | 8 | 参数: 9 | - **shapes** (tuple) - 想要生成量子态的个数和维度,例如, `(m, n)` 表示m个量子态,每个状态由 :math:`\log_2(n)` 量子比特形成。 10 | - **norm_axis** (int) - 应用归一化的轴。默认值: ``0``。 11 | - **comp** (bool) - 如果为 ``True`` ,量子态的每个振幅将是一个复数。默认值: ``True``。 12 | - **seed** (int) - 随机种子。默认值: ``None``。 13 | 14 | 返回: 15 | numpy.ndarray,一个随机的归一化量子态。 16 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/mindquantum.algorithm.error_mitigation.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.error_mitigation 2 | ====================================== 3 | 4 | .. automodule:: mindquantum.algorithm.error_mitigation 5 | 6 | .. autosummary:: 7 | :toctree: error_mitigation 8 | :nosignatures: 9 | :template: classtemplate.rst 10 | 11 | mindquantum.algorithm.error_mitigation.fold_at_random 12 | mindquantum.algorithm.error_mitigation.zne 13 | mindquantum.algorithm.error_mitigation.generate_double_qubits_rb_circ 14 | mindquantum.algorithm.error_mitigation.generate_single_qubit_rb_circ 15 | mindquantum.algorithm.error_mitigation.query_double_qubits_clifford_elem 16 | mindquantum.algorithm.error_mitigation.query_single_qubit_clifford_elem 17 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/mindquantum.algorithm.library.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.library 2 | ============================== 3 | 4 | .. automodule:: mindquantum.algorithm.library 5 | 6 | .. autosummary:: 7 | :toctree: library 8 | :nosignatures: 9 | :template: classtemplate.rst 10 | 11 | mindquantum.algorithm.library.amplitude_encoder 12 | mindquantum.algorithm.library.bitphaseflip_operator 13 | mindquantum.algorithm.library.general_ghz_state 14 | mindquantum.algorithm.library.general_w_state 15 | mindquantum.algorithm.library.qft 16 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/mindquantum.algorithm.mapping.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.mapping 2 | ============================= 3 | 4 | .. automodule:: mindquantum.algorithm.mapping 5 | 6 | .. autosummary:: 7 | :toctree: mapping 8 | :nosignatures: 9 | :template: classtemplate.rst 10 | 11 | mindquantum.algorithm.mapping.SABRE 12 | mindquantum.algorithm.mapping.MQSABRE 13 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/mindquantum.algorithm.qaia.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm.qaia 2 | ========================== 3 | 4 | .. automodule:: mindquantum.algorithm.qaia 5 | 6 | .. autosummary:: 7 | :toctree: qaia 8 | :nosignatures: 9 | :template: classtemplate.rst 10 | 11 | mindquantum.algorithm.qaia.QAIA 12 | mindquantum.algorithm.qaia.CAC 13 | mindquantum.algorithm.qaia.CFC 14 | mindquantum.algorithm.qaia.LQA 15 | mindquantum.algorithm.qaia.NMFA 16 | mindquantum.algorithm.qaia.ASB 17 | mindquantum.algorithm.qaia.BSB 18 | mindquantum.algorithm.qaia.DSB 19 | mindquantum.algorithm.qaia.SFC 20 | mindquantum.algorithm.qaia.SimCIM 21 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ASWAP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ASWAP.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/PCHeaXYZ1F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/PCHeaXYZ1F.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/PCHeaXYZ2F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/PCHeaXYZ2F.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/RYCascade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/RYCascade.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/RYFull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/RYFull.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/RYLinear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/RYLinear.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/RYRZFull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/RYRZFull.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz1.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz10.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz11.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz12.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz13.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz14.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz15.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz16.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz17.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz18.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz19.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz2.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz3.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz4.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz5.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz6.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz7.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz8.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/ansatz_images/ansatz9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/api_python_en/algorithm/nisq/ansatz_images/ansatz9.png -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.ASWAP.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.ASWAP 8 | ================================ 9 | 10 | .. autoclass:: ASWAP 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz1.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz1 8 | ================================== 9 | 10 | .. autoclass:: Ansatz1 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz10.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz10 8 | =================================== 9 | 10 | .. autoclass:: Ansatz10 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz11.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz11 8 | =================================== 9 | 10 | .. autoclass:: Ansatz11 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz12.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz12 8 | =================================== 9 | 10 | .. autoclass:: Ansatz12 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz13.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz13 8 | =================================== 9 | 10 | .. autoclass:: Ansatz13 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz14.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz14 8 | =================================== 9 | 10 | .. autoclass:: Ansatz14 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz15.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz15 8 | =================================== 9 | 10 | .. autoclass:: Ansatz15 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz16.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz16 8 | =================================== 9 | 10 | .. autoclass:: Ansatz16 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz17.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz17 8 | =================================== 9 | 10 | .. autoclass:: Ansatz17 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz18.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz18 8 | =================================== 9 | 10 | .. autoclass:: Ansatz18 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz19.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz19 8 | =================================== 9 | 10 | .. autoclass:: Ansatz19 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz2.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz2 8 | ================================== 9 | 10 | .. autoclass:: Ansatz2 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz3.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz3 8 | ================================== 9 | 10 | .. autoclass:: Ansatz3 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz4.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz4 8 | ================================== 9 | 10 | .. autoclass:: Ansatz4 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz5.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz5 8 | ================================== 9 | 10 | .. autoclass:: Ansatz5 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz6.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz6 8 | ================================== 9 | 10 | .. autoclass:: Ansatz6 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz7.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz7 8 | ================================== 9 | 10 | .. autoclass:: Ansatz7 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz8.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz8 8 | ================================== 9 | 10 | .. autoclass:: Ansatz8 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.Ansatz9.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.Ansatz9 8 | ================================== 9 | 10 | .. autoclass:: Ansatz9 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.PCHeaXYZ1F.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.PCHeaXYZ1F 8 | ===================================== 9 | 10 | .. autoclass:: PCHeaXYZ1F 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.PCHeaXYZ2F.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.PCHeaXYZ2F 8 | ===================================== 9 | 10 | .. autoclass:: PCHeaXYZ2F 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.RYCascade.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.RYCascade 8 | ==================================== 9 | 10 | .. autoclass:: RYCascade 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.RYFull.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.RYFull 8 | ================================= 9 | 10 | .. autoclass:: RYFull 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.RYLinear.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.RYLinear 8 | =================================== 9 | 10 | .. autoclass:: RYLinear 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/algorithm/nisq/mindquantum.algorithm.nisq.RYRZFull.rst: -------------------------------------------------------------------------------- 1 | .. role:: hidden 2 | :class: hidden-section 3 | 4 | .. currentmodule:: mindquantum.algorithm.nisq 5 | 6 | 7 | mindquantum.algorithm.nisq.RYRZFull 8 | =================================== 9 | 10 | .. autoclass:: RYRZFull 11 | :exclude-members: bprop, construct, extend_repr 12 | :members: 13 | 14 | 15 | 16 | .. 17 | autogenerated from _templates/classtemplate.rst 18 | note it does not have :inherited-members: 19 | -------------------------------------------------------------------------------- /docs/api_python_en/core/mindquantum.core.parameterresolver.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core.parameterresolver 2 | ================================== 3 | 4 | .. automodule:: mindquantum.core.parameterresolver 5 | 6 | Class 7 | --------------- 8 | 9 | .. autosummary:: 10 | :toctree: parameterresolver 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | mindquantum.core.parameterresolver.ParameterResolver 15 | mindquantum.core.parameterresolver.PRGenerator 16 | -------------------------------------------------------------------------------- /docs/api_python_en/mindquantum.algorithm.rst: -------------------------------------------------------------------------------- 1 | mindquantum.algorithm 2 | ===================== 3 | 4 | .. automodule:: mindquantum.algorithm 5 | 6 | .. autosummary:: 7 | :toctree: algorithm 8 | 9 | mindquantum.algorithm.compiler 10 | mindquantum.algorithm.library 11 | mindquantum.algorithm.nisq 12 | mindquantum.algorithm.error_mitigation 13 | mindquantum.algorithm.mapping 14 | mindquantum.algorithm.qaia 15 | -------------------------------------------------------------------------------- /docs/api_python_en/mindquantum.core.rst: -------------------------------------------------------------------------------- 1 | mindquantum.core 2 | ================ 3 | 4 | .. automodule:: mindquantum.core 5 | 6 | .. autosummary:: 7 | :toctree: core 8 | 9 | mindquantum.core.gates 10 | mindquantum.core.circuit 11 | mindquantum.core.operators 12 | mindquantum.core.parameterresolver 13 | -------------------------------------------------------------------------------- /docs/api_python_en/mindquantum.device.rst: -------------------------------------------------------------------------------- 1 | mindquantum.device 2 | ================== 3 | 4 | .. automodule:: mindquantum.device 5 | 6 | Class 7 | ----- 8 | 9 | .. autosummary:: 10 | :toctree: device 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | mindquantum.device.QubitNode 15 | mindquantum.device.QubitsTopology 16 | mindquantum.device.GridQubits 17 | mindquantum.device.LinearQubits 18 | -------------------------------------------------------------------------------- /docs/api_python_en/mindquantum.engine.rst: -------------------------------------------------------------------------------- 1 | mindquantum.engine 2 | ================== 3 | 4 | .. automodule:: mindquantum.engine 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/api_python_en/mindquantum.io.rst: -------------------------------------------------------------------------------- 1 | mindquantum.io 2 | ============== 3 | 4 | .. automodule:: mindquantum.io 5 | 6 | Class 7 | ------ 8 | 9 | .. autosummary:: 10 | :toctree: io 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | mindquantum.io.BlochScene 15 | mindquantum.io.HiQASM 16 | mindquantum.io.OpenQASM 17 | 18 | Function 19 | --------- 20 | 21 | .. autosummary:: 22 | :toctree: io 23 | :nosignatures: 24 | :template: classtemplate.rst 25 | 26 | mindquantum.io.bprint 27 | mindquantum.io.random_hiqasm 28 | mindquantum.io.draw_topology 29 | mindquantum.io.draw_topology_plt 30 | -------------------------------------------------------------------------------- /docs/api_python_en/mindquantum.simulator.rst: -------------------------------------------------------------------------------- 1 | mindquantum.simulator 2 | ===================== 3 | 4 | .. automodule:: mindquantum.simulator 5 | 6 | Class 7 | ------ 8 | 9 | .. autosummary:: 10 | :toctree: simulator 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | mindquantum.simulator.GradOpsWrapper 15 | mindquantum.simulator.Simulator 16 | mindquantum.simulator.NoiseBackend 17 | 18 | Function 19 | --------- 20 | 21 | .. autosummary:: 22 | :toctree: simulator 23 | :nosignatures: 24 | :template: classtemplate.rst 25 | 26 | mindquantum.simulator.fidelity 27 | mindquantum.simulator.get_supported_simulator 28 | mindquantum.simulator.inner_product 29 | mindquantum.simulator.get_stabilizer_string 30 | mindquantum.simulator.get_tableau_string 31 | mindquantum.simulator.decompose_stabilizer 32 | -------------------------------------------------------------------------------- /docs/api_python_en/mindquantum.utils.rst: -------------------------------------------------------------------------------- 1 | mindquantum.utils 2 | ================= 3 | 4 | .. automodule:: mindquantum.utils 5 | 6 | Function 7 | --------- 8 | 9 | .. autosummary:: 10 | :toctree: utils 11 | :nosignatures: 12 | :template: classtemplate.rst 13 | 14 | mindquantum.utils.fdopen 15 | mindquantum.utils.ket_string 16 | mindquantum.utils.mod 17 | mindquantum.utils.normalize 18 | mindquantum.utils.random_circuit 19 | mindquantum.utils.random_state 20 | mindquantum.utils.random_insert_gates 21 | 22 | Progress bar 23 | ------------ 24 | 25 | .. autosummary:: 26 | :toctree: utils 27 | :nosignatures: 28 | :template: classtemplate.rst 29 | 30 | mindquantum.utils.SingleLoopProgress 31 | mindquantum.utils.TwoLoopsProgress 32 | -------------------------------------------------------------------------------- /docs/api_python_en/overview.rst: -------------------------------------------------------------------------------- 1 | overview 2 | ================ 3 | 4 | .. autosummary:: 5 | :nosignatures: 6 | 7 | mindquantum.dtype 8 | mindquantum.core 9 | mindquantum.simulator 10 | mindquantum.framework 11 | mindquantum.algorithm 12 | mindquantum.device 13 | mindquantum.io 14 | mindquantum.engine 15 | mindquantum.utils 16 | -------------------------------------------------------------------------------- /docs/circuit_svg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/docs/circuit_svg.png -------------------------------------------------------------------------------- /docs/index.html.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

Redirecting...

12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/source/api/cxx.rst: -------------------------------------------------------------------------------- 1 | .. Copyright 2022 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | .. _cxx: 16 | 17 | C++ 18 | === 19 | This is the documentation of the C++ engine classes and decomposition rule 20 | functions of MindQuantum, mainly intended for developers. 21 | 22 | .. toctree:: 23 | -------------------------------------------------------------------------------- /docs/source/api/python.rst: -------------------------------------------------------------------------------- 1 | .. Copyright 2022 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Python 16 | ====== 17 | 18 | .. automodule:: mindquantum 19 | :members: 20 | :special-members: __init__ 21 | :imported-members: 22 | -------------------------------------------------------------------------------- /mindquantum/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Console entry point to access MindQuantum installation variables.""" 16 | 17 | from mindquantum_config import main 18 | 19 | # ============================================================================== 20 | 21 | 22 | if __name__ == "__main__": 23 | main() 24 | -------------------------------------------------------------------------------- /mindquantum/algorithm/mapping/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Huawei Technologies Co., Ltd 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================ 15 | """Qubit mapping module.""" 16 | from .mq_sabre import MQSABRE 17 | from .sabre import SABRE 18 | 19 | __all__ = ["SABRE", "MQSABRE"] 20 | __all__.sort() 21 | -------------------------------------------------------------------------------- /mindquantum/config/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Huawei Technologies Co., Ltd 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================ 15 | """Global config for mindquantum.""" 16 | from .config import context 17 | 18 | __all__ = [] 19 | -------------------------------------------------------------------------------- /mindquantum/engine/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Huawei Technologies Co., Ltd 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================ 15 | """Circuit engine module.""" 16 | 17 | from .circuitengine import BasicQubit, CircuitEngine, circuit_generator 18 | 19 | __all__ = ["BasicQubit", "CircuitEngine", "circuit_generator"] 20 | __all__.sort() 21 | -------------------------------------------------------------------------------- /mindquantum/io/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | """Input/Output module for MindQuantum.""" 15 | 16 | from . import display, qasm 17 | from .beauty_print import bprint 18 | from .display import * 19 | from .qasm import * 20 | 21 | __all__ = ['bprint'] 22 | __all__.extend(display.__all__) 23 | __all__.extend(qasm.__all__) 24 | __all__.sort() 25 | -------------------------------------------------------------------------------- /mindquantum/third_party/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 The OpenFermion Developers 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # You may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | """Third-party modules for MindQuantum.""" 16 | 17 | # Allow extending this namespace. 18 | from .unitary_cc import uccsd_singlet_generator, uccsd_singlet_get_packed_amplitudes 19 | -------------------------------------------------------------------------------- /mindquantum_config/__main__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Console entry point to access MindQuantum installation variables.""" 16 | 17 | from . import main 18 | 19 | # ============================================================================== 20 | 21 | 22 | if __name__ == "__main__": 23 | main() 24 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | scipy>=1.5.3 2 | matplotlib>=3.4.3 3 | rich==10.9.0 4 | importlib-metadata>=0.9;python_version<"3.8" 5 | typing_extensions;python_version<"3.8" 6 | -------------------------------------------------------------------------------- /requirements_test.txt: -------------------------------------------------------------------------------- 1 | scipy>=1.5.3 2 | cirq>=1.0.0 3 | openfermion>=1.5.0 4 | matplotlib>=3.4.3 5 | rich==10.9.0 6 | importlib-metadata>=0.9;python_version<"3.8" 7 | typing_extensions;python_version<"3.8" 8 | numba>=0.53.1 9 | -------------------------------------------------------------------------------- /scripts/build/ci_windows_build.bat: -------------------------------------------------------------------------------- 1 | venv\Scripts\activate 2 | 3 | cmake -S "." -B "build" -DIN_PLACE_BUILD:BOOL=ON -DIS_PYTHON_BUILD:BOOL=OFF ^ 4 | -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON ^ 5 | -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo ^ 6 | -DENABLE_DOCUMENTATION:BOOL=OFF ^ 7 | -DENABLE_GITEE:BOOL=ON -DENABLE_LOGGING:BOOL=OFF ^ 8 | -DENABLE_LOGGING_DEBUG_LEVEL:BOOL=OFF -DENABLE_LOGGING_TRACE_LEVEL:BOOL=OFF ^ 9 | -DBUILD_TESTING:BOOL=OFF -DCLEAN_3RDPARTY_INSTALL_DIR:BOOL=OFF ^ 10 | -DUSE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY:BOOL=OFF ^ 11 | -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY:BOOL=OFF -DJOBS:STRING=4 ^ 12 | -G "MinGW Makefiles" 13 | 14 | rem python -m build --unset BUILD_TESTING --unset CLEAN_3RDPARTY_INSTALL_DIR ^ 15 | rem --set ENABLE_GITEE --unset ENABLE_LOGGING --unset ENABLE_LOGGING_DEBUG_LEVEL ^ 16 | rem --set USE_VERBOSE_MAKEFILE --var JOBS 12 build_ext --jobs 12 17 | -------------------------------------------------------------------------------- /scripts/build/dos/call_cmd.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem Copyright 2022 Huawei Technologies Co., Ltd 3 | rem 4 | rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | rem you may not use this file except in compliance with the License. 6 | rem You may obtain a copy of the License at 7 | rem 8 | rem http://www.apache.org/licenses/LICENSE-2.0 9 | rem 10 | rem Unless required by applicable law or agreed to in writing, software 11 | rem distributed under the License is distributed on an "AS IS" BASIS, 12 | rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | rem See the License for the specific language governing permissions and 14 | rem limitations under the License. 15 | rem ============================================================================ 16 | 17 | rem call_cmd ... 18 | 19 | :call_cmd 20 | if NOT !dry_run! == 1 ( %* ) else (echo %*) 21 | exit /B 0 22 | -------------------------------------------------------------------------------- /scripts/update_cmake_pkg_hashes.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | BASEPATH=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd ) 4 | 5 | cmake "$@" -P "${BASEPATH}/cmake/update_cmake_pkg_hashes.cmake" 6 | -------------------------------------------------------------------------------- /tests/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-build/include_order,-build/namespaces,-build/namespaces_literals,-readability/check,-runtime/references 2 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # Requirements for fully test 2 | 3 | - openfermion 4 | - numba 5 | - mindspore 6 | -------------------------------------------------------------------------------- /tests/cmake-ldtest/.gitignore: -------------------------------------------------------------------------------- 1 | CMakeLists.txt 2 | -------------------------------------------------------------------------------- /tests/cmake-ldtest/CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | filter=-build/include_order,-build/include_subdir 2 | -------------------------------------------------------------------------------- /tests/cmake-ldtest/shared_lib.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "shared_lib.h" 18 | 19 | int foo() { 20 | return 42; // NOLINT 21 | } 22 | -------------------------------------------------------------------------------- /tests/cmake-ldtest/shared_lib.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef SHARED_LIB_HPP 18 | #define SHARED_LIB_HPP 19 | 20 | int foo(); 21 | 22 | #endif /* SHARED_LIB_HPP */ 23 | -------------------------------------------------------------------------------- /tests/cmake-ldtest/shared_test.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | #include "shared_lib.h" 20 | 21 | int main() { 22 | std::cout << foo() << std::endl; 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /tests/st/H4.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/tests/st/H4.hdf5 -------------------------------------------------------------------------------- /tests/st/LiH.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mindspore-ai/mindquantum/48b41bb072e23dce4b1568c5d45421d9824ef3b4/tests/st/LiH.hdf5 -------------------------------------------------------------------------------- /tests/st/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Huawei Technologies Co., Ltd 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================ 15 | 16 | """MindQuantum st test module.""" 17 | -------------------------------------------------------------------------------- /tests/ut/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Huawei Technologies Co., Ltd 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================ 15 | 16 | """MindQuantum ut test module.""" 17 | -------------------------------------------------------------------------------- /tests/ut/test_mindquantum.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Huawei Technologies Co., Ltd 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================ 15 | """Test mindquantum.""" 16 | 17 | # test 18 | 19 | 20 | def test_empty(): 21 | """Dummy test.""" 22 | assert 1 < 2 # pylint: disable=comparison-of-constants 23 | -------------------------------------------------------------------------------- /third_party/cmake/mindquantumTargetsExternal.cmake.in: -------------------------------------------------------------------------------- 1 | # ============================================================================== 2 | # 3 | # Copyright 2022 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # ============================================================================== 18 | 19 | @MQ_FIND_EXTERNAL_PACKAGES@ 20 | -------------------------------------------------------------------------------- /third_party/lru_cache/patch/fix-memory-leak-node-deletion-callback.patch001: -------------------------------------------------------------------------------- 1 | diff -Npur lru_cache-orig/lru_cache/lru_cache_impl.h lru_cache/lru_cache/lru_cache_impl.h 2 | --- lru_cache-orig/lru_cache/lru_cache_impl.h 2022-07-19 15:45:22.863854820 +0200 3 | +++ lru_cache/lru_cache/lru_cache_impl.h 2022-07-19 15:46:17.937460555 +0200 4 | @@ -325,8 +325,6 @@ class LruCacheImpl { 5 | node_type& oldest_node = value_list_.oldest(); 6 | Key old_key = oldest_node.key(); 7 | map().erase(oldest_node.key()); 8 | - dropped_entry_callback_(std::move(oldest_node.key()), 9 | - std::move(oldest_node.value())); 10 | map().emplace(key, value_list_.oldest_index()); 11 | 12 | return value_list_.replace_oldest_entry(old_key, key, std::move(new_value)); 13 | --------------------------------------------------------------------------------