I want to realize Hubbard-Holstein model which is mixed bose-fermi model. I watch the question:enter link description here
the QN file work well. However, Hubbard-holstein hamiltonian like below(Cdagup,Cdagdn,Cup,Cdn is spinfull fermi and Ab,Adagb is bose). I want to initial fermi state and bose state. When I set the initial state , the program error: setting IQtensor element non-zero would violate its symmetry. I think the problem is
ampo += g,"Cdagup",j,"Ab",j+1;
which are not conserve bose number. I want to know how to correct code,Thank a lot.
int N=80;
auto U=3.6;
auto J=1.0;
auto g=3.0;
auto K=5.0;
auto sites=BF(N);
auto ampo=AutoMPO(sites);
for(int j=1;j<=N-2;j+=2)
{
ampo += -J,"Cdagup",j+2,"Cup",j;
ampo += -J,"Cdagdn",j+2,"Cdn",j;
ampo += -J,"Cdagup",j,"Cup",j+2;
ampo += -J,"Cdagdn",j,"Cdn",j+2;
}
for(int j=1;j<=N;j=j+2)
{
ampo += U,"Nup",j,"Ndn",j;
ampo += g,"Cdagup",j,"Ab",j+1;
ampo += g,"Cup",j,"Adagb",j+1;
ampo += g,"Cdagdn",j,"Ab",j+1;
ampo += g,"Cdn",j,"Adagb",j+1;
ampo += K,"Adagb",j+1,"Ab",j+1;
}
}
auto H = IQMPO(ampo);
auto state0 = InitState(sites);
for(int i = 1; i <= N; i=i+1)
{
if (i%4==1)
{
state0.set(i,"Up");
}
else if (i%4==3)
{
state0.set(i,"Dn");
}
else
{
state0.set(i,"b1");
}
}
auto psi = IQMPS(state0);
auto sweeps=Sweeps(5);
sweeps.maxm() = 20,50,100,200,500;
sweeps.cutoff() = 1E-12;
auto energy = dmrg(psi,H,sweeps,{"Quiet=",true});