# how to construct a one-dimensional two component bose-hubbard model

Hello everyone!

Recently, I was doing something related to one-dimensional two component bose-hubbard model.
I need its density distribution and correlators at various two points.

With the guide in this post ( Two-component Bose-Hubbard model - ITensor Support Q&A), I construct a new site called ABBoson with two component conserved separately.

It’s Hamiltonian is as follows:

\hat{H}=-t\sum_{i}(\hat{a}^{\dagger}_{i+1}\hat{a}_{i}+\hat{b}^{\dagger}_{i+1}\hat{b}_{i}+h.c.)+U_{aa}/2\sum_{i}\hat{n}^{a}_i(\hat{n}^{a}_i-1)+U_{bb}/2\sum_{i}\hat{n}^{b}_i(\hat{n}^{b}_i-1)+U_{ab}\sum_{i}\hat{n}^{a}_i\hat{n}^{b}_i

and Hamiltonian in my codes:

auto sites = ABBoson(L,{"ConseveQNs",true,"ConserveNb",false,"MaxOcc",max});
auto ampo = AutoMPO(sites);
for (int i = 1;i <= L-3; i += 2)
{
ampo += -U/2, "N", i;
ampo += U/2, "N", i,"N",i;
ampo += -t_1, "A", i, "Adag", i + 2;
ampo += -t_1, "Adag", i, "A", i + 2;
}
ampo += -U/2, "N", L-1;
ampo += U/2, "N", L-1,"N",L-1;
for (int i = 2;i <= L-2; i += 2)
{
ampo += -U/2, "N", i;
ampo += U/2, "N", i,"N",i;
ampo += -t_2, "A", i, "Adag", i + 2;
ampo += -t_2, "Adag", i, "A", i + 2;
}
ampo += -U/2, "N", L;
ampo += U/2, "N", L,"N",L;
for (int i = 1;i <= L-1; i += 2)
{
ampo +=U_12, "N", i,'N',i+1;
}


I want to measure its density distribution at ground state with different fillings.
Here is my initial state:

auto state = InitState(sites,"0");
for (int i = 1; i <= L/2-1; i =i+2)
{
state.set(i,"1");
}
for (int i = L; i >= L/2; i =i-2)
{
state.set(i,"1");
}
auto psi0=MPS(state);
//auto psi0=randomMPS(state);


and measurement of density

for( auto i : range1(L))
{
psi.position(i);
auto ket = psi(i);
auto bra = dag(prime(ket,"Site"));
auto Numop = op(sites,"N",i);
auto Numi = elt(bra*Numop*ket);
fp1=fopen(file_name1.str().c_str(),"a");
fprintf(fp1,"%i,%f\n",i,Numi);
fclose(fp1);
}


But here comes a problem, in my results, local density on every odd number sites is zero and nonzero on even number sites (and all zero in correlation functions).

So, are there some mistakes in my codes or I completely misunderstand the way to construct two component bose-hubbard model with MPS and dmrg.

Thanks

Thanks for a clear explanation. Your code looks good though I haven’t run it myself.

The issue you’re describing sounds most likely to be a convergence issue, meaning DMRG is either stuck in a state which isn’t the ground state or it just hasn’t been run long enough.

Is the energy still changing in the last few sweeps?

How many sweeps are you doing?

It can be challenging to converge starting from a state where all the particles are next to each other on one side of the system. It’s not a problem but may require doing a lot of sweeps. Alternatively you can spread the particles out when making the initial state.

1 Like

Hi Miles,
Here is my sweep parameters

auto sweeps = Sweeps(8);
sweeps.noise()=1E-6,1E-6,1E-8,1E-8,1E-10,1E-10,1E-12,1E-12;
sweeps.maxdim() = 50,80,100,200,400,800,1000,1000;
sweeps.cutoff() = 1E-14;


This time, I use a mixed site to construct two-component bose-hubbard model.

using twocom=MixedSiteSet<BosonSite,BosonSite>;
auto sites=twocom(L,{"ConserveNb",true,"ConserveNb",true,"MaxOcc=",max});


And an another initial state (half filling).

auto state = InitState(sites,"0");
//half filling
for (int i = 1; i <= L-1; i += 4)
{
state.set(i,"1");
}
for (int i = 2; i <= L; i += 4)
{
state.set(i,"1");
}


But it still doesn’t work both MPS(state) and randomMPS(state).
The density is still zero in odd-number site (except the first site) and nonzero in even-number site.
So does the problem attribute to the model’s Hamiltonian? Or my Hamiltonian in codes is not the right way?

Thanks!

Could you please try using the following sweeps settings instead, and please let me know if you get better results?

auto sweeps = Sweeps(26);
sweeps.noise()=1E-6,1E-6,1E-8,1E-8,1E-10,1E-10,1E-12,1E-12;
sweeps.maxdim() = 10,10,10,10,10,10,10,10,10,10,20,20,20,20,20,40,40,40,40,80,100,200,400,800,1000,1000;
sweeps.cutoff() = 1E-12;

1 Like

Thank you very much!

It works, even though just the first several odd-number sites are not zero any more and the rest are still zero.

So if I want to make more progress, how should I set the sweep parameters?
And one more question, what is the difference between MPS(state) and randomMPS(state)?

Furthermore, when I use the ABBosn site in Two-component Bose-Hubbard model - ITensor Support Q&A , I set  "ConserveNb",true ,it reports that
“In .set, cannot set element with flux different from ITensor flux”.
What dose that mean? Is there something else I need to modify?

Thank you again for your kind help!

Sure, let’s keep discussing. Would you mind asking the question about MPS(state) versus randomMPS(state) as a new topic?

I think for your case, if setting the sweeps as I suggested above does not lead to a good result, then you’ll need to adjust your initial state. Starting from all the particles on the left can be very challenging for DMRG to converge. So I would suggest instead to distribute the particles throughout the lattice leaving space in between them.

When you get an error about “flux” in ITensor, what it means is that when quantum numbers (QNs) are enabled, such as by setting “ConserveNb=”,true, then the only kind of tensors which you are allowed to make are ones which change the QN by a well-defined amount. For boson systems, this means you can only make operators like “N” or “A” or “Adag” and operators like that (which change the boson number by 0, -1, or +1 respectively). Any other tensor or operator isn’t allowed. To tell you more about why you got that error in your specific case I would need you to tell me some more about the context.

To learn more about how the QN system works in ITensor, a good reference is the ITensor Paper.

1 Like