HPhi++  3.1.0
mltplyMPISpin.cpp File Reference

Functions for spin Hamiltonian + MPI. More...

#include "Common.hpp"
#include "mltplyCommon.hpp"
#include "bitcalc.hpp"
#include "wrapperMPI.hpp"
#include "mltplyMPISpin.hpp"
#include "mltplyMPISpinCore.hpp"

Go to the source code of this file.

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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)
 
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 region. More...
 
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 region. More...
 
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 region. More...
 
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 region. More...
 
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 region. More...
 
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 region. More...
 

Detailed Description

Functions for spin Hamiltonian + MPI.

Definition in file mltplyMPISpin.cpp.

Function Documentation

◆ child_general_int_GeneralSpin_MPIdouble()

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 region.

Author
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]i_intInteraction ID
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 337 of file mltplyMPISpin.cpp.

References BindStruct::Def, DefineList::InterAll_OffDiagonal, DefineList::ParaInterAll_OffDiagonal, and X_child_CisAitCjuAjv_GeneralSpin_MPIdouble().

Referenced by mltplyGeneralSpin().

342  {
344  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
345  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
346  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
347  X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
348 
349 }/*void GC_child_general_int_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.hpp:161
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.hpp:170
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...

◆ child_general_int_GeneralSpin_MPIsingle()

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 region.

Author
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]i_intInteraction ID
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 355 of file mltplyMPISpin.cpp.

References BindStruct::Def, DefineList::InterAll_OffDiagonal, DefineList::ParaInterAll_OffDiagonal, and X_child_CisAitCjuAjv_GeneralSpin_MPIsingle().

Referenced by mltplyGeneralSpin().

360  {
361 
363  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
364  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
365  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
366  X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
367 
368 }/*void GC_child_general_int_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.hpp:161
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.hpp:170
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...

◆ child_general_int_spin_MPIdouble()

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.

Author
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]i_intInteraction ID
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 32 of file mltplyMPISpin.cpp.

References BindStruct::Def, DefineList::InterAll_OffDiagonal, DefineList::ParaInterAll_OffDiagonal, and X_child_general_int_spin_MPIdouble().

Referenced by mltplyHalfSpin().

37  {
39  (int)X->Def.InterAll_OffDiagonal[i_int][0], (int)X->Def.InterAll_OffDiagonal[i_int][1],
40  (int)X->Def.InterAll_OffDiagonal[i_int][3], (int)X->Def.InterAll_OffDiagonal[i_int][4],
41  (int)X->Def.InterAll_OffDiagonal[i_int][5], (int)X->Def.InterAll_OffDiagonal[i_int][7],
42  X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
43 }/*void child_general_int_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.hpp:161
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.hpp:170
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.

◆ child_general_int_spin_MPIsingle()

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.

Author
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]i_intInteraction ID
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 141 of file mltplyMPISpin.cpp.

References BindStruct::Def, DefineList::InterAll_OffDiagonal, DefineList::ParaInterAll_OffDiagonal, and X_child_general_int_spin_MPIsingle().

Referenced by mltplyHalfSpin().

146  {
147 
149  (int)X->Def.InterAll_OffDiagonal[i_int][0], (int)X->Def.InterAll_OffDiagonal[i_int][1],
150  (int)X->Def.InterAll_OffDiagonal[i_int][3], (int)X->Def.InterAll_OffDiagonal[i_int][4],
151  (int)X->Def.InterAll_OffDiagonal[i_int][5], (int)X->Def.InterAll_OffDiagonal[i_int][7],
152  X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
153 }/*void child_general_int_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: struct.hpp:161
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.hpp:170

◆ GC_child_general_int_GeneralSpin_MPIdouble()

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 region.

Author
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]i_intInteraction ID
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 268 of file mltplyMPISpin.cpp.

References BindStruct::Def, DefineList::InterAll_OffDiagonal, DefineList::ParaInterAll_OffDiagonal, X_GC_child_CisAisCjuAjv_GeneralSpin_MPIdouble(), X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble(), and X_GC_child_CisAitCjuAjv_GeneralSpin_MPIdouble().

Referenced by mltplyGeneralSpinGC().

273  {
274 
275  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
276  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
278  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
279  X->Def.InterAll_OffDiagonal[i_int][4], X->Def.InterAll_OffDiagonal[i_int][5],
280  X->Def.InterAll_OffDiagonal[i_int][7], X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
281  }
282  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
283  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
285  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
286  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
287  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
288  }
289  else {
291  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
292  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
293  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
294  X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
295  }
296 }/*void GC_child_general_int_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.hpp:161
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.
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...
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.hpp:170
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.

◆ GC_child_general_int_GeneralSpin_MPIsingle()

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 region.

Author
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]i_intInteraction ID
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 302 of file mltplyMPISpin.cpp.

References BindStruct::Def, DefineList::InterAll_OffDiagonal, DefineList::ParaInterAll_OffDiagonal, X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle(), X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle(), and X_GC_child_CisAitCjuAjv_GeneralSpin_MPIsingle().

Referenced by mltplyGeneralSpinGC().

307  {
308 
309  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
310  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
312  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
313  X->Def.InterAll_OffDiagonal[i_int][4], X->Def.InterAll_OffDiagonal[i_int][5],
314  X->Def.InterAll_OffDiagonal[i_int][7], X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
315  }
316  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
317  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
319  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
320  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
321  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
322  }
323  else {
325  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
326  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
327  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
328  X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
329  }
330 
331 }/*void GC_child_general_int_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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...
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.hpp:161
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.hpp:170
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...
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...

◆ GC_child_general_int_spin_MPIdouble()

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 region.

Author
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]i_intInteraction ID
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 222 of file mltplyMPISpin.cpp.

References BindStruct::Def, GC_child_CisAisCjuAjv_spin_MPIdouble(), GC_child_CisAitCiuAiv_spin_MPIdouble(), GC_child_CisAitCjuAju_spin_MPIdouble(), and DefineList::InterAll_OffDiagonal.

Referenced by mltplyHalfSpinGC().

227  {
228  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
229  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
230  GC_child_CisAisCjuAjv_spin_MPIdouble(i_int, X, nstate, tmp_v0, tmp_v1);
231  }
232  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
233  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
234  GC_child_CisAitCjuAju_spin_MPIdouble(i_int, X, nstate, tmp_v0, tmp_v1);
235  }
236  else {
237  GC_child_CisAitCiuAiv_spin_MPIdouble(i_int, X, nstate, tmp_v0, tmp_v1);
238  }
239 }/*void GC_child_general_int_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.hpp:161
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_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 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...

◆ GC_child_general_int_spin_MPIsingle()

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 region.

Author
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]i_intInteraction ID
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 245 of file mltplyMPISpin.cpp.

References BindStruct::Def, GC_child_CisAisCjuAjv_spin_MPIsingle(), GC_child_CisAitCiuAiv_spin_MPIsingle(), GC_child_CisAitCjuAju_spin_MPIsingle(), and DefineList::InterAll_OffDiagonal.

Referenced by mltplyHalfSpinGC().

250  {
251  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
252  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
253  GC_child_CisAisCjuAjv_spin_MPIsingle(i_int, X, nstate, tmp_v0, tmp_v1);
254  }
255  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
256  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
257  GC_child_CisAitCjuAju_spin_MPIsingle(i_int, X, nstate, tmp_v0, tmp_v1);
258  }
259  else {
260  GC_child_CisAitCiuAiv_spin_MPIsingle(i_int, X, nstate, tmp_v0, tmp_v1);
261  }
262 }/*void GC_child_general_int_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.hpp:161
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...
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_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...

◆ X_child_general_int_spin_MPIdouble()

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.

Author
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_ispin2Spin 2
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[in]org_ispin4Spin 4
[in]tmp_JCopupling constatnt
[in,out]X
[in,out]tmp_v0\({\bf v}_0=H {\bf v}_1\)
[in]tmp_v1Vector to be producted

Definition at line 49 of file mltplyMPISpin.cpp.

References BindStruct::Check, BindStruct::Def, GetOffComp(), CheckList::idim_max, LargeList::ihfbit, LargeList::ilft, LargeList::irght, BindStruct::Large, list_1, list_1buf, list_2_1, list_2_2, LargeList::mode, myrank, SendRecv_cv(), SendRecv_i(), SendRecv_iv(), DefineList::Tpow, and v1buf.

Referenced by child_general_int_spin_MPIdouble(), expec_cisajscktalt_SpinHalf(), and mltplyHalfSpin().

60  {
61  int mask1, mask2, state1, state2, origin;
62  long int idim_max_buf, j, ioff;
63  std::complex<double> Jint;
64  int one = 1;
65 
66  mask1 = (int)X->Def.Tpow[org_isite1];
67  mask2 = (int)X->Def.Tpow[org_isite3];
68  origin = myrank ^ (mask1 + mask2);
69 
70  state1 = (origin & mask1) / mask1;
71  state2 = (origin & mask2) / mask2;
72 
73  if (state1 == org_ispin2 && state2 == org_ispin4) {
74  Jint = tmp_J;
75  }
76  else if (state1 == org_ispin1 && state2 == org_ispin3) {
77  Jint = conj(tmp_J);
78  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
79  Jint = 0;
80  }
81  }
82  else return;
83 
84  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
85  SendRecv_iv(origin, X->Check.idim_max + 1, idim_max_buf + 1, list_1, list_1buf);
86  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
87 
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++) {
92  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
93  zaxpy_(&nstate, &Jint, &v1buf[j][0], &one, &tmp_v0[ioff][0], &one);
94  }/*for (j = 1; j <= idim_max_buf; j++)*/
95 }/*std::complex<double> X_child_general_int_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
long int * list_2_1
Definition: global.cpp:27
long int * list_2_2
Definition: global.cpp:28
std::complex< double > ** v1buf
Definition: global.cpp:22
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int mode
multiply or expectation value.
Definition: struct.hpp:331
long int irght
Used for Ogata-Lin ???
Definition: struct.hpp:344
long int SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
Definition: wrapperMPI.cpp:504
long int * list_1buf
Definition: global.cpp:26
long int ilft
Used for Ogata-Lin ???
Definition: struct.hpp:345
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
Definition: bitcalc.cpp:195
long int ihfbit
Used for Ogata-Lin ???
Definition: struct.hpp:346
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
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...
Definition: wrapperMPI.cpp:424
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
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...
Definition: wrapperMPI.cpp:465
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int * list_1
Definition: global.cpp:25
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_child_general_int_spin_MPIsingle()

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 
)
Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_ispin2Spin 2
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[in]org_ispin4Spin 4
[in]tmp_JCopupling constatnt
[in,out]X
[in,out]tmp_v0\({\bf v}_0=H {\bf v}_1\)
[in]tmp_v1Vector to be producted

Definition at line 158 of file mltplyMPISpin.cpp.

References BindStruct::Check, BindStruct::Def, GetOffComp(), CheckList::idim_max, LargeList::ihfbit, LargeList::ilft, LargeList::irght, BindStruct::Large, list_1, list_1buf, list_2_1, list_2_2, LargeList::mode, myrank, SendRecv_cv(), SendRecv_i(), SendRecv_iv(), DefineList::Tpow, and v1buf.

Referenced by child_general_int_spin_MPIsingle(), expec_cisajscktalt_SpinHalf(), and mltplyHalfSpin().

169  {
170  int mask2, state2, origin;
171  long int mask1, idim_max_buf, j, ioff, state1, jreal, state1check;
172  std::complex<double> Jint;
173  int one = 1;
174  /*
175  Prepare index in the inter PE
176  */
177  mask2 = (int)X->Def.Tpow[org_isite3];
178  origin = myrank ^ mask2;
179  state2 = (origin & mask2) / mask2;
180 
181  if (state2 == org_ispin4) {
182  state1check = (long int) org_ispin2;
183  Jint = tmp_J;
184  }
185  else if (state2 == org_ispin3) {
186  state1check = (long int) org_ispin1;
187  Jint = conj(tmp_J);
188  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
189  Jint = 0;
190  }
191  }
192  else return;
193 
194  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
195  SendRecv_iv(origin, X->Check.idim_max + 1, idim_max_buf + 1, list_1, list_1buf);
196  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
197  /*
198  Index in the intra PE
199  */
200  mask1 = X->Def.Tpow[org_isite1];
201  //printf("debug1 %ld\n", idim_max_buf);
202 
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++) {
207  jreal = list_1buf[j];
208 
209  state1 = (jreal & mask1) / mask1;
210  if (state1 == state1check) {
211  GetOffComp(list_2_1, list_2_2, jreal ^ mask1,
212  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
213  zaxpy_(&nstate, &Jint, &v1buf[j][0], &one, &tmp_v0[ioff][0], &one);
214  }
215  }
216 }/*std::complex<double> X_child_general_int_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
long int * list_2_1
Definition: global.cpp:27
long int * list_2_2
Definition: global.cpp:28
std::complex< double > ** v1buf
Definition: global.cpp:22
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int mode
multiply or expectation value.
Definition: struct.hpp:331
long int irght
Used for Ogata-Lin ???
Definition: struct.hpp:344
long int SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
Definition: wrapperMPI.cpp:504
long int * list_1buf
Definition: global.cpp:26
long int ilft
Used for Ogata-Lin ???
Definition: struct.hpp:345
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
Definition: bitcalc.cpp:195
long int ihfbit
Used for Ogata-Lin ???
Definition: struct.hpp:346
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
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...
Definition: wrapperMPI.cpp:424
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
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...
Definition: wrapperMPI.cpp:465
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int * list_1
Definition: global.cpp:25
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_child_general_int_spin_TotalS_MPIdouble()

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.

Author
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]org_isite1site 1
[in]org_isite3site 3
[in,out]X
[in,out]tmp_v0\({\bf v}_0=H {\bf v}_1\)
[in]tmp_v1Vector to be producted

Definition at line 101 of file mltplyMPISpin.cpp.

References BindStruct::Check, BindStruct::Def, GetOffComp(), CheckList::idim_max, LargeList::ihfbit, LargeList::ilft, LargeList::irght, BindStruct::Large, list_1, list_1buf, list_2_1, list_2_2, myrank, SendRecv_cv(), SendRecv_i(), SendRecv_iv(), DefineList::Tpow, and v1buf.

107  {
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;
111 
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;
118 
119  ibit_tmp = (num1_up) ^ (num2_up);
120  if (ibit_tmp == 0) return;
121 
122  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
123  SendRecv_iv(origin, X->Check.idim_max + 1, idim_max_buf + 1, list_1, list_1buf);
124  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
125 
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++) {
131  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
132  zaxpy_(&nstate, &dmv, &v1buf[j][0], &one, &tmp_v0[ioff][0], &one);
133  }/*for (j = 1; j <= idim_max_buf; j++)*/
134  return;
135 }/*std::complex<double> X_child_general_int_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
long int * list_2_1
Definition: global.cpp:27
long int * list_2_2
Definition: global.cpp:28
std::complex< double > ** v1buf
Definition: global.cpp:22
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
long int irght
Used for Ogata-Lin ???
Definition: struct.hpp:344
long int SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
Definition: wrapperMPI.cpp:504
long int * list_1buf
Definition: global.cpp:26
long int ilft
Used for Ogata-Lin ???
Definition: struct.hpp:345
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
Definition: bitcalc.cpp:195
long int ihfbit
Used for Ogata-Lin ???
Definition: struct.hpp:346
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
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...
Definition: wrapperMPI.cpp:424
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
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...
Definition: wrapperMPI.cpp:465
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int * list_1
Definition: global.cpp:25
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305