• Home
  • About
    • refraction-ray photo

      refraction-ray

      Blog of thoughs and archive of experience

    • Learn More
  • Posts
    • All Posts
    • Tags Archive
    • Posts Archive
  • Projects
  • RSS

TensorCircuit-NG

24 Jun 2020

See the repo here.

pypi docs stars license

Try the package by pip install tensorcircuit-ng.

From tensorcircuit to TensorCircuit-NG

tensorcircuit started in 2020 as a simple circuit API on top of Google’s TensorNetwork package, with a unified AD interface so that the same code runs on TensorFlow, PyTorch and Jax backends. The original repo is now archived.

TensorCircuit-NG is its technical successor, led and maintained by the original development team, and a fully compatible drop-in replacement (import tensorcircuit as tc still works).

Introduction

TensorCircuit-NG is a high-performance quantum software framework built on tensor network engines and modern ML frameworks (Jax, TensorFlow, PyTorch). It supports automatic differentiation, JIT compilation, hardware acceleration, vectorized parallelism and multi-node multi-GPU distributed simulation, and composes quantum circuits, neural networks and tensor networks seamlessly.

Circuit types cover ideal (Circuit), noisy (DMCircuit), Clifford (StabilizerCircuit), qudit (QuditCircuit), approximate MPS (MPSCircuit), analog (AnalogCircuit), U(1) symmetric (U1Circuit) and fermionic Gaussian (FGSCircuit) simulation, together with quantum hardware access.

It is also designed as an AI-native research runtime: the repo ships AGENTS.md, 200+ example scripts and built-in agentic skills, so that coding agents such as Claude Code or Codex can turn research questions into runnable, optimized and validated quantum experiments.

import tensorcircuit as tc

tc.set_backend("jax")

def forward(theta):
    c = tc.Circuit(2)
    c.H(0)
    c.CNOT(0, 1)
    c.rx(1, theta=theta)
    return tc.backend.real(c.expectation_ps(z=[0, 1]))

g = tc.backend.jit(tc.backend.grad(forward))

Ecosystem

  • TenCirChem-NG: quantum computational chemistry based on TensorCircuit.
  • TenCirPauli: Rust-native companion for Pauli propagation and U(1) circuit execution.
  • Quantum computing lectures with TC-NG.

Papers

  1. S.-X. Zhang et al., TensorCircuit: a Quantum Software Framework for the NISQ Era, Quantum 7, 912 (2023), arXiv:2205.10091.
  2. TensorCircuit-NG: A Universal, Composable, and Scalable Platform for Quantum Computing and Quantum Simulation, arXiv:2602.14167.

Blogs

  • TensorCircuit-NG:下一代科研基础设施
  • 基于 TensorCircuit-NG 的千比特万参数全梯度量子算法训练