0 votes
asked by (130 points)

I am quite new to Julia and ITensros lib and tensor networks overall. I have been studying them for a couple of weeks, yet I have some questions which I couldn’t resolve on my own. Sorry, if some of the questions are already mentioned in the documentation but couldn’t get the intuitive idea from there.

1) I want to approximate a 2D spin-lattice with dmrg. Spins are binary as 1 or 0. Is there a default configuration for this? If not, How can I define this from scratch?

2) This is one of the components I have in the Hamiltonian. Is it possible to define this with OpSum() and ampo? Hamiltonian

3) I have some other components in the Hamiltonian very similar to this one. How can I create H = H1 + H2 + H3 for the overall Hamiltonian?

Hope I did not violate any rules. I am working on this for a project, so this is not a homework or exam problem. In case the image link is not working, I am adding one more: Hamiltonian

Direct Drive Link for image: https://drive.google.com/file/d/1uUPB-K4vFbJ0JToJV7DPx9IjhiUlDP1C/view?usp=sharing

Thanks in advance.

commented by (70.1k points)
Hi thanks for the question. For part (1), yes we have two types of site indices that can work for your case. They are the “S=1/2” site type or the “Qubit” site type. Formally these are equivalent (just an index with a dimension of 2) but the practical differences are that they use different conventions like the states of the Qubit are called “0” and “1” whereas for “S=1/2” they are called “Up” and “Dn”.

We need to make a more comprehensive introduction about this, but you can see many examples of the `siteinds` function in places like here:
All the siteinds function does is return a Julia array of indices of the requested type. So if you change “S=1” to either “S=1/2” or “Qubit” you will get the kind of indices you want.

Regarding your other questions, I was able to view your link with the Hamiltonian definition. However, I am not sure how the “s” operator is defined and what “e” means etc (I have some guesses but not really 100% sure) so if you could please provide more details it would be helpful.

Overall, our system for making Hamiltonians expects a sum of products of local operators. So in your case, you would need to compute the overall square (power of 2) in your Hamiltonian to expand the whole thing as a sum for it to be ready to be input to our system.

Hope that helps you get started - we can discuss more.

commented by (130 points)
edited by
Sorry for the inconvenience,

And thanks for your response.

edit: opening the squares is not feasible I think, since there is a square term with a double summation. This introduces a square term with N^2 local spin.

The density matrix has the dimension NxN^2 and there is a certain pattern in it that will be defined by the hamiltonian. So, S is the spin at the location (i)'th row and (e+m*N)'th column. So, m, i, and e for just indexing. To be more simple I didn't go into the conceptual background of them. If you think it is necessary I can reveal more about them.

Also, I have some prework for flatten this density matrix and thread this is a 1D ground-state search. But it is not fully done yet and I understand as ITensors can work with 2D structures as well.

Other than that S is the spin itself as 0 or 1 (in this case up/down but in the computation, they should be threaded as 0/1). It has also a conceptual meaning. If you need, I can put references. I tried my best to ask the question as simply as possible and didn't go much about them. However, I myself write down the hamiltonian. So, it is not any kind of copy-paste or something. But of course, I inspired some other works.

For the third question, I want to take a linear combination of the defined 3 hamiltonians. I also need to multiply hamiltonians with a constant.

Thank you again for your response, it is a precious experience for me to discuss with you!


commented by (130 points)
edited by
Hello again,

I prepared a very short 1-page doc about what I am trying to do and wanted to share it with you.

google drive link: https://drive.google.com/file/d/1L70eeME3k7HeoSoSZrDHK5rgKf-OSavI/view?usp=sharing

in short:

I took the problem as an NxN matrix and it defines the problem for optimization.

flatten it and added one more dimension and this matrix created spins as NxN^2 matrix.

I also flatten it to be able to use it for MPS in 1D.

Then defined the hamiltonian accordingly in a way that the ground state solution is the optimized value.

I planned to set psi0 with a heuristic algorithm to avoid divergence.

Other than that I am not sure expanding out the square is possible since there is a term with double summation in the square. I do not know any way to expand this trivially. The number of the components is decided by N, in some sense it is uncertain. Cant be hard-coded I think.

I read some of your papers on this project and I am glad you responded to me before, thanks for that.

If you think this is doable with ITensors it is VERY good news for me. If not I am open to any suggestion that you can give me. Thanks for your attention.

commented by (70.1k points)
Hi, so before getting into the larger context of the project you are trying accomplish, expanding a square of a sum is always possible. For example, if you have an expression like

(\sum_j A_j)^2 then it would, as you know, expand into

\sum_i \sum_j A_i A_j

Double sums are perfectly fine as input to OpSum (= AutoMPO) in ITensor. The only requirement is that each line of input to OpSum is a product of single-site operators. So terms like A_i A_j are fine, as are A_i B_j C_k etc. An overall square is not something OpSum can process itself, because it would require doing symbolic algebra to expand the square and collect terms etc. So you have to do that part on paper first.

Hope that helps!

If that answers your question about making the MPO, then please let me know what your next question would be. Thanks.


Please log in or register to answer this question.

Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.