Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod sz #159

Merged
merged 17 commits into from
Dec 3, 2024
4 changes: 3 additions & 1 deletion src/CalcByLOBPCG.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,12 +650,14 @@ int CalcByLOBPCG(
switch (X->Bind.Def.iCalcModel) {
case HubbardGC:
case SpinGC:
case KondoGC:
case SpinlessFermionGC:
initial_mode = 1; // 1 -> random initial vector
break;
case Hubbard:
case Kondo:
case KondoGC:
case tJ:
case tJGC:
case Spin:
case SpinlessFermion:

Expand Down
4 changes: 3 additions & 1 deletion src/CalcByLanczos.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@ int CalcByLanczos(
switch(X->Bind.Def.iCalcModel){
case HubbardGC:
case SpinGC:
case KondoGC:
case SpinlessFermionGC:
initial_mode = 1; // 1 -> random initial vector
break;
case Hubbard:
case Kondo:
case KondoGC:
case tJ:
case tJGC:
case Spin:
case SpinlessFermion:

Expand Down
26 changes: 20 additions & 6 deletions src/CalcSpectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,12 @@ int MakeExcitedList(
case HubbardGC:
break;
case HubbardNConserved:
case KondoGC:
case Hubbard:
case Kondo:
case KondoGC:
case tJ:
case tJNConserved:
case tJGC:
*iFlgListModifed = TRUE;
break;
case Spin:
Expand All @@ -466,13 +469,16 @@ int MakeExcitedList(
}
} else if (X->Def.NPairExcitationOperator > 0) {
switch (X->Def.iCalcModel) {
case HubbardGC:
case SpinGC:
case HubbardNConserved:
break;
case HubbardGC:
case KondoGC:
case tJNConserved:
case tJGC:
break;
case Hubbard:
case Kondo:
case tJ:
case Spin:
if (X->Def.PairExcitationOperator[0][1] != X->Def.PairExcitationOperator[0][3]) {
*iFlgListModifed = TRUE;
Expand Down Expand Up @@ -519,16 +525,20 @@ int MakeExcitedList(
case HubbardGC:
break;
case HubbardNConserved:
case KondoNConserved:/*To be confirmed*/
case tJNConserved:/*To be confirmed*/
if (X->Def.SingleExcitationOperator[0][2] == 1) { //cis
X->Def.Ne = X->Def.NeMPI + 1;
}
else{
X->Def.Ne = X->Def.NeMPI - 1;
}
break;
case KondoGC:
case Hubbard:
case Kondo:
case KondoGC:
case tJ:
case tJGC:
if (X->Def.SingleExcitationOperator[0][2] == 1) { //cis
X->Def.Ne = X->Def.NeMPI + 1;
if (X->Def.SingleExcitationOperator[0][1] == 0) {//up
Expand Down Expand Up @@ -557,13 +567,17 @@ int MakeExcitedList(
} else if (X->Def.NPairExcitationOperator > 0) {
X->Def.Ne=X->Def.NeMPI;
switch (X->Def.iCalcModel) {
case HubbardGC:
case SpinGC:
case HubbardNConserved:
case HubbardGC:
case KondoNConserved:/*To be confirmed*/
case tJNConserved:/*To be confirmed*/
break;
case KondoGC:
case Hubbard:
case Kondo:
case KondoGC:
case tJ:
case tJGC:
if (X->Def.PairExcitationOperator[0][1] != X->Def.PairExcitationOperator[0][3]) {
if (X->Def.PairExcitationOperator[0][1] == 0) {//up
X->Def.Nup = X->Def.NupOrg + 1;
Expand Down
99 changes: 93 additions & 6 deletions src/CheckMPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ int CheckMPI(struct BindStruct *X/**< [inout] */)
case Hubbard:
case HubbardNConserved:
case Kondo:
case KondoNConserved:
case KondoGC:
case tJ:
case tJNConserved:
case tJGC:

/**@brief
<li> For Hubbard & Kondo
Expand Down Expand Up @@ -104,6 +108,32 @@ int CheckMPI(struct BindStruct *X/**< [inout] */)

break;/*case Hubbard:*/

case tJ:
/**@brief
<li>For canonical Hubbard
DefineList::Nup, DefineList::Ndown, and DefineList::Ne should be
differerent in each PE.</li>
*/
SmallDim = myrank;
for (isite = X->Def.Nsite; isite < X->Def.NsiteMPI; isite++) {
SpinNum = SmallDim % 4;
SmallDim /= 4;
if (SpinNum == 1 /*01*/) {
X->Def.Nup -= 1;
X->Def.Ne -= 1;
}
else if (SpinNum == 2 /*10*/) {
X->Def.Ndown -= 1;
X->Def.Ne -= 1;
}
/*else if (SpinNum == 3 //11){
X->Def.Nup -= 1;
X->Def.Ndown -= 1;
X->Def.Ne -= 2;
}*/
} /*for (isite = X->Def.Nsite; isite < X->Def.NsiteMPI; isite++)*/
break;/*case tJ:*/

case HubbardNConserved:
/**@brief
<li>For N-conserved canonical Hubbard
Expand All @@ -119,8 +149,24 @@ int CheckMPI(struct BindStruct *X/**< [inout] */)

break; /*case HubbardNConserved:*/

case KondoGC:
case tJNConserved:
case tJGC:/*is this correct?*/
/**@brief
<li>For N-conserved canonical Hubbard
DefineList::Ne should be differerent in each PE.</li>
*/
SmallDim = myrank;
for (isite = X->Def.Nsite; isite < X->Def.NsiteMPI; isite++) {
SpinNum = SmallDim % 4;
SmallDim /= 4;
if (SpinNum == 1 /*01*/ || SpinNum == 2 /*10*/) X->Def.Ne -= 1;
//else if (SpinNum == 3 /*11*/) X->Def.Ne -= 2;
} /*for (isite = X->Def.Nsite; isite < X->Def.NsiteMPI; isite++)*/
break; /*case HubbardNConserved:*/

case Kondo:
case KondoNConserved:
case KondoGC:
/**@brief
<li>For canonical Kondo system
DefineList::Nup, DefineList::Ndown, and DefineList::Ne should be
Expand Down Expand Up @@ -155,7 +201,32 @@ int CheckMPI(struct BindStruct *X/**< [inout] */)
}
}/*for (isite = X->Def.Nsite; isite < X->Def.NsiteMPI; isite++)*/
} /*if (X->Def.iCalcModel == Kondo)*/

else if(X->Def.iCalcModel == KondoNConserved){
SmallDim = myrank;
for (isite = X->Def.Nsite; isite < X->Def.NsiteMPI; isite++) {
SpinNum = SmallDim % 4;
SmallDim /= 4;
if (X->Def.LocSpn[isite] == ITINERANT) {
if (SpinNum == 1 /*01*/) {
//X->Def.Nup -= 1;
X->Def.Ne -= 1;
}
else if (SpinNum == 2 /*10*/) {
//X->Def.Ndown -= 1;
X->Def.Ne -= 1;
}
else if (SpinNum == 3 /*11*/) {
//X->Def.Nup -= 1;
//X->Def.Ndown -= 1;
X->Def.Ne -= 2;
}
}
else {
fprintf(stdoutMPI, "\n Stop because local spin in the inter process region\n");
return FALSE;
}
}/*for (isite = X->Def.Nsite; isite < X->Def.NsiteMPI; isite++)*/
}
break; /*case KondoGC, Kondo*/

} /*switch (X->Def.iCalcModel) 2(inner)*/
Expand Down Expand Up @@ -318,11 +389,15 @@ void CheckMPI_Summary(struct BindStruct *X/**< [inout] */) {
fprintf(stdoutMPI, " Site Bit\n");
for (isite = 0; isite < X->Def.Nsite; isite++) {
switch (X->Def.iCalcModel) {
case HubbardGC:
case Hubbard:
case HubbardNConserved:
case HubbardGC:
case Kondo:
case KondoNConserved:
case KondoGC:
case tJ:
case tJNConserved:
case tJGC:

fprintf(stdoutMPI, " %4d %4d\n", isite, 4);
break;
Expand All @@ -346,11 +421,15 @@ void CheckMPI_Summary(struct BindStruct *X/**< [inout] */) {
fprintf(stdoutMPI, " Site Bit\n");
for (isite = X->Def.Nsite; isite < X->Def.NsiteMPI; isite++) {
switch (X->Def.iCalcModel) {
case HubbardGC:
case Hubbard:
case HubbardNConserved:
case HubbardGC:
case Kondo:
case KondoNConserved:
case KondoGC:
case tJ:
case tJNConserved:
case tJGC:

fprintf(stdoutMPI, " %4d %4d\n", isite, 4);
break;
Expand Down Expand Up @@ -404,11 +483,15 @@ void CheckMPI_Summary(struct BindStruct *X/**< [inout] */) {
as a binary (excepting general spin) format.
*/
switch (X->Def.iCalcModel) {
case HubbardGC: /****************************************************/
case Hubbard:
case HubbardNConserved:
case HubbardGC: /****************************************************/
case Kondo:
case KondoNConserved:
case KondoGC:
case tJ:
case tJNConserved:
case tJGC:

SmallDim = iproc;
for (isite = X->Def.Nsite; isite < X->Def.NsiteMPI; isite++) {
Expand Down Expand Up @@ -466,11 +549,15 @@ void CheckMPI_Summary(struct BindStruct *X/**< [inout] */) {
affected by the number of processes.
*/
switch (X->Def.iCalcModel) {
case HubbardGC: /****************************************************/
case Hubbard:
case HubbardNConserved:
case HubbardGC: /****************************************************/
case Kondo:
case KondoNConserved:
case KondoGC:
case tJ:
case tJNConserved:
case tJGC:

X->Def.Tpow[2 * X->Def.Nsite] = 1;
for (isite = 2 * X->Def.Nsite + 1; isite < 2 * X->Def.NsiteMPI; isite++)
Expand Down
4 changes: 3 additions & 1 deletion src/PairEx.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ int GetPairExcitedState
iret=GetPairExcitedStateHubbardGC(X, tmp_v0, tmp_v1);
break;

case KondoGC:
case Hubbard:
case Kondo:
case KondoGC:
case tJ:
case tJGC:
iret=GetPairExcitedStateHubbard(X, tmp_v0, tmp_v1);
break;

Expand Down
4 changes: 3 additions & 1 deletion src/SingleEx.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ int GetSingleExcitedState(
iret = GetSingleExcitedStateHubbardGC(X, tmp_v0, tmp_v1);
break;

case KondoGC:
case Hubbard:
case Kondo:
case KondoGC:
case tJ:
case tJGC:
iret = GetSingleExcitedStateHubbard(X, tmp_v0, tmp_v1);
break;

Expand Down
8 changes: 6 additions & 2 deletions src/bitcalc.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,15 @@ int GetSplitBitByModel(
{
int tmpNsite=Nsite;
switch(iCalcModel){
case Hubbard:
case HubbardGC:
case KondoGC:
case HubbardNConserved:
case Hubbard:
case Kondo:
case KondoNConserved:
case KondoGC:
case tJ:
case tJNConserved:
case tJGC:
tmpNsite *= 2;
break;
case Spin:
Expand Down
Loading
Loading