Release Notes

MindQuantum 0.13.0 Release Notes

MindQuantum 0.13.0 introduces mqvector_npu, a device-resident state-vector simulator backend for Ascend 910B NPUs, along with the graph-replayed Ascend CANN backend (ascend-float32) for QAIA BSB and DSB; extracts a shared circuit-tiling execution engine (circuit_tiling) with runtime-dispatched Arm SVE vectorization on Linux AArch64; rebuilds the mqmatrix density-matrix simulator on full row-major storage; replaces binary OpenMP thread switching with work-proportional team sizing; and modernizes the build system and Python 3.9–3.12 toolchain.

Major Features and Enhancements

Simulator

  • [BETA] Device-resident Ascend 910B state-vector backend mqvector_npu (!3172): Added a single-precision (mindquantum.complex64) full-amplitude state-vector simulator backend for Ascend 910B NPUs.

    • End-to-end device execution: Quantum states reside in NPU HBM, combining Vector-core local circuit tiling with Cube-core strict-FP32 dense operator fusion (disabling HF32/FP16/BF16 precision downgrades). Circuit evolution, Pauli/CSR expectations, checkpoint-free hybrid adjoint gradients, exact multi-frequency parameter-shift rules, pure-state noise trajectories, tree-based sampling, and reduced density-matrix contractions run entirely on device, returning only scalar or target results to the host (~54 ms per adjoint gradient step on 24-qubit 4-layer MaxCut QAOA on Ascend 910B2).

    • Precision and build-from-source requirements: Supports complex64 only, and input Hamiltonian objects must be single-precision (e.g., Hamiltonian(op, mq.float32) or ham.astype(mq.float32)). Because Ascend C kernels are compiled for a specific target SoC (Ascend910B[1-4]) against a local CANN installation, pre-built release .whl packages do not include mqvector_npu; users must source their local CANN environment and build from source with ENABLE_ASCEND=ON and the matching MQ_ASCEND_SOC (see docs/mqvector_npu.md).

  • [STABLE] Shared circuit-tiling engine (circuit_tiling) and Arm SVE vectorization (!3146, !3165, !3175):

    • Circuit tiling: Unlike conventional gate fusion (which multiplies consecutive gates into a dense matrix, losing single-gate sparsity and fragmenting on parameterized gates), mqsim_circuit_tiling gathers a local 8-qubit state tile (256 amplitudes) into L1 cache once, applies multiple gates in place while preserving structured sparsity and folding adjacent diagonal runs, and scatters once. Forward evolution and adjoint gradients share the same tiled execution path, enabled automatically on mqvector when n_qubits >= 13.

    • Cross-tile Arm SVE execution with runtime dispatch: On Linux AArch64, dedicated SVE + FCMA kernels use Gather/Scatter, FCMLA complex multiply-accumulate, and predicate masks to evolve multiple independent state tiles in parallel, with automatic runtime dispatch based on host CPU capabilities. On Kunpeng 920F with NUMA affinity (OMP_PLACES=cores OMP_PROC_BIND=close), 20–28 qubit random circuits and MaxCut QAOA workloads run 3–5× faster than 0.12.0.

  • [STABLE] mqmatrix density-matrix simulator rebuilt on full storage and circuit tiling (!3165): Treats an \(n\)-qubit row-major density matrix as a state vector over \(2n\) index bits on top of circuit_tiling, exploiting Hermitian symmetry at runtime by evolving only the lower block triangle.

    • Noise channels lower directly to superoperators (diagonal channels such as phase damping and dephasing fold into adjacent diagonal gates), noisy and noiseless circuits share one C++ adjoint-differentiation path, and measurement-ending noisy circuits sample from a single exact mixed-state evolution. At 10 qubits, apply_circuit is 3× faster, gradients are 2× faster, and 1000-shot noisy sampling drops from 278 s to 0.12 s.

  • [STABLE] Work-proportional OpenMP thread scheduling (!3168): CPU simulators and operator sparsification now allocate 1 thread per 8,192 amplitudes (capped by OMP_NUM_THREADS), and gradient batches allocate workers within workers * team <= MaxThreads, eliminating many-core fork/join slowdowns on small states and speeding up mid-size batches by 1.6×–1.8×.

Algorithm, Examples & AI Skills

  • [BETA] Graph-replayed Ascend CANN backend (ascend-float32) for QAIA BSB and DSB (!3162): Added a PyTorch-free native Ascend 910B backend backend='ascend-float32' (with keyword-only device_id=0; 'npu-float32' remains the PyTorch/torch_npu backend) for BSB and DSB, along with a standalone QPLIB/Gset benchmark suite on the qaia-cann branch.

    • Batched Cube GEMM and aclmdlRI graph replay: Batches replicas into a single strict-FP32 Cube matrix multiplication (aclnnMatmul, KEEP_DTYPE, never HF32), fuses the kick-drift-wall update and next-step DSB sign into one Ascend C Vector kernel (sb_kernel.asc), and lazily captures the full iteration schedule into a replayable aclmdlRI execution graph on the first update() (invalidating and replacing the cached plan via SHA-256 content digests whenever J, h, p, or integration parameters are modified). On Ascend 910B2 (100 replicas, 1000 steps), repeated solves across 23 QPLIB binary instances achieve median speedups of 52.1× (DSB) and 37.8× (BSB) over the single-threaded SciPy sparse CPU baseline.

    • Requires building from source: Shares the -DENABLE_ASCEND=ON -DMQ_ASCEND_SOC=Ascend910B[1-4] build toolchain and runtime guard with mqvector_npu. Pre-built release .whl packages do not include this backend; users must source their local CANN environment and build from source (see docs/qaia_ascend.md).

  • [BETA] QAIA Generalized Ballistic Simulated Bifurcation (GBSB) (!3159): Added GBSB under mindquantum.algorithm.qaia with nonlinear bifurcation control, supporting 'cpu-float32', 'gpu-float32', and 'npu-float32' backends.

  • [STABLE] Decoded Quantum Interferometry (DQI) and OTOC examples (!3128, !3142): Added a complete DQI combinatorial optimization implementation (arXiv:2509.08328) under example/dqi_mindquantum/, and mqmps-based many-body OTOC light-cone spreading (arXiv:2506.10191) and \(\text{H}_2\) bond-length inversion (arXiv:2510.19550) studies under example/otoc_simulation/.

  • [STABLE] MindQuantum AI Agent Skills (!3125, !3126): Added 6 domain skill packages under skills/ (covering core APIs, variational training, noisy simulation, QAIA solvers, circuit compilation, and quantum chemistry) for AI coding assistants, installable via npx skills add https://atomgit.com/mindspore/mindquantum.git.

