# Correct way to code first few excited state energies

edited

Dear forum,

I am trying to calculate the energies of the first few excited states for the system discussed in an earlier post:

http://itensor.org/support/89/issues-with-my-drmg-code

For this purpose, I went through the following:

http://itensor.org/docs.cgi?page=formulas/excited_dmrg

I believe the code first finds the ground state |psi0> and then finds the lowest energy state |psi1> that is orthogonal to the ground state, i.e. <psi0|psi1> = 0 and similarly finds higher excited states |psi2>, |psi3>, etc. Assuming this is how the code works, I wrote the following lines:

 auto psi0 = IQMPS(initState);

auto en0 = dmrg(psi0,H,sweeps,{"Quiet=",true});

auto wfs  = vector<IQMPS>(1);

wfs.at(0) = psi0;

auto psi1 = IQMPS(initState);

auto en1 = dmrg(psi1,H,wfs,sweeps,{"Quiet=",true,"Weight=",20.0});

auto wfs1 = vector<IQMPS>(1);

wfs1.at(0) = psi1;

auto psi2 = IQMPS(initState);

auto en2 = dmrg(psi2,H,wfs1,sweeps,{"Quiet=",true,"Weight=",20.0});


Note: The Hamiltonian is a function of the polarization angle theta.

The output does not make sense because the first excited state energies (en1) for some values of theta are smaller than the ground state energies (en0) and the second excited state energies (en2) for some values of theta are smaller than the first excited state energies.

Questions:
(1) What is the correct way to code first few excited state energies?
(2) What does the Weight option exactly do and why is it taken to be 20.0?
(3) If the ground state is , say, 3-fold degenerate, do en0, en1 and en2 report the same value of energy?

Regards,
Niraj

+1 vote
selected

Hi Niraj,
Your code is almost correct. A mistake that I see is that, to get the second excited state you need to include both psi0 and psi1 in the vector of wavefunctions, because psi2 must be orthogonal to these.

The Weight arg is a factor that multiplies the energy penalty inside the DMRG code for any two wavefunctions to be orthogonal. The energy penalty used is <psin|psim> * Weight. This is added to the energy of the state, so that DMRG wants to make the new state orthogonal to all of the ones in the vector provided to lower the energy.

The answer to part (3) of your question depends on whether you are using IQMPS or just MPS. If you are using MPS (the simpler case to discuss) then there is no consideration for quantum numbers, and if the ground state is n-fold degenerate, then the the first n "excited" states found using ITensor DMRG will all just have the same energy. But if you instead use IQMPS, then as you find "excited" states with increasing energy, you may only get 1 or 2 of the ground states, because the other degenerate ground states could have different quantum numbers from the first one you found. A good example is the S=1 Heisenberg chain, where there are four ground states: two ground states have total Sz of 0, while the other two have total Sz (in units of 1/2) of +2 and -2

I recently added documentation for the orthogonalizing DMRG that discusses some details about it:
http://itensor.org/docs.cgi?page=classes/dmrg

commented by (630 points)
edited
Hi Miles,
Thank you so much for the reply. Following your suggestions, I modified my code as follows:

auto wfs1 = vector<IQMPS>(2);

wfs1.at(0) = psi0;

wfs1.at(1) = psi1;

auto psi2 = IQMPS(initState);

auto energy2 = dmrg(psi2,H,wfs1,sweeps,{"Quiet=",true,"Weight=",20.0});

However, I occasionally ended up getting values of excited state (first or second or both) energy lower than the ground state energy. My questions are:

(1) Does my code look correct?

(2) It looks like my code sometimes doesn't know which energy eigenvalue of the Hamiltonian is the lowest and I am guessing "Weight" argument has something to do with this. Is there any way to make the code choose the optimal value of the "Weight"? (By optimal, I mean the value of "Weight" that gives the most approximate values of ground and excited state energy)

(3) Is it possible  to calculate and sort (for instance, in ascending order) some of the lowest energy eigenvalues of the Hamiltonian without taking into account the eigenstates (similar to exact diagonalization)?

Regards,
Niraj
commented by (70.1k points)
Hi Niraj,
Sorry about the slow reply to this. Your code *could* be correct, but I'm not sure without more information. Are psi0 and psi1 already optimized to be the ground state and first excited state?

If so, then yes it is correct and should make psi2 to be the second excited state.

But, there is a caution about this code which I think you are seeing. It does not systematically find the eigenstates from bottom to stop in a "smart" way i.e. checking that if you orthogonalize against the ground state that the result is at all guaranteed to be the first excited state, and not some higher excited state.

All this version of DMRG does is to add a penalty which is the weight times the overlap of the current state with all of the states in the vector "wfs". Sometimes this can lead to weird behavior like finding higher excited states than the one you intended to find. Or if the weight is too small you could get the same state twice.

You'll have to experiment both with different weight values and with different DMRG accuracy parameters (maxm, cutoff, noise, niter) to see what are the "best practices" for controlling the algorithm. Practice on small systems and for Hamiltonians you understand well.

To answer your last question more directly, no this version of DMRG cannot directly target higher excited states without getting all of the lower ones (I think that's what you were asking about?).

Miles
commented by (630 points)
Hi Miles,
Thank you so much for the reply once again.  Yes, psi0 and psi1 are ground state and first excited state. You clearly answered all the questions I had.

Regards,
Niraj
commented by (240 points)
edited by
Hi Miles,

I have a silly question about the spin 1 heisenberg model. Why do you say it has 4 degenerate ground state? I just use mathematic to diagnoliaze a spin 1 heisenberg model at small size N=4,6,8, for both PBC and OBC, I get a single ground state in spin 0 sector and 3 degenerate 1st exited state in spin 1 sector. I know that for PBC, the energy difference will remain finite as system size increase and we call the energy difference the gap. Does it mean that for OBC, the energy difference will vanish? Then how can I calculate the gap? Maybe by calculate higher excited states?
commented by (70.1k points)
Hi, so the statement about 4 degenerate ground states refers to the case where the system size is large (like close to 100 sites or larger). Basically the picture to have is that there are topologically protected edge states that develop on longer chains which act like free spin 1/2's and then the ground state manifold is similar to the states of two uncoupled spin 1/2's (1 singlet state and 3 triplet states).

Here is a helpful article (about the AKLT point but the S=1 Heisenberg has qualitatively the same properties): https://en.wikipedia.org/wiki/AKLT_model
commented by (240 points)
Hi Miles,

I understand the AKLT model, the degeneracy and the edge state. But about the Heisenberg model, I always "hear" that it has similar features like the AKLT. Do you know any paper explaining this in more details, like giving an analytical explanation or physical picture why this is true (not only show numerical result, and not only just say it's in the Haldane phase and there're edge states)? And if I calculate higher excitations using OBC, say the 5th smallest eigenvalue, do I call the difference between 1st and 5th smallest eigen-energy the "gap"?
commented by (70.1k points)
Yes there is an extensive literature. One of the papers that most addresses your question is: https://arxiv.org/abs/0909.4059

In the end, though, what else can we rest on besides numerical results for most systems? Experimental results can have "bugs" just as much as numerics (e.g. unaccounted for effects such as disorder in the material). And it's unlikely we will ever have an exact closed-form solution for most models such as the S=1 Heisenberg model.