+1 vote
asked by (160 points)

Hi,
I am modifying the code provided by the following link in order to calculate the spin-spin correlation function between site b and b+2.
http://itensor.org/docs.cgi?page=formulas/measure_mps
However, my naive modification (attached below) with replacing b+1 by b+2 does not work.
Could you help me to solve this problem? Thanks!

    psi.position(b);

    ITensor bondket = psi.A(b)*psi.A(b+2);
    ITensor bondbra = dag(prime(bondket,Site)); 

    ITensor zzop = sites.op("Sz",b)*sites.op("Sz",b+2); 
    ITensor pmop = 0.5*sites.op("S+",b)*sites.op("S-",b+2); 
    ITensor mpop = 0.5*sites.op("S-",b)*sites.op("S+",b+2);

1 Answer

+1 vote
answered by (630 points)
edited by

Hello,
I believe the above method works only for a correlation between two adjacent sites. I would use the following method to calculate the correlation between any two sites:

http://itensor.org/docs.cgi?page=tutorials/correlations

Regards,
Niraj

commented by (70.1k points)
Good answer, Niraj. Also here is a "code formula" about two-point correlation functions as well
http://itensor.org/docs.cgi?page=formulas/correlator_mps
commented by (160 points)
Dear Niraj and Miles,
I have solve the problem, thanks a lot!
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

...