# the Ising model in a transverse field, DMRG

Hello everyone!

The ground energy of the Ising model in a transverse field with OBC can be found, for example at

Here is the code

#include "itensor/all.h"

using namespace itensor;
using std::vector;

int main()
{
int N = 16;
auto sites = SpinHalf(N);
auto psi = MPS(sites);

auto ampo = AutoMPO(sites);
for(int j = 1; j < N; ++j)
{
ampo += -1.0,"Sz",j,"Sz",j+1;
ampo += -1.0,"Sx",j;
}
ampo += -1.0,"Sx",N;
auto H = MPO(ampo);

auto sweeps = Sweeps(4);
sweeps.maxm() = 10,40,100,200;
sweeps.cutoff() = 1E-9;

auto energy = dmrg(psi,H,sweeps,{"Quiet",true});

printfln("result",energy/N);

return 0;
}


The code does not reproduce the correct results (see the table at the site)

+1 vote
answered by (44.9k points)

So I think that website is actually in error. The critical point of the transverse-field Ising model occurs at h/J = 1 when one writes the Hamiltonian in terms of Pauli matrices, not in terms of spin operators (Pauli matrices divided by two). This site writes the Hamiltonian in terms of spin operators as you can see, but still states that the critical point occurs at h/J = 1, which is not correct.

Could you see if there is another reference somewhere, or another code you can obtain, which could reproduce these energies or give correct energies?

Best regards,
Miles

commented by (8k points)
I didn't notice you had already commented, but it looks like if you make the Hamiltonian with:

for(int j = 1; j < N; ++j)
{
ampo += -4.0,"Sz",j,"Sz",j+1;
ampo += -2.0,"Sx",j;
}
ampo += -2.0,"Sx",N;

it matches the formula they give.
commented by (44.9k points)
Thanks Matt. Great to know one can get the energies on the site if one makes this fix. Yes, that's what I had suspected but didn't check it myself.
commented by (8k points)
I added a test for DMRG using that exact result here: https://github.com/ITensor/ITensor/blob/v3/unittest/mpo_test.cc#L537 since we should have a unit test for DMRG anyway.
commented by (44.9k points)
That's a good idea - thanks for doing that
answered by (8k points)

Hello,

I believe that website you are referencing is slightly wrong. The phase transition for the Hamiltonian they write down, written in terms of spin operators, should be h/J=1/2, not h/J=1 (all of it looks correct if the Hamiltonian was written in terms of Pauli operators). If you change the line to:

ampo += -2.0,"Sz",j,"Sz",j+1;


you should get the correct critical ground state (and the energy should match the formula they give, up to a factor of two, I believe also because of the confusion between using Pauli operators and spin operators).

Cheers,
Matt

commented by (630 points)
Thank you very much MattFishman and miles!