Skip to content

Commit

Permalink
add tJ
Browse files Browse the repository at this point in the history
  • Loading branch information
tmisawa committed Apr 15, 2024
1 parent 442e147 commit f1c877d
Show file tree
Hide file tree
Showing 4 changed files with 441 additions and 68 deletions.
34 changes: 32 additions & 2 deletions src/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
int check(struct BindStruct *X){

FILE *fp;
long unsigned int i,tmp_sdim;
long unsigned int i,j,tmp_sdim;
int NLocSpn,NCond,Nup,Ndown;
long unsigned int u_tmp;
long unsigned int tmp;
Expand Down Expand Up @@ -130,6 +130,37 @@ int check(struct BindStruct *X){
comb_sum +=comb_up*comb_down;
}
break;

case tJ:
comb_up = Binomial(Ns, X->Def.Nup, comb, Ns);
comb_down = Binomial(Ns-X->Def.Nup, X->Def.Ndown, comb, Ns);
comb_sum = comb_up*comb_down;
break;

case tJNConserved:
comb_sum=0;
if(X->Def.Ne > X->Def.Nsite){
iMinup = X->Def.Ne-X->Def.Nsite;
iAllup = X->Def.Nsite;
}

for(i=iMinup; i<= iAllup; i++){
comb_up = Binomial(Ns, i, comb, Ns);
comb_down = Binomial(Ns-i, X->Def.Ne-i, comb, Ns-i);
comb_sum += comb_up*comb_down;
}
break;

case tJGC:
comb_sum=0;
for(i=0; i<= X->Def.Ne; i++){
comb_up = Binomial(Ns, i, comb, Ns);
for(j=0; j<= X->Def.Ne; j++){
comb_down = Binomial(Ns-i, j, comb, Ns-i);
comb_sum += comb_up*comb_down;
}
}
break;

case Kondo:
//idim_max
Expand Down Expand Up @@ -195,7 +226,6 @@ int check(struct BindStruct *X){
}
break;
case Spin:

if(X->Def.iFlgGeneralSpin ==FALSE){
if(X->Def.Nup+X->Def.Ndown != X->Def.Nsite){
fprintf(stderr, " 2Sz is incorrect.\n");
Expand Down
25 changes: 14 additions & 11 deletions src/include/DefCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@
#define cTPQ 5 /*!< CalcType is canonical TPQ*/

/*!< CalcModel */
#define NUM_CALCMODEL 6 /*!< Number of model types defined by CalcModel in calcmodfile. Note: HubbardNConserved is not explicitly defined in calcmod file and thus not counted. SpinlessFermion and SpinlessFermionGC are not yet supported*/
#define Hubbard 0 /*!< CalcModel is Hubbard model.*/
#define Spin 1 /*!< CalcModel is Spin system.*/
#define Kondo 2 /*!< CalcModel is Kondo model.*/
#define HubbardGC 3 /*!< CalcModel is GrandCanonical Hubbard model.*/
#define SpinGC 4 /*!< CalcModel is GrandCanonical Spin system.*/
#define KondoGC 5 /*!< CalcModel is GrandCanonical Kondo model.*/
#define HubbardNConserved 6 /*!< CalcModel is Hubbard model under particle number conserved. This symmetry is automatically introduced by not defining 2Sz in a modpara file.*/
#define SpinlessFermion 7 /*!< CalcModel is GrandCanonical Spinless fermion model.*/
#define SpinlessFermionGC 8 /*!< CalcModel is GrandCanonical Spinless fermionGC model.*/
#define KondoNConserved 20 /*!< CalcModel is Kondo model under particle number conserved.*/
#define NUM_CALCMODEL 12 /*!< Number of model types defined by CalcModel in calcmodfile. Note: HubbardNConserved is not explicitly defined in calcmod file and thus not counted. SpinlessFermion and SpinlessFermionGC are not yet supported*/
#define Hubbard 0 /*!< CalcModel is Hubbard model.*/
#define Spin 1 /*!< CalcModel is Spin system.*/
#define Kondo 2 /*!< CalcModel is Kondo model.*/
#define HubbardGC 3 /*!< CalcModel is GrandCanonical Hubbard model.*/
#define SpinGC 4 /*!< CalcModel is GrandCanonical Spin system.*/
#define KondoGC 5 /*!< CalcModel is GrandCanonical Kondo model.*/
#define HubbardNConserved 6 /*!< CalcModel is Hubbard model under particle number conserved. This symmetry is automatically introduced by not defining 2Sz in a modpara file.*/
#define SpinlessFermion 7 /*!< CalcModel is GrandCanonical Spinless fermion model.*/
#define SpinlessFermionGC 8 /*!< CalcModel is GrandCanonical Spinless fermionGC model.*/
#define tJ 9 /*!< CalcModel is Canonical tJ model.*/
#define tJGC 10 /*!< CalcModel is GrandCanonical tJ model.*/
#define tJNConserved 11 /*!< CalcModel is Canonical w/o Sz conservation tJ model*/
#define KondoNConserved 12 /*!< CalcModel is Kondo model under particle number conserved.*/

/*!< OutputMode */
#define NUM_OUTPUTMODE 2 /*!< Number of output mode.*/
Expand Down
119 changes: 66 additions & 53 deletions src/include/sz.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,25 @@ int omp_sz(
long unsigned int *list_jb_
);

int omp_tJ(
long unsigned int ib,
long unsigned int ihfbit,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long unsigned int *list_jb_
);

int omp_sz_hacker(
long unsigned int ib,
long unsigned int ihfbit,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long unsigned int *list_jb_
);
long unsigned int ib,
long unsigned int ihfbit,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long unsigned int *list_jb_
);

int omp_sz_Kondo(
long unsigned int ib,
Expand All @@ -57,35 +67,35 @@ int omp_sz_KondoNConserved(
);

int omp_sz_KondoGC(
long unsigned int ib,
long unsigned int ihfbit,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long unsigned int *list_jb_
);
long unsigned int ib,
long unsigned int ihfbit,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long unsigned int *list_jb_
);

int omp_sz_spin(
long unsigned int ib,
long unsigned int ihfbit,
unsigned int N,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long unsigned int *list_jb_
);
long unsigned int ib,
long unsigned int ihfbit,
unsigned int N,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long unsigned int *list_jb_
);

int omp_sz_spin_hacker(
long unsigned int ib,
long unsigned int ihfbit,
unsigned int N,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long unsigned int *list_jb_
long unsigned int ib,
long unsigned int ihfbit,
unsigned int N,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long unsigned int *list_jb_
);

int omp_sz_Kondo_hacker(
Expand All @@ -100,30 +110,30 @@ int omp_sz_Kondo_hacker(


int omp_sz_GeneralSpin(
long unsigned int ib,
long unsigned int ihfbit,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long int *list_2_1_Sz_,
long int *list_2_2_Sz_,
long unsigned int *list_jb_
);
long unsigned int ib,
long unsigned int ihfbit,
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_,
long int *list_2_1_Sz_,
long int *list_2_2_Sz_,
long unsigned int *list_jb_
);

long int Binomial(
int n,
int k,
long int **comb,
int Nsite
);
int n,
int k,
long int **comb,
int Nsite
);

int sz(
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_
);
struct BindStruct *X,
long unsigned int *list_1_,
long unsigned int *list_2_1_,
long unsigned int *list_2_2_
);

int Read_sz(
struct BindStruct *X,
Expand All @@ -147,4 +157,7 @@ void calculate_jb_Hubbard(struct BindStruct *X,long unsigned int *list_jb, long
void calculate_jb_Hubbard_Hacker(struct BindStruct *X,long unsigned int *list_jb, long unsigned int ihfbit, unsigned int N2);
void calculate_jb_HubbardNCoserved(struct BindStruct *X,long unsigned int *list_jb, long unsigned int ihfbit, unsigned int N2);
void calculate_jb_HubbardNCoserved_Hacker(struct BindStruct *X,long unsigned int *list_jb, long unsigned int ihfbit, unsigned int N2);
void calculate_jb_tJ(struct BindStruct *X,long unsigned int *list_jb, long unsigned int ihfbit, unsigned int N2);
void calculate_jb_tJNConserved(struct BindStruct *X,long unsigned int *list_jb, long unsigned int ihfbit, unsigned int N2);
void calculate_jb_tJGC(struct BindStruct *X,long unsigned int *list_jb, long unsigned int ihfbit, unsigned int N2);
/*[e] func. for refactoring */
Loading

0 comments on commit f1c877d

Please sign in to comment.