DEV Community

Cover image for Chasing Quantum States Through Time: A Tour of Time-Evolution Methods in TensorCircuit-NG
Shixin Zhang
Shixin Zhang

Posted on

Chasing Quantum States Through Time: A Tour of Time-Evolution Methods in TensorCircuit-NG

Flip a single spin in a spin chain and, at first glance, almost nothing seems to happen. It is just a small disturbance dropped into a large quantum system.

But then the disturbance propagates. Magnetization changes. Entanglement grows. Observables evolve. If a simulation is to follow the system from beginning to end, it has to keep track of the quantum state as it moves through time.

The Schrödinger equation itself looks deceptively simple:

insert equation

One line on paper turns into a surprisingly diverse collection of numerical methods in code. Some methods keep the Hamiltonian and the full state space explicitly. Some break time evolution into small steps. Some never construct the Hamiltonian matrix at all, and only ask what the Hamiltonian does to a state. Others change the representation of the quantum state itself.

For (n) qubits, a full state vector already contains (2^n) complex amplitudes. Before the state has evolved very far, memory may become the limiting factor.

Different time-evolution algorithms therefore make different trade-offs between computational cost, memory, accuracy, and the complexity of the state representation.

TensorCircuit-NG supports all of these approaches.


Solve Everything at Once: Exact Diagonalization

Exact diagonalization takes the most straightforward approach: keep the Hamiltonian and the complete Hilbert space.

For a time-independent Hamiltonian,

$$
|\psi(t)\rangle=e^{-iHt}|\psi(0)\rangle,
$$

and once (H) has been diagonalized, changing the time only requires applying phases to its eigencomponents. Evaluating the state at different times is therefore essentially independent of the Hilbert-space dimension after the initial diagonalization.

insert equation / complexity

The price is obvious: storing a dense Hamiltonian is extremely expensive.

For example, a dense (16)-qubit Hamiltonian in complex128 already requires roughly 64 GB of memory. The actual diagonalization requires several times more working memory. The bill is paid upfront, but for small systems and simulations requiring many time points, that can be a very good trade.


Split Time into Pieces: Trotter, TEBD, and ODE Solvers

Trotter decomposition takes a different route. Instead of applying the full evolution operator at once, it divides the total evolution time into small intervals and applies local evolution operators sequentially.

The smaller the time step, the smaller the Trotter error—but the more steps have to be performed.

insert scaling equation

Trotter evolution does not require constructing the full Hamiltonian matrix, but it still stores the complete state vector.

TEBD goes one step further.

Instead of representing the state as a dense vector, TEBD represents it as a matrix product state (MPS). Local gates are applied sequentially, and the bond dimension is truncated after each update.

insert equation

For a one-dimensional system, the memory requirement can scale only linearly with system size for fixed bond dimension, rather than exponentially with the number of sites. This makes simulations involving hundreds or even thousands of qubits possible—provided that entanglement does not drive the required bond dimension too high.

The trade-off is now twofold: Trotter error from discretizing time, and truncation error from compressing the quantum state.

ODE-based evolution takes yet another approach. Instead of explicitly constructing a product formula, it integrates the Schrödinger equation directly. This is particularly convenient for time-dependent Hamiltonians and driven systems.

The number of integration steps is determined by the numerical integrator, often adaptively, with the target error controlled by the solver.


No Matrix Required: Krylov, Chebyshev, and expm-multiply

For a time-independent Hamiltonian, the formal solution is

$$
|\psi(t)\rangle=e^{-iHt}|\psi(0)\rangle.
$$

But there is no reason to explicitly construct (e^{-iHt}).

Krylov methods approximate the evolution in a small subspace generated by repeated applications of (H) to the initial state.

Chebyshev methods approximate the exponential using a polynomial expansion.

expm-multiply uses a scaled Taylor-series approach to approximate the action of the matrix exponential on a vector.

The common idea is simple:

We do not need the matrix exponential. We only need its action on the state.

These methods can work directly with a matrix-vector-product (MVP) interface. The implementation only needs to answer the question

$$
|\phi\rangle \mapsto H|\phi\rangle.
$$

The Hamiltonian itself does not necessarily need to exist as an explicit matrix.

This is particularly useful for large sparse or structured many-body Hamiltonians. Compared with explicitly constructing and multiplying sparse matrices, a specialized MVP implementation can avoid substantial memory traffic and exploit the structure of the underlying operators.

TenCirPauli: Extending the MVP Interface

TensorCircuit-NG already provides MVP implementations for spin operators and Pauli Hamiltonians.

TenCirPauli extends this abstraction to fermionic, bosonic, spin, and mixed many-body Hamiltonians, while also supporting MVPs after symmetry reduction.

For example, particle-number conservation or total-magnetization conservation can be used to restrict the calculation to a symmetry sector. The resulting reduced operator can then be passed directly to an ODE solver, Krylov evolution, Chebyshev expansion, or expm-multiply.

The evolution algorithm does not need to know where the operator came from.

It only needs an MVP.

This separation between operator construction and operator action is useful both numerically and architecturally: the same evolution machinery can operate on very different physical representations.


TDVP: Let Parameters Move Instead of the Full State

Eventually, the full wavefunction becomes too large to store.

At that point, another possibility is to stop representing the quantum state explicitly.

Instead, represent it using a parameterized ansatz,

$$
|\psi(\boldsymbol{\theta})\rangle,
$$

and evolve the parameters (\boldsymbol{\theta}).

Time-dependent variational principle (TDVP) projects the exact Schrödinger dynamics onto the tangent space of the chosen variational manifold. The simulation therefore follows the best direction available within the chosen ansatz rather than the full Hilbert space.

