Hi, I am thankful for your reply. However my problem remains even I have updated my code. Actually my Hamiltonian is a two-leg hubbard model. There are two types of hopping. One is along the parallel direction. Another hopping is between the leg. The parallel hopping has extra phase to represent the flux and the hopping between leg is real. Therefore my Hamiltonian has both real and complex elements. The following is my full kinetic part:
for(int b=1; b<=N-3; b+=2)
{
if(phi==0)
{
ampo += -tpara,"Cdagup",b,"Cup",b+2;
ampo += -tpara,"Cdagup",b+2,"Cup",b;
ampo += -tpara,"Cdagdn",b,"Cdn",b+2;
ampo += -tpara,"Cdagdn",b+2,"Cdn",b;
}
else
{
ampo += (-(tpara)*std::polar(1.,-phi/2.)),"Cdagup",b,"Cup",b+2;
ampo += (-(tpara)*std::polar(1.,+phi/2.)),"Cdagup",b+2,"Cup",b;
ampo += (-(tpara)*std::polar(1.,-phi/2.)),"Cdagdn",b,"Cdn",b+2;
ampo += (-(tpara)*std::polar(1.,+phi/2.)),"Cdagdn",b+2,"Cdn",b;
}
ampo += -tperp,"Cdagup",b,"Cup",b+1;
ampo += -tperp,"Cdagup",b+1,"Cup",b;
ampo += -tperp,"Cdagdn",b,"Cdn",b+1;
ampo += -tperp,"Cdagdn",b+1,"Cdn",b;
}
ampo += -tperp,"Cdagup",N-1,"Cup",N;
ampo += -tperp,"Cdagup",N,"Cup",N-1;
ampo += -tperp,"Cdagdn",N-1,"Cdn",N;
ampo += -tperp,"Cdagdn",N,"Cdn",N-1;
for(int b=2; b<=N-2;b+=2)
{
if(phi==0)
{
ampo += -tpara,"Cdagup",b,"Cup",b+2;
ampo += -tpara,"Cdagup",b+2,"Cup",b;
ampo += -tpara,"Cdagdn",b,"Cdn",b+2;
ampo += -tpara,"Cdagdn",b+2,"Cdn",b;
}
else
{
ampo += (-(tpara)*std::polar(1.,+phi/2.)),"Cdagup",b,"Cup",b+2;
ampo += (-(tpara)*std::polar(1.,-phi/2.)),"Cdagup",b+2,"Cup",b;
ampo += (-(tpara)*std::polar(1.,+phi/2.)),"Cdagdn",b,"Cdn",b+2;
ampo += (-(tpara)*std::polar(1.,-phi/2.)),"Cdagdn",b+2,"Cdn",b;
}
}
IQMPO H = IQMPO(ampo);
I set N=12 and number of particles is 6. The exact solution with phi=\pi is -11.4401 but I can
not reproduce with my code. Actually my code gives me the solution the same as the solution with zero flux. When I turn off the flux, the code behave normally. Could you help me to solve my problem?