0 votes
asked by (270 points)

Hi all,

I am trying to implement the AKLT Hamiltonian for the Spin-2 case.
Having computed with Mathematica the power (Si * Sj)^3 and (Si * Sj)^4 (that are contained in the Hamiltonian) as a function of the operators S+ and S-, I have terms of the form

ampo += 1.0, "Sz*S+*S+",indices_prime[i],"Sz*S-*S-",indices_prime[i+1];

and

ampo += 1.0, "S+*S-*Sz*Sz",indices_prime[i],"S-*S+*Sz*Sz",indices_prime[i+1];

with products of three or four operators on each site. I compile the code, but when I try to run it, I obtain the following error:

"Operator S- name not recognized".

Actually, the code seems to recognise the operator "S-", because, if I put only two operators for each site (for instance, "S+S-" and "S-S+"), it works. I think the error it is due to the fact that I am using more than two operators in the product on each site.

Any advice?

Thank you very much.

commented by (70.1k points)
Hi, thanks for the question. One question before I try to find the issue: what is the value type for the array or vector "indices_prime"? Are those integers or ITensor Index types? Thanks -
commented by (270 points)
Hi Miles,

thank you for your precious help. In the array "indices_prime" I have normal integers (1,2,3...N).

Best.
commented by (70.1k points)
Hi, so the following case worked for me:

    int N = 10;
    auto sites = SpinTwo(N);

    auto ampo = AutoMPO(sites);
    for(int j = 1; j < N; ++j)
        {
        ampo += "Sz*S+*S+",j,"Sz*S-*S-",j+1;
        ampo += "S+*S-*Sz*Sz",j,"S-*S+*Sz*Sz",j+1;
        }
    auto H = toMPO(ampo);

so then perhaps the issue you are seeing is because of the specific values of indices_prime[i] and indices_prime[i+1] ? Could you print out or test all of these values and make sure they are between 1 and N, inclusive?

Otherwise I think I will need more information or a minimal example code reproducing the bug in order to investigate it.

Thanks,
Miles
commented by (270 points)
Hi Miles,

thank you very much. In the end, I solved the problem: there was a typo in the string of operators. Now it works for any number of operators.


Thank you very much for your precious help.

Best.
commented by (70.1k points)
Great. Thanks for following up! It’s useful to know so we can catch any potential bugs.

Feel free to ask us if you need any more help

Miles

1 Answer

0 votes
answered by (70.1k points)

(This question was answered in the above comments thread.)

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.

Categories

...