VUMPS with 12 dimensional local hilbert space

Hi all,
I am trying to find ground state of a system with a 12 dimensional local Hilbert space using VUMPS.

I have appropirately overloaded the required 12 *12 dimensional operators for the Hamiltonian.

I am having a problem with initialization of the method.

I am getting an error which is asking me to overload the space, siteind or siteinds method.
Could someone direct on what further changes do I need to make the code attached below work?

ITensors.space(::SiteType"S=11/2") = 12

#######################################################




#Creating Sz operator
ITensors.op(::OpName"Sz",::SiteType"S=11/2") =
[+1   0    0    0   0   0   0   0   0   0   0   0
0   +1   0    0   0   0   0   0   0   0   0   0
0   0    +1    0   0   0   0   0   0   0   0   0
0   0    0    +1   0   0   0   0   0   0   0   0
0   0    0    0   +1   0   0   0   0   0   0   0
0   0    0    0   0   +1   0   0   0   0   0   0
0   0    0    0   0   0   -1   0   0   0   0   0
0   0    0    0   0   0   0   -1   0   0   0   0
0   0    0    0   0   0   0   0   -1   0   0   0
0   0    0    0   0   0   0   0   0   -1   0   0
0   0    0    0   0   0   0   0   0   0   -1   0
0   0    0    0   0   0   0   0   0   0   0   -1]

initstate(n) = isodd(n) ? "↑" : "↓"
s = infsiteinds("S=11/2", N; conserve_qns, initstate)
ψ = InfMPS(s, initstate)

I define other operators as well like Sz and then create the required Hamiltonian unit cell.

I think the problem lies in the last three lines of the code.

Thanks.

The error is in your definition of space - it needs to also pass conserve_qns as you passed it later

ITensors.space(::SiteType"S=11/2"; conserve_qns = false) = 12 
initstate(n) = isodd(n) ? 1 : 2
s = infsiteinds("S=11/2", N; conserve_qns = false, initstate)
ψ = InfMPS(s, initstate)

You can also just omit conserve_qns in the above example.

Note you have not shown us what your conserve_qns is in your example and will need to be false since your Sz operator is not defined with quantum numbers.

2 Likes

Hi,

Thanks, I omitted the conserve_qns kwarg, that issue seems to be resolved.
But now I am getting a different error message which says- "ArgumentError: Overload of “val” function not found for Index tags “S=11/2,Site,c=1,n=1"”. How do I overload this val function?

You’ll have to be more specific with your error if this is not the problem, but for example

ITensors.val(::ValName"↑",::SiteType"S=11/2") = 1
ITensors.val(::ValName"↓",::SiteType"S=11/2") = 2

Or you can use initstate(n) = isodd(n) ? 1 : 2.

In general, the spinhalf.jl source code is a good reference of things to define. Another suggestion is you could also build your S=11/2 sites off of Qudit sites withdim=12 (qudit.jl source)

Thanks a lot!.
The problem seems to have been fixed.
I will calculate some expectations, hope it matches approximately with the finite DMRG results!

1 Like

Hi,
So the code is running now, but I do not know for some reason the bond dimensions are never crossing 12, even though the specified tolerance( say 10^(-5)) is never reached irrespective of the number of outer iterations being performed( the max bond dimension is set to 100).

I am guessing perhaps the algorithm is getting stuck in some local minima?

Or is there something else going wrong?
Please let me know what you think.
Thanks.

Could you maybe post a minimal example code?

It’s entirely possible that its getting stuck somewhere. You could also try modifying the initial state, perhaps even initializing with a finite dmrg or infinite dmrg state at a higher bond dimension.
The other thing is to try and converge the vumps iterations before running subspace expansion part, if that is what you mean.

I have attached a code below

using PackageCompiler
using ITensors, ITensorMPS
using ITensorInfiniteMPS

base_path = joinpath(pkgdir(ITensorInfiniteMPS), "examples", "vumps", "src")
src_files = ["vumps_subspace_expansion.jl", "entropy.jl"]
for f in src_files
  include(joinpath(base_path, f))
end

###########################################################################

##############################################



