ITensor / ITensorInfiniteMPS.jl

A package for working with infinite matrix product states (MPS) with ITensor.
MIT License
30 stars 19 forks source link

Unable to do subspace expansion for QN conserved Hamiltonian with only next-nearest-neighbor hopping #75

Open mingruyang opened 1 year ago

mingruyang commented 1 year ago

As mentioned in #69, the default subspace expansion does not work in my case:

maxdim = 100 # Maximum bond dimension
cutoff = 1e-8 # Singular value cutoff when increasing the bond dimension
max_vumps_iters = 100 # Maximum number of iterations of the VUMPS algorithm at each bond dimension
vumps_tol = 1e-9
conserve_qns = true
solver_tol = (x -> x / 10)
outer_iters = 10 # Number of times to increase the bond dimension

function initstate(n)
    if n%2==0
        if (n/2)%2==1 
            return "Dn"
        else 
            return "Up"
        end
    else
        if n==2*1-1 return "Up" end
        if n==2*3-1 return "Dn" end
        if n==2*5-1 return "Up" end
        if n==2*7-1 return "Dn" end
        if n==2*9-1 return "Up" end
        if n==2*11-1 return "Dn" end
        if n==2*13-1 return "Up" end
        if n==2*14-1 return "Dn" end
        if n==2*15-1 return "Up" end
        if n==2*16-1 return "Dn" end
        if n==2*17-1 return "Up" end
        if n==2*18-1 return "Dn" end
        if n==2*19-1 return "Up" end
        if n==2*21-1 return "Dn" end
        if n==2*23-1 return "Up" end
        if n==2*25-1 return "Dn" end
        if n==2*27-1 return "Up" end
        if n==2*29-1 return "Dn" end
        if n==2*31-1 return "Up"
        else return "Emp"
        end
    end
end

N = 62 # Number of sites in the unit cell
s = infsiteinds(n->isodd(n) ? "tJ" : "S=1/2", N; conserve_qns, initstate)
ψ = InfMPS(s, initstate)

function ITensorInfiniteMPS.unit_cell_terms(::Model"mymodel"; N)
  ampo = OpSum()

  t = 1.0;
  Jc = 0.5;
  Js = 0.5;
  Jk = 1.25;
  Jcs = 0.25;

    for j in 1:2:N
        ampo += -t,"Cdagup",j,"Cup",j+2;
        ampo += -t,"Cdagdn",j,"Cdn",j+2;
        ampo += -t,"Cdagup",j+2,"Cup",j;
        ampo += -t,"Cdagdn",j+2,"Cdn",j;
        ampo += 0.5*Jc,"S+",j,"S-",j+2;
        ampo += 0.5*Jc,"S-",j,"S+",j+2;
        ampo +=     Jc,"Sz",j,"Sz",j+2;
        ampo += -0.25*Jc,"Ntot",j,"Ntot",j+2;
    end
    for j in 2:2:N
        ampo += 0.5*Js,"S+",j,"S-",j+2;
        ampo += 0.5*Js,"S-",j,"S+",j+2;
        ampo +=     Js,"Sz",j,"Sz",j+2;
    end
    for j in 1:2:N
        ampo += 0.5*Jk,"S+",j,"S-",j+1;
        ampo += 0.5*Jk,"S-",j,"S+",j+1;
        ampo +=     Jk,"Sz",j,"Sz",j+1;
    end
    for j in 1:2:N
        ampo += 0.5*Jcs,"S+",j,"S-",j+3;
        ampo += 0.5*Jcs,"S-",j,"S+",j+3;
        ampo +=     Jcs,"Sz",j,"Sz",j+3;
    end
    for j in 2:2:N
        ampo += 0.5*Jcs,"S+",j,"S-",j+1;
        ampo += 0.5*Jcs,"S-",j,"S+",j+1;
        ampo +=     Jcs,"Sz",j,"Sz",j+1;
    end

  return ampo
end
model = Model("mymodel")
H = InfiniteSum{MPO}(model, s; N)
vumps_kwargs = (tol=vumps_tol, maxiter=max_vumps_iters, solver_tol)
subspace_expansion_kwargs = (cutoff=cutoff, maxdim=maxdim)
ψ = vumps_subspace_expansion(H, ψ; outer_iters, subspace_expansion_kwargs, vumps_kwargs)

Also in the example codes, all examples are using vumps_subspace_expansion. Is it easy to use as input (1) a randomly generated QN conserved uMPS with bond dimension larger than 1 (2) a MPS which has optimized by iDMRG and then calling the VUMPS without subspace expansion?

mtfishman commented 1 year ago

See discussion in #69 for some context about the subspace expansion methods that are currently used and what their limitations are, as well as work on making better error messages for when it fails.

mtfishman commented 1 year ago

