TensorCircuit-NG (Nightly)

raw JSON →
1.6.0.dev20260508 verified Sat May 09 auth: no python

Nightly release of TensorCircuit-NG, a high-performance unified quantum computing framework for the NISQ era. Supports multiple backends (JAX, TensorFlow, PyTorch) for quantum circuit simulation, tensor network contraction, stabilizer simulation, and analog/digital quantum computing. Current version 1.6.0.dev20260508, released nightly.

pip install tensorcircuit-nightly
error ModuleNotFoundError: No module named 'tensorcircuit'
cause Installed 'tensorcircuit-nightly' but imported as a different name, or package not installed.
fix
Run 'pip install tensorcircuit-nightly' and use 'import tensorcircuit as tc'.
error AttributeError: module 'tensorcircuit' has no attribute 'Circuit'
cause Installed the old 'tensorcircuit' package (not nightly) which uses a different API.
fix
Uninstall 'tensorcircuit' and install 'tensorcircuit-nightly'. Then import as 'tensorcircuit'.
error ValueError: Unsupported backend: 'tensorflow'
cause TensorFlow backend has been removed in nightly versions after 1.5.0.
fix
Use JAX or PyTorch backend: set tc.set_backend('jax') or 'pytorch'.
breaking TensorCircuit-NG (tensorcircuit-nightly) is a separate fork from the original TensorCircuit (tensorcircuit). Do not install both. The original is no longer maintained.
fix Uninstall original: 'pip uninstall tensorcircuit'. Install nightly: 'pip install tensorcircuit-nightly'.
deprecated Backend 'tensorflow' is deprecated and may be removed in a future release. Use JAX or PyTorch instead.
fix Set default backend: tc.set_backend('jax') or 'pytorch'.
gotcha Importing 'tensorcircuit' directly (without the nightly suffix) installs the old, unmaintained version. Many APIs differ.
fix Always install 'tensorcircuit-nightly' and import as 'tensorcircuit' (the package name is the same, but the distribution is different).
gotcha The nightly release may have breaking changes without notice. Pin to a specific version if reproducibility is needed.
fix Use 'pip install tensorcircuit-nightly==1.6.0.dev20260508' for a specific nightly.

Create a Bell state circuit and measure Z expectation on qubit 1.

import tensorcircuit as tc
c = tc.Circuit(2)
c.h(0)
c.cnot(0,1)
print(c.expectation((tc.gates.z(), [1])))