HΦ  3.2.0
mltplyMPISpin.c File Reference

Functions for spin Hamiltonian + MPI. More...

#include "mpi.h"
#include "Common.h"
#include "mltplyCommon.h"
#include "bitcalc.h"
#include "wrapperMPI.h"
#include "mltplyMPISpin.h"
#include "mltplyMPISpinCore.h"
+ Include dependency graph for mltplyMPISpin.c:

Go to the source code of this file.

Functions

void child_general_int_spin_MPIdouble (unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
 Exchange term in Spin model When both site1 and site2 are in the inter process region. More...
 
double complex X_child_general_int_spin_MPIdouble (int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
 Exchange term in Spin model When both site1 and site2 are in the inter process region. More...
 
double complex X_child_general_int_spin_TotalS_MPIdouble (int org_isite1, int org_isite3, struct BindStruct *X, double complex *tmp_v0, double complex *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 (unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
 Exchange term in Spin model When only site2 is in the inter process region. More...
 
double complex X_child_general_int_spin_MPIsingle (int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
 
void GC_child_general_int_spin_MPIdouble (unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *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 (unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *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 (unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *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 (unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *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 (unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *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 (unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *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.c.

Function Documentation

◆ child_general_int_GeneralSpin_MPIdouble()

void child_general_int_GeneralSpin_MPIdouble ( unsigned long int  i_int,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  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 466 of file mltplyMPISpin.c.

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

Referenced by mltplyGeneralSpin().

471  {
472  double complex dam_pr;
474  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
475  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
476  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
477  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
478  X->Large.prdct += dam_pr;
479 
480 }/*void GC_child_general_int_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
double complex prdct
The expectation value of the energy.
Definition: struct.h:314
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
double complex * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.h:170
double complex X_child_CisAitCjuAjv_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the canonical general spin system when both sites are in the inter process region...
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.h:161
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ child_general_int_GeneralSpin_MPIsingle()

void child_general_int_GeneralSpin_MPIsingle ( unsigned long int  i_int,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  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 486 of file mltplyMPISpin.c.

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

Referenced by mltplyGeneralSpin().

491  {
492  double complex dam_pr;
493 
495  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
496  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
497  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
498  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
499 
500  X->Large.prdct += dam_pr;
501 }/*void GC_child_general_int_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
double complex X_child_CisAitCjuAjv_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the canonical general spin system when one of these sites is in the inter process re...
double complex prdct
The expectation value of the energy.
Definition: struct.h:314
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
double complex * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.h:170
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.h:161
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ child_general_int_spin_MPIdouble()

void child_general_int_spin_MPIdouble ( unsigned long int  i_int,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  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)

Add \(\langle v_1| H_{\rm this} | v_1 \rangle\) to LargeList::prdct

Parameters
[in]i_intInteraction ID
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 35 of file mltplyMPISpin.c.

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

Referenced by mltplyHalfSpin().

40  {
41 #ifdef MPI
42  double complex dam_pr = 0;
44  (int)X->Def.InterAll_OffDiagonal[i_int][0], (int)X->Def.InterAll_OffDiagonal[i_int][1],
45  (int)X->Def.InterAll_OffDiagonal[i_int][3], (int)X->Def.InterAll_OffDiagonal[i_int][4],
46  (int)X->Def.InterAll_OffDiagonal[i_int][5], (int)X->Def.InterAll_OffDiagonal[i_int][7],
47  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
52  X->Large.prdct += dam_pr;
53 #endif
54 }/*void child_general_int_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
double complex prdct
The expectation value of the energy.
Definition: struct.h:314
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
double complex * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.h:170
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.h:161
double complex X_child_general_int_spin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Exchange term in Spin model When both site1 and site2 are in the inter process region.
Definition: mltplyMPISpin.c:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ child_general_int_spin_MPIsingle()

void child_general_int_spin_MPIsingle ( unsigned long int  i_int,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  tmp_v1 
)

Exchange term in Spin model When only site2 is in the inter process region.

Returns
\(\langle v_1| H_{\rm this} | v_1 \rangle\)
Author
Mitsuaki Kawamura (The University of Tokyo)

Add \(\langle v_1| H_{\rm this} | v_1 \rangle\) to LargeList::prdct

Parameters
[in]i_intInteraction ID
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 196 of file mltplyMPISpin.c.

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

Referenced by mltplyHalfSpin().

201  {
202 #ifdef MPI
203  double complex dam_pr = 0;
204 
206  (int)X->Def.InterAll_OffDiagonal[i_int][0], (int)X->Def.InterAll_OffDiagonal[i_int][1],
207  (int)X->Def.InterAll_OffDiagonal[i_int][3], (int)X->Def.InterAll_OffDiagonal[i_int][4],
208  (int)X->Def.InterAll_OffDiagonal[i_int][5], (int)X->Def.InterAll_OffDiagonal[i_int][7],
209  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
214  X->Large.prdct += dam_pr;
215 #endif
216 }/*void child_general_int_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
double complex prdct
The expectation value of the energy.
Definition: struct.h:314
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
double complex * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.h:170
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.h:161
double complex X_child_general_int_spin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GC_child_general_int_GeneralSpin_MPIdouble()

void GC_child_general_int_GeneralSpin_MPIdouble ( unsigned long int  i_int,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  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 388 of file mltplyMPISpin.c.

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

Referenced by mltplyGeneralSpinGC().

393  {
394 #ifdef MPI
395  double complex dam_pr;
396  // MPI_Status statusMPI;
397 
398  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
399  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
401  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
402  X->Def.InterAll_OffDiagonal[i_int][4], X->Def.InterAll_OffDiagonal[i_int][5],
403  X->Def.InterAll_OffDiagonal[i_int][7], X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
404  }
405  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
406  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
408  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
409  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
410  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
411  }
412  else {
414  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
415  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
416  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
417  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
418  }
419  X->Large.prdct += dam_pr;
420 #endif
421 }/*void GC_child_general_int_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
double complex X_GC_child_CisAisCjuAjv_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
term in Spin model. When both site1 and site3 are in the inter process region.
double complex prdct
The expectation value of the energy.
Definition: struct.h:314
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
double complex * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.h:170
double complex X_GC_child_CisAitCjuAjv_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.h:161
double complex X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
term in Spin model. When both site1 and site3 are in the inter process region.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GC_child_general_int_GeneralSpin_MPIsingle()

void GC_child_general_int_GeneralSpin_MPIsingle ( unsigned long int  i_int,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  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 427 of file mltplyMPISpin.c.

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

Referenced by mltplyGeneralSpinGC().

432  {
433 #ifdef MPI
434  double complex dam_pr;
435 
436  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
437  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
439  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
440  X->Def.InterAll_OffDiagonal[i_int][4], X->Def.InterAll_OffDiagonal[i_int][5],
441  X->Def.InterAll_OffDiagonal[i_int][7], X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
442  }
443  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
444  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
446  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
447  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
448  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
449  }
450  else {
452  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
453  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
454  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
455  X->Def.ParaInterAll_OffDiagonal[i_int], X, tmp_v0, tmp_v1);
456  }
457 
458  X->Large.prdct += dam_pr;
459 #endif
460 }/*void GC_child_general_int_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
double complex X_GC_child_CisAitCjuAjv_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when one of these site is in the inter proces...
double complex X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_ispin2, int org_isite3, int org_ispin3, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when one of these site is in the inter proces...
double complex prdct
The expectation value of the energy.
Definition: struct.h:314
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
double complex * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.h:170
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.h:161
double complex X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle(int org_isite1, int org_ispin1, int org_isite3, int org_ispin3, int org_ispin4, double complex tmp_J, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when one of these site is in the inter proces...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GC_child_general_int_spin_MPIdouble()

void GC_child_general_int_spin_MPIdouble ( unsigned long int  i_int,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  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 342 of file mltplyMPISpin.c.

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().

347  {
348  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
349  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
350  GC_child_CisAisCjuAjv_spin_MPIdouble(i_int, X, tmp_v0, tmp_v1);
351  }
352  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
353  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
354  GC_child_CisAitCjuAju_spin_MPIdouble(i_int, X, tmp_v0, tmp_v1);
355  }
356  else {
357  GC_child_CisAitCiuAiv_spin_MPIdouble(i_int, X, tmp_v0, tmp_v1);
358  }
359 }/*void GC_child_general_int_spin_MPIdouble*/
void GC_child_CisAitCiuAiv_spin_MPIdouble(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Exchange and Pairlifting term in Spin model + GC When both site1 and site2 are in the inter process r...
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
void GC_child_CisAisCjuAjv_spin_MPIdouble(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Wrapper for calculating CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the int...
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.h:161
void GC_child_CisAitCjuAju_spin_MPIdouble(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Wrapper for calculating CisAitCjuAju term in Spin model + GC When both site1 and site2 are in the int...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GC_child_general_int_spin_MPIsingle()

void GC_child_general_int_spin_MPIsingle ( unsigned long int  i_int,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  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 365 of file mltplyMPISpin.c.

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().

370  {
371  if (X->Def.InterAll_OffDiagonal[i_int][1] == X->Def.InterAll_OffDiagonal[i_int][3] &&
372  X->Def.InterAll_OffDiagonal[i_int][5] != X->Def.InterAll_OffDiagonal[i_int][7]) {
373  GC_child_CisAisCjuAjv_spin_MPIsingle(i_int, X, tmp_v0, tmp_v1);
374  }
375  else if (X->Def.InterAll_OffDiagonal[i_int][1] != X->Def.InterAll_OffDiagonal[i_int][3] &&
376  X->Def.InterAll_OffDiagonal[i_int][5] == X->Def.InterAll_OffDiagonal[i_int][7]) {
377  GC_child_CisAitCjuAju_spin_MPIsingle(i_int, X, tmp_v0, tmp_v1);
378  }
379  else {
380  GC_child_CisAitCiuAiv_spin_MPIsingle(i_int, X, tmp_v0, tmp_v1);
381  }
382 }/*void GC_child_general_int_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
void GC_child_CisAitCiuAiv_spin_MPIsingle(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *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(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Wrapper for CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region...
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.h:161
void GC_child_CisAitCjuAju_spin_MPIsingle(unsigned long int i_int, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Wrapper for CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ X_child_general_int_spin_MPIdouble()

double complex X_child_general_int_spin_MPIdouble ( int  org_isite1,
int  org_ispin1,
int  org_ispin2,
int  org_isite3,
int  org_ispin3,
int  org_ispin4,
double complex  tmp_J,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  tmp_v1 
)

Exchange term in Spin model When both site1 and site2 are in the inter process region.

Returns
\(\langle v_1| H_{\rm this} | v_1 \rangle\)
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 61 of file mltplyMPISpin.c.

References BindStruct::Check, BindStruct::Def, exitMPI(), 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, DefineList::Tpow, and v1buf.

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

72  {
73 #ifdef MPI
74  int mask1, mask2, state1, state2, ierr, origin;
75  unsigned long int idim_max_buf, j, ioff;
76  MPI_Status statusMPI;
77  double complex Jint, dmv, dam_pr;
78 
79  mask1 = (int)X->Def.Tpow[org_isite1];
80  mask2 = (int)X->Def.Tpow[org_isite3];
81  origin = myrank ^ (mask1 + mask2);
82 
83  state1 = (origin & mask1) / mask1;
84  state2 = (origin & mask2) / mask2;
85 
86  if (state1 == org_ispin2 && state2 == org_ispin4) {
87  Jint = tmp_J;
88  }
89  else if (state1 == org_ispin1 && state2 == org_ispin3) {
90  Jint = conj(tmp_J);
91  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
92  Jint = 0;
93  }
94  }
95  else return 0;
96 
97  ierr = MPI_Sendrecv(&X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
98  &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0, MPI_COMM_WORLD, &statusMPI);
99  if (ierr != 0) exitMPI(-1);
100  ierr = MPI_Sendrecv(list_1, X->Check.idim_max + 1, MPI_UNSIGNED_LONG, origin, 0,
101  list_1buf, idim_max_buf + 1, MPI_UNSIGNED_LONG, origin, 0, MPI_COMM_WORLD, &statusMPI);
102  if (ierr != 0) exitMPI(-1);
103  ierr = MPI_Sendrecv(tmp_v1, X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
104  v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0, MPI_COMM_WORLD, &statusMPI);
105  if (ierr != 0) exitMPI(-1);
106 
107  dam_pr = 0.0;
108  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
109 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff) \
110  firstprivate(idim_max_buf, Jint, X) shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
111  for (j = 1; j <= idim_max_buf; j++) {
113  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
114  dmv = Jint * v1buf[j];
115  tmp_v0[ioff] += dmv;
116  dam_pr += conj(tmp_v1[ioff]) * dmv;
117  }/*for (j = 1; j <= idim_max_buf; j++)*/
118  }/*if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC)*/
119  else {
120 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff) \
121  firstprivate(idim_max_buf, Jint, X) shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
122  for (j = 1; j <= idim_max_buf; j++) {
124  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
125  dmv = Jint * v1buf[j];
126  dam_pr += conj(tmp_v1[ioff]) * dmv;
127  }/*for (j = 1; j <= idim_max_buf; j++)*/
128  }/*if (! (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC))*/
129  return dam_pr;
130 #else
131  return 0.0;
132 #endif
133 }/*double complex X_child_general_int_spin_MPIdouble*/
void exitMPI(int errorcode)
MPI Abortation wrapper.
Definition: wrapperMPI.c:86
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
long unsigned int ihfbit
Used for Ogata-Lin ???
Definition: struct.h:345
unsigned long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.h:303
long unsigned int * list_1buf
Definition: global.h:48
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
long unsigned int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.h:90
long unsigned int ilft
Used for Ogata-Lin ???
Definition: struct.h:344
long unsigned int * list_2_1
Definition: global.h:49
int GetOffComp(long unsigned int *_list_2_1, long unsigned int *_list_2_2, long unsigned int _ibit, const long unsigned int _irght, const long unsigned int _ilft, const long unsigned int _ihfbit, long unsigned int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.c:195
long unsigned int * list_1
Definition: global.h:47
long unsigned int * list_2_2
Definition: global.h:50
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
int myrank
Process ID, defined in InitializeMPI()
Definition: global.h:163
double complex * v1buf
Definition: global.h:37
struct CheckList Check
Size of the Hilbert space.
Definition: struct.h:411
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ X_child_general_int_spin_MPIsingle()

double complex X_child_general_int_spin_MPIsingle ( int  org_isite1,
int  org_ispin1,
int  org_ispin2,
int  org_isite3,
int  org_ispin3,
int  org_ispin4,
double complex  tmp_J,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  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 222 of file mltplyMPISpin.c.

References BindStruct::Check, BindStruct::Def, exitMPI(), 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, DefineList::Tpow, and v1buf.

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

233  {
234 #ifdef MPI
235  int mask2, state2, ierr, origin;
236  unsigned long int mask1, idim_max_buf, j, ioff, state1, jreal, state1check;
237  MPI_Status statusMPI;
238  double complex Jint, dmv, dam_pr;
239  /*
240  Prepare index in the inter PE
241  */
242  mask2 = (int)X->Def.Tpow[org_isite3];
243  origin = myrank ^ mask2;
244  state2 = (origin & mask2) / mask2;
245 
246  if (state2 == org_ispin4) {
247  state1check = (unsigned long int) org_ispin2;
248  Jint = tmp_J;
249  }
250  else if (state2 == org_ispin3) {
251  state1check = (unsigned long int) org_ispin1;
252  Jint = conj(tmp_J);
253  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
254  Jint = 0;
255  }
256  }
257  else return 0;
258 
259  ierr = MPI_Sendrecv(&X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
260  &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
261  MPI_COMM_WORLD, &statusMPI);
262  if (ierr != 0) exitMPI(-1);
263  ierr = MPI_Sendrecv(list_1, X->Check.idim_max + 1, MPI_UNSIGNED_LONG, origin, 0,
264  list_1buf, idim_max_buf + 1, MPI_UNSIGNED_LONG, origin, 0,
265  MPI_COMM_WORLD, &statusMPI);
266  if (ierr != 0) exitMPI(-1);
267  ierr = MPI_Sendrecv(tmp_v1, X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
268  v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
269  MPI_COMM_WORLD, &statusMPI);
270  if (ierr != 0) exitMPI(-1);
271  /*
272  Index in the intra PE
273  */
274  mask1 = X->Def.Tpow[org_isite1];
275 
276  dam_pr = 0.0;
277  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
278 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff, jreal, state1) \
279 firstprivate(idim_max_buf, Jint, X, mask1, state1check, org_isite1) \
280 shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
281  for (j = 1; j <= idim_max_buf; j++) {
282 
283  jreal = list_1buf[j];
284 
285  state1 = (jreal & mask1) / mask1;
286  if (state1 == state1check) {
287  GetOffComp(list_2_1, list_2_2, jreal ^ mask1,
288  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
289 
290  dmv = Jint * v1buf[j];
291  tmp_v0[ioff] += dmv;
292  dam_pr += conj(tmp_v1[ioff]) * dmv;
293  }
294  }
295  }
296  else if (X->Large.mode == M_TOTALS) {
297 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff, jreal, state1) \
298 firstprivate(idim_max_buf, Jint, X, mask1, state1check, org_isite1) \
299 shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
300  for (j = 1; j <= idim_max_buf; j++) {
301 
302  jreal = list_1buf[j];
303 
304  state1 = (jreal & mask1) / mask1;
305  if (state1 == state1check) {
306  GetOffComp(list_2_1, list_2_2, jreal ^ mask1,
307  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
308 
309  dmv = Jint * v1buf[j];
310  dmv = 0.5 * v1buf[j];
311  dam_pr += conj(tmp_v1[ioff]) * dmv;
312  }/*if (state1 == state1check)*/
313  }/*for (j = 1; j <= idim_max_buf; j++)*/
314  }/*if (X->Large.mode == M_TOTALS)*/
315  else {
316 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff, jreal, state1) \
317 firstprivate(idim_max_buf, Jint, X, mask1, state1check, org_isite1) \
318 shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
319  for (j = 1; j <= idim_max_buf; j++) {
320 
321  jreal = list_1buf[j];
322 
323  state1 = (jreal & mask1) / mask1;
324  if (state1 == state1check) {
325  GetOffComp(list_2_1, list_2_2, jreal ^ mask1,
326  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
327  dmv = Jint * v1buf[j];
328  dam_pr += conj(tmp_v1[ioff]) * dmv;
329  }/*if (state1 == state1check)*/
330  }/*for (j = 1; j <= idim_max_buf; j++)*/
331  }
332  return dam_pr;
333 #else
334  return 0.0;
335 #endif
336 }/*double complex X_child_general_int_spin_MPIsingle*/
void exitMPI(int errorcode)
MPI Abortation wrapper.
Definition: wrapperMPI.c:86
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
long unsigned int ihfbit
Used for Ogata-Lin ???
Definition: struct.h:345
unsigned long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.h:303
long unsigned int * list_1buf
Definition: global.h:48
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
long unsigned int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.h:90
long unsigned int ilft
Used for Ogata-Lin ???
Definition: struct.h:344
long unsigned int * list_2_1
Definition: global.h:49
int GetOffComp(long unsigned int *_list_2_1, long unsigned int *_list_2_2, long unsigned int _ibit, const long unsigned int _irght, const long unsigned int _ilft, const long unsigned int _ihfbit, long unsigned int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.c:195
long unsigned int * list_1
Definition: global.h:47
long unsigned int * list_2_2
Definition: global.h:50
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
int myrank
Process ID, defined in InitializeMPI()
Definition: global.h:163
double complex * v1buf
Definition: global.h:37
struct CheckList Check
Size of the Hilbert space.
Definition: struct.h:411
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ X_child_general_int_spin_TotalS_MPIdouble()

double complex X_child_general_int_spin_TotalS_MPIdouble ( int  org_isite1,
int  org_isite3,
struct BindStruct X,
double complex *  tmp_v0,
double complex *  tmp_v1 
)

Exchange term in Spin model When both site1 and site2 are in the inter process region.

Returns
\(\langle v_1| H_{\rm this} | v_1 \rangle\)
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 140 of file mltplyMPISpin.c.

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

Referenced by totalspin_Spin().

146  {
147 #ifdef MPI
148  int mask1, mask2, num1_up, num2_up, ierr, origin;
149  unsigned long int idim_max_buf, j, ioff, ibit_tmp;
150  MPI_Status statusMPI;
151  double complex dmv, dam_pr;
152 
153  mask1 = (int)X->Def.Tpow[org_isite1];
154  mask2 = (int)X->Def.Tpow[org_isite3];
155  if (mask1 == mask2) origin = myrank ^ mask1;
156  else origin = myrank ^ (mask1 + mask2);
157  num1_up = (origin & mask1) / mask1;
158  num2_up = (origin & mask2) / mask2;
159 
160  ibit_tmp = (num1_up) ^ (num2_up);
161  if (ibit_tmp == 0) return 0;
162 
163  ierr = MPI_Sendrecv(&X->Check.idim_max, 1, MPI_UNSIGNED_LONG, origin, 0,
164  &idim_max_buf, 1, MPI_UNSIGNED_LONG, origin, 0,
165  MPI_COMM_WORLD, &statusMPI);
166  if (ierr != 0) exitMPI(-1);
167  ierr = MPI_Sendrecv(list_1, X->Check.idim_max + 1, MPI_UNSIGNED_LONG, origin, 0,
168  list_1buf, idim_max_buf + 1, MPI_UNSIGNED_LONG, origin, 0,
169  MPI_COMM_WORLD, &statusMPI);
170  if (ierr != 0) exitMPI(-1);
171  ierr = MPI_Sendrecv(tmp_v1, X->Check.idim_max + 1, MPI_DOUBLE_COMPLEX, origin, 0,
172  v1buf, idim_max_buf + 1, MPI_DOUBLE_COMPLEX, origin, 0,
173  MPI_COMM_WORLD, &statusMPI);
174  if (ierr != 0) exitMPI(-1);
175 
176  dam_pr = 0.0;
177 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, dmv, ioff) \
178  firstprivate(idim_max_buf, X) shared(list_2_1, list_2_2, list_1buf, v1buf, tmp_v1, tmp_v0)
179  for (j = 1; j <= idim_max_buf; j++) {
181  X->Large.irght, X->Large.ilft, X->Large.ihfbit, &ioff);
182  dmv = 0.5 * v1buf[j];
183  dam_pr += conj(tmp_v1[ioff]) * dmv;
184  }/*for (j = 1; j <= idim_max_buf; j++)*/
185  return dam_pr;
186 #else
187  return 0.0;
188 #endif
189 }/*double complex X_child_general_int_spin_MPIdouble*/
void exitMPI(int errorcode)
MPI Abortation wrapper.
Definition: wrapperMPI.c:86
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
long unsigned int ihfbit
Used for Ogata-Lin ???
Definition: struct.h:345
unsigned long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.h:303
long unsigned int * list_1buf
Definition: global.h:48
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
long unsigned int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.h:90
long unsigned int ilft
Used for Ogata-Lin ???
Definition: struct.h:344
long unsigned int * list_2_1
Definition: global.h:49
int GetOffComp(long unsigned int *_list_2_1, long unsigned int *_list_2_2, long unsigned int _ibit, const long unsigned int _irght, const long unsigned int _ilft, const long unsigned int _ihfbit, long unsigned int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.c:195
long unsigned int * list_1
Definition: global.h:47
long unsigned int * list_2_2
Definition: global.h:50
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
int myrank
Process ID, defined in InitializeMPI()
Definition: global.h:163
double complex * v1buf
Definition: global.h:37
struct CheckList Check
Size of the Hilbert space.
Definition: struct.h:411
+ Here is the call graph for this function:
+ Here is the caller graph for this function: