[{"data":1,"prerenderedAt":372},["ShallowReactive",2],{"content-query-3lxce7rJK9":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"body":13,"_type":366,"_id":367,"_source":368,"_file":369,"_stem":370,"_extension":371},"/news/zh/2230","zh",false,"","MindSpore Quantum 0.8 | 量子线路模拟器全新升级，新增GPU模拟器，性能倍级提升","MindSpore Quantum 0.8版本全新发布","2023-04-11","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/04/13/e63af0e469f0494786f7db0b2792e62d.png","news",{"type":14,"children":15,"toc":358},"root",[16,24,33,38,43,52,60,65,73,78,85,90,97,102,110,115,122,127,135,140,148,153,163,168,176,181,189,194,201,209,217,234,239,247,254,269,274,282,289,297,302,314,324,329,338,346,351],{"type":17,"tag":18,"props":19,"children":21},"element","h1",{"id":20},"mindspore-quantum-08-量子线路模拟器全新升级新增gpu模拟器性能倍级提升",[22],{"type":23,"value":8},"text",{"type":17,"tag":25,"props":26,"children":27},"p",{},[28],{"type":17,"tag":29,"props":30,"children":31},"strong",{},[32],{"type":23,"value":9},{"type":17,"tag":25,"props":34,"children":35},{},[36],{"type":23,"value":37},"经过社区开发者们的不断努力，量子计算MindSpore Quantum最新的0.8版本正式面世。",{"type":17,"tag":25,"props":39,"children":40},{},[41],{"type":23,"value":42},"新版本中我们推出了**更强劲的自研量子模拟器mqvector ，新发布GPU模拟器mqvector_gpu。**此外新版本支持更多的量子门，方便用户开发更多新的量子算法。下面就带大家快速浏览0.8版本的关键特性。",{"type":17,"tag":25,"props":44,"children":45},{},[46],{"type":17,"tag":47,"props":48,"children":51},"img",{"alt":49,"src":50},"image.png","https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413022847.06942479749003598124744547543319:50540412033011:2400:73ACD83175094BD019C2778741F3F29572A37FFA8A63B84E6EB9B4867F4A1817.png",[],{"type":17,"tag":25,"props":53,"children":54},{},[55],{"type":17,"tag":29,"props":56,"children":57},{},[58],{"type":23,"value":59},"全新量子模拟器，性能更强劲",{"type":17,"tag":25,"props":61,"children":62},{},[63],{"type":23,"value":64},"新版本中我们推出了全新的量子模拟器mqvector，支持全振幅量子模拟，且可自适应控制量子模拟时调用的运算资源，性能表现更好。",{"type":17,"tag":25,"props":66,"children":67},{},[68],{"type":17,"tag":29,"props":69,"children":70},{},[71],{"type":23,"value":72},"【VQE求解化学分子基态能量】",{"type":17,"tag":25,"props":74,"children":75},{},[76],{"type":23,"value":77},"VQE求解化学分子基态能量-CPU、GPU（12量子比特 H6），MindSpore Quantum与主流软件Qiskit、TensorFlow-Quantum对比效果如下面两图所示， CPU性能提高12倍以上，GPU性能提高7倍以上。",{"type":17,"tag":25,"props":79,"children":80},{},[81],{"type":17,"tag":47,"props":82,"children":84},{"alt":49,"src":83},"https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413022911.43462087629936127225835619650254:50540412033011:2400:0C52C696C7AE7066F8615572B68F570F18CB97F7D2278DE55417FD5D3D584F4B.png",[],{"type":17,"tag":25,"props":86,"children":87},{},[88],{"type":23,"value":89},"图1 量子模拟器 VQE（CPU）性能对比图",{"type":17,"tag":25,"props":91,"children":92},{},[93],{"type":17,"tag":47,"props":94,"children":96},{"alt":49,"src":95},"https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413022934.95895948030597230449584469988174:50540412033011:2400:C5B99B1C485A554BA79892C280D53CC26AAA853EAD206281B003198DB29587F6.png",[],{"type":17,"tag":25,"props":98,"children":99},{},[100],{"type":23,"value":101},"图2 量子模拟器 VQE（GPU）性能对比图",{"type":17,"tag":25,"props":103,"children":104},{},[105],{"type":17,"tag":29,"props":106,"children":107},{},[108],{"type":23,"value":109},"【QAOA求解Max-Cut问题模拟】",{"type":17,"tag":25,"props":111,"children":112},{},[113],{"type":23,"value":114},"QAOA求解Max-Cut问题（16量子比特），MindSpore Quantum与主流软件Qiskit、Qulacs对比效果如下图所示，性能提高2倍以上。",{"type":17,"tag":25,"props":116,"children":117},{},[118],{"type":17,"tag":47,"props":119,"children":121},{"alt":49,"src":120},"https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413023023.16416182727012689866531670362624:50540412033011:2400:2A2B93624BFCECC8F9ABD6DF7AA5A1772F62AC07FA32A946E58B14C7013CE7C2.png",[],{"type":17,"tag":25,"props":123,"children":124},{},[125],{"type":23,"value":126},"图3 量子模拟器 QAOA性能对比图",{"type":17,"tag":25,"props":128,"children":129},{},[130],{"type":17,"tag":29,"props":131,"children":132},{},[133],{"type":23,"value":134},"【随机线路演化模拟】",{"type":17,"tag":25,"props":136,"children":137},{},[138],{"type":23,"value":139},"随机线路演化CPU-20量子比特，GPU-22量子比特，MindSpore Quantum与主流软件Qiskit、Quest对比效果如下面两图所示，CPU性能提高2倍以上，GPU性能提高5倍以上。",{"type":17,"tag":25,"props":141,"children":142},{},[143],{"type":17,"tag":47,"props":144,"children":147},{"alt":145,"src":146},"cke_4442.png","https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413023104.08619945673440155708306934862869:50540412033011:2400:2B061F8C5894B4F2782E08C3D7FB3BFA3901B698769F5B5B268C7C7E9D933358.png",[],{"type":17,"tag":25,"props":149,"children":150},{},[151],{"type":23,"value":152},"新版本MindSpore Quantum可以通过如下指令来升级：",{"type":17,"tag":154,"props":155,"children":157},"pre",{"code":156},"pip install mindquantum==0.8.0\n",[158],{"type":17,"tag":159,"props":160,"children":161},"code",{"__ignoreMap":7},[162],{"type":23,"value":156},{"type":17,"tag":25,"props":164,"children":165},{},[166],{"type":23,"value":167},"使用方式如下：",{"type":17,"tag":154,"props":169,"children":171},{"code":170},"from mindquantum.algorithm.library import qft\nfrom mindquantum.simulator import Simulator\n\ncirc = qft(range(3))\nsim = Simulator('mqvector', circ.n_qubits)\nsim.apply_circuit(circ)\n",[172],{"type":17,"tag":159,"props":173,"children":174},{"__ignoreMap":7},[175],{"type":23,"value":170},{"type":17,"tag":25,"props":177,"children":178},{},[179],{"type":23,"value":180},"其他会使用到量子模拟器的地方也可使用，例如：",{"type":17,"tag":154,"props":182,"children":184},{"code":183},"from mindquantum.algorithm.library import qft\nqft(range(3)).matrix(backend='mqvector')\n",[185],{"type":17,"tag":159,"props":186,"children":187},{"__ignoreMap":7},[188],{"type":23,"value":183},{"type":17,"tag":25,"props":190,"children":191},{},[192],{"type":23,"value":193},"此外，我们还推出了基于GPU的量子模拟器mqvector_gpu，具体使用方式与mqvector类似。注意：该模拟器仍处于beta试用阶段，具体调用方式后续可能会持续优化。GPU版本的MindSpore Quantum 0.8请扫下方二维码下载，下个版本将可以直接使用pip指令来安装。下载后删除名称中的\"_gpu\"，然后使用pip指令来安装下载的安装包。",{"type":17,"tag":25,"props":195,"children":196},{},[197],{"type":17,"tag":47,"props":198,"children":200},{"alt":49,"src":199},"https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413023212.94780976715514909200264984477004:50540412033011:2400:88D1807760EB98313725C7EC1CF612CA1AF711D2AD95C69EBDD28EC73D78BFEC.png",[],{"type":17,"tag":25,"props":202,"children":203},{},[204],{"type":17,"tag":47,"props":205,"children":208},{"alt":206,"src":207},"cke_7814.png","https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413023240.32757774395052289069065044795161:50540412033011:2400:C2E3759A76BFD78091B4939AD5AF5FC06FD86B8DDC61ED01BF16DDCD45700F8D.png",[],{"type":17,"tag":25,"props":210,"children":211},{},[212],{"type":17,"tag":47,"props":213,"children":216},{"alt":214,"src":215},"cke_9512.png","https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413023422.23118709752746207733224980133654:50540412033011:2400:C9C5E2A21C3E8FC13BABDC9D5A6FE7FA5E5CBC33715357A0D5C656BE86A22BDC.png",[],{"type":17,"tag":218,"props":219,"children":221},"h3",{"id":220},"_24-barriergate",[222,227,229],{"type":17,"tag":29,"props":223,"children":224},{},[225],{"type":23,"value":226},"2.4",{"type":23,"value":228}," ",{"type":17,"tag":29,"props":230,"children":231},{},[232],{"type":23,"value":233},"BarrierGate",{"type":17,"tag":25,"props":235,"children":236},{},[237],{"type":23,"value":238},"在新版本中，我们可以只对特定的比特添加屏障门，请看示例：",{"type":17,"tag":154,"props":240,"children":242},{"code":241},"import mindquantum.core.gates as G\nfrom mindquantum.core.circuit import Circuit, UN\ncirc = Circuit() + UN(G.H, 3) + UN(G.BarrierGate(), [0, 2]) + UN(G.H, 3)\n",[243],{"type":17,"tag":159,"props":244,"children":245},{"__ignoreMap":7},[246],{"type":23,"value":241},{"type":17,"tag":25,"props":248,"children":249},{},[250],{"type":17,"tag":47,"props":251,"children":253},{"alt":49,"src":252},"https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413023931.60331942148569154012639956593144:50540412033011:2400:C97FAE068A59C1757CDF3C5B8CE261182AC0958FA39258AB1288C170601F49D9.png",[],{"type":17,"tag":218,"props":255,"children":257},{"id":256},"_25-krauschannel",[258,263,264],{"type":17,"tag":29,"props":259,"children":260},{},[261],{"type":23,"value":262},"2.5",{"type":23,"value":228},{"type":17,"tag":29,"props":265,"children":266},{},[267],{"type":23,"value":268},"KrausChannel",{"type":17,"tag":25,"props":270,"children":271},{},[272],{"type":23,"value":273},"我们还新增了KrausChannel接口，用户可以根据自己的需求来自定义噪声信道，进行含噪线路模拟。",{"type":17,"tag":154,"props":275,"children":277},{"code":276},"from mindquantum.core.gates import KrausChannel\nfrom mindquantum.core.circuit import Circuit\nfrom math import sqrt\n\ngamma = 0.01\nkmat0 = [[1, 0], [0, sqrt(1 - gamma)]]\nkmat1 = [[0, 0], [0, sqrt(gamma)]]\nphase_damping = KrausChannel('phase-damping', [kmat0, kmat1])\ncirc = Circuit().h(0).x(1)\ncirc += phase_damping.on(0)\ncirc += phase_damping.on(1)\n",[278],{"type":17,"tag":159,"props":279,"children":280},{"__ignoreMap":7},[281],{"type":23,"value":276},{"type":17,"tag":25,"props":283,"children":284},{},[285],{"type":17,"tag":47,"props":286,"children":288},{"alt":49,"src":287},"https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413024057.71483944234349495478477593191339:50540412033011:2400:FDEC3DF6B088A2BF75856951A5FF45ABBD80328137671CBA5DEADBB73FB4C8C6.png",[],{"type":17,"tag":25,"props":290,"children":291},{},[292],{"type":17,"tag":47,"props":293,"children":296},{"alt":294,"src":295},"cke_18648.png","https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413024124.68125457787350376137212118094096:50540412033011:2400:BBAE81A28E75BEEFE2A3AFFAE758A689190B8D4A30668B57FD7F0D121DB94DC3.png",[],{"type":17,"tag":25,"props":298,"children":299},{},[300],{"type":23,"value":301},"往期回顾",{"type":17,"tag":25,"props":303,"children":304},{},[305],{"type":17,"tag":306,"props":307,"children":311},"a",{"href":308,"rel":309},"http://mp.weixin.qq.com/s?__biz=MzkxMTM2MjMzNg==&mid=2247583191&idx=1&sn=9e76c7328e7644ab4c694fffd52fc125&chksm=c11e9598f6691c8e206f56a1c1eb8852ca57a465bcbdf49a2b2af7c028234adfaa5897c0b887&scene=21#wechat_redirect",[310],"nofollow",[312],{"type":23,"value":313},"MindSpore Quantum 0.7 | 多平台可安装，灵活易用，只为给开发者带来更好的体验！",{"type":17,"tag":25,"props":315,"children":316},{},[317],{"type":17,"tag":306,"props":318,"children":321},{"href":319,"rel":320},"https://mp.weixin.qq.com/s?__biz=MzI3NjAzMjA0NA==&mid=2247487870&idx=1&sn=269af5865cba4c56ba9e14c6b51d94b5&chksm=eb7aee3ddc0d672b98c6d345bc4ae72b1b9e4a630b47441026b4db38025cba62f2ac24e383ba&scene=21#wechat_redirect",[310],[322],{"type":23,"value":323},"MindSpore Quantum 0.6 | 易用灵活新起点，展示模块功能强，只为带给开发者更好的体验！",{"type":17,"tag":25,"props":325,"children":326},{},[327],{"type":23,"value":328},"点击阅读原文查看代码仓版本Release Notes",{"type":17,"tag":25,"props":330,"children":331},{},[332],{"type":17,"tag":306,"props":333,"children":336},{"href":334,"rel":335},"https://gitee.com/mindspore/mindquantum/releases",[310],[337],{"type":23,"value":334},{"type":17,"tag":25,"props":339,"children":340},{},[341],{"type":17,"tag":29,"props":342,"children":343},{},[344],{"type":23,"value":345},"加入MindSpore Quantum SIG",{"type":17,"tag":25,"props":347,"children":348},{},[349],{"type":23,"value":350},"如果您对量子计算感兴趣，或者有新的想法，欢迎加入MindSpore Quantum SIG，和我们一起探讨！（扫码添加小助手微信，进入SIG）",{"type":17,"tag":25,"props":352,"children":353},{},[354],{"type":17,"tag":47,"props":355,"children":357},{"alt":49,"src":356},"https://fileserver.developer.huaweicloud.com/FileServer/getFile/cmtybbs/e64/154/b38/90a1d5d431e64154b387b3660e356ff5.20230413024155.28503425280428641749829315206618:50540412033011:2400:F9AEB383E85374A5DE59DE24714932BA2B0AB12ED50854733DE576BF45D7B4DB.png",[],{"title":7,"searchDepth":359,"depth":359,"links":360},4,[361,364],{"id":220,"depth":362,"text":363},3,"2.4 BarrierGate",{"id":256,"depth":362,"text":365},"2.5 KrausChannel","markdown","content:news:zh:2230.md","content","news/zh/2230.md","news/zh/2230","md",1776506064347]