Goal

After this module you can find the symmetry of a lattice Hamiltonian and prove that it makes the Hamiltonian block-diagonal. You can attach charges to tensor legs and say which entries of a symmetric tensor may be nonzero. You can explain why SVD, QR and the DMRG eigensolver work one block at a time, and estimate what that saves. Finally, you can run DMRG in a chosen symmetry sector, for example to get the first excited state of the Ising chain as the lowest state with odd parity.

Notebooks

In Module 4 every tensor was a dense array. DMRG never asked whether the Hamiltonian had any structure beyond locality. Most Hamiltonians we care about do. The transverse-field Ising chain does not change when we flip every spin. The XXZ chain never changes the number of up spins. Each such fact is a conserved quantity, and a conserved quantity is free information. It tells us, before any computation, that most matrix elements of are zero.

This module shows how to use that information inside a tensor network. The idea fits in one sentence: give every index a charge, and keep only the entries where charge is conserved. Everything else follows from it. The Hamiltonian becomes block-diagonal. Each MPS tensor splits into small dense blocks. Every SVD becomes a set of smaller SVDs. And DMRG, run with these tensors, can never leave the charge sector we start it in. That last point is a feature: the lowest state with odd parity is the first excited state of the Ising chain, and we get it from a ground-state solver.

We treat the two abelian groups that cover most applications: (a parity, two charges) and (a conserved integer or half-integer). The non-abelian group gets a short paragraph near the end.

Symmetries of a Hamiltonian

We keep the conventions of Module 4. The transverse-field Ising model (TFIM) on an open chain of sites is

and the XXZ chain is

with . Unless we say otherwise, we use , and .

Definition 5.1 (Symmetry of a Hamiltonian).

A symmetry of is a group together with unitaries , one for every , such that and for all . We call it an on-site symmetry if each is a product of the same single-site unitary.

Both models have an on-site symmetry in the sense of Definition 5.1. For the TFIM the group is , with

For XXZ the group is , with for every angle , where is the total magnetization.

Proposition 5.1 (Both models are symmetric).

and . Hence for every .

Neither symmetry survives every change to the model. A longitudinal field breaks the parity of the TFIM. A transverse field breaks the of XXZ, because flips one spin and changes by one. A symmetry is a property of the specific , so we always check it before we use it.

Schur’s lemma: symmetric means block-diagonal

Let be a unitary representation of an abelian group. Since all the commute with each other, they can be diagonalized together. Each common eigenvector satisfies for a phase . The function is the charge of the vector, and counts vectors that share the same charge. For the charge is with . For it is the magnetization , with .

