DEV Community

Shixin Zhang
Shixin Zhang

Posted on

Tensor Networks Do Not Mean Approximate Simulation: The Right Way to Understand TensorCircuit-NG

When introducing TensorCircuit-NG, people often ask: Is it mainly suited to low-entanglement states? Is it essentially a matrix product state (MPS) simulator? Since it uses tensor networks, are its results approximate?

These questions are easy to ask because many people are first introduced to tensor networks through MPS; in practical MPS applications, SVD truncation is also very common. As a result, MPS, tensor networks, and approximate simulation gradually become conflated.

The correct picture of TensorCircuit-NG is that it provides multiple modes for quantum circuit simulation. The most commonly used Circuit and DMCircuit can perform exact contractions of complete circuit tensor networks, producing exact results consistent with state-vector or density-matrix simulators. MPSCircuit, meanwhile, is a dedicated MPS simulator: it can use truncation to control the computational cost, or remain exact when no truncation is applied.

Therefore, tensor networks do not necessarily imply approximation, nor do they necessarily imply the use of MPS. To understand TensorCircuit-NG, the most important thing is to distinguish the core data structures, exactness, and use cases behind its different simulation modes:

Simulation mode Core data structure Exact? Typical use cases
Circuit Complete circuit tensor network Yes Full amplitudes, local observables, arbitrary circuits
DMCircuit Complete density-matrix tensor network Yes Open systems, noisy quantum evolution
MPSCircuit Matrix product state (MPS) Optional (depending on whether truncation is used) One-dimensional local circuits, low-entanglement systems

Tensor Networks Are Not an Approximation Algorithm

The most important concept here is that a tensor network is first and foremost a way to represent and compute with a problem, not an approximation algorithm.

The initial state, quantum gates, and measurement operators in a quantum circuit can all be represented as tensors. Connecting these objects according to the circuit structure produces a tensor network.

The next step is to contract these tensors one by one according to some chosen order. This process can itself be exact, just like matrix multiplication; it does not inherently involve any approximation.

Approximation usually comes from additional compression operations. For example, to limit the size of intermediate tensors, one may discard some of the smaller singular values or limit the dimensions of internal connections. This is an optional computational strategy, not part of the definition of tensor networks.

In other words, “tensor networks” and “truncation” are two separate issues. The former describes how a computation is organized, while the latter describes whether the computation is actively compressed.

Circuit in TensorCircuit-NG: Exact Contraction of Complete Circuits

The most commonly used Circuit in TensorCircuit-NG is not an approximate simulator designed for low-entanglement states.

It organizes the initial state and quantum gates into a complete circuit tensor network, and then contracts the network according to the specific task. Users can compute the complete output state, or directly compute amplitudes, probabilities, expectation values, and other observables.

In this process, TensorCircuit-NG does not perform a low-rank approximation, and its results match those of a traditional state-vector simulator exactly.

This leads to an important distinction: a traditional state-vector simulator often explicitly stores the entire quantum state as a large vector and repeatedly updates it. Tensor-network simulation, by contrast, can preserve the circuit structure, choose a suitable contraction order, and compute the target quantity only when it is actually needed. If the user wants the complete output wavefunction, they ultimately still have to deal with the scale of the complete output itself. However, if the user only cares about a local observable or needs just a small number of amplitudes and probabilities, tensor networks may avoid generating a large number of irrelevant intermediate results.

Therefore, the advantage of TensorCircuit-NG is not “trading accuracy for speed,” but “improving efficiency through more flexible computational organization.”

Compared with State-Vector Simulators, Where Does the Speedup Come From?

If we view a traditional state-vector simulator as a fixed, global tensor-contraction scheme, it typically maintains the complete quantum state explicitly and applies quantum gates in a relatively fixed order. TensorCircuit-NG instead formulates the same problem as a tensor network and searches for a more suitable contraction path based on the topology of that network.

The key to performance is finding a better computational order. A better contraction path can often significantly reduce the size of intermediate tensors, memory usage, and total computational cost; for some problems, the speedup can even reach several orders of magnitude.

