137 #include <bitcalc.hpp> 138 #include "mltplyCommon.hpp" 139 #include "mltplyHubbard.hpp" 140 #include "mltplyMPIHubbard.hpp" 141 #include "CalcTime.hpp" 142 #include "mltplyHubbardCore.hpp" 143 #include "mltplyMPIHubbardCore.hpp" 152 int nstate, std::complex<double> **tmp_v0,
153 std::complex<double> **tmp_v1
156 long int isite1, isite2, sigma1, sigma2;
157 long int isite3, isite4, sigma3, sigma4;
158 long int ibitsite1, ibitsite2, ibitsite3, ibitsite4;
160 std::complex<double> tmp_trans;
162 std::complex<double> tmp_V;
192 for (ihermite = 0; ihermite<2; ihermite++) {
225 if (
CheckPE(isite1 - 1, X) == TRUE ||
CheckPE(isite2 - 1, X) == TRUE ||
226 CheckPE(isite3 - 1, X) == TRUE ||
CheckPE(isite4 - 1, X) == TRUE) {
228 ibitsite1 = X->
Def.
OrgTpow[2*isite1-2+sigma1] ;
229 ibitsite2 = X->
Def.
OrgTpow[2 * isite2 - 2 + sigma2];
230 ibitsite3 = X->
Def.
OrgTpow[2 * isite3 - 2 + sigma3];
231 ibitsite4 = X->
Def.
OrgTpow[2 * isite4 - 2 + sigma4];
232 if (ibitsite1 == ibitsite2 && ibitsite3 == ibitsite4) {
235 tmp_V, X, nstate, tmp_v0, tmp_v1);
237 else if (ibitsite1 == ibitsite2 && ibitsite3 != ibitsite4) {
239 isite3 - 1, sigma3, isite4 - 1, sigma4,
240 tmp_V, X, nstate, tmp_v0, tmp_v1);
242 else if (ibitsite1 != ibitsite2 && ibitsite3 == ibitsite4) {
244 isite3 - 1, sigma3, tmp_V, X, nstate, tmp_v0, tmp_v1);
246 else if (ibitsite1 != ibitsite2 && ibitsite3 != ibitsite4) {
248 isite3 - 1, sigma3, isite4 - 1, sigma4, tmp_V, X, nstate, tmp_v0, tmp_v1);
254 for (ihermite = 0; ihermite < 2; ihermite++) {
267 sigma1, sigma2, sigma3, sigma4, tmp_V);
295 for (ihermite = 0; ihermite<2; ihermite++) {
341 int nstate, std::complex<double> **tmp_v0,
342 std::complex<double> **tmp_v1
345 long int isite1, isite2, sigma1, sigma2;
346 long int isite3, isite4, sigma3, sigma4;
347 long int ibitsite1, ibitsite2, ibitsite3, ibitsite4;
349 std::complex<double> tmp_trans;
351 std::complex<double> tmp_V;
381 for (ihermite = 0; ihermite<2; ihermite++) {
412 if (
CheckPE(isite1 - 1, X) == TRUE ||
CheckPE(isite2 - 1, X) == TRUE
413 ||
CheckPE(isite3 - 1, X) == TRUE ||
CheckPE(isite4 - 1, X) == TRUE)
416 ibitsite1 = X->
Def.
OrgTpow[2 * isite1 - 2 + sigma1];
417 ibitsite2 = X->
Def.
OrgTpow[2 * isite2 - 2 + sigma2];
418 ibitsite3 = X->
Def.
OrgTpow[2 * isite3 - 2 + sigma3];
419 ibitsite4 = X->
Def.
OrgTpow[2 * isite4 - 2 + sigma4];
420 if (ibitsite1 == ibitsite2 && ibitsite3 == ibitsite4)
422 isite1 - 1, sigma1, isite3 - 1, sigma3, tmp_V, X, nstate, tmp_v0, tmp_v1);
423 else if (ibitsite1 == ibitsite2 && ibitsite3 != ibitsite4)
425 isite1 - 1, sigma1, isite3 - 1, sigma3, isite4 - 1, sigma4, tmp_V, X, nstate, tmp_v0, tmp_v1);
426 else if (ibitsite1 != ibitsite2 && ibitsite3 == ibitsite4)
428 isite1 - 1, sigma1, isite2 - 1, sigma2, isite3 - 1, sigma3, tmp_V, X, nstate, tmp_v0, tmp_v1);
429 else if (ibitsite1 != ibitsite2 && ibitsite3 != ibitsite4)
431 isite1 - 1, sigma1, isite2 - 1, sigma2, isite3 - 1, sigma3, isite4 - 1, sigma4, tmp_V, X, nstate, tmp_v0, tmp_v1);
436 for(ihermite=0; ihermite<2; ihermite++){
449 sigma1, sigma2, sigma3, sigma4, tmp_V);
475 for (ihermite = 0; ihermite<2; ihermite++) {
524 int nstate, std::complex<double> **tmp_v0,
525 std::complex<double> **tmp_v1,
532 #pragma omp parallel for default(none) \ 533 firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1,nstate) 534 for (j = 1; j <= i_max; j++)
544 int nstate, std::complex<double> **tmp_v0,
545 std::complex<double> **tmp_v1,
552 #pragma omp parallel for default(none) \ 553 firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1,nstate) 554 for (j = 1; j <= i_max; j++)
565 std::complex<double> **tmp_v0,
566 std::complex<double> **tmp_v1,
568 std::complex<double> trans
570 long int j, isite1, isite2, Asum, Adiff;
577 #pragma omp parallel for default(none) private(j) shared(tmp_v0, tmp_v1,nstate) \ 578 firstprivate(i_max,X,Asum,Adiff,isite1,isite2,trans) 579 for (j = 1; j <= i_max; j++)
580 CisAjt(j, nstate, tmp_v0, tmp_v1, X, isite1, isite2, Asum, Adiff, trans);
589 int nstate, std::complex<double> **tmp_v0,
590 std::complex<double> **tmp_v1,
592 std::complex<double> trans
594 long int j, isite1, isite2, Asum, Adiff;
603 if (isite1 == isite2) {
604 #pragma omp parallel for default(none) \ 605 private(j) firstprivate(i_max,X,isite1, trans) shared(tmp_v0, tmp_v1,nstate) 606 for (j = 1; j <= i_max; j++)
607 GC_CisAis(j, nstate, tmp_v0, tmp_v1, isite1, trans);
610 #pragma omp parallel for default(none) private(j,tmp_off) shared(tmp_v0,tmp_v1,nstate) \ 611 firstprivate(i_max,X,Asum,Adiff,isite1,isite2,trans) 612 for (j = 1; j <= i_max; j++)
613 GC_CisAjt(j, nstate, tmp_v0, tmp_v1, isite1, isite2, Asum, Adiff, trans, &tmp_off);
623 int nstate, std::complex<double> **tmp_v0,
624 std::complex<double> **tmp_v1,
627 std::complex<double> tmp_V;
629 long int isite1, isite2, isite3, isite4;
630 long int Asum, Bsum, Adiff, Bdiff;
631 long int tmp_off = 0;
632 long int tmp_off_2 = 0;
648 #pragma omp parallel default(none) \ 649 private(j, tmp_off, tmp_off_2) \ 650 firstprivate(i_max, X, isite1, isite2, isite3, isite4, Asum, Bsum, Adiff, Bdiff, tmp_V) \ 651 shared(tmp_v0, tmp_v1,nstate) 653 if (isite1 == isite2 && isite3 == isite4) {
655 for (j = 1; j <= i_max; j++)
658 else if (isite1 == isite2 && isite3 != isite4) {
660 for (j = 1; j <= i_max; j++)
662 j, isite1, isite3, isite4, Bsum, Bdiff, tmp_V, nstate, tmp_v0, tmp_v1, X, &tmp_off);
664 else if (isite1 != isite2 && isite3 == isite4) {
666 for (j = 1; j <= i_max; j++)
667 child_CisAjtCkuAku_element(j, isite1, isite2, isite3, Asum, Adiff, tmp_V, nstate, tmp_v0, tmp_v1, X, &tmp_off);
669 else if (isite1 != isite2 && isite3 != isite4) {
671 for (j = 1; j <= i_max; j++)
673 j, isite1, isite2, isite3, isite4, Asum, Adiff, Bsum, Bdiff, tmp_V, nstate, tmp_v0, tmp_v1, X, &tmp_off_2);
684 int nstate, std::complex<double> **tmp_v0,
685 std::complex<double> **tmp_v1,
688 std::complex<double> tmp_V;
690 long int isite1, isite2, isite3, isite4;
691 long int Asum, Bsum, Adiff, Bdiff;
692 long int tmp_off = 0;
693 long int tmp_off_2 = 0;
708 #pragma omp parallel default(none) private(j) \ 709 firstprivate(i_max, X, isite1, isite2, isite4, isite3, Asum, Bsum, Adiff, Bdiff, tmp_off, tmp_off_2, tmp_V) \ 710 shared(tmp_v0, tmp_v1,nstate) 712 if (isite1 == isite2 && isite3 == isite4) {
714 for (j = 1; j <= i_max; j++)
717 else if (isite1 == isite2 && isite3 != isite4) {
719 for (j = 1; j <= i_max; j++)
720 GC_child_CisAisCjtAku_element(j, isite1, isite3, isite4, Bsum, Bdiff, tmp_V, nstate, tmp_v0, tmp_v1, &tmp_off);
722 else if (isite1 != isite2 && isite3 == isite4) {
724 for (j = 1; j <= i_max; j++)
726 j, isite1, isite2, isite3, Asum, Adiff, tmp_V, nstate, tmp_v0, tmp_v1, &tmp_off);
728 else if (isite1 != isite2 && isite3 != isite4) {
730 for (j = 1; j <= i_max; j++)
732 j, isite1, isite2, isite3, isite4, Asum, Adiff, Bsum, Bdiff, tmp_V,
733 nstate, tmp_v0, tmp_v1, &tmp_off_2);
744 int nstate, std::complex<double> **tmp_v0,
745 std::complex<double> **tmp_v1,
752 #pragma omp parallel for default(none) \ 753 firstprivate(i_max,X,off) private(j) shared(tmp_v0, tmp_v1,nstate) 754 for (j = 1; j <= i_max; j++)
765 int nstate, std::complex<double> **tmp_v0,
766 std::complex<double> **tmp_v1,
773 #pragma omp parallel for default(none) \ 774 firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1,nstate) 775 for (j = 1; j <= i_max; j++)
int child_exchange_GetInfo(int iExchange, struct BindStruct *X)
Compute mask for bit operation of exchange term.
int mltplyHubbard(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
perform Hamiltonian vector product for (extended) Hubbard type model.
struct DefineList Def
Definision of system (Hamiltonian) etc.
std::complex< double > * EDParaGeneralTransfer
Value of general transfer integrals by a def file. malloc in setmem_def(). Data Format [DefineList::N...
void GC_child_general_hopp_MPIsingle(long int itrans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Hubbard + GC When only site2 is in the inter process region.
void child_CisAjtCkuAku_element(long int j, long int isite1, long int isite2, long int isite3, long int Asum, long int Adiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute term of canonical Hubbard system.
long int is2_spin
Mask used in the bit oeration.
void GC_child_general_hopp_MPIdouble(long int itrans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Hubbard + GC When both site1 and site2 are in the inter process region.
void child_general_hopp(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, std::complex< double > trans)
Compute hopping (canonical)
long int * OrgTpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
void GC_CisAjt(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int is1_spin, long int is2_spin, long int sum_spin, long int diff_spin, std::complex< double > tmp_V, long int *tmp_off)
term for grandcanonical Hubbard
int ** ExchangeCoupling
[DefineList::NExchangeCoupling][2] Index of exchange term. malloc in setmem_def().
void X_child_CisAisCjtAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_isite4, int org_ispin4, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of canonical Hubbard system.
std::complex< double > tmp_trans
Hopping parameter.
void child_exchange_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute exchange term of canonical-Hubbard.
int Nsite
Number of sites in the INTRA process region.
void GC_child_exchange_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute exchange term of grandcanonical Hubbard system.
struct LargeList Large
Variables for Matrix-Vector product.
void child_general_int(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute inter-all term (canonical)
int ** EDGeneralTransfer
Index of transfer integrals for calculation. malloc in setmem_def(). Data Format [DefineList::NTransf...
void 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, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of canonical Hubbard system.
void GC_child_CisAisCjtAku_element(long int j, long int isite1, long int isite3, long int isite4, long int Bsum, long int Bdiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int *tmp_off)
Compute term of grandcanonical Hubbard system.
long int is4_spin
Mask used in the bit oeration.
void 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, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical Hubbard system.
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
void X_child_CisAjtCkuAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, int org_isite3, int org_ispin3, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of canonical Hubbard system.
long int A_spin
Mask used in the bit oeration.
int ** PairHopping
[DefineList::NPairHopping][2] Index of pair-hopping. malloc in setmem_def().
void GC_CisAis(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int is1_spin, std::complex< double > tmp_trans)
Operation of (Grandcanonical)
long int B_spin
Mask used in the bit oeration.
int EDNTransfer
Number of transfer integrals for calculation.
int child_pairhopp_GetInfo(int iPairHopp, struct BindStruct *X)
Compute mask for bit operation of pairhop term.
double * ParaExchangeCoupling
[DefineList::NExchangeCoupling] Coupling constant of exchange term. malloc in setmem_def().
void GC_child_general_int(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute inter-all term (canonical)
void X_GC_child_CisAjtCkuAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, int org_isite3, int org_ispin3, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical Hubbard system.
void child_CisAisCjtAku_element(long int j, long int isite1, long int isite3, long int isite4, long int Bsum, long int Bdiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute term of canonical Hubbard system.
void child_general_hopp_MPIsingle(long int itrans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Hubbard (Kondo) + Canonical ensemble When only site2 is in the inter process region...
void GC_child_pairhopp(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute pairhopp term (grandcanonical)
void GC_child_pairhopp_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute pairhopp term of grandcanonical Hubbard system.
long int i_max
Length of eigenvector.
void child_exchange(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute Exchange term (canonical) in single process.
int NExchangeCoupling
Number of exchange term.
void GC_child_CisAjtCkuAlv_element(long int j, long int isite1, long int isite2, long int isite3, long int isite4, long int Asum, long int Adiff, long int Bsum, long int Bdiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int *tmp_off_2)
Compute term of grandcanonical Hubbard system.
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
int mltplyHubbardGC(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
perform Hamiltonian vector product for (extended) Hubbard type model (Grandcanonical).
void StopTimer(int n)
function for calculating elapse time [elapse time=StartTimer-StopTimer]
int NInterAll_OffDiagonal
Number of interall term (off-diagonal)
void child_pairhopp_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Compute pairhopp term of canonical Hubbard system.
void child_CisAjtCkuAlv_element(long int j, long int isite1, long int isite2, long int isite3, long int isite4, long int Asum, long int Adiff, long int Bsum, long int Bdiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off_2)
Compute term of canonical Hubbard system.
double * ParaPairHopping
[DefineList::NPairHopping] Coupling constant of pair-hopping term. malloc in setmem_def().
int child_general_hopp_GetInfo(struct BindStruct *X, long int isite1, long int isite2, long int sigma1, long int sigma2)
Compute mask for bit operation of hopping term.
void GC_child_exchange(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute Exchange term (grandcanonical) in single process.
void child_CisAisCisAis_element(long int j, long int isite1, long int isite3, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of canonical Hubbard system.
int child_general_int_GetInfo(struct BindStruct *X, long int isite1, long int isite2, long int isite3, long int isite4, long int sigma1, long int sigma2, long int sigma3, long int sigma4, std::complex< double > tmp_V)
Compute mask for bit operation of general interaction term.
void X_GC_child_CisAisCjtAku_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_isite4, int org_ispin4, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical Hubbard system.
void child_pairhopp(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute pairhopp term (canonical)
int NPairHopping
Number of pair-hopping term.
long int is3_spin
Mask used in the bit oeration.
long int is1_spin
Mask used in the bit oeration.
void X_child_CisAisCjtAjt_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of canonical Hubbard system.
int CheckPE(int org_isite, struct BindStruct *X)
Check whether this site is in the inter process region or not.
void GC_child_general_hopp(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, std::complex< double > trans)
Commpute hopping term (grandcanonical)
long int isA_spin
Mask used in the bit oeration.
void child_general_hopp_MPIdouble(long int itrans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Hubbard (Kondo) + Canonical ensemble When both site1 and site2 are in the inter proce...
void CisAjt(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int is1_spin, long int is2_spin, long int sum_spin, long int diff_spin, std::complex< double > tmp_V)
term for canonical Hubbard
void GC_child_CisAjtCkuAku_element(long int j, long int isite1, long int isite2, long int isite3, long int Asum, long int Adiff, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int *tmp_off)
Compute term of grandcanonical Hubbard system.
long int isB_spin
Mask used in the bit oeration.
void GC_child_CisAisCisAis_element(long int j, long int isite1, long int isite3, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical Hubbard system.
void StartTimer(int n)
function for initializing elapse time [start]
void X_GC_child_CisAisCjtAjt_Hubbard_MPI(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, std::complex< double > tmp_V, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical Hubbard system.
std::complex< double > tmp_V
Coupling constant.