Open source · MindSpore ecosystem
Quantum circuits,differentiatedend‑to‑end
Parameterized quantum circuits in Python. CPU, GPU, and Ascend backends. Auto-differentiation via MindSpore.
Get startedCircuit([H.on(0), X.on(1, 0)]) | Outcome, q1 q0 | Probability |
|---|---|
| |00⟩ | 50% |
| |01⟩ | 0% |
| |10⟩ | 0% |
| |11⟩ | 50% |
00 or 11, each with 50% probability.
Explore the circuit & Pythonbell_state.py
CNOT entangles the pair. Only 00 or 11 can be measured, each with 50% probability.
from mindquantum.core.circuit import Circuit
from mindquantum.core.gates import H, X
from mindquantum.simulator import Simulator
circ = Circuit([H.on(0), X.on(1, 0)])
sim = Simulator('mqvector', 2)
sim.apply_circuit(circ)
probabilities = abs(sim.get_qs()) ** 2 Learn how the simulator works → Exact statevector · computed at build time · MindQuantum 0.12.0 / mqvector
Source AtomGit (opens in new tab) GitHub (opens in new tab) Gitee (opens in new tab)
User-friendly, high-performance, AI-compatible
MindSpore Quantum is built around the NISQ era. Four pillars take a quantum program from a Python expression to a real chip: a typed circuit DSL, differentiable circuits through MindSpore, three first-class simulator backends, and a batteries-included algorithm library.
- 01
A Pythonic circuit DSL
Quantum gates, circuits, parameter resolvers, and Hamiltonians as typed Python primitives. Arbitrary control on any gate, chain-rule circuit composition, and OpenQASM export.
- Quantum Gate
- Quantum Circuit
- Parameter Resolver
- Observable
- 02
Differentiable end to end
Parameterized circuits differentiate through MindSpore's autograd via the adjoint method. VQE, QAOA, and QNN models compose with any MindSpore optimizer, an order of magnitude faster on QAOA than competing frameworks.
- VQE
- QAOA
- QNN
- Adjoint gradient
- Ansatz library
- 03
Three backends, one model
State-vector and density-matrix simulators tuned per architecture: SIMD with OpenMP on x86, CUDA on NVIDIA, NEON on Ascend. Switch single- and double-precision per run, no recompile.
- x86 (AVX)
- GPU (CUDA)
- Ascend (NEON)
- Noise channels
- 04
Algorithms, batteries included
VQE, QAOA, Grover, Shor, HHL, and Quantum Phase Estimation as one-line APIs. A dedicated VQE quantum-chemistry simulator is open-sourced in-tree, ready for LiH, H₂O, and beyond.
- Grover
- Shor
- HHL
- QPE
- VQE chemistry simulator
From your first circuit to your next idea
Install once. Then follow a tutorial, explore an algorithm, or go straight to the API.
Set up MindQuantum
pip install mindquantum==0.12.0 Python 3.9–3.11
MindSpore Quantum V0.12 released →- 01
Quantum foundations
Zero-foundation introduction to quantum information and computing — the math, the postulates, and the vocabulary you need before writing any circuit.
- 02
API reference
Find the interfaces for circuits, gates, simulators, and differentiable algorithms.
- 03
Algorithm case studies
Runnable walkthroughs of VQE, QAOA, Grover, and quantum phase estimation — the jumping-off point for research work.
100+ peer-reviewed papers from 30+ institutions — including Peking University, Tsinghua, and Shanghai Jiao Tong.