[{"data":1,"prerenderedAt":472},["ShallowReactive",2],{"content-query-rAvhdGaxRg":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"body":13,"_type":466,"_id":467,"_source":468,"_file":469,"_stem":470,"_extension":471},"/news/zh/2025-12-15-2","zh",false,"","昇思人工智能框架峰会 | MindSpore Quantum量子启发求解器，助力大规模组合优化问题求解效率倍增","MindSpore Quantum实现了量子启发式求解器","2025-12-15","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/07/25/199b735845bf4106b44b2035dc97bd39.png","news",{"type":14,"children":15,"toc":461},"root",[16,24,30,39,47,59,74,82,90,113,121,139,147,160,168,173,178,186,194,202,207,215,220,228,233,245,313,321,329,334,339,350,355,365,370,378,390,400,405,413,420,425,430,435,452],{"type":17,"tag":18,"props":19,"children":21},"element","h1",{"id":20},"昇思人工智能框架峰会-mindspore-quantum量子启发求解器助力大规模组合优化问题求解效率倍增",[22],{"type":23,"value":8},"text",{"type":17,"tag":25,"props":26,"children":27},"p",{},[28],{"type":23,"value":29},"在物流调度、金融投资等领域，随着数据规模的扩大，组合优化问题往往面临计算复杂度激增的难题，传统算法难以在有限算力与求解精度之间取得平衡。为此，MindSpore Quantum实现了量子启发式求解器。该方案基于经典硬件模拟量子演化特性，旨在优化大规模问题的寻优效率，为解决工业级复杂问题提供了一种高性能的技术新解。",{"type":17,"tag":25,"props":31,"children":32},{},[33],{"type":17,"tag":34,"props":35,"children":36},"strong",{},[37],{"type":23,"value":38},"# 01",{"type":17,"tag":25,"props":40,"children":41},{},[42],{"type":17,"tag":34,"props":43,"children":44},{},[45],{"type":23,"value":46},"量子启发式算法简介",{"type":17,"tag":25,"props":48,"children":49},{},[50,52,57],{"type":23,"value":51},"量子启发式算法是一种新式的算法，它源于或直接受基于",{"type":17,"tag":34,"props":53,"children":54},{},[55],{"type":23,"value":56},"量子力学原理",{"type":23,"value":58},"的计算方法的启发，旨在利用量子力学的独特性质（叠加态、量子纠缠和量子并行性）来改进传统算法的性能。",{"type":17,"tag":60,"props":61,"children":62},"ul",{},[63,69],{"type":17,"tag":64,"props":65,"children":66},"li",{},[67],{"type":23,"value":68},"对于线性代数问题：受HHL（Harrow-Hassidim-Lloyd）算法的启发，Ewin Tang提出了量子启发算法，与已知的经典方法相比，这些算法具有指数级的性能加速。",{"type":17,"tag":64,"props":70,"children":71},{},[72],{"type":23,"value":73},"对于组合优化问题：受量子退火或类似（量子）伊辛机启发的算法。",{"type":17,"tag":25,"props":75,"children":76},{},[77],{"type":17,"tag":34,"props":78,"children":79},{},[80],{"type":23,"value":81},"量子启发式算法的发展脉络",{"type":17,"tag":25,"props":83,"children":84},{},[85],{"type":17,"tag":34,"props":86,"children":87},{},[88],{"type":23,"value":89},"1、相干伊辛机 Coherent Ising Machine, CIM",{"type":17,"tag":60,"props":91,"children":92},{},[93,98,103,108],{"type":17,"tag":64,"props":94,"children":95},{},[96],{"type":23,"value":97},"模拟相干伊辛机 Simulated Coherent Ising Machine (SimCIM, 2019)",{"type":17,"tag":64,"props":99,"children":100},{},[101],{"type":23,"value":102},"混沌振幅控制 Chaotic Amplitude Control (CAC, 2020)",{"type":17,"tag":64,"props":104,"children":105},{},[106],{"type":23,"value":107},"混沌振幅反馈 Chaotic Feedback Control (CFC, 2021)",{"type":17,"tag":64,"props":109,"children":110},{},[111],{"type":23,"value":112},"离散振幅反馈 Separated Feedback Control (SFC, 2021)",{"type":17,"tag":25,"props":114,"children":115},{},[116],{"type":17,"tag":34,"props":117,"children":118},{},[119],{"type":23,"value":120},"2、模拟分岔 Simulated Bifurcation",{"type":17,"tag":60,"props":122,"children":123},{},[124,129,134],{"type":17,"tag":64,"props":125,"children":126},{},[127],{"type":23,"value":128},"绝热模拟分岔 adiabatic Simulated Bifurcation (aSB, 2019)",{"type":17,"tag":64,"props":130,"children":131},{},[132],{"type":23,"value":133},"弹道模拟分岔 ballistic Simulated Bifurcation (bSB, 2021)",{"type":17,"tag":64,"props":135,"children":136},{},[137],{"type":23,"value":138},"离散模拟分岔 discrete Simulated Bifurcation (dSB, 2021)",{"type":17,"tag":25,"props":140,"children":141},{},[142],{"type":17,"tag":34,"props":143,"children":144},{},[145],{"type":23,"value":146},"3、平均场退火 Mean Field Annealing",{"type":17,"tag":60,"props":148,"children":149},{},[150,155],{"type":17,"tag":64,"props":151,"children":152},{},[153],{"type":23,"value":154},"局域量子退火 Local Quantum Annealing (LQA, 2022)",{"type":17,"tag":64,"props":156,"children":157},{},[158],{"type":23,"value":159},"含噪平均场退火 Mean-Field Approximate Optimization Algorithm (MFAOA, 2023)",{"type":17,"tag":25,"props":161,"children":162},{},[163],{"type":17,"tag":34,"props":164,"children":165},{},[166],{"type":23,"value":167},"量子启发式算法中的模拟分岔算法 Simulated Bifurcation",{"type":17,"tag":25,"props":169,"children":170},{},[171],{"type":23,"value":172},"模拟分岔算法其核心思想是通过模拟非线性哈密顿动力学的分岔现象来寻找伊辛模型（Ising problem）的基态，从而将组合优化问题映射为物理系统的优化问题。",{"type":17,"tag":25,"props":174,"children":175},{},[176],{"type":23,"value":177},"基于模拟哈密顿方程中的分岔过程，系统通过动态调节控制参数，使系统经历一系列动力学分岔，最终收敛到由伊辛自旋变量稳定（+-1），并得到稳定解，这个解对应原始问题的局部最优解或近似解。",{"type":17,"tag":25,"props":179,"children":180},{},[181],{"type":17,"tag":34,"props":182,"children":183},{},[184],{"type":23,"value":185},"# 02",{"type":17,"tag":25,"props":187,"children":188},{},[189],{"type":17,"tag":34,"props":190,"children":191},{},[192],{"type":23,"value":193},"量子启发式算法应用场景",{"type":17,"tag":25,"props":195,"children":196},{},[197],{"type":17,"tag":34,"props":198,"children":199},{},[200],{"type":23,"value":201},"1、物流与生产调度",{"type":17,"tag":25,"props":203,"children":204},{},[205],{"type":23,"value":206},"量子启发式算法擅长解决旅行商问题、0-1背包问题等NP困难问题，为物流路径规划、生产调度提供高效方案。",{"type":17,"tag":25,"props":208,"children":209},{},[210],{"type":17,"tag":34,"props":211,"children":212},{},[213],{"type":23,"value":214},"2、通信网络",{"type":17,"tag":25,"props":216,"children":217},{},[218],{"type":23,"value":219},"量子启发式算法可应用于通信网络的优化设计，例如路由优化、资源分配等，提供网络的效率和可靠性。",{"type":17,"tag":25,"props":221,"children":222},{},[223],{"type":17,"tag":34,"props":224,"children":225},{},[226],{"type":23,"value":227},"3、蛋白质结构和药物研发",{"type":17,"tag":25,"props":229,"children":230},{},[231],{"type":23,"value":232},"蛋白质分子的折叠对接是药物研发中的重要课题，量子启发式算法可预测多种蛋白质分子旋转角度，缩短求解时间，加速药物的筛选和研发。",{"type":17,"tag":25,"props":234,"children":235},{},[236,238,243],{"type":23,"value":237},"MindSpore Quantum已经集成量子启发式算法模块，并提供",{"type":17,"tag":34,"props":239,"children":240},{},[241],{"type":23,"value":242},"CPU、NPU****版本",{"type":23,"value":244},"，适配多种硬件设备，并提供极致性能。",{"type":17,"tag":60,"props":246,"children":247},{},[248,253,258,263,268,273,278,283,288,293,298,303,308],{"type":17,"tag":64,"props":249,"children":250},{},[251],{"type":23,"value":252},"mindquantum.algorithm.qaia.QAIA 量子退火启发式算法基类",{"type":17,"tag":64,"props":254,"children":255},{},[256],{"type":23,"value":257},"mindquantum.algorithm.qaia.CAC 混沌振幅控制算法",{"type":17,"tag":64,"props":259,"children":260},{},[261],{"type":23,"value":262},"mindquantum.algorithm.qaia.CFC 混沌振幅反馈算法",{"type":17,"tag":64,"props":264,"children":265},{},[266],{"type":23,"value":267},"mindquantum.algorithm.qaia.LQA 局域量子退火算法",{"type":17,"tag":64,"props":269,"children":270},{},[271],{"type":23,"value":272},"mindquantum.algorithm.qaia.NMFA 含噪平均场退火算法",{"type":17,"tag":64,"props":274,"children":275},{},[276],{"type":23,"value":277},"mindquantum.algorithm.qaia.ASB 绝热模拟分叉算法",{"type":17,"tag":64,"props":279,"children":280},{},[281],{"type":23,"value":282},"mindquantum.algorithm.qaia.BSB 弹道模拟分叉算法",{"type":17,"tag":64,"props":284,"children":285},{},[286],{"type":23,"value":287},"mindquantum.algorithm.qaia.DSB 离散模拟分叉算法",{"type":17,"tag":64,"props":289,"children":290},{},[291],{"type":23,"value":292},"mindquantum.algorithm.qaia.TSB 三元量化模拟分岔算法",{"type":17,"tag":64,"props":294,"children":295},{},[296],{"type":23,"value":297},"mindquantum.algorithm.qaia.USB 均匀量化模拟分岔算法",{"type":17,"tag":64,"props":299,"children":300},{},[301],{"type":23,"value":302},"mindquantum.algorithm.qaia.LSB 对数量化模拟分岔算法",{"type":17,"tag":64,"props":304,"children":305},{},[306],{"type":23,"value":307},"mindquantum.algorithm.qaia.SFC 离散振幅反馈算法",{"type":17,"tag":64,"props":309,"children":310},{},[311],{"type":23,"value":312},"mindquantum.algorithm.qaia.SimCIM 模拟相干伊辛机算法",{"type":17,"tag":25,"props":314,"children":315},{},[316],{"type":17,"tag":34,"props":317,"children":318},{},[319],{"type":23,"value":320},"# 03",{"type":17,"tag":25,"props":322,"children":323},{},[324],{"type":17,"tag":34,"props":325,"children":326},{},[327],{"type":23,"value":328},"实战案例-使用量子启发式算法求解最大割问题",{"type":17,"tag":25,"props":330,"children":331},{},[332],{"type":23,"value":333},"组合优化问题是一类在有限的选项集合中找到最优解的数学问题，它有着广泛的应用，像投资组合，旅行商问题等。它的求解难度随着问题规模的增加指数增长。因此，目前还不存在高效的经典算法来求解组合优化问题。",{"type":17,"tag":25,"props":335,"children":336},{},[337],{"type":23,"value":338},"Max-Cut问题是其中一种组合优化问题，该问题需要将一个图中的顶点分成两部分，并使得两部分被切割的边最多。如下图：",{"type":17,"tag":340,"props":341,"children":343},"div",{"style":342},"text-align: center;",[344],{"type":17,"tag":345,"props":346,"children":349},"img",{"src":347,"style":348,"alt":7},"/category/information/news/banner/2025-12-15-2-1.jpg","display: block;margin: 0 auto;max-width:60%",[],{"type":17,"tag":25,"props":351,"children":352},{},[353],{"type":23,"value":354},"下面演示使用MindSpore Quantum中的量子启发式算法求解最大割问题，数据集来源于经典的GSet问题，选取G22图，其规模是2000节点，19990条边。",{"type":17,"tag":356,"props":357,"children":359},"pre",{"code":358},"# 导入需要的Python模块  \nfrom mindquantum.algorithm.qaia import DSB  \nimport numpy as np  \nimport pandas as pd  \nfrom scipy.sparse import coo_matrix  \nimport time\n\n# 数据准备# 下载数据，无向图数据集来源于GSetimport requests  \n  \ngraph_file =\"https://web.stanford.edu/~yyye/yyye/Gset/G22\"  \n  \n# 使用requests库中的get方法发送HTTP请求，将url的响应结果存入变量，再以二进制写入模式打开文件写入本地response = requests.get(graph_file)  \nopen(\"G22\", \"wb\").write(response.content)  \n  \n# 数据处理def read_gset(filename, negate=True):  \n# 读取图表graph = pd.read_csv(filename, sep=\" \")  \n# 节点的数量n_v =int(graph.columns[0])  \n# 边的数量n_e =int(graph.columns[1])  \n  \n# 如果节点和边不匹配，会抛出错误assert n_e == graph.shape[0], \"The number of edges is not matched\"  \n  \n# 将读取的数据转换为一个COO矩阵（Coordinate List Format），并返回一个稀疏矩阵  \nG = coo_matrix(  \n(  \nnp.concatenate([graph.iloc[:, -1], graph.iloc[:, -1]]),  \n(  \nnp.concatenate([graph.iloc[:, 0] -1, graph.iloc[:, 1] -1]),  \nnp.concatenate([graph.iloc[:, 1] -1, graph.iloc[:, 0] -1]),  \n),  \n),  \nshape=(n_v, n_v),  \n)  \nif negate:  \nG =-G  \n  \nreturn G\n\n  \n\nG = read_gset(\"./G22\")\n\nstart_time = time.time()  \nsolver = DSB(G, batch_size=100, n_iter=1000, backend=\"npu-float32\")  \nsolver.update()  \ncut = solver.calc_cut()  \nend_time = time.time()\n\n  \n\nprint(f\"G22 MAXCut is : {max(cut)}\\nuse time:{end_time-start_time}\")\n",[360],{"type":17,"tag":361,"props":362,"children":363},"code",{"__ignoreMap":7},[364],{"type":23,"value":358},{"type":17,"tag":25,"props":366,"children":367},{},[368],{"type":23,"value":369},"输出：",{"type":17,"tag":356,"props":371,"children":373},{"code":372},"G22 MAXCut is : 13353.0\n   use time:0.5273990631103516\n",[374],{"type":17,"tag":361,"props":375,"children":376},{"__ignoreMap":7},[377],{"type":23,"value":372},{"type":17,"tag":25,"props":379,"children":380},{},[381,383,388],{"type":23,"value":382},"可以看到，",{"type":17,"tag":34,"props":384,"children":385},{},[386],{"type":23,"value":387},"DSB算法",{"type":23,"value":389},"仅用0.53秒就求解出了2000节点的GSet图，该图的最大切割数在13353附近。",{"type":17,"tag":391,"props":392,"children":394},"h3",{"id":393},"使用npu加速量子启发式算法",[395],{"type":17,"tag":34,"props":396,"children":397},{},[398],{"type":23,"value":399},"使用NPU加速量子启发式算法",{"type":17,"tag":25,"props":401,"children":402},{},[403],{"type":23,"value":404},"上述卓越的求解速度，归功于MindSpore Quantum中利用NPU对此类量子启发式算法的显著加速。我们分别在CPU和NPU后端上运行DSB算法，求解最大割问题：",{"type":17,"tag":356,"props":406,"children":408},{"code":407},"import time  \n  \nstart_time = time.time()  \nsolver = DSB(G, batch_size=100, n_iter=1000, backend=\"cpu-float32\")  \nsolver.update()  \ncut = solver.calc_cut()  \ncpu_fp32_time = time.time() - start_time  \n  \nstart_time = time.time()  \nsolver = DSB(G, batch_size=100, n_iter=1000, backend=\"npu-float32\")  \nsolver.update()  \ncut = solver.calc_cut()  \nnpu_fp32_time = time.time() - start_time\n\nimport matplotlib.pyplot as plt# 计算加速比cpu_speedup = cpu_fp32_time / cpu_fp32_time  \nnpu_speedup = cpu_fp32_time / npu_fp32_time  \n  \n  \ndevices = [\"CPU-Float32\", \"NPU-Float32\"]  \ntimes = [cpu_fp32_time, npu_fp32_time]  \nspeedups = [cpu_speedup, npu_speedup]  \ncolors = [\"#4C72B0\", \"#DD8452\"]  \n  \n  \nplt.figure(figsize=(10, 6), dpi=100)  \n  \n# 绘制横向条形图, 表示不同后端的计算时间bars = plt.barh(devices, times, color=colors, height=0.6)  \n  \n# 添加数据标签和加速比  \nfor i, (time, speedup) inenumerate(zip(times, speedups)):  \nplt.text(  \ntime +0.05,  \ni,  \nf\"{time:.2f}s ({speedup:.1f}x)\",  \nva=\"center\",  \nfontsize=12,  \n)  \n  \nplt.title(  \n\"QAIA Performance Comparison On Different Hardware In G22\", fontsize=14, pad=20  \n)  \nplt.xlabel(\"Time(seconds)\", fontsize=12)  \nplt.xlim(0, max(times) *1.3)  \nplt.grid(axis=\"x\", linestyle=\"--\", alpha=0.7)  \nplt.tight_layout()  \n  \nplt.show()\n",[409],{"type":17,"tag":361,"props":410,"children":411},{"__ignoreMap":7},[412],{"type":23,"value":407},{"type":17,"tag":340,"props":414,"children":415},{"style":342},[416],{"type":17,"tag":345,"props":417,"children":419},{"src":418,"style":348,"alt":7},"/category/information/news/banner/2025-12-15-2-2.jpg",[],{"type":17,"tag":25,"props":421,"children":422},{},[423],{"type":23,"value":424},"可以看到，对于同样的问题，如果使用CPU进行求解，需要14.2秒才能完成，而NPU仅需0.5秒，使求解速度提升了28倍。",{"type":17,"tag":25,"props":426,"children":427},{},[428],{"type":23,"value":429},"MindSpore Quantum是基于昇思MindSpore开源深度学习平台开发的新一代通用量子计算框架，聚焦于NISQ阶段的算法实现与落地。结合HiQ高性能量子计算模拟器和昇思MindSpore并行自动微分能力，MindSpore Quantum有着极简的开发模式和极致的性能体验，能够高效处理量子机器学习、量子化学模拟和量子组合优化等问题，为广大科研人员、老师和学生提供快速设计和验证量子算法的高效平台，让量子计算触手可及。",{"type":17,"tag":25,"props":431,"children":432},{},[433],{"type":23,"value":434},"MindSpore Quantum开源仓库：",{"type":17,"tag":25,"props":436,"children":437},{},[438,446,450],{"type":17,"tag":439,"props":440,"children":444},"a",{"href":441,"rel":442},"https://atomgit.com/mindspore/mindquantum",[443],"nofollow",[445],{"type":23,"value":441},{"type":17,"tag":447,"props":448,"children":449},"br",{},[],{"type":23,"value":451},"\nMindSpore Quantum社区文档地址：",{"type":17,"tag":25,"props":453,"children":454},{},[455],{"type":17,"tag":439,"props":456,"children":459},{"href":457,"rel":458},"https://www.mindspore.cn/mindquantum/docs/zh-CN/r0.11/index.html",[443],[460],{"type":23,"value":457},{"title":7,"searchDepth":462,"depth":462,"links":463},4,[464],{"id":393,"depth":465,"text":399},3,"markdown","content:news:zh:2025-12-15-2.md","content","news/zh/2025-12-15-2.md","news/zh/2025-12-15-2","md",1776506059800]