function ITensorInfiniteMPS.unit_cell_terms(::Model"Clock";  J_i, J_c, h, G_c, C)
    os = OpSum()
    os += -J_i,"Sz",1,"Sz",2
    os += -J_c,"Cos",1,"Cos",2
    os += -J_c,"Sin",1,"Sin",2

    os += -h,"Sx",1
    os += -h,"Sx",2
    os += -G_c,"L",1
    os += -G_c,"L",2
    os += -C,"Coup",1
    os += -C,"Coup",2
    return os
end



model = Model("Clock")

T = 0.00116

model_params = (J_i = 0.1, J_c = 1.0, h = T, G_c = T, C = 1.0);

maxdim = 500 # Maximum bond dimension
cutoff = 1e-16 # 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-8
outer_iters = 20 # Number of times to increase the bond dimension



N = 2 # Number of sites in the unit cell






initstate(n) = isodd(n) ? 1 : 2
s = infsiteinds("S=11/2", N; initstate)

ψ = InfMPS(s, initstate)


H = InfiniteSum{MPO}(model, s; model_params...)

# Check translational invariance
println("\nCheck translation invariance of the initial VUMPS state")
@show norm(contract(ψ.AL[1:N]..., ψ.C[N]) - contract(ψ.C[0], ψ.AR[1:N]...))

vumps_kwargs = (tol=vumps_tol, maxiter=max_vumps_iters, solver_tol=(x -> x / 1000))
subspace_expansion_kwargs = (cutoff=cutoff, maxdim=maxdim)

ψ = vumps_subspace_expansion(H, ψ; outer_iters, subspace_expansion_kwargs, vumps_kwargs)

# Check translational invariance
println("\nCheck translation invariance of the final VUMPS state")
@show norm(contract(ψ.AL[1:N]..., ψ.C[N]) - contract(ψ.C[0], ψ.AR[1:N]...))

function expect_two_site(ψ::InfiniteCanonicalMPS, h::ITensor, n1n2)
  n1, n2 = n1n2
  ϕ = ψ.AL[n1] * ψ.AL[n2] * ψ.C[n2]
  return inner(ϕ, apply(h, ϕ))
end

function expect_two_site(ψ::InfiniteCanonicalMPS, h::MPO, n1n2)
  return expect_two_site(ψ, contract(h), n1n2)
end

Sz = [expect(ψ, "Sz", n) for n in 1:N]

bs = [(1, 2), (2, 3)]
energy_infinite = map(b -> expect_two_site(ψ, H[b], b), bs)







@show Sz, energy_infinite

An example of the mentioned parameter values where I am having trouble.

I will try out the first thing.

Could you direct me where to look to understand how to make sure the VUMPS has converged before subspace expansion?

Thanks.

For that parameter regime it seems VUMPS gets very stuck. The first sign,

The two-site subspace expansion produced a zero-norm expansion at (1, 2). This is likely due to the long-range nature of the QN conserving Hamiltonian.
The two-site subspace expansion produced a zero-norm expansion at (2, 3). This is likely due to the long-range nature of the QN conserving Hamiltonian.

where the subspace expansion step is essentially failing, which is why you don’t see the bond dimension increasing. Not only that, theres ϵᵖʳᵉˢ = 0.828943792029676, in the VUMPS iterations which never decreases, so there is never a good set of gauge conditions.

I was able to make more headway by using the multisite_update_alg = "parallel" (add this to vumps_kwargs), where at least one can get a state with a good gauge, but the energy is essentially the same

If the issues seems to be that subspace expansion isn’t working for your model, you could try first doing imaginary time evolution with infinite TEBD (iTEBD) to grow the bond dimension and project towards the ground state and then switch to VUMPS.

I’ve also heard people have success starting with infinite DMRG (iDMRG) and the switching to VUMPS, unfortunately we don’t have iTEBD or iDMRG implemented in ITensorInfiniteMPS.jl but iTEBD is a pretty simple algorithm to implement.

Thanks, I will try these hybrid schemes, hopefully I will be able to make some progress.

I tried that as well, the energy pretty much does stay the same. I will try out other things and let you guys know if I make any progress.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.