Bug Fixes

  • QAIA LSB and USB fixes (!3124): Fixed the inverted logarithmic scale exponent (\(2^{-l_x} \to 2^{l_x}\)) and x = 0 guard in LSB, and widened default x initialization in USB from [-0.01, 0.01] to [-0.1, 0.1] so uniform quantization does not zero out the driving force (restoring 2.0×–2.7× TTS speedups over DSB on MaxCut benchmarks).

  • QAIA backend conversions, validation, and coupling normalization fixes: Accepted dense numpy.ndarray coupling matrices J on GPU/NPU backends; converted external spin inputs x in calc_cut/calc_energy and NPU external field h in SB properly; fixed CPU CAC/CFC/SFC coupling normalization to use element-wise sparse squares self.J.power(2).sum(); required explicit xi in SB when both J and h are zero; and enforced per-class _VALID_BACKENDS across QAIA subclasses.

  • Worker thread exception propagation (!3165): Caught exceptions thrown inside ParallelBatch worker threads and rethrew them on the calling thread instead of triggering std::terminate and crashing the Python interpreter.

  • mqmatrix derivative gates, Pauli channels, and measurement accuracy (!3165): Fixed apply_gate(..., diff=True) to zero local basis states outside the derivative's support; accumulated Pauli channels as \(\sum_k p_k P_k \rho P_k\) directly to avoid square-root NaNs from rounding; validated finite positive trace and both branch weights during measurement.

  • OpenQASM barrier parsing (!3156): Fixed OpenQASM().from_string() retaining only the first qubit when parsing barrier instructions over multi-qubit registers (e.g., qreg q[4]; barrier q;).

  • MindSpore device context and documentation fixes (!3127, !3130, !3166): Replaced deprecated ms.set_context(device_target="CPU") calls with ms.set_device("CPU") in mindquantum.framework, and fixed typos and math rendering across API docstrings.

Build System and Project Modernization

  • Configure-time OpenBLAS verification and ENABLE_MPS option (!3174): Added FindOpenBLAS.cmake to verify all required mqmps symbols at configure time (preventing macOS from selecting Accelerate and failing at link time) and gated mqmps behind -DENABLE_MPS=ON/OFF.

  • Isolated pybind11 ABI and multi-arch mqrt (!3137, !3174): Enabled MQ_ISOLATE_PYBIND11_INTERNALS by default to isolate extension symbol tables; enabled mqrt builds on both AArch64 and x86_64.

  • Build scripts and toolchain improvements (!3111, !3153, !3154, !3165): Fixed stale cache errors on consecutive build.sh runs, --clean-all directory resolution, and GCC 13+ <cstdint> headers for Catch2; migrated Python linting/formatting to Ruff and aligned local hooks with the CI gate.

Breaking and Behavioral Changes

  • Python version requirement (!3111): Supported versions are now Python 3.9–3.12 (dropped Python 3.7 and 3.8).

  • API removal and exception fix (!3168): Removed Simulator.set_threads_number() (use OMP_NUM_THREADS instead); accessing non-existent attributes on mindquantum.framework now raises AttributeError instead of ImportError.

  • mqmatrix storage, sampling, and validation changes (!3165): Full-matrix storage doubles single-state memory (reducing max qubit count by 1 for a fixed memory budget) and adds 10%–15% overhead on \(\le 6\)-qubit circuits; terminal noisy sampling consumes random draws differently under a fixed seed (distribution unchanged); passing circ_left/simulator_left or invalid noise channel parameters now raises an error before execution.

  • Build and CMake option changes (!3127, !3148, !3169, !3174):

    • Requires CMake \(\ge\) 3.20 and pybind11 >= 3.1; building mqvector_cq now requires -DENABLE_CUQUANTUM=ON (or build.sh --gpu --cuquantum); Linux AArch64 defaults to MQ_ARM_SVE=ON (pass -DMQ_ARM_SVE=OFF if the compiler lacks SVE support);

    • Removed MQ_BLAS_LIBRARIES, MQ_LAPACK_LIBRARIES, and BLAS_SYMBOL_PREFIX in favor of OpenBLAS_ROOT, OpenBLAS_LIBRARY, and OpenBLAS_SYMBOL_PREFIX; build scripts install runtime and test dependencies by default and removed --only-pytest (use --no-python-deps to skip).

Contributors

Thanks to the following developers for their contributions:

dsdsdshe, huangzhe-2026, liqingyu_2026, lllrt, mangrovecoder, Tsingpy.

Welcome contributions to the project in any form!