DMRG: using N site result as a starting guess for N+2 site computation

Hello!

As the title, I would like to compute the ground state energy, using finite size DMRG, of some Hamiltonian with N sites. After that is done, I would also like to repeat the same computation for the Hamiltonian on a few more sites, let’s say N+2.

I know how to do this starting from some random guess, but I am interested in the case where N is already largish, say for example N=100. I expect such a system to be already large enough so that the matrices living in the bulk of the state don’t change that much.
This means that if the state (writing only the physical indices explicitly)
|\psi\rangle = \sum_{\{\sigma_i\}} A_1^{\sigma_1}\ldots A_{N}^{\sigma_{N}} |\sigma_1 \ldots \sigma_{N} \rangle
is a good approximation of the ground state for N sites, I expect
|\psi'\rangle = \sum_{\{\sigma_i\}} A_1^{\sigma_1}\ldots A_{N/2}^{\sigma_{N/2}}A_{N/2}^{\sigma_{N/2+1}}A_{N/2+1}^{\sigma_{N/2+2}}A_{N/2+1}^{\sigma_{N/2+3}}\ldots A_{N}^{\sigma_{N+2}} |\sigma_1 \ldots \sigma_{N+2} \rangle
to be not too far from the ground state for N+2 sites. What I’m doing is just taking the central two sites for the N case, and inserting them in the center of the spin chain to grow it by two sites. After I’ve done this, I would run the dmrg for N+2 with |\psi'\rangle as a starting state

How does one build |\psi'\rangle in ITensors?

I’ve tried and failed by doing the following

N = 4
NHalf = div(N,2)
s = siteinds("S=1/2", N; conserve_qns=true)
psi1 = randomMPS(s, n -> isodd(n) ? "Up" : "Dn"; linkdims=4)

println(dot(psi1,psi1))

psi2 = MPS(N+2)

for i=1:NHalf
    psi2[i] = psi1[i]
    psi2[N+2-i] = psi1[N-i]
end

psi2[NHalf+1] = psi1[NHalf]
psi2[NHalf+2] = psi1[NHalf+1]

println(dot(psi2,psi2))

But I get an “access to undefined reference” error on the last line

Did you check that the integers going into the brackets for psi2 are all “in bounds”, i.e. between [1,N+2]?

The other things about the strategy you’re using here (unrelated to the error message you’re getting) are that:

  1. you will need to make sure the “virtual” or link indices of the MPS connect up properly when you make psi2. Otherwise you will get an error later if you try to use psi2 in an algorithm like DMRG. To check this, you can print out psi2 and look at the indices (the id numbers of the indices) to see if they link up properly or not.
  2. to actually make it so that psi2 has similar properties to psi1, there is an ansatz for this (unfortunately a bit technical) by Ian McCulloch (in this paper) also covered by Uli Schollwoeck in his “DMRG in the Age of Matrix Product States” paper that explains a way to “grow” an MPS to have similar local properties as the original MPS.