For context, currently we use the 2-site subspace expansion method proposed in Appendix B of https://arxiv.org/abs/1701.07035. @mingruyang, as you are well aware (https://arxiv.org/abs/2005.06104) an approach based on 2-site variations has the same limitations as 2-site TDVP so would fail for models with just next-nearest neighbor terms in the Hamiltonian.

I have been discussing with @LHerviou about alternatives (some related to your work in https://arxiv.org/abs/2005.06104 which would involve applying an infinite MPO of the Hamiltonian or exponential of the Hamiltonian to the infinite MPS in some way that expands the dimensions, and/or something related to the subspace expansion method proposed in https://arxiv.org/abs/1501.05504 which @LHerviou is using successfully in iDMRG).

You can input any InfiniteMPS you want to into vumps, you can see that vumps_subspace_expansion (https://github.com/ITensor/ITensorInfiniteMPS.jl/blob/main/examples/vumps/src/vumps_subspace_expansion.jl) is not even defined in the library itself and is just a simple loop over vumps/tdvp (which exactly preserves the bond dimension/QN space) and subspace_expansion which performs the 2-site variation from https://arxiv.org/abs/1701.07035 to expand the subspace. I designed it that way on purpose since then people can choose how and when to expand the bond dimension, since that will depend on the model you are studying (VUMPS is not yet a "black box" to the same extent as DMRG and we will have to work out the best practices, see https://github.com/ITensor/ITensorInfiniteMPS.jl#readme).

mtfishman commented 1 year ago

@mingruyang, here's a little hack I just thought of: what about first turning on a small nearest neighbor term in the Hamiltonian and then turning it off once you reach your desired bond dimension (or maybe even just after you expand beyond a product state)?

mingruyang commented 1 year ago

Matt, thanks for your explanation. To use the hack you mentioned, then I need to first extend the local Hilbert space of the even sites from Heisenberg (dim 2) to t-J (dim 3), otherwise the nearest hopping could not be defined. Another thing I could do is blocking 2 sites and define a custom siteset with the local Hilbert space dimension=2*3=6, and then the default 2-site subspace expansion can be used. I could also feed the VUMPS with a MPS which is already optimized by iDMRG and do not do subspace expansion.

LHerviou commented 1 year ago

Hi, Just a small comment: normal 2-site DMRG should have the same problems here, I believe. It is just that the terms that allow you to explore the parameter space are more than nearest neighbour. If you use n-site DMRG or DMRG with mixer/noise, you should bypass that issue.

Also pure curiosity: you do need such a big unit-cell?

mingruyang commented 1 year ago

I understand this point. So for iDMRG or finite-system DMRG, I either do 3-site algorithm or use the 2-site algorithm with noise, and this will be more efficient than blocking 2 sites and use a dim 6 local Hilbert space.

I need to use the unit cell of this size because otherwise I cannot impose the charge number conservation at this filling (19/31), and also from my iDMRG result, there are always translational symmetry breaking like CDW when the bond dimension is finite.

On Tue, Mar 28, 2023 at 12:50 PM LHerviou @.***> wrote:

Hi, Just a small comment: normal 2-site DMRG should have the same problems here, I believe. It is just that the terms that allow you to explore the parameter space are more than nearest neighbour. If you use n-site DMRG or DMRG with mixer/noise, you should bypass that issue.

Also pure curiosity: you do need such a big unit-cell?

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/ITensor/ITensorInfiniteMPS.jl/issues/75*issuecomment-1486636416__;Iw!!CzAuKJ42GuquVTTmVmPViYEvSg!MrqXQTR-aCGvgiGTVy2N99UDwb8vtuB7osSZECIsJplR2jBecTBQQ9jcpNFGGyvfTxxy1VB9zU4eFmAa-HJvjdA$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AEHX2T66XQGY7UZA2TCGU3TW6K675ANCNFSM6AAAAAAWCSNGBE__;!!CzAuKJ42GuquVTTmVmPViYEvSg!MrqXQTR-aCGvgiGTVy2N99UDwb8vtuB7osSZECIsJplR2jBecTBQQ9jcpNFGGyvfTxxy1VB9zU4eFmAaAmWyuzY$ . You are receiving this because you were mentioned.Message ID: @.***>

-- Mingru Yang Postdoctoral Researcher Faculty of Physics University of Vienna Austria

LHerviou commented 1 year ago

On paper it should be more efficient, though in practice it depends a bit on the implementation of the noise and of the bond dimension of the MPO.

So as far as I can say, a weak breakdown of translation invariance should not be a problem. You can capture incommensurate correlations with small unit cells (see my latest paper on arXiv as a not special example). On one hand, it does help convergence to keep a moderately large unit cell, on the other hand, VUMPS works pretty well to restore/find superpositions with translation invariance. To be noted, I had some small difficulty converging with VUMPS when there were several GS. Concerning the filling: you might want to experiment starting from a non-product state if the computation becomes too expensive then. Not sure we have tools to do that automatically though.

Loic Herviou

mtfishman commented 1 year ago

Unfortunately we don't have iTEBD implemented right now, but that would be pretty easy to implement and then we could use iTEBD and apply a shallow random unitary circuit to generate random low-bond dimension iMPS. That's essentially what we do in the randomMPS function in ITensors.jl and it works really well for DMRG.

(EDIT: I realize now that Loic was probably referring to constructing a specific non-product starting state as opposed to a random one, but I think the technique of starting VUMPS from random non-product starting state is worth considering as a simple way to circumventing subspace expansion issues. VUMPS/DMRG don't have the stricter requirements of using particular starting states/preserving evolution properly like TDVP so random starting states could be a simple solution to subspace expansion issues.)

mtfishman commented 1 year ago

Matt, thanks for your explanation. To use the hack you mentioned, then I need to first extend the local Hilbert space of the even sites from Heisenberg (dim 2) to t-J (dim 3), otherwise the nearest hopping could not be defined. Another thing I could do is blocking 2 sites and define a custom siteset with the local Hilbert space dimension=2*3=6, and then the default 2-site subspace expansion can be used. I could also feed the VUMPS with a MPS which is already optimized by iDMRG and do not do subspace expansion.

@mingruyang it's not clear to me why you can't define some Hamiltonian term between any two Hilbert spaces (whether or not they have the same dimension), the only issue I could imagine is if you can't construct a term that preserves the symmetries you are hoping to preserve (which would get turned off anyway so you could bring back the symmetry in principle, but we don't have great support for that right now).

mingruyang commented 1 year ago

The spin exchange interaction between the even and odd sites is ready there in the Hamiltonian, but this does not help the problem. The default 2-site subspace expansion fails because the charge number cannot fluctuate since there is no hopping between the odd and even sites. In the Heisenberg site, there is no room to define a creation or anihilation operator, so how could one define a hopping to a Heisenberg site?

On Tue, Mar 28, 2023 at 4:14 PM Matt Fishman @.***> wrote:

Matt, thanks for your explanation. To use the hack you mentioned, then I need to first extend the local Hilbert space of the even sites from Heisenberg (dim 2) to t-J (dim 3), otherwise the nearest hopping could not be defined. Another thing I could do is blocking 2 sites and define a custom siteset with the local Hilbert space dimension=2*3=6, and then the default 2-site subspace expansion can be used. I could also feed the VUMPS with a MPS which is already optimized by iDMRG and do not do subspace expansion.

@mingruyang https://urldefense.com/v3/__https://github.com/mingruyang__;!!CzAuKJ42GuquVTTmVmPViYEvSg!NGkDKv7wi1XQOcHGw3_sIINFj4JDgauAqxWsqJYz6ihn6K7DILKq80qfXFSqpvQx8dup6ZHibiwaHfgKhf6u8xU$ it's not clear to me why you can't define some Hamiltonian term between any two Hilbert spaces (whether or not they have the same dimension), the only issue I could imagine is if you can't construct a term that preserves the symmetries you are hoping to preserve (which would get turned off anyway so you could bring back the symmetry in principle, but we don't have great support for that right now).

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/ITensor/ITensorInfiniteMPS.jl/issues/75*issuecomment-1486977805__;Iw!!CzAuKJ42GuquVTTmVmPViYEvSg!NGkDKv7wi1XQOcHGw3_sIINFj4JDgauAqxWsqJYz6ihn6K7DILKq80qfXFSqpvQx8dup6ZHibiwaHfgKX4z8cp0$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AEHX2TZBGVW7XQTLDNDYZWDW6LW5XANCNFSM6AAAAAAWCSNGBE__;!!CzAuKJ42GuquVTTmVmPViYEvSg!NGkDKv7wi1XQOcHGw3_sIINFj4JDgauAqxWsqJYz6ihn6K7DILKq80qfXFSqpvQx8dup6ZHibiwaHfgKCEvixus$ . You are receiving this because you were mentioned.Message ID: @.***>

-- Mingru Yang Postdoctoral Researcher Faculty of Physics University of Vienna Austria

mtfishman commented 1 year ago

Gotcha, thanks for the explanation. That makes sense that you can't expand the particle number sectors by adding couplings between the even and odd sites (I hadn't looked carefully at your particular model, I was picturing the ladder example you used in https://arxiv.org/abs/2005.06104).

In principle it would be easy enough to extend the VUMPS code and our subspace expansion approach to 3-sites (or more generally n-sites) for someone who is ambitious enough and has the time to do it.