This means that the core advantage of TensorCircuit-NG is not a trade-off between accuracy and efficiency, as one might easily assume. The results from Circuit match those of a state-vector simulator exactly, and the results from DMCircuit match those of a complete density-matrix simulator exactly, while using less memory and achieving higher throughput.

From this perspective, compared with traditional state-vector simulators, TensorCircuit-NG offers a “free lunch”: unchanged accuracy, a consistent programming interface, and significantly better time and space efficiency.

DMCircuit: Complete Density-Matrix Simulation Based on Tensor Networks

DMCircuit follows the same philosophy. TensorCircuit-NG’s DMCircuit describes quantum systems directly at the density-matrix level. Quantum gates, noise channels, and measurement processes are all incorporated into a complete density-matrix tensor network, which is then evaluated through exact contraction.

Therefore, DMCircuit does not mean that some low-rank approximation is applied to noise, nor does it default to sampling only a few trajectories. It performs a complete simulation of mixed-state evolution. This naturally incurs higher computational and storage costs than pure-state simulation, but those costs correspond to a more complete physical description.

This is also why the claim that “TensorCircuit-NG is only suitable for low-entanglement pure states” is a misconception. It can readily handle complete density matrices and open-system evolution.

MPS Is One Special Form of Tensor Network

So, what exactly is MPSCircuit?

An MPS, or matrix product state, is a special tensor-network structure. Each qubit position is represented by a local tensor, and neighboring positions are connected through internal bonds. This structure is particularly well suited to one-dimensional local circuits and low-entanglement states, and an MPS can represent the corresponding quantum state using far fewer resources than a complete state vector.

However, an MPS does not inherently mean approximation either.

In principle, any finite-size quantum state can be represented exactly as an MPS; the required internal bond dimension may simply be very large. During MPS evolution, retaining all the information makes it possible to obtain exact results. Approximation errors from SVD truncation arise only when the size of the internal bonds is actively limited.

Therefore, MPSCircuit can be either an approximate simulator or an exact simulator. The key question is whether truncation is performed, not simply whether the simulator is based on MPS.

The source of confusion is that, in large-scale computations, people often use MPS truncation because it is an effective way to control computational cost. Over time, many people come to mistake this commonly used truncated-MPS approach for the essence of MPS, and then go one step further and assume that all tensor-network simulation methods are approximate.

Beyond the Three Main Modes: More Native Simulators

The Circuit, DMCircuit, and MPSCircuit introduced above are three important examples for understanding the simulation philosophy of TensorCircuit-NG, but they are not the whole story.

Another core design principle of TensorCircuit-NG is to choose a more native and efficient data structure based on the specific structure of the quantum system and circuit, rather than forcing every problem to use the same general-purpose representation. Different physical models and circuit types often have a simulator that is best suited to them.

For example, QuditCircuit targets qudit systems whose local dimension is greater than two; StabilizerCircuit targets Clifford and stabilizer circuits, using the stabilizer formalism to represent and evolve quantum states; FGSSimulator targets fermionic Gaussian states and exploits the structure of correlation matrices; and U1Circuit targets circuits with symmetries, working directly in the particle-number-conserving subspace.

What these simulators have in common is that they do not reduce every problem to explicitly storing a complete wavefunction. For circuits with special structure, using the corresponding native representation can greatly reduce unnecessary computational and memory costs while preserving exactness.

Therefore, the right way to understand TensorCircuit-NG is not to begin by asking whether it is an approximate MPS simulator. Instead, ask: What structure does the current problem have? Should we use a complete circuit tensor network, a complete density matrix, an MPS, or a specialized representation such as stabilizers or fermionic Gaussian states?

If one concludes that TensorCircuit-NG “is only suitable for low-entanglement states” or “can only perform approximate simulation” simply because it uses tensor networks, one is actually mistaking one common use case for the operating principles of the entire framework.

In summary, tensor networks are a computational framework, MPS are a special structure, and truncation is an optional strategy. The core advantage of TensorCircuit-NG is to make its data structures fit the problem as closely as possible: where generality is needed, it performs complete and exact tensor-network contractions; where special structure exists, it uses more native, specialized simulators. By choosing a more suitable representation for each scenario, it can provide both greater efficiency and equally rigorous results.

Top comments (0)