Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

TEBD for 1D Spin Chain Dynamics

Hello! Welcome back to our series on advanced computational methods.

In our last lesson, you implemented the infinite-system DMRG algorithm to find the ground state of a 1D spin chain. This was a powerful application of the Matrix Product State (MPS) formalism to a static, time-independent problem. Today, we shift our focus from finding stationary states to simulating their evolution in time.

Your learning outcome for this lesson is to implement the Time-Evolving Block Decimation (TEBD) algorithm to simulate the real-time dynamics of a 1D spin chain. TEBD is a cornerstone algorithm for studying how quantum states evolve under a given Hamiltonian, making it indispensable for probing non-equilibrium physics in many-body systems. We will see that the time evolution operator can be broken down into a series of local "gates," much like in a quantum circuit, which we can then apply sequentially to an MPS.

1. From Schrödinger to Suzuki-Trotter

The time evolution of a quantum state is governed by the Schrödinger equation, whose formal solution is given by the time evolution operator:

(We'll set ). For a many-body system, the Hamiltonian is a sum of local terms, for instance, the nearest-neighbor Heisenberg model:

The challenge is that the local terms generally do not commute with each other. This means we cannot simply write as a product of exponentials of the local terms. Applying the full operator to an MPS is computationally intractable because it would generate long-range entanglement and destroy the MPS structure.

The solution is to approximate the evolution over a small time step using a Suzuki-Trotter decomposition. The core idea is to split the Hamiltonian into parts whose terms do commute among themselves. For a nearest-neighbor model, a natural split is between even- and odd-numbered bonds:

All terms within commute with each other, as do all terms within .

Using the Baker-Campbell-Hausdorff formula, we can approximate the time-evolution operator. The simplest (first-order) approximation is:

A more accurate and commonly used (second-order) symmetric decomposition is:

This decomposition breaks the global evolution into a sequence of local two-site operations, or "gates," which we can apply efficiently to an MPS.

Time-evolving block-decimation (TEBD) - Tensor Network

For a more rigorous look at the Suzuki-Trotter decomposition and its associated errors, let's turn to the TensorNetwork.org documentation. It provides a clear derivation for the Heisenberg chain.

Read the first two main sections of the page (up to the heading 'Errors'). Pay attention to how the Hamiltonian is split and how the first- and second-order approximations (TEBD1 and TEBD2) are constructed. Your physics background will make the connection to the BCH formula immediate.

This decomposition is visually represented by applying layers of two-site gates to the MPS, as shown below.

Time-Evolving Block Decimation (TEBD) Algorithm Steps
This image illustrates the core concepts of TEBD. (a) A second-order Suzuki-Trotter decomposition of the time evolution operator \(e^{-iHt}\) applied to an MPS. The evolution is broken into layers of two-site unitary gates acting on even and odd bonds. (b) The procedure for applying a single two-site gate \(U\) to two adjacent MPS tensors \(\Gamma\) and \(\lambda\). The tensors are contracted, and an SVD is performed to restore the MPS structure, with a potential truncation of the bond dimension.

2. Evolving the MPS: The Gate Application Algorithm

Now that we have a sequence of two-site gates, how do we apply them to our MPS? This process is the heart of TEBD and is beautifully explained through the lens of quantum circuits, which are themselves a form of tensor network.

Tutorial on Tensor Networks and Quantum Computing with Miles Stoudenmire

To build a strong conceptual model, let's watch Miles Stoudenmire (a co-developer of the ITensor library) explain the connection between quantum circuits, tensor networks, and the TEBD algorithm. This video will make the entire process highly intuitive.

Please watch from 47:20 to 1:03:40. This covers: The direct correspondence between quantum circuits and tensor networks (47:20). The introduction of the TEBD algorithm for simulating these circuits (55:31). How to apply a simple single-qubit gate (59:17). The crucial procedure for applying a two-qubit gate using SVD and truncation (1:00:46). Focus intently on this last part, as it is the central mechanism of TEBD.

Let's summarize the key steps for applying a two-site gate to an MPS, as shown in the video and the diagram above. Assume our MPS is in a canonical form where the tensors are denoted by and the diagonal matrices of singular values by .

  1. Contract: Identify the two tensors at sites and , and , and the singular value matrix between them. Contract these three tensors with the two-site gate . This forms a single, large tensor that connects the bonds from sites and .

    (Note: There are different conventions for absorbing the matrices; a common one is to absorb the on the bond being updated, as well as the adjacent ones.)

  2. Reshape and Decompose: Reshape the four-index tensor into a matrix where the rows correspond to the incoming bond from site and the physical index of site , and the columns correspond to the physical index of site and the outgoing bond to site . Perform a Singular Value Decomposition (SVD) on this matrix:

  3. Truncate and Update: The matrix contains the new singular values for the bond between sites and . To prevent the bond dimension from growing indefinitely, we truncate it by keeping only the largest singular values. This is the "Block Decimation" step. The error introduced by this truncation is the sum of the squares of the discarded singular values.

  4. Restore MPS Form: The matrices and (after reshaping) become the new MPS tensors and , and the truncated becomes the new singular value matrix . The state is now an MPS again, ready for the next gate application.

Applying a single-site gate is much simpler: just contract the gate with the corresponding MPS tensor. This operation does not change the bond dimension at all.

3. Sources of Error

It is crucial to understand the two distinct, controllable sources of error in a TEBD simulation:

  1. Trotter Error: This is an approximation error from the Suzuki-Trotter decomposition itself. It depends on the size of the time step . For a second-order decomposition, the error per step is , leading to a global error of for a total time . This error can be reduced by using smaller time steps or higher-order decompositions.

  2. Truncation Error: This error arises from discarding singular values during the SVD step to maintain a fixed bond dimension . It depends on how much entanglement is generated by the evolution. If the state is highly entangled, many singular values will be significant, and truncating them will lead to a larger error. This can be reduced by increasing the bond dimension .

Test your understanding!

Imagine you are simulating a quantum quench where a parameter in the Hamiltonian is suddenly changed. You observe that the truncation error per time step starts to increase significantly as the simulation progresses. What does this physically signify about the state of the system, and what are your two main options to improve the simulation's accuracy?

Show answer

A growing truncation error signifies that the amount of entanglement in the system is increasing rapidly. The quench has created excitations that are propagating and correlating different parts of the chain. The MPS with a fixed bond dimension is becoming a less faithful representation of this highly entangled state.

To improve accuracy, you have two options:

  1. Increase the bond dimension (): This is the most direct way to combat truncation error. A larger allows the MPS to represent more entanglement. The trade-off is a higher computational cost, which scales as .
  2. Decrease the time step (): While this primarily controls the Trotter error, a smaller time step also means less entanglement is generated per step. This can sometimes help the SVD truncation to perform better, though increasing is the more direct solution for truncation error itself.

4. Your Turn: Implementing the TEBD Algorithm

With the theory in place, it's time to implement it. Your task is to write a Python script that simulates the time evolution of a 1D spin chain using TEBD. The pseudocode provided in the TensorNetwork.org resource is an excellent blueprint.

Time-evolving block-decimation (TEBD) - Tensor Network

This resource provides clear pseudocode that you can translate into your Python implementation. Focus on the TIMESTEP function, which orchestrates the gate applications.

Study the Algorithm Pseudocode for the TEBD2 section. This provides the structure for your main functions. You will need to implement the logic for PREPARE_U_α (calculating the gate matrix) and the APPLY step within TIMESTEP (the contract-SVD-truncate procedure).

Here is a step-by-step guide for your implementation:

  1. Setup:

    • Define your model parameters: chain length N, total evolution time T, time step dt, and max bond dimension chi.
    • Define your local operators (Pauli matrices sx, sy, sz) and the identity id.
    • Construct the two-site Hamiltonian term h_j,j+1 for the Heisenberg model.
  2. Initial State:

    • Create an initial MPS. A simple choice is a Néel state (|↑↓↑↓...⟩). This can be represented as an MPS with all bond dimensions equal to 1. An MPS is typically stored as a list of tensors.
  3. Gate Preparation (PREPARE_U):

    • Calculate the gate matrices for the even and odd bonds using scipy.linalg.expm:
      • U_even = expm(-1j * h * dt / 2)
      • U_odd = expm(-1j * h * dt)
    • You will need to reshape these (d*d, d*d) matrices into 4-index tensors (d, d, d, d) for easy contraction, where d is the local dimension (2 for spin-1/2).
  4. Core Gate Application Function:

    • Write a function apply_gate(tensor1, tensor2, singular_values, gate, chi) that performs the central TEBD step on two adjacent tensors.
    • Inside this function:
      a. Absorb the singular_values matrix into the tensors.
      b. Contract the two tensors and the gate to form the combined tensor . Use numpy.tensordot.
      c. Reshape into a matrix.
      d. Perform the SVD using numpy.linalg.svd.
      e. Truncate the results to the maximum bond dimension chi. Keep track of the discarded weight (sum of squares of discarded singular values) to monitor the error.
      f. Reshape the resulting U and V_dagger back into MPS tensors.
      g. Return the new tensors and the new singular value matrix.
  5. Main Evolution Loop:

    • Loop from t = 0 to T in steps of dt.
    • In each step, perform a full second-order Trotter update:
      a. Apply U_even to all even bonds (0,1), (2,3), ... using your apply_gate function.
      b. Apply U_odd to all odd bonds (1,2), (3,4), ...
      c. Apply U_even again to all even bonds.
    • After each full time step, calculate and store observables of interest, for example, the magnetization at each site.
    • Plot the evolution of your observable over time. A classic experiment is to start with a single spin flipped in a ferromagnetic ground state and watch it propagate.

This is a substantial but highly rewarding coding project that will cement your understanding of tensor network dynamics. Your proficiency with Python and NumPy will be invaluable here.

Conclusion

In this lesson, you have learned the theory and algorithmic structure of the Time-Evolving Block Decimation (TEBD) method. We have seen how a seemingly intractable global time evolution can be systematically approximated as a sequence of local, two-site unitary gates via the Suzuki-Trotter decomposition.

Key Takeaways:

  • TEBD simulates real-time dynamics of 1D quantum systems represented by MPS.
  • The Suzuki-Trotter decomposition breaks the time-evolution operator into a product of local, two-site gates.
  • Applying a two-site gate to an MPS involves a contract-SVD-truncate cycle that updates the local tensors while controlling the bond dimension.
  • The accuracy of TEBD is governed by a trade-off between the Trotter error (controlled by the time step ) and the truncation error (controlled by the bond dimension ).

Preview of the Next Lesson:
So far in this module, we have focused on deterministic methods based on the MPS ansatz (DMRG and TEBD), which are exceptionally powerful for 1D systems with low entanglement. In our next lesson, we will begin exploring a completely different paradigm for tackling many-body problems: Quantum Monte Carlo (QMC). We will start by outlining the principles of these stochastic, sampling-based methods, which excel in different regimes, particularly for higher-dimensional systems and for calculating properties of systems in thermal equilibrium.

Can't find a good explanation? Sign up and we'll make it for you

Sign up