21 #include "mltplyCommon.hpp" 22 #include "bitcalc.hpp" 23 #include "wrapperMPI.hpp" 24 #include "mltplyMPISpin.hpp" 25 #include "mltplyMPISpinCore.hpp" 35 int nstate, std::complex<double> **tmp_v0,
36 std::complex<double> **tmp_v1
56 std::complex<double> tmp_J,
58 int nstate, std::complex<double> **tmp_v0,
59 std::complex<double> **tmp_v1
61 int mask1, mask2, state1, state2, origin;
62 long int idim_max_buf, j, ioff;
63 std::complex<double> Jint;
66 mask1 = (int)X->
Def.
Tpow[org_isite1];
67 mask2 = (
int)X->
Def.
Tpow[org_isite3];
68 origin =
myrank ^ (mask1 + mask2);
70 state1 = (origin & mask1) / mask1;
71 state2 = (origin & mask2) / mask2;
73 if (state1 == org_ispin2 && state2 == org_ispin4) {
76 else if (state1 == org_ispin1 && state2 == org_ispin3) {
88 #pragma omp parallel for default(none) private(j, ioff) \ 89 firstprivate(idim_max_buf,Jint,X) shared(list_2_1,list_2_2,list_1buf,v1buf,tmp_v1,tmp_v0,nstate,one) 90 for (j = 1; j <= idim_max_buf; j++) {
93 zaxpy_(&nstate, &Jint, &
v1buf[j][0], &one, &tmp_v0[ioff][0], &one);
105 int nstate, std::complex<double> **tmp_v0,
106 std::complex<double> **tmp_v1
108 int mask1, mask2, num1_up, num2_up, origin, one = 1;
109 long int idim_max_buf, j, ioff, ibit_tmp;
110 std::complex<double> dmv;
112 mask1 = (int)X->
Def.
Tpow[org_isite1];
113 mask2 = (
int)X->
Def.
Tpow[org_isite3];
114 if (mask1 == mask2) origin =
myrank ^ mask1;
115 else origin =
myrank ^ (mask1 + mask2);
116 num1_up = (origin & mask1) / mask1;
117 num2_up = (origin & mask2) / mask2;
119 ibit_tmp = (num1_up) ^ (num2_up);
120 if (ibit_tmp == 0)
return;
126 #pragma omp parallel for default(none) private(j, dmv, ioff) \ 127 firstprivate(idim_max_buf, X) \ 128 shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0,nstate,one) 129 for (j = 1; j <= idim_max_buf; j++) {
132 zaxpy_(&nstate, &dmv, &
v1buf[j][0], &one, &tmp_v0[ioff][0], &one);
144 int nstate, std::complex<double> **tmp_v0,
145 std::complex<double> **tmp_v1
165 std::complex<double> tmp_J,
167 int nstate, std::complex<double> **tmp_v0,
168 std::complex<double> **tmp_v1
170 int mask2, state2, origin;
171 long int mask1, idim_max_buf, j, ioff, state1, jreal, state1check;
172 std::complex<double> Jint;
177 mask2 = (int)X->
Def.
Tpow[org_isite3];
179 state2 = (origin & mask2) / mask2;
181 if (state2 == org_ispin4) {
182 state1check = (
long int) org_ispin2;
185 else if (state2 == org_ispin3) {
186 state1check = (
long int) org_ispin1;
200 mask1 = X->
Def.
Tpow[org_isite1];
203 #pragma omp parallel for default(none) private(j, ioff, jreal, state1) \ 204 firstprivate(idim_max_buf, Jint, X, mask1, state1check, org_isite1) \ 205 shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0,nstate,one) 206 for (j = 1; j <= idim_max_buf; j++) {
209 state1 = (jreal & mask1) / mask1;
210 if (state1 == state1check) {
213 zaxpy_(&nstate, &Jint, &
v1buf[j][0], &one, &tmp_v0[ioff][0], &one);
225 int nstate, std::complex<double> **tmp_v0,
226 std::complex<double> **tmp_v1
248 int nstate, std::complex<double> **tmp_v0,
249 std::complex<double> **tmp_v1
271 int nstate, std::complex<double> **tmp_v0,
272 std::complex<double> **tmp_v1
305 int nstate, std::complex<double> **tmp_v0,
306 std::complex<double> **tmp_v1
340 int nstate, std::complex<double> **tmp_v0,
341 std::complex<double> **tmp_v1
358 int nstate, std::complex<double> **tmp_v0,
359 std::complex<double> **tmp_v1
struct DefineList Def
Definision of system (Hamiltonian) etc.
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.
std::complex< double > ** v1buf
void X_child_general_int_spin_TotalS_MPIdouble(int org_isite1, int org_isite3, 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_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...
struct LargeList Large
Variables for Matrix-Vector product.
void X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, std::complex< double > tmp_J, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Compute term in the grandcanonical general spin system when one of these site is in the inter proces...
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...
int mode
multiply or expectation value.
long int irght
Used for Ogata-Lin ???
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...
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
long int SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
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...
void GC_child_CisAitCjuAju_spin_MPIdouble(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Wrapper for calculating CisAitCjuAju term in Spin model + GC When both site1 and site2 are in the int...
void GC_child_CisAitCiuAiv_spin_MPIsingle(long int i_int, 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...
long int ilft
Used for Ogata-Lin ???
void GC_child_CisAisCjuAjv_spin_MPIsingle(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Wrapper for CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region...
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...
int GetOffComp(long int *_list_2_1, long int *_list_2_2, long int _ibit, const long int _irght, const long int _ilft, const long int _ihfbit, long int *_ioffComp)
function of getting off-diagonal component
long int ihfbit
Used for Ogata-Lin ???
void X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, std::complex< double > tmp_J, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
term in Spin model. When both site1 and site3 are in the inter process region.
int myrank
Process ID, defined in InitializeMPI()
void SendRecv_cv(int origin, long int nMsgS, long int nMsgR, std::complex< double > *vecs, std::complex< double > *vecr)
Wrapper of MPI_Sendrecv for std::complex<double> number. When we pass a message longer than 2^31-1 (m...
void GC_child_CisAitCiuAiv_spin_MPIdouble(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Exchange and Pairlifting term in Spin model + GC When both site1 and site2 are in the inter process r...
void X_GC_child_CisAitCjuAjv_GeneralSpin_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)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
void GC_child_CisAitCjuAju_spin_MPIsingle(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Wrapper for CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region...
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
void X_GC_child_CisAitCjuAjv_GeneralSpin_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)
Compute term in the grandcanonical general spin system when one of these site is in the inter proces...
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
void X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, 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)
Compute term in the grandcanonical general spin system when one of these site is in the inter proces...
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.
void SendRecv_iv(int origin, long int nMsgS, long int nMsgR, long int *vecs, long int *vecr)
Wrapper of MPI_Sendrecv for long integer number. When we pass a message longer than 2^31-1 (max of in...
void X_child_CisAitCjuAjv_GeneralSpin_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)
Compute term in the canonical general spin system when both sites are in the inter process region...
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...
void GC_child_CisAisCjuAjv_spin_MPIdouble(long int i_int, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
Wrapper for calculating CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the int...
void X_child_CisAitCjuAjv_GeneralSpin_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)
Compute term in the canonical general spin system when one of these sites is in the inter process re...
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 X_GC_child_CisAisCjuAjv_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, 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. When both site1 and site3 are in the inter process region.
struct CheckList Check
Size of the Hilbert space.
long int idim_max
The dimension of the Hilbert space of this process.