← all repositories
mit-han-lab/torchquantum

Build quantum neural networks like normal PyTorch models

It treats quantum circuits as differentiable PyTorch modules so you can simulate and deploy them like normal neural nets.

1.6k stars Jupyter Notebook ML FrameworksDomain Apps
torchquantum
Not currently ranked — collecting fresh signals.
star history

What it does

TorchQuantum is a PyTorch-native framework for simulating quantum computations on classical hardware. It treats quantum devices and gates as differentiable tensor operations, supporting statevector simulation, automatic gradients via autograd, and batched training on CPU or GPU. Once a circuit is trained, built-in Qiskit plugins convert it for deployment on real IBMQ hardware.

The interesting bit

The framework scales simulation to 30+ qubits across multiple GPUs and frames everything—gates, measurements, hybrid models—as standard PyTorch modules. That means you can drop a QuantumDevice into an otherwise normal torch.nn model and backpropagate through it just like a convolution layer.

Key highlights

  • Dynamic computation graphs for debugging quantum circuits with familiar PyTorch tools.
  • Batch-mode tensorized processing on GPU for training parameterized quantum circuits.
  • Direct export to QASM and IBM Qiskit ecosystem integration for running on real quantum devices.
  • Examples spanning MNIST classification, VQE, QAOA, and quantum kernel methods.
  • Part of both the PyTorch and Qiskit ecosystems.

Caveats

  • The README advertises “pulse simulation on GPUs” in the intro but lists pulse-level simulation as “coming soon” in the feature list, so its current status is unclear.
  • Most real-hardware examples reference IBMQ specifically; support for other backends is not demonstrated in the sources.

Verdict

Researchers building hybrid quantum-classical models or prototyping QML algorithms in a familiar deep-learning environment should look here. If you need mature pulse-level control or a hardware-agnostic quantum SDK, this is probably not your final stop.

Frequently asked

What is mit-han-lab/torchquantum?
It treats quantum circuits as differentiable PyTorch modules so you can simulate and deploy them like normal neural nets.
Is torchquantum open source?
Yes — mit-han-lab/torchquantum is open source, released under the MIT license.
What language is torchquantum written in?
mit-han-lab/torchquantum is primarily written in Jupyter Notebook.
How popular is torchquantum?
mit-han-lab/torchquantum has 1.6k stars on GitHub.
Where can I find torchquantum?
mit-han-lab/torchquantum is on GitHub at https://github.com/mit-han-lab/torchquantum.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.