0 votes
asked by (680 points)

Here is some code that is essentially what I am doing. H is an XYZ model with different couplings in all directions. psi is the ground state of the Heisenberg model. N(L) = 4. NumCenter = 1 for the LocalMPO as well.

/* psi is ground state with QNs removed, 
   MaxDim=10. */
sites = SpinHalf(N);
auto ampo = AutoMPO(sites);
for(auto j : range1(N-1))
    ampo += 0.5,"S+",j,"S-",j+1;
    ampo += -0.5,"S-",j,"S+",j+1;
    ampo += 0.317,"Sz",j,"Sz",j+1;
auto H = removeQNs(toMPO(ampo));
LocalMPO PH(H,*args);
auto R = PH.R();
auto Heff = PH.H()(1)*R;
ITensor d;
ITensor U;
auto res = U*d*prime(U);
auto dif = res - Heff;   

The result for the printouts are

Heff =
ITensor ord=4: (dim=2|id=213|"n=1,Site,S=1/2") (dim=2|id=213|"n=1,Site,S=1/2")' (dim=2|id=925|"l=1,Link") (dim=2|id=925|"l=1,Link")'
{norm=0.69 (Dense Real)}
(1,1,1,1) -0.026417
(2,2,1,1) -0.170760
(1,2,2,1) -0.455342
(2,1,1,2) 0.4553418
(1,1,2,2) -0.170760
(2,2,2,2) -0.026417

res =
ITensor ord=4: (dim=2|id=213|"n=1,Site,S=1/2")' (dim=2|id=925|"l=1,Link")' (dim=2|id=213|"n=1,Site,S=1/2") (dim=2|id=925|"l=1,Link")
{norm=0.69 (Dense Real)}
(1,1,1,1) -0.026417
(2,1,2,1) -0.170760
(1,2,2,1) 0.4553418
(2,1,1,2) 0.4553418
(1,2,1,2) -0.170760
(2,2,2,2) -0.026417

norm(dif) = 0.910684

We see the error lies in the (1,2,2,1) element.

I've tried leaving QNs on the tensors, and different equivalent forms for res, and I'm not sure what's wrong here. Any help would be greatly appreciated.


1 Answer

+1 vote
answered by (680 points)

Simple mistake, I used S+ and S- instead of Sx and Sy, and so my Hamiltonian was in fact not Hermitian. Fixing this solved the issue.

commented by (70.1k points)
Thanks for letting us know, and for posting the 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.