+1 vote
asked by (320 points)

Hi, I recently have to compute the expectation value of pair-pair correlation function for s wave so I need the operator like C{i,up}C{i,down}. I add two new operators in the class HubbardSite as followings:

if(opname == "sWavedag")
if(opname == "sWave")
Can I get the correct IQMPO for the operator C{j,down}^{\dag}C{j,up}^{\dag}C{i,up}C{i,down} by using the AutoMPO like the following piece of the code:
ampo += 1 "sWavedag", j, "sWave",i ;
I would be thankful for your reply.

1 Answer

0 votes
answered by (70.1k points)

Hi, so you can proceed this way i.e. defining custom operators. But for an operator composed of C and C^\dagger operators, the nice thing about the new AutoMPO is that you could just write:

ampo += "Cdagdn", j, "Cdagup", j, "Cup", i, "Cdn", i;

When I showed you the code that avoided putting two C's or Cdag's on the same site, that was because they had the same spin so would give zero anyway. In the above operator, the C's or Cdag's sharing a site have different spin so it's perfectly ok.

Also you don't always have to put a numerical coefficient in front; it's optional.

Finally, if you want to test any operator you are adding to an AutoMPO, you can add just that operator only, then use the InitState class (see sample/iqdmrg.cc or sample/exthubbard.cc) to put particles on specific sites. Making two different IQMPS this way, you can then use the overlap(psi1,Op,psi2) function to compute the matrix elements of an IQMPO "Op" and confirm that the matrix elements are correct (correct value and sign).

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.