This is a supplement for a former question : http://itensor.org/support/357/problems-about-1-d-bose-fermi-mixture-when-using-dmrg
I have done a minimal modification to "BoseFermiMix.h" file by adding a private "Args" object in the definition of class BoseFermiMix. The modified part of the code is presented as follow
class BoseFermiMix
{
IQIndex s;
private:
Args args_site;
public:
BoseFermiMix() {}
BoseFermiMix(IQIndex I): s(I) {}
BoseFermiMix(int n, Args const& args=Args::global())
{
args_site=Args::global();
if(n%2==1) // spinless fermion
{
s=IQIndex(nameint("site=",n),
Index(nameint("Em",n),1,Site), QN("Sz=",0,"Nf=",0), // vaccum
Index(nameint("f1",n),1,Site), QN("Sz=",0,"Nf=",1) // 1 fermion
);
args_site.add("Fermion_Site?",true);
}
else // spinless boson (3 boson/site at most)
{
s=IQIndex(nameint("site=",n),
Index(nameint("Em",n),1,Site),QN("Sz=",0,"Nb=",0),
Index(nameint("b1",n),1,Site),QN("Sz=",0,"Nb=",1),
Index(nameint("b2",n),1,Site),QN("Sz=",0,"Nb=",2),
Index(nameint("b3",n),1,Site),QN("Sz=",0,"Nb=",3)
);
args_site.add("Fermion_Site?",false);
}
}
The new-added Args object "argssite" is {"FermionSite",true} when this site is fermion (on odd site). And the Jordan-Wigner string operator "F" is now relying on the flag given by "args_site" as we presented below
else if ((opname=="F" || opname=="FermiPhase") && (args_site.getBool("Fermion_Site?")))
{
Op.set(Em,EmP,1);
Op.set(f1,f1P,-1);
}
else if ((opname=="F" || opname=="FermiPhase") && !(args_site.getBool("Fermion_Site?")))
{
Op.set(Em,EmP,1);
Op.set(f1,f1P,1);
}
that is, "F" is identity when this site is boson, normal Jordan-Wigner operator F when this site is fermion.
It seems the problem is solved but I still have the following mistakes
(1) dmrg runs so quickly (less than 1 s) even for large particle number (N=2000) and small cut-off (1E-15).
(2) the result it gives is different each time
(3) Entropy at center bond is always zero (all very small)
Another problem, which may give us some implication, is that : if I set all fermion parameters (such as fermion hopping and Bose-fermi interaction) to be zero, than this model shall give the same result as spinless Bose-Hubbard model. (fermion now has no effect on the system and all boson lies on even site ). In fact, I wrote a siteset file "BoseHubbard.h" to describe spinless BoseHubbard model I believe it is right.
#ifndef __ITENSOR_BOSEHUBBARD__H
#define __ITENSOR_BOSEHUBBARD__H
#include "itensor/mps/siteset.h"
#include <cmath>
namespace itensor
{
class BoseHubbard;
using BH=BasicSiteSet<BoseHubbard>;
auto Sqrt3=1.7320508075688772;
class BoseHubbard
{
IQIndex s;
public:
BoseHubbard() {}
BoseHubbard(IQIndex I): s(I) {}
BoseHubbard(int n, Args const& args=Args::global())
{
// spinless boson (3 boson/site at most)
s=IQIndex(nameint("site=",n),
Index(nameint("Emp",n),1,Site),QN("Sz=",0,"Nb=",0),
Index(nameint("b1",n),1,Site),QN("Sz=",0,"Nb=",1),
Index(nameint("b2",n),1,Site),QN("Sz=",0,"Nb=",2),
Index(nameint("b3",n),1,Site),QN("Sz=",0,"Nb=",3)
);
}
IQIndex index() const {return s;}
IQIndexVal state(std::string const& state)
{
if (state=="Emp")
{
return s(1);
}
else if (state=="b1")
{
return s(2);
}
else if (state=="b2")
{
return s(3);
}
else if (state=="b3")
{
return s(4);
}
}
IQTensor op(std::string const& opname, Args const& args) const
{
auto sP=prime(s);
IQIndexVal
Em(s(1)),EmP(sP(1)),
b1(s(2)),b1P(sP(2)),
b2(s(3)),b2P(sP(3)),
b3(s(4)),b3P(sP(4));
IQTensor Op(dag(s),sP);
// boson single-site operator
if (opname=="Nb")
{
Op.set(b1,b1P,1);
Op.set(b2,b2P,2);
Op.set(b3,b3P,3);
}
else if (opname=="Ab")
{
Op.set(Em,b1P,1);
Op.set(b1,b2P,Sqrt2);
Op.set(b2,b3P,Sqrt3);
}
else if (opname=="Adagb")
{
Op.set(b1,EmP,1);
Op.set(b2,b1P,Sqrt2);
Op.set(b3,b2P,Sqrt3);
}
else if (opname=="Id")
{
Op.set(Em,EmP,1);
Op.set(b1,b1P,1);
Op.set(b2,b2P,1);
Op.set(b3,b3P,1);
}
else
{
Error("Operator " + opname + " name not recognized !");
}
return Op;
}
};
}
#endif
unfortunately, result given by "BoseFermiMix.h" is still not right compared to "BoseHubbard.h" and it also have the faults given in (1) and (3) above. ((2) is solved)