159 #include <bitcalc.hpp> 160 #include "common/setmemory.hpp" 161 #include "mltplyCommon.hpp" 162 #include "mltplySpin.hpp" 163 #include "CalcTime.hpp" 164 #include "mltplySpinCore.hpp" 165 #include "mltplyHubbardCore.hpp" 166 #include "mltplyMPISpin.hpp" 167 #include "mltplyMPISpinCore.hpp" 175 int nstate, std::complex<double> **tmp_v0,
176 std::complex<double> **tmp_v1
192 int nstate, std::complex<double> **tmp_v0,
193 std::complex<double> **tmp_v1
196 long int isite1, isite2, sigma1, sigma2;
197 long int sigma3, sigma4;
200 std::complex<double> tmp_V;
230 for (ihermite = 0; ihermite<2; ihermite++) {
296 int nstate, std::complex<double> **tmp_v0,
297 std::complex<double> **tmp_v1
302 long int tmp_off = 0;
303 long int tmp_off2 = 0;
305 long int isite1, isite2, sigma1, sigma2;
306 long int sigma3, sigma4;
310 std::complex<double> tmp_V;
345 for (ihermite = 0; ihermite < 2; ihermite++) {
354 #pragma omp parallel for default(none) \ 355 private(j,tmp_sgn,off,tmp_off,tmp_off2) \ 356 firstprivate(i_max,isite1,isite2,sigma1,sigma2,sigma3,sigma4,X,tmp_V,ihfbit) \ 357 shared(tmp_v0,tmp_v1,list_1,list_2_1,list_2_2,one,nstate) 358 for (j = 1; j <= i_max; j++) {
360 if (tmp_sgn == TRUE) {
362 if (tmp_sgn == TRUE) {
364 zaxpy_(&nstate, &tmp_V, &tmp_v1[j][0], &one, &tmp_v0[off][0], &one);
383 int nstate, std::complex<double> **tmp_v0,
384 std::complex<double> **tmp_v1
392 if(iret != 0)
return iret;
403 int nstate, std::complex<double> **tmp_v0,
404 std::complex<double> **tmp_v1
409 long int is1_spin = 0;
410 long int isite1, isite2, sigma1, sigma2;
411 long int sigma3, sigma4;
412 std::complex<double> tmp_trans;
415 std::complex<double> tmp_V;
431 fprintf(stderr,
"Transverse_OffDiagonal component is illegal.\n");
438 X, nstate, tmp_v0, tmp_v1);
444 for(ihermite=0; ihermite<2; ihermite++){
456 fprintf(stderr,
"Transverse_OffDiagonal component is illegal.\n");
461 is1_spin = X->
Def.
Tpow[isite1 - 1];
462 #pragma omp parallel for default(none) \ 463 private(j, tmp_sgn) firstprivate(i_max, is1_spin, sigma2, X,off, tmp_trans) \ 464 shared(tmp_v0, tmp_v1,one,nstate) 465 for (j = 1; j <= i_max; j++) {
468 zaxpy_(&nstate, &tmp_trans, &tmp_v1[j][0], &one, &tmp_v0[off + 1][0], &one);
500 for (ihermite = 0; ihermite < 2; ihermite++) {
605 int nstate, std::complex<double> **tmp_v0,
606 std::complex<double> **tmp_v1
611 long int tmp_off = 0;
612 long int isite1, isite2, sigma1, sigma2;
613 long int sigma3, sigma4;
614 std::complex<double> tmp_trans;
618 std::complex<double> tmp_V;
637 if (isite1 == isite2) {
638 if (sigma1 != sigma2) {
641 isite1 - 1, sigma1, sigma2, tmp_trans, X, nstate, tmp_v0, tmp_v1);
644 for (ihermite = 0; ihermite<2; ihermite++) {
653 #pragma omp parallel for default(none) \ 654 private(j, tmp_sgn, num1) firstprivate(i_max, isite1, sigma1, sigma2, X, off, tmp_trans) \ 655 shared(tmp_v0, tmp_v1,one,nstate) 656 for (j = 1; j <= i_max; j++) {
660 zaxpy_(&nstate, &tmp_trans, &tmp_v1[j][0], &one, &tmp_v0[off + 1][0], &one);
667 fprintf(stderr,
"Error: Transverse_Diagonal component must be absorbed !");
699 for (ihermite = 0; ihermite < 2; ihermite++) {
709 if (sigma1 == sigma2) {
710 if (sigma3 == sigma4) {
711 fprintf(stderr,
"InterAll_OffDiagonal component is illegal.\n");
716 #pragma omp parallel for default(none) \ 717 private(j, tmp_sgn, off) \ 718 firstprivate(i_max, isite1, isite2, sigma1, sigma3, sigma4, X, tmp_V) \ 719 shared(tmp_v0, tmp_v1,one,nstate) 720 for (j = 1; j <= i_max; j++) {
723 if (tmp_sgn == TRUE) {
725 if (tmp_sgn == TRUE) {
726 zaxpy_(&nstate, &tmp_V, &tmp_v1[j][0], &one, &tmp_v0[off + 1][0], &one);
732 else if (sigma3 == sigma4) {
734 #pragma omp parallel for default(none) \ 735 private(j, tmp_sgn, off, tmp_off) \ 736 firstprivate(i_max, isite1, isite2, sigma1, sigma2, sigma3, sigma4, X, tmp_V) \ 737 shared(tmp_v0, tmp_v1,one,nstate) 738 for (j = 1; j <= i_max; j++) {
740 if (tmp_sgn == TRUE) {
743 if (tmp_sgn == TRUE) {
744 zaxpy_(&nstate, &tmp_V, &tmp_v1[j][0], &one, &tmp_v0[off + 1][0], &one);
750 #pragma omp parallel for default(none) \ 751 private(j, tmp_sgn, off, tmp_off) \ 752 firstprivate(i_max, isite1, isite2, sigma1, sigma2, sigma3, sigma4, X, tmp_V) \ 753 shared(tmp_v0, tmp_v1,one,nstate) 754 for (j = 1; j <= i_max; j++) {
757 if (tmp_sgn == TRUE) {
760 if (tmp_sgn == TRUE) {
761 zaxpy_(&nstate, &tmp_V, &tmp_v1[j][0], &one, &tmp_v0[off + 1][0], &one);
786 int nstate, std::complex<double> **tmp_v0,
787 std::complex<double> **tmp_v1,
794 #pragma omp parallel for default(none) \ 795 firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1,nstate) 796 for (j = 1; j <= i_max; j++)
805 int nstate, std::complex<double> **tmp_v0,
806 std::complex<double> **tmp_v1,
813 #pragma omp parallel for default(none) \ 814 firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1,nstate) 815 for (j = 1; j <= i_max; j++)
824 int nstate, std::complex<double> **tmp_v0,
825 std::complex<double> **tmp_v1,
832 #pragma omp parallel for default(none) \ 833 firstprivate(i_max, X,off) private(j) shared(tmp_v0, tmp_v1,nstate) 834 for (j = 1; j <= i_max; j++)
843 int nstate, std::complex<double> **tmp_v0,
844 std::complex<double> **tmp_v1,
847 std::complex<double> tmp_V, dmv;
849 long int org_sigma2, org_sigma4;
850 long int isA_up, isB_up;
851 long int tmp_off = 0;
862 #pragma omp parallel for default(none) private(j, tmp_sgn, dmv) \ 863 firstprivate(i_max,X,isA_up,isB_up,org_sigma2,org_sigma4,tmp_off,tmp_V) \ 864 shared(tmp_v1, tmp_v0,one,nstate) 865 for (j = 1; j <= i_max; j++) {
868 dmv = (std::complex<double>)tmp_sgn * tmp_V;
869 zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[tmp_off][0], &one);
879 int nstate, std::complex<double> **tmp_v0,
880 std::complex<double> **tmp_v1,
883 std::complex<double> tmp_V;
885 long int org_isite1, org_isite2;
886 long int org_sigma1, org_sigma2, org_sigma3, org_sigma4;
887 long int isA_up, isB_up;
888 long int tmp_off = 0;
898 isA_up = X->
Def.
Tpow[org_isite1 - 1];
899 isB_up = X->
Def.
Tpow[org_isite2 - 1];
901 #pragma omp parallel default(none) \ 902 private(j) shared(tmp_v0,tmp_v1,nstate) \ 903 firstprivate(i_max,X,isA_up,isB_up,org_sigma1,org_sigma2,org_sigma3,org_sigma4,tmp_off,tmp_V) 905 if (org_sigma1 == org_sigma2 && org_sigma3 == org_sigma4) {
907 for (j = 1; j <= i_max; j++)
909 j, isA_up, isB_up, org_sigma2, org_sigma4, tmp_V, nstate, tmp_v0, tmp_v1);
911 else if (org_sigma1 == org_sigma2 && org_sigma3 != org_sigma4) {
913 for (j = 1; j <= i_max; j++)
915 j, org_sigma2, org_sigma4, isA_up, isB_up, tmp_V, nstate, tmp_v0, tmp_v1, &tmp_off);
917 else if (org_sigma1 != org_sigma2 && org_sigma3 == org_sigma4) {
919 for (j = 1; j <= i_max; j++)
921 j, org_sigma2, org_sigma4, isA_up, isB_up, tmp_V, nstate, tmp_v0, tmp_v1, &tmp_off);
923 else if (org_sigma1 != org_sigma2 && org_sigma3 != org_sigma4) {
925 for (j = 1; j <= i_max; j++)
927 j, org_sigma2, org_sigma4, isA_up, isB_up, tmp_V, nstate, tmp_v0, tmp_v1, &tmp_off);
struct DefineList Def
Definision of system (Hamiltonian) etc.
int mltplyGeneralSpin(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Driver function for General Spin hamiltonian.
std::complex< double > * EDParaGeneralTransfer
Value of general transfer integrals by a def file. malloc in setmem_def(). Data Format [DefineList::N...
void GC_child_pairlift_spin(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute pair-lift term of spin Hamiltonian (grandcanonical)
int BitCheckGeneral(const long int org_bit, const int org_isite, const int target_ispin, const long int *SiteToBit, const long int *Tpow)
bit check function for general spin
void GC_child_CisAisCisAis_spin_element(long int j, long int isA_up, long int isB_up, long int org_sigma2, long int org_sigma4, std::complex< double > tmp_V, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term of grandcanonical spsin system.
long int is2_spin
Mask used in the bit oeration.
void GC_child_pairlift_spin_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Multiply Hamiltonian of pairlift term of grandcanonical spin system.
void child_general_int_spin_MPIdouble(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Exchange term in Spin model When both site1 and site2 are in the inter process region.
void GC_child_CisAisCitAiu_spin_element(long int j, long int org_sigma2, long int org_sigma4, long int isA_up, long int isB_up, 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 spsin system.
int ** ExchangeCoupling
[DefineList::NExchangeCoupling][2] Index of exchange term. malloc in setmem_def().
int NPairLiftCoupling
Number of pair-lift term.
int X_child_exchange_spin_element(long int j, struct BindStruct *X, long int isA_up, long int isB_up, long int sigmaA, long int sigmaB, long int *tmp_off)
Compute index of final wavefunction associated to spin-exchange term.
int Nsite
Number of sites in the INTRA process region.
void GC_child_general_int_spin_MPIdouble(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
int child_general_int_spin_GetInfo(struct BindStruct *X, long int isite1, long int isite2, long int sigma1, long int sigma2, long int sigma3, long int sigma4, std::complex< double > tmp_V)
Set parameters for the bit operation of spin-general interaction term.
long int is1_up
Mask used in the bit oeration.
int mltplySpinGC(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Driver function for Spin hamiltonian.
struct LargeList Large
Variables for Matrix-Vector product.
void child_exchange_spin(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute exchange term of spin Hamiltonian (canonical)
void X_GC_child_CisAitCiuAiv_spin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, std::complex< double > tmp_J, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Exchange and Pairlifting term in Spin model + GC When only site2 is in the inter process region...
int ** EDGeneralTransfer
Index of transfer integrals for calculation. malloc in setmem_def(). Data Format [DefineList::NTransf...
void GC_child_general_int_spin(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute Inter-All term of spin Hamiltonian (grandcanonical)
int ConvertToList1GeneralSpin(const long int org_ibit, const long int ihlfbit, long int *_ilist1Comp)
function of converting component to list_1
int isite2
Is it realy used ???
void child_general_int_GeneralSpin_MPIsingle(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
long int is4_spin
Mask used in the bit oeration.
void X_GC_child_CisAit_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
void GC_child_general_int_GeneralSpin_MPIsingle(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
int mltplyHalfSpin(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Driver function for Spin 1/2 hamiltonian.
void X_child_general_int_spin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, std::complex< double > tmp_J, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
void child_general_int_GeneralSpin_MPIdouble(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
int ** PairLiftCoupling
[DefineList::NPairHopping][2] Index of pair-lift term. malloc in setmem_def().
int EDNTransfer
Number of transfer integrals for calculation.
int mltplySpin(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Driver function for Spin hamiltonian.
double * ParaExchangeCoupling
[DefineList::NExchangeCoupling] Coupling constant of exchange term. malloc in setmem_def().
int GetOffCompGeneralSpin(const long int org_ibit, const int org_isite, const int org_ispin, const int off_ispin, long int *_ioffComp, const long int *SiteToBit, const long int *Tpow)
function of getting off-diagonal component for general spin
double * ParaPairLiftCoupling
[DefineList::NPairHopping] Coupling constant of pair-lift term. malloc in setmem_def().
void GC_child_general_int_GeneralSpin_MPIdouble(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
void X_GC_child_CisAitCiuAiv_spin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, std::complex< double > tmp_J, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
term in Spin model + GC. When both site1 and site2 are in the inter process region.
int child_exchange_spin_GetInfo(int iExchange, struct BindStruct *X)
Set parameters for the bit operation of spin-exchange term.
long int i_max
Length of eigenvector.
int mltplyGeneralSpinGC(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Driver function for General Spin hamiltonian (grandcanonical)
int NExchangeCoupling
Number of exchange term.
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
int iFlgGeneralSpin
Flag for the general (Sz/=1/2) spin.
int mltplyHalfSpinGC(struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Driver function for Spin 1/2 Hamiltonian (grandcanonical)
int child_pairlift_spin_GetInfo(int iPairLift, struct BindStruct *X)
Set parameters for the bit operation of spin-pairlift term.
void StopTimer(int n)
function for calculating elapse time [elapse time=StartTimer-StopTimer]
int NInterAll_OffDiagonal
Number of interall term (off-diagonal)
void GC_child_exchange_spin_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Multiply Hamiltonian of exchange term of grandcanonical spin system.
void child_exchange_spin_element(long int j, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X, long int *tmp_off)
Multiply Hamiltonian of exchange term of canonical spin system.
void X_GC_child_CisAit_spin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Hopping term in Spin + GC When both site1 and site2 are in the inter process region.
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
void child_general_int_spin_MPIsingle(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Exchange term in Spin model When only site2 is in the inter process region.
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.
int X_SpinGC_CisAit(long int j, long int is1_spin, long int sigma2, long int *tmp_off)
Compute index of final wavefunction by term (grandcanonical).
void GC_child_general_int_spin_MPIsingle(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
General interaction term in the Spin model + GC When both site1 and site2 are in the inter process re...
long int is3_spin
Mask used in the bit oeration.
long int is1_spin
Mask used in the bit oeration.
void child_general_int_spin(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute Inter-All term of spin Hamiltonian (canonical)
void X_child_general_int_spin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, std::complex< double > tmp_J, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Exchange term in Spin model When both site1 and site2 are in the inter process region.
void GC_child_CisAitCiuAiu_spin_element(long int j, long int org_sigma2, long int org_sigma4, long int isA_up, long int isB_up, 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 spsin system.
struct CheckList Check
Size of the Hilbert space.
int isite1
Is it realy used ???
long int sdim
Dimension for Ogata-Lin ???
void GC_child_exchange_spin(int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, struct BindStruct *X)
Compute exchange term of spin Hamiltonian (grandcanonical)
long int idim_max
The dimension of the Hilbert space of this process.
long int is2_up
Mask used in the bit oeration.
void GC_child_CisAitCiuAiv_spin_element(long int j, long int org_sigma2, long int org_sigma4, long int isA_up, long int isB_up, 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 spsin system.
void StartTimer(int n)
function for initializing elapse time [start]
std::complex< double > tmp_V
Coupling constant.