Hi everyone. I am Idriss, and currently I am trying to implement some code in Julia based on DMRG algorithm focusing on a mixed spin ring of spins (1/2, 1) with 14 sites and with a focus on 4 sites to find the reduced ground state. My current problem is at the level of using periodic boundary conditions for such a task.
Therefore, I would like to kindly ask whether you could have some advices or ideas I could use to solve this task.
Thank you for your reaction. Please I would like to know, is there a way to extend the code to a spin ring of mixed spins (1/2, 1), and returning a 4-site ground state?
Hi Idriss,
As a practial solution, you can implement periodic boundary conditions by just mapping your sites to an ordering 1,2,3,4,5, …, N and then in this ordering treating the “periodic” bond connecting site N to site 1 as a “long range” interaction. So you can view your Hamiltonian as something like:
where the last term is the “long range” or “long bond” interaction.
You can input Hamiltonians of this type directly into our OpSum system just as I wrote above. Please look at our example codes to see how to use the OpSum system.
The main thing to understand, though, is that our DMRG code will produce an open-boundary MPS even though the Hamiltonian is mathematically equivalent to a periodic one. This means that while it will give correct results for a large enough bond dimension and enough sweeps of DMRG, it will generally be harder to converge and more expensive than open-boundary DMRG. So please only do this with some caution and carefully studying smaller systems before trying larger systems.
Also please consider if you actually need periodic boundaries, since DMRG is sub-optimal in this case, or if it is just a preference.
Let’s say you want to measure the reduced density matrix of the sites c and c+1 of an MPS. Then you can do that with the following code:
orthogonalize!(psi,c)
ket = psi[c]*psi[c+1]
bra = dag(ket)
rho = prime(ket,"Site")*bra
I would strongly suggest you write a tensor diagram and think about the “orthogonality conditions” of an MPS to understand what the code above is doing. Also I give a longer answer in this post about how to get a reduced density matrix for the entire left half of a finite system that could be helpful background for you.
To do more sites, you can generalize the above code to make ket include more MPS tensors, such as ket = psi[c]*psi[c+1]*psi[c+2] for the three-site case. Note that this calculation scales exponentially in the number of sites, but should work well for a small number of sites.
Please is there a way to solve this problem for any rings base on couple of mixed spins because I tried to implement the code you wrote for couple (1,1/2) but I realized that for a couple (1/2, 3/2) the code fails?
Also, I am a bit struggling to implement the code with PBC as you clearly explained. Therefore, any help would be very welcome.
Sorry to bother with my questions. I am new to the field but interested in learning.
Hi Idriss, at this point it would be helpful if you could please make your question more detailed and specific and also when you do, please start a new post for each question.
By specific, I mean like if the code fails, please say what that means e.g. did you get an error or a different result from what you were expecting? What did you try to do about it and did you print out various tensors to see if the code was operating the way you wanted? Please spend some time creating diagrams of the tensors you are contracting and printing out the intermediate ITensors in your calculation to see if they match your diagrams. To print only the indices of a tensor T you can use @show inds(T).