0 votes
asked by (400 points)

Hi Miles,

I have been recently trying doing some iDMRG simulations (C++v3). It is super nice of you to give sample codes in https://github.com/ITensor/iDMRG. And for others who might be interested, here is a great brief introduction to the algorithm - http://itensor.org/docs.cgi?page=tutorials/iDMRG&vers=cppv2.

But since I don't find any documentations about the implementation of the codes, it is a bit hard for me to modify based on that. And I think you might be I have some naive technical questions regarding how to construct a general Hamiltonian (to be specific, biquadratic Heisenberg model for my purpose).

$$H=\sum_{}\alpha s_i\cdot s_j+\beta(s_i\cdot s_j)^2$$

In the Heisenberg.h,

Question 1
How is the size for each QN block being decided? (3, 1, 1) in the following code.

        auto ts = format("Link,l=%d",l);
    links.at(l) = Index(QN({"Sz", 0}),3,

Question 2

I guess the following codes are the ones that deal with the construction of Heisenberg MPO. But could you explain how these columns and rows correspond to the MPO of the Heisenberg MPO? And in general, how do you specify the row and column indices?

        W = ITensor(dag(sites_(n)),prime(sites_(n)),row,col);

    W += sites_.op("Id",n) * setElt(row(1)) * setElt(col(1)); //ending state
    W += sites_.op("Id",n) * setElt(row(2)) * setElt(col(2)); //starting state

    W += sites_.op("Sz",n) * setElt(row(3)) * setElt(col(1));
    W += sites_.op("Sz",n) * setElt(row(2)) * setElt(col(3)) * Jz_;

    W += sites_.op("Sm",n) * setElt(row(4)) * setElt(col(1));
    W += sites_.op("Sp",n) * setElt(row(2)) * setElt(col(4)) * J_/2;

    W += sites_.op("Sp",n) * setElt(row(5)) * setElt(col(1));
    W += sites_.op("Sm",n) * setElt(row(2)) * setElt(col(5)) * J_/2;

Thank you very much!


commented by (400 points)

Thats very helpful. Actually, I have figured out the problem after checking some previous answers and McCulloch's paper https://arxiv.org/pdf/0804.2509.pdf. Although I still need to figure out the details of the iDMRG algorithms, I am now able to construct the mpo and do some calculation for now. Sorry for asking such a naive question.

Thanks a lot.


1 Answer

0 votes
answered by (70.1k points)

(Please see answer above.)

(Sorry for the slow reply on this but glad you did figure it out!)

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.