138 #include "mltplyCommon.h" 139 #include "mltplyHubbard.h" 140 #include "mltplyMPIHubbard.h" 141 #include "CalcTime.h" 142 #include "mltplyHubbardCore.h" 143 #include "mltplyMPIHubbardCore.h" 152 double complex *tmp_v0,
153 double complex *tmp_v1
156 long unsigned int isite1, isite2, sigma1, sigma2;
157 long unsigned int isite3, isite4, sigma3, sigma4;
158 long unsigned int ibitsite1, ibitsite2, ibitsite3, ibitsite4;
160 double complex dam_pr;
161 double complex tmp_trans;
163 double complex tmp_V;
193 for (ihermite = 0; ihermite<2; ihermite++) {
231 ibitsite1 = X->
Def.
OrgTpow[2*isite1-2+sigma1] ;
232 ibitsite2 = X->
Def.
OrgTpow[2 * isite2 - 2 + sigma2];
233 ibitsite3 = X->
Def.
OrgTpow[2 * isite3 - 2 + sigma3];
234 ibitsite4 = X->
Def.
OrgTpow[2 * isite4 - 2 + sigma4];
235 if (ibitsite1 == ibitsite2 && ibitsite3 == ibitsite4) {
238 tmp_V, X, tmp_v0, tmp_v1);
240 else if (ibitsite1 == ibitsite2 && ibitsite3 != ibitsite4) {
242 isite3 - 1, sigma3, isite4 - 1, sigma4,
243 tmp_V, X, tmp_v0, tmp_v1);
245 else if (ibitsite1 != ibitsite2 && ibitsite3 == ibitsite4) {
247 isite3 - 1, sigma3, tmp_V, X, tmp_v0, tmp_v1);
249 else if (ibitsite1 != ibitsite2 && ibitsite3 != ibitsite4) {
251 isite3 - 1, sigma3, isite4 - 1, sigma4, tmp_V, X, tmp_v0, tmp_v1);
257 for (ihermite = 0; ihermite < 2; ihermite++) {
270 sigma1, sigma2, sigma3, sigma4, tmp_V);
300 for (ihermite = 0; ihermite<2; ihermite++) {
349 double complex *tmp_v0,
350 double complex *tmp_v1
353 long unsigned int isite1, isite2, sigma1, sigma2;
354 long unsigned int isite3, isite4, sigma3, sigma4;
355 long unsigned int ibitsite1, ibitsite2, ibitsite3, ibitsite4;
357 double complex dam_pr;
358 double complex tmp_trans;
360 double complex tmp_V;
390 for (ihermite = 0; ihermite<2; ihermite++) {
426 ibitsite1 = X->
Def.
OrgTpow[2 * isite1 - 2 + sigma1];
427 ibitsite2 = X->
Def.
OrgTpow[2 * isite2 - 2 + sigma2];
428 ibitsite3 = X->
Def.
OrgTpow[2 * isite3 - 2 + sigma3];
429 ibitsite4 = X->
Def.
OrgTpow[2 * isite4 - 2 + sigma4];
430 if (ibitsite1 == ibitsite2 && ibitsite3 == ibitsite4)
432 isite1 - 1, sigma1, isite3 - 1, sigma3, tmp_V, X, tmp_v0, tmp_v1);
433 else if (ibitsite1 == ibitsite2 && ibitsite3 != ibitsite4)
435 isite1 - 1, sigma1, isite3 - 1, sigma3, isite4 - 1, sigma4, tmp_V, X, tmp_v0, tmp_v1);
436 else if (ibitsite1 != ibitsite2 && ibitsite3 == ibitsite4)
438 isite1 - 1, sigma1, isite2 - 1, sigma2, isite3 - 1, sigma3, tmp_V, X, tmp_v0, tmp_v1);
439 else if (ibitsite1 != ibitsite2 && ibitsite3 != ibitsite4)
441 isite1 - 1, sigma1, isite2 - 1, sigma2, isite3 - 1, sigma3, isite4 - 1, sigma4, tmp_V, X, tmp_v0, tmp_v1);
447 for(ihermite=0; ihermite<2; ihermite++){
460 sigma1, sigma2, sigma3, sigma4, tmp_V);
488 for (ihermite = 0; ihermite<2; ihermite++) {
541 double complex *tmp_v0,
542 double complex *tmp_v1,
547 long unsigned int off = 0;
548 double complex dam_pr = 0.0;
550 #pragma omp parallel for default(none) reduction(+:dam_pr) firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1) 551 for (j = 1; j <= i_max; j++)
562 double complex *tmp_v0,
563 double complex *tmp_v1,
568 long unsigned int off = 0;
569 double complex dam_pr = 0;
571 #pragma omp parallel for default(none) reduction(+:dam_pr) firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1) 572 for (j = 1; j <= i_max; j++)
583 double complex *tmp_v0,
584 double complex *tmp_v1,
588 long unsigned int j, isite1, isite2, Asum, Adiff;
590 double complex dam_pr = 0;
597 #pragma omp parallel for default(none) reduction(+:dam_pr) \ 598 firstprivate(i_max,X,Asum,Adiff,isite1,isite2,trans) private(j) shared(tmp_v0, tmp_v1) 599 for (j = 1; j <= i_max; j++)
600 dam_pr +=
CisAjt(j, tmp_v0, tmp_v1, X, isite1, isite2, Asum, Adiff, trans) * trans;
610 double complex *tmp_v0,
611 double complex *tmp_v1,
615 long unsigned int j, isite1, isite2, Asum, Adiff;
616 long unsigned int tmp_off;
618 double complex dam_pr = 0;
625 if (isite1 == isite2) {
626 #pragma omp parallel for default(none) reduction(+:dam_pr) \ 627 private(j) firstprivate(i_max,X,isite1, trans) shared(tmp_v0, tmp_v1) 628 for (j = 1; j <= i_max; j++)
629 dam_pr +=
GC_CisAis(j, tmp_v0, tmp_v1, X, isite1, trans) * trans;
632 #pragma omp parallel for default(none) reduction(+:dam_pr) \ 633 firstprivate(i_max,X,Asum,Adiff,isite1,isite2,trans) private(j,tmp_off) shared(tmp_v0, tmp_v1) 634 for (j = 1; j <= i_max; j++)
635 dam_pr +=
GC_CisAjt(j, tmp_v0, tmp_v1, X, isite1, isite2, Asum, Adiff, trans, &tmp_off) * trans;
646 double complex *tmp_v0,
647 double complex *tmp_v1,
650 double complex dam_pr, tmp_V;
651 long unsigned int j, i_max;
652 long unsigned int isite1, isite2, isite3, isite4;
653 long unsigned int Asum, Bsum, Adiff, Bdiff;
654 long unsigned int tmp_off = 0;
655 long unsigned int tmp_off_2 = 0;
672 #pragma omp parallel default(none) reduction(+:dam_pr) \ 673 private(j, tmp_off, tmp_off_2) \ 674 firstprivate(i_max, X, isite1, isite2, isite3, isite4, Asum, Bsum, Adiff, Bdiff, tmp_V) \ 675 shared(tmp_v0, tmp_v1) 677 if (isite1 == isite2 && isite3 == isite4) {
679 for (j = 1; j <= i_max; j++)
682 else if (isite1 == isite2 && isite3 != isite4) {
684 for (j = 1; j <= i_max; j++)
686 j, isite1, isite3, isite4, Bsum, Bdiff, tmp_V, tmp_v0, tmp_v1, X, &tmp_off);
688 else if (isite1 != isite2 && isite3 == isite4) {
690 for (j = 1; j <= i_max; j++)
691 dam_pr +=
child_CisAjtCkuAku_element(j, isite1, isite2, isite3, Asum, Adiff, tmp_V, tmp_v0, tmp_v1, X, &tmp_off);
693 else if (isite1 != isite2 && isite3 != isite4) {
695 for (j = 1; j <= i_max; j++)
697 j, isite1, isite2, isite3, isite4, Asum, Adiff, Bsum, Bdiff, tmp_V, tmp_v0, tmp_v1, X, &tmp_off_2);
709 double complex *tmp_v0,
710 double complex *tmp_v1,
713 double complex dam_pr, tmp_V;
714 long unsigned int j, i_max;
715 long unsigned int isite1, isite2, isite3, isite4;
716 long unsigned int Asum, Bsum, Adiff, Bdiff;
717 long unsigned int tmp_off = 0;
718 long unsigned int tmp_off_2 = 0;
734 #pragma omp parallel default(none) reduction(+:dam_pr) private(j) \ 735 firstprivate(i_max, X, isite1, isite2, isite4, isite3, Asum, Bsum, Adiff, Bdiff, tmp_off, tmp_off_2, tmp_V) \ 736 shared(tmp_v0, tmp_v1) 738 if (isite1 == isite2 && isite3 == isite4) {
740 for (j = 1; j <= i_max; j++)
743 else if (isite1 == isite2 && isite3 != isite4) {
745 for (j = 1; j <= i_max; j++)
746 dam_pr +=
GC_child_CisAisCjtAku_element(j, isite1, isite3, isite4, Bsum, Bdiff, tmp_V, tmp_v0, tmp_v1, X, &tmp_off);
748 else if (isite1 != isite2 && isite3 == isite4) {
750 for (j = 1; j <= i_max; j++)
752 j, isite1, isite2, isite3, Asum, Adiff, tmp_V, tmp_v0, tmp_v1, X, &tmp_off);
754 else if (isite1 != isite2 && isite3 != isite4) {
756 for (j = 1; j <= i_max; j++)
758 j, isite1, isite2, isite3, isite4, Asum, Adiff, Bsum, Bdiff, tmp_V, tmp_v0, tmp_v1, X, &tmp_off_2);
770 double complex *tmp_v0,
771 double complex *tmp_v1,
776 long unsigned int off = 0;
777 double complex dam_pr = 0.0;
779 #pragma omp parallel for default(none) reduction(+:dam_pr) firstprivate(i_max,X,off) private(j) shared(tmp_v0, tmp_v1) 780 for (j = 1; j <= i_max; j++)
792 double complex *tmp_v0,
793 double complex *tmp_v1,
798 long unsigned int off = 0;
799 double complex dam_pr = 0.0;
801 #pragma omp parallel for default(none) \ 802 reduction(+:dam_pr) firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1) 803 for (j = 1; j <= i_max; j++)
struct DefineList Def
Definision of system (Hamiltonian) etc.
long unsigned int B_spin
Mask used in the bit oeration.
double complex GC_child_exchange(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X)
Compute Exchange term (grandcanonical) in single process.
void StartTimer(int n)
function for initializing elapse time [start]
int CheckPE(int org_isite, struct BindStruct *X)
Check whether this site is in the inter process region or not.
int ** ExchangeCoupling
[DefineList::NExchangeCoupling][2] Index of exchange term. malloc in setmem_def().
long unsigned int is4_spin
Mask used in the bit oeration.
void StopTimer(int n)
function for calculating elapse time [elapse time=StartTimer-StopTimer]
long unsigned int isB_spin
Mask used in the bit oeration.
int child_general_int_GetInfo(int iInterAll, struct BindStruct *X, long unsigned int isite1, long unsigned int isite2, long unsigned int isite3, long unsigned int isite4, long unsigned int sigma1, long unsigned int sigma2, long unsigned int sigma3, long unsigned int sigma4, double complex tmp_V)
Compute mask for bit operation of general interaction term.
double complex X_GC_child_CisAisCjtAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_isite4, int org_ispin4, double complex tmp_V, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term of grandcanonical Hubbard system.
double complex prdct
The expectation value of the energy.
double complex child_CisAjtCkuAku_element(long unsigned int j, long unsigned int isite1, long unsigned int isite2, long unsigned int isite3, long unsigned int Asum, long unsigned int Adiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of canonical Hubbard system.
struct LargeList Large
Variables for Matrix-Vector product.
double complex child_pairhopp_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute pairhopp term of canonical Hubbard system.
long unsigned int is1_spin
Mask used in the bit oeration.
double complex X_child_CisAisCjtAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_isite4, int org_ispin4, double complex tmp_V, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term of canonical Hubbard system.
double complex CisAjt(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int is1_spin, long unsigned int is2_spin, long unsigned int sum_spin, long unsigned int diff_spin, double complex tmp_V)
term for canonical Hubbard
int ** EDGeneralTransfer
Index of transfer integrals for calculation. malloc in setmem_def(). Data Format [DefineList::NTransf...
double complex * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
double complex X_child_CisAisCjtAjt_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, double complex tmp_V, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term of canonical Hubbard system.
double complex GC_child_pairhopp_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute pairhopp term of grandcanonical Hubbard system.
unsigned int NInterAll_OffDiagonal
Number of interall term (off-diagonal)
long unsigned int is3_spin
Mask used in the bit oeration.
double complex GC_CisAjt(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int is1_spin, long unsigned int is2_spin, long unsigned int sum_spin, long unsigned int diff_spin, double complex tmp_V, long unsigned int *tmp_off)
term for grandcanonical Hubbard
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
double complex child_exchange_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute exchange term of canonical-Hubbard.
long unsigned int * OrgTpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
void GC_child_general_hopp_MPIdouble(unsigned long int itrans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard + GC When both site1 and site2 are in the inter process region.
int ** PairHopping
[DefineList::NPairHopping][2] Index of pair-hopping. malloc in setmem_def().
double complex X_GC_child_CisAisCjtAjt_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, double complex tmp_V, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term of grandcanonical Hubbard system.
double complex GC_child_exchange_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute exchange term of grandcanonical Hubbard system.
double complex child_general_hopp(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, double complex trans)
Compute hopping (canonical)
double complex tmp_trans
Hopping parameter.
long unsigned int A_spin
Mask used in the bit oeration.
double * ParaExchangeCoupling
[DefineList::NExchangeCoupling] Coupling constant of exchange term. malloc in setmem_def().
unsigned int Nsite
Number of sites in the INTRA process region.
double complex * EDParaGeneralTransfer
Value of general transfer integrals by a def file. malloc in setmem_def(). Data Format [DefineList::N...
void child_general_hopp_MPIdouble(unsigned long int itrans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard (Kondo) + Canonical ensemble When both site1 and site2 are in the inter proce...
int child_pairhopp_GetInfo(int iPairHopp, struct BindStruct *X)
Compute mask for bit operation of pairhop term.
double complex X_child_CisAjtCkuAlv_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, int org_isite3, int org_ispin3, int org_isite4, int org_ispin4, double complex tmp_V, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term of canonical Hubbard system.
double complex GC_child_general_int(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X)
Compute inter-all term (canonical)
double complex X_child_CisAjtCkuAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, int org_isite3, int org_ispin3, double complex tmp_V, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term of canonical Hubbard system.
long int i_max
Length of eigenvector.
double complex GC_child_pairhopp(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X)
Compute pairhopp term (grandcanonical)
double complex GC_child_CisAisCisAis_element(long unsigned int j, long unsigned int isite1, long unsigned int isite3, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of grandcanonical Hubbard system.
void GC_child_general_hopp_MPIsingle(unsigned long int itrans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard + GC When only site2 is in the inter process region.
double complex child_general_int(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X)
Compute inter-all term (canonical)
unsigned int NExchangeCoupling
Number of exchange term.
double complex X_GC_child_CisAjtCkuAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, int org_isite3, int org_ispin3, double complex tmp_V, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term of grandcanonical Hubbard system.
double complex child_pairhopp(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X)
Compute pairhopp term (canonical)
unsigned int NPairHopping
Number of pair-hopping term.
long unsigned int is2_spin
Mask used in the bit oeration.
int child_general_hopp_GetInfo(struct BindStruct *X, unsigned long int isite1, unsigned long int isite2, unsigned long int sigma1, unsigned long int sigma2)
Compute mask for bit operation of hopping term.
double complex child_CisAisCisAis_element(long unsigned int j, long unsigned int isite1, long unsigned int isite3, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of canonical Hubbard system.
double complex tmp_V
Coupling constant.
double * ParaPairHopping
[DefineList::NPairHopping] Coupling constant of pair-hopping term. malloc in setmem_def().
int mltplyHubbardGC(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
perform Hamiltonian vector product for (extended) Hubbard type model (Grandcanonical).
unsigned int EDNTransfer
Number of transfer integrals for calculation.
long unsigned int isA_spin
Mask used in the bit oeration.
double complex X_GC_child_CisAjtCkuAlv_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, int org_isite3, int org_ispin3, int org_isite4, int org_ispin4, double complex tmp_V, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term of grandcanonical Hubbard system.
double complex GC_child_general_hopp(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, double complex trans)
Commpute hopping term (grandcanonical)
double complex child_exchange(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X)
Compute Exchange term (canonical) in single process.
void child_general_hopp_MPIsingle(unsigned long int itrans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard (Kondo) + Canonical ensemble When only site2 is in the inter process region...
int child_exchange_GetInfo(int iExchange, struct BindStruct *X)
Compute mask for bit operation of exchange term.
double complex GC_child_CisAisCjtAku_element(long unsigned int j, long unsigned int isite1, long unsigned int isite3, long unsigned int isite4, long unsigned int Bsum, long unsigned int Bdiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of grandcanonical Hubbard system.
double complex GC_child_CisAjtCkuAku_element(long unsigned int j, long unsigned int isite1, long unsigned int isite2, long unsigned int isite3, long unsigned int Asum, long unsigned int Adiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of grandcanonical Hubbard system.
double complex child_CisAjtCkuAlv_element(long unsigned int j, long unsigned int isite1, long unsigned int isite2, long unsigned int isite3, long unsigned int isite4, long unsigned int Asum, long unsigned int Adiff, long unsigned int Bsum, long unsigned int Bdiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off_2)
Compute term of canonical Hubbard system.
double complex GC_CisAis(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int is1_spin, double complex tmp_trans)
Operation of (Grandcanonical)
double complex GC_child_CisAjtCkuAlv_element(long unsigned int j, long unsigned int isite1, long unsigned int isite2, long unsigned int isite3, long unsigned int isite4, long unsigned int Asum, long unsigned int Adiff, long unsigned int Bsum, long unsigned int Bdiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off_2)
Compute term of grandcanonical Hubbard system.
int mltplyHubbard(struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
perform Hamiltonian vector product for (extended) Hubbard type model.
double complex child_CisAisCjtAku_element(long unsigned int j, long unsigned int isite1, long unsigned int isite3, long unsigned int isite4, long unsigned int Bsum, long unsigned int Bdiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of canonical Hubbard system.