Skip to main content

Open source · MindSpore ecosystem

Quantum circuits,differentiatedend‑to‑end

Parameterized quantum circuits in Python. CPU, GPU, and Ascend backends. Auto-differentiation via MindSpore.

Get started
Two qubits. One Bell state. |Φ⁺⟩
Circuit([H.on(0), X.on(1, 0)])
q0 |0⟩ q1 |0⟩ H
Measurement probabilities
Outcome, q1 q0Probability
|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)

Composer — a standalone visual circuit editor that runs entirely in your browser.
Try Composer
Core capabilities

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.

  1. 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
  2. 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
  3. 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
  4. 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
Architecture
  1. 02

    Quantum Neural Network

    Encoder

    Ansatz

    QRam

  2. 03

    Compiler

    Quantum Circuit Compilation

    Qubit Mapping

  3. 04

    Domain Specific Language

    Quantum Gate

    Quantum Circuit

    Quantum Operator

  4. 05

    Simulator

    Full Amplitude Simulator

    Density Matrix Simulator

    Quantum Chemistry Simulator

Research

100+ peer-reviewed papers from 30+ institutions — including Peking University, Tsinghua, and Shanghai Jiao Tong.