Fewer parameters can mean dramatically lower computational cost—but also potentially larger projection error.

TensorCircuit-NG supports several variants of this idea:

  • Variational-circuit TDVP uses the output of a parameterized quantum circuit as the state representation.
  • MPS-TDVP uses an MPS as the variational manifold. For low-entanglement one-dimensional systems, it can reach system sizes far beyond dense-state simulation and is often more natural than TEBD for long-range interactions.

The key idea is the same:

Instead of following every amplitude in Hilbert space, follow the coordinates of a much smaller manifold.


A Quick Comparison

Method Time cost Memory Typical scale
Exact diagonalization Essentially constant per additional time point after diagonalization Full Hamiltonian + full state ~14 qubits without symmetry reduction; 16+ with symmetry
Trotter / ODE Roughly linear in the number of time steps Full state ~25–30 qubits
Krylov / Chebyshev / expm-multiply Roughly linear in the number of evolution steps / MVP evaluations Full state + work vectors ~25–30 qubits
Variational-circuit TDVP Roughly linear in evolution steps State + variational parameters ~20 qubits
TEBD / MPS-TDVP Roughly linear in system size for fixed bond dimension MPS Hundreds to thousands of qubits in 1D

These numbers are not hard limits. The actual boundary depends heavily on hardware, precision, Hamiltonian structure, entanglement growth, bond dimension, and how much memory one is willing to spend.

And these days, that last variable can get expensive very quickly.


There Are More Ways to Evolve a Quantum State

Some physical problems admit even more specialized representations.

Free-fermion dynamics

Free-fermion evolution is one such special case.

When both the Hamiltonian and initial state preserve fermionic Gaussian structure, TensorCircuit-NG's FGSSimulator can evolve the system directly on the Gaussian-state manifold rather than storing the full many-body wavefunction.

Neural quantum states

For more complicated entanglement structures, neural quantum states (NQS) combined with time-dependent variational Monte Carlo provide another route. Conceptually, NQS-tVMC is again a TDVP calculation, but with a neural-network wavefunction and Monte Carlo sampling replacing an explicitly stored state.

PEPS

For genuinely two-dimensional systems, PEPS provides a natural extension of tensor-network representations. Real-time PEPS evolution remains substantially more difficult than its one-dimensional counterparts, but recent PEPS-tVMC approaches are beginning to combine PEPS representations with variational Monte Carlo.

TensorCircuit-NG does not currently provide ready-to-run examples for all of these approaches. But the underlying infrastructure is designed to make such extensions possible.

If your Agent needs another one, bring it along.


The Algorithm Is Only Half the Story

Time-evolution algorithms look quite similar on paper. In practice, the way they are executed can make a substantial difference.

TensorCircuit-NG brings automatic differentiation, JIT compilation, vectorization, and GPU execution into the same computational workflow. This is particularly useful when quantum dynamics is not an isolated simulation, but part of a larger machine-learning or optimization pipeline.

JIT compilation

Repeated evolution steps can be compiled into an optimized computation graph instead of being dispatched one operation at a time from Python.

GPU and vmap

State-vector operations, MVPs, tensor contractions, and other numerical kernels can run directly on GPUs.

vmap makes it possible to evolve batches of initial states or evaluate multiple time points in parallel when the problem structure allows it.

Automatic differentiation

Parameters do not have to be fixed inputs.

Hamiltonian couplings, external fields, evolution times, and even initial-state parameters can all become differentiable quantities.

This turns problems such as quantum-control optimization, Hamiltonian inverse design, pulse optimization, and target-state preparation into gradient-based computational problems rather than brute-force parameter sweeps.

That is where the distinction between a physics simulator and a computational framework becomes important.


So Which Method Should You Use?

Ideally, you should not have to memorize this table.

Given a concrete problem, the right choice depends on the Hamiltonian, system size, entanglement growth, time dependence, available hardware, desired accuracy, and whether gradients are required.

This is also increasingly a job for an Agent.

Give the Agent the problem, the TensorCircuit-NG documentation, and the relevant hardware constraints. It can decide whether the calculation calls for exact diagonalization, an MVP-based method, Trotter evolution, MPS, TDVP, or something more specialized—and tune the numerical parameters accordingly.

There is a practical reason to explicitly tell an Agent about TensorCircuit-NG.

If you do not, it may reach for one of the established "standard" packages by default. They are standards for good reasons.

They are also very good at being standard.

And sometimes, very standard means very slow.


Examples and References

  1. Exact evolution, Krylov, and ODE comparison
    https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/time_evolution_comparison.py

  2. Trotter decomposition
    https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/timeevolution_trotter.py

  3. TEBD and MPS
    https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/xyzmodel_tebd.py

  4. ODE-based evolution with time-dependent driving
    https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/ng_whitepaper/IVD_time_evolution.py

  5. Krylov time evolution
    https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/krylov_time_evolution.py

  6. Chebyshev evolution
    https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/chebyshev_evol.py

  7. expm-multiply evolution
    https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/expm_multiply_evol.py

  8. Fermionic MVP time evolution
    https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/tencirpauli_fermion_mvp_timeevolution.py

  9. TenCirPauli: many-body operators, symmetry reduction, and MVP
    https://github.com/tensorcircuit/TenCirPauli

  10. Variational-circuit TDVP
    https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/variational_dynamics.py

  11. MPS-TDVP
    https://github.com/tensorcircuit/tensorcircuit-ng/blob/master/examples/one_site_tdvp.py

Top comments (0)