Lemma 5.1 (Schur's lemma for abelian symmetries).

If for all , then whenever . Ordering the basis by charge, is block-diagonal,

and the spectrum of is the union of the spectra of the blocks .

Figure 5.1 shows the lemma at work for , applied to the two symmetries of Proposition 5.1. In the basis the TFIM matrix looks scattered. The parity is diagonal in the basis, where a basis state’s charge is the number of factors mod 2. After rotating every site to that basis and sorting, the matrix falls apart into two blocks of size 32. XXZ needs no rotation: sorting the basis by gives seven blocks of sizes .

Nonzero pattern of the Hamiltonian at N = 6. (a) TFIM in the Z basis. (b) The same TFIM in the X basis, sorted by parity: two blocks of 32, with nothing between them. (c) XXZ sorted by total magnetization: seven blocks. The red lines are the sector boundaries.
Figure 5.1. Nonzero pattern of the Hamiltonian at N = 6. (a) TFIM in the Z basis. (b) The same TFIM in the X basis, sorted by parity: two blocks of 32, with nothing between them. (c) XXZ sorted by total magnetization: seven blocks. The red lines are the sector boundaries.

Sector targeting. Since each block is a Hamiltonian in its own right, “the ground state of the block ” is a sensible object: the lowest state with charge . Often this is exactly the excited state we want. For the TFIM at any , the ground state is even and the first excited state is odd, so the ground state of is the first excited state (Proposition 5.4 below). The worked example below checks this to 14 digits.

Charges on legs: graded spaces and fusion rules

Schur’s lemma is about one big matrix. A tensor network never builds that matrix, so we need the same idea on each index. We give every leg a charged basis.

Definition 5.2 (Graded space and fusion rule).

A graded space is a vector space with a basis in which every vector has a definite charge,

where is the number of basis vectors with charge (the multiplicity or degeneracy of ). When two legs are combined, charges combine by the fusion rule of the group. For the rule is . For it is . The dual of a leg (the same leg pointing the other way) carries the opposite charges, .

A spin-1/2 in the TFIM is : is even and is odd. A spin-1/2 in XXZ is . Fusing four XXZ sites gives multiplicities for . These are the block sizes of the Hamiltonian, now obtained by counting.

Definition 5.3 (Symmetric tensor).

Give each leg of a tensor a direction, incoming or outgoing, and a graded space. is symmetric if it commutes with the group acting on all legs at once. For abelian groups this is a selection rule on the entries:

so total incoming charge equals total outgoing charge.

Figure 5.2 shows the rule for one MPS tensor.

A a b s nonzero only if a + s = b Z2: sum mod 2 U(1): ordinary sum
Figure 5.2. A symmetric MPS tensor. Arrows give the direction of each leg. Charge flowing in (left bond a, physical leg s) must equal charge flowing out (right bond b), so only the entries that satisfy the fusion rule are stored.
Proposition 5.2 (Block form of a symmetric tensor).

Group the incoming legs into a domain and the outgoing legs into a codomain . Fuse each side into a graded space, with and states of total charge . Then a symmetric is a direct sum of dense blocks,

and it has free parameters instead of .

Take the tensor of the Julia notebook. Its left bond is with charges and multiplicities . Its physical leg is a spin-1/2. Its outgoing right bond has charges and multiplicities . The dense array has entries. The allowed blocks are (rows: , columns: 3), (rows: , columns: 2) and (rows: 3, columns: 1). So only numbers are stored. In Hands-on 5.2 you write this count for arbitrary legs, and check it against TensorKit’s dim(t) (Julia) or our dictionary of blocks (Python).

Symmetric MPS, MPOs and charge flow

Now we apply the selection rule to every tensor of an MPS. Every leg is a graded space as in Definition 5.2, and every tensor is symmetric as in Definition 5.3. Each bond of the MPS points from left to right. Each physical leg points into its tensor. Each tensor obeys , and Figure 5.3 shows how the charges add up along the chain:

A1 A2 A3 AN ... 0 q1 q1+q2 Q q1 q2 q3 qN
Figure 5.3. Charge flow in a symmetric MPS. The left boundary carries charge 0, each physical leg brings in its charge, and the bond after site i carries the total charge of sites 1 to i. The right boundary bond, of dimension 1, fixes the total charge Q of the state.
Proposition 5.3 (A symmetric MPS has a definite total charge).

Let the left boundary bond carry charge 0 and the right boundary bond carry charge . If every tensor obeys , then the MPS lies in the charge- sector: . Conversely, every state with charge has an exact symmetric MPS representation.

The same rule applies to MPOs. The TFIM machine of Module 4 has states (finished, open, ready). In the basis, does not change parity, but flips and , so it carries charge 1. After the machine emits the first of a term, the string has flipped the parity once, and the open state must remember that. So the open state carries charge 1 and the other two carry charge 0. For XXZ the machine has three open states, one for each kind of two-site term, and their charges are the charge emitted so far: after , after , and after (Figure 5.4). In Hands-on 5.3 you build this coupling as a -symmetric tensor and read off the bond charges .

ready charge 0 finished charge 0 after S+ charge +1 after Z charge 0 after S- charge -1 1 1 2J S+ J Delta Z 2J S- S- Z S+
Figure 5.4. The XXZ MPO as a finite-state machine with charged states. S+ and S- are the raising and lowering matrices of the XXZ Hamiltonian (5.2). Each open state remembers the charge the string has emitted so far, and its partner operator removes it again. In the order (finished, after S+, after Z, after S-, ready) the MPO bond is therefore the graded space with charges (0, +1, 0, -1, 0).

Two practical points follow. First, the TFIM must be written in the basis, where the parity is diagonal. In the basis the local tensors are not block-diagonal in any useful way, and TensorKit refuses to build them: converting a non-symmetric array into a symmetric tensor raises an error about “non-zero elements at incompatible positions”. Second, the MPO tensors become sparse: the TFIM tensor stores 18 of its 36 entries, and the XXZ tensor stores 34 of 100.

Why SVD, QR and eigensolvers work block by block

With every tensor in block form, the remaining question is whether the linear algebra respects the blocks. It does, and the proof is short.

Theorem 5.1 (Factorizations of a symmetric matrix).

Let be a symmetric tensor reshaped into a matrix, with rows and columns grouped by charge. Then:

  1. Its SVD is , where is the SVD of each block. The singular values of are the union of those of the blocks, and every singular vector has a definite charge.
  2. The best rank- approximation of keeps the largest singular values over all blocks. Its error is the same as the Eckart-Young error for (1).
  3. The same holds for QR, polar decomposition and the eigendecomposition of a Hermitian : each is the direct sum of the factorizations of the blocks.

The eigensolver of DMRG behaves the same way. This is the key result of the module.

Theorem 5.2 (Symmetric DMRG stays in its sector).

Run two-site DMRG with a symmetric MPO and a symmetric initial MPS of total charge , with all tensors stored in block form. Then every MPS visited has charge . The energy converges to (a variational upper bound on) the lowest eigenvalue of the block , not of .

What we save. Suppose the two-site tensor , reshaped to a matrix, has blocks of sizes . The dense SVD costs about operations, and the block SVD costs

For with two equal blocks this is against : a factor 4 in time and 2 in memory. For the number of charges on a bond grows with , and the gain grows with it. Figure 5.5 evaluates both ratios with the real block sizes of the critical TFIM and the XXZ ground state at . For XXZ the memory gain grows from 3.2 at to 4.8 at , and the SVD flop gain from 12 to 23.

Measured wall times gain less than the flop count, for two reasons. Small matrices run far below the peak speed of BLAS, and the block bookkeeping has its own overhead. In Python with numpy, the measured SVD speed-up on the same block sizes is about 2 for and between 3 and 4.5 for (dashed lines in Figure 5.5). In the Julia notebook, TensorKit’s SVD of a tensor ran 6 to 8 times faster than the dense SVD, against a flop-count ratio of 22. A full DMRG run at , gains less, because the eigensolver works on many small blocks. In our Julia runs it was 1.6 to 2.4 times faster with for the TFIM and 2.5 to 2.8 times faster with for XXZ. The Python notebook, whose block bookkeeping runs in Python, gains only 1.2 to 1.3. These timings change from machine to machine and from run to run, and the gains grow with .

Cost of dense versus symmetric storage, with the block sizes of exact N = 16 ground states (critical TFIM for Z2, XXZ at Delta = 0.5 for U(1)). (a) Memory of one MPS tensor, dense divided by the stored blocks. (b) SVD of the two-site tensor: flop count (5.9) (solid) and numpy wall time on random blocks of the same sizes (dashed, from D = 32).
Figure 5.5. Cost of dense versus symmetric storage, with the block sizes of exact N = 16 ground states (critical TFIM for Z2, XXZ at Delta = 0.5 for U(1)). (a) Memory of one MPS tensor, dense divided by the stored blocks. (b) SVD of the two-site tensor: flop count (5.9) (solid) and numpy wall time on random blocks of the same sizes (dashed, from D = 32).

Entanglement resolved by charge

Proposition 5.3 has a consequence we can measure. Every Schmidt vector across a cut has a definite charge, the charge of the left half. So the entanglement spectrum splits into one list per charge, and each list has a weight : the probability that the left half carries charge . Symmetric codes get this for free, because the singular values already come in blocks. In Hands-on 5.4 you build random MPS with a prescribed total charge and look at the charges that appear on their bonds.

Figure 5.6 shows three cases at . In the ordered TFIM (), the even ground state is close to a cat state of the two magnetized states. Both halves of the cat give the same spectrum, so the even and odd lists coincide and the weights are 0.504 and 0.496. In the disordered phase () the even sector dominates, with weight 0.965. For XXZ the left half’s magnetization is centred on 0 (weight 0.859), with 0.071 at each of and only at . This is why a symmetric MPS for XXZ needs only a handful of charges on each bond, as we used in the cost estimate.

Charge-resolved entanglement spectra at the middle bond of exact N = 16 ground states. (a) Ordered TFIM, g = 0.5: even and odd lists are equal. (b) Disordered TFIM, g = 1.5: the even sector dominates. (c) XXZ at Delta = 0.5: Schmidt values grouped by the magnetization of the left half.
Figure 5.6. Charge-resolved entanglement spectra at the middle bond of exact N = 16 ground states. (a) Ordered TFIM, g = 0.5: even and odd lists are equal. (b) Disordered TFIM, g = 1.5: the even sector dominates. (c) XXZ at Delta = 0.5: Schmidt values grouped by the magnetization of the left half.

Non-abelian symmetries. The Heisenberg chain has the full spin-rotation symmetry. Now the irreducible representations are multiplets of size , and Schur’s lemma says more: acts as the identity inside each multiplet. By the Wigner-Eckart theorem, a symmetric tensor then factors into a fixed Clebsch-Gordan part and a smaller reduced tensor that we store and optimize. The bookkeeping is heavier (fusion is no longer a simple sum), but TensorKit handles it with the same interface. In the Julia notebook the Heisenberg chain gives with no symmetry, with and with . At the middle bond the version stores 16 multiplets for what are 44 states. For a detailed treatment of non-abelian symmetries in tensor networks we refer to (2).

Worked example: the Ising chain in parity sectors

We diagonalize the TFIM at , , by sector. Rotate every site with a Hadamard gate, so that becomes diagonal. A basis state is then a string of , and its parity is the number of factors mod 2. Sorting the 256 basis states by parity gives two blocks of 128 (Hands-on 5.1). The three lowest levels of each are

sector
even
odd

Together they reproduce the dense spectrum. The ground state of the chain is the even , and the first excited state is the lowest odd state, . The second even level, , lies above the first two odd ones. So “lowest state in the odd sector” is a cleaner way to find than asking an eigensolver for two eigenvalues.

We can check these numbers exactly. The Jordan-Wigner transformation maps the TFIM to free fermions (3). With the bidiagonal matrix that has on the diagonal and above it, and its singular values,

Proposition 5.4 (The first excitation is odd).

For and finite , the TFIM ground state is even, and the lowest odd eigenvalue is in .

Both sectors match to about . The same check at is out of reach for exact diagonalization, but not for symmetric DMRG. With , the even sector gives , from the free-fermion value. Starting instead from an MPS whose right boundary bond is odd, the same code gives , within of the exact result. The gap comes out of two ground-state calculations.

For XXZ at , the lowest energies in the sectors are , , , and . Symmetric DMRG started in the sectors reproduces them to about . The ground state lies at , as it must for an antiferromagnet.

Warning

  • Dense codes leak out of the sector. Theorem 5.2 needs block storage. quimb’s DMRG stores dense tensors, and its local eigensolver can put weight on the wrong charge. In the quimb notebook a run started from a product state with ends at , the true ground state. The robust fix is a penalty: minimize , or for the odd sector. With above the gap between sectors, this gives the sector’s lowest state at any precision.
  • Ordered phases break the symmetry. For the even and odd ground states are almost degenerate (split by at , ). Dense DMRG happily returns a magnetized mixture with close to 0 (0.012 in the seeded quimb notebook; the value depends on the random start) instead of . Its energy is fine, but its parity, and its charge-resolved spectrum, are not. Symmetric DMRG returns the even cat state.
  • The wrong basis. The of the TFIM is diagonal in the basis, not the basis. Forgetting the rotation gives local tensors that are not symmetric, and a library will refuse them (TensorKit) or silently give the wrong blocks (hand-written code).
  • An empty sector. A product state built with trivial bond spaces only has charge 0. In any other sector the initial MPS is the zero vector, and the eigensolver fails with a zero-norm error. The bond spaces must be built so that the charges can reach the requested (Hands-on 5.4).
  • Conventions. quimb’s built-in Ising MPO is in spin-1/2 operators, so our model needs and . The sign of does not change the spectrum, so energies alone will not catch this error. Check a state, not just an energy.

Why it matters

Symmetries are the cheapest speed-up in tensor networks. They cost nothing in accuracy, they reduce memory and time by factors that grow with , and they give every state and every Schmidt value a quantum number. They also turn excited-state problems into ground-state problems, one sector at a time. This is why production codes such as ITensor (4), TeNPy (5) and TensorKit build them in. For , the formalism goes back to Singh, Pfeifer and Vidal (6).

Next. We have now used tensor networks to represent states and their Hamiltonians. In Module 6 we use the same tools to simulate quantum circuits. There the gates generally break all symmetries, and the cost is set by how fast the circuit builds up entanglement.

Further reading

  • (6): tensor networks with a symmetry, including symmetric tensors, their block structure and a symmetric MERA. The general case, any compact symmetry group including non-abelian ones, is in (7).
  • (8): DMRG in MPS and MPO language, with conserved quantum numbers on the bonds.
  • (9): section on conserved quantum numbers in MPS-based DMRG.
  • (5): charges, leg directions and block-sparse tensors as implemented in TeNPy.
  • (4): quantum-number conserving tensors in ITensor.
  • (3): the exact solution of the transverse-field Ising chain, which gives our reference numbers.

Homework

The problems for this module are in Homework 5: counting stored entries (Problem 5.1), the symmetry of the two models (Problem 5.2), charges on MPO bonds (Problem 5.3), the first excited state as the lowest odd state (Problem 5.4), penalties versus symmetric storage (Problem 5.5), and the hands-on gaps in the notebooks (Problem 5.6).

1.
Eckart C, Young G. The approximation of one matrix by another of lower rank. Psychometrika. 1936;1(3):211–8.
2.
Weichselbaum A. Non-abelian symmetries in tensor networks: A quantum symmetry space approach. Annals of Physics. 2012;327(12):2972–3047.
3.
Pfeuty P. The one-dimensional Ising model with a transverse field. Annals of Physics. 1970;57(1):79–90.
4.
Fishman M, White SR, Stoudenmire EM. The ITensor Software Library for Tensor Network Calculations. SciPost Physics Codebases. 2022;4.
5.
Hauschild J, Pollmann F. Efficient numerical simulations with Tensor Networks: Tensor Network Python (TeNPy). SciPost Physics Lecture Notes. 2018;5.
6.
Singh S, Pfeifer RNC, Vidal G. Tensor network states and algorithms in the presence of a global U(1) symmetry. Physical Review B. 2011;83(11):115125.
7.
Singh S, Pfeifer RNC, Vidal G. Tensor network decompositions in the presence of a global symmetry. Physical Review A. 2010;82(5):050301.
8.
McCulloch IP. From density-matrix renormalization group to matrix product states. Journal of Statistical Mechanics: Theory and Experiment. 2007;2007(10):P10014.
9.
Schollwöck U. The density-matrix renormalization group in the age of matrix product states. Annals of Physics. 2011;326(1):96–192.