HPhi++  3.1.0
mltplyMPISpinCore.cpp File Reference

Functions for spin Hamiltonian + MPI (Core) More...

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

Go to the source code of this file.

Functions

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 region. More...
 
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)
 \(c_{is}^\dagger c_{it} c_{iu}^\dagger c_{iv}\) term in Spin model + GC. When both site1 and site2 are in the inter process region. More...
 
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 inter process region. More...
 
void X_GC_child_CisAisCjuAjv_spin_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)
 CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region. More...
 
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 inter process region. More...
 
void X_GC_child_CisAitCjuAju_spin_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)
 CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region. More...
 
void X_GC_child_CisAisCjuAju_spin_MPIdouble (int org_isite1, int org_ispin1, 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)
 CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region. More...
 
void X_GC_child_CisAisCjuAju_spin_MPIsingle (int org_isite1, int org_ispin1, 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)
 CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region. More...
 
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. More...
 
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. More...
 
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. More...
 
void X_GC_child_CisAisCjuAjv_spin_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)
 CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region. More...
 
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. More...
 
void X_GC_child_CisAitCjuAju_spin_MPIsingle (int org_isite1, 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)
 CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region. More...
 
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)
 \(c_{is}^\dagger c_{is} c_{ju}^\dagger c_{jv}\) term in Spin model. When both site1 and site3 are in the inter process region. More...
 
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)
 \(c_{is}^\dagger c_{it} c_{ju}^\dagger c_{ju}\) term in Spin model. When both site1 and site3 are in the inter process region. More...
 
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 \(c_{is}^\dagger c_{it} c_{ju}^\dagger c_{jv}\) term in the grandcanonical general spin system when both site is in the inter process region. More...
 
void X_GC_child_CisAisCjuAju_GeneralSpin_MPIdouble (int org_isite1, int org_ispin1, 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 \(c_{is}^\dagger c_{is} c_{ju}^\dagger c_{ju}\) term in the grandcanonical general spin system when both site is in the inter process region. More...
 
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 \(c_{is}^\dagger c_{it}\) term in the grandcanonical general spin system when both site is in the inter process region. More...
 
void X_GC_child_CisAis_GeneralSpin_MPIdouble (int org_isite1, int org_ispin1, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
 Compute \(c_{is}^\dagger c_{is}\) term in the grandcanonical general spin system when both site is in the inter process region. More...
 
void X_GC_child_AisCis_GeneralSpin_MPIdouble (int org_isite1, int org_ispin1, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1)
 Compute \(c_{is} c_{is}^\dagger\) term in the grandcanonical general spin system when both site is in the inter process region. More...
 
void X_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, long int idim_max)
 Compute \(c_{is}^\dagger c_{it}\) term in the canonical general spin system when both site is in the inter process region. More...
 
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 \(c_{is}^\dagger c_{is}c_{ju}^\dagger c_{jv}\) term in the grandcanonical general spin system when one of these site is in the inter process region. More...
 
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 \(c_{is}^\dagger c_{it}c_{ju}^\dagger c_{ju}\) term in the grandcanonical general spin system when one of these site is in the inter process region. More...
 
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 \(c_{is}^\dagger c_{is}c_{ju}^\dagger c_{jv}\) term in the grandcanonical general spin system when one of these site is in the inter process region. More...
 
void X_GC_child_CisAisCjuAju_GeneralSpin_MPIsingle (int org_isite1, int org_ispin1, 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 \(c_{is}^\dagger c_{is}c_{ju}^\dagger c_{ju}\) term in the grandcanonical general spin system when one of these site is in the inter process region. More...
 
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 \(c_{is}^\dagger c_{it}c_{ju}^\dagger c_{jv}\) term in the canonical general spin system when both sites are in the inter process region. More...
 
void X_child_CisAisCjuAju_GeneralSpin_MPIdouble (int org_isite1, int org_ispin1, 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 \(c_{is}^\dagger c_{is}c_{ju}^\dagger c_{ju}\) term in the canonical general spin system when both sites are in the inter process region. More...
 
void X_child_CisAisCjuAju_GeneralSpin_MPIsingle (int org_isite1, int org_ispin1, 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 \(c_{is}^\dagger c_{is}c_{ju}^\dagger c_{ju}\) term in the canonical general spin system when one of these sites is in the inter process region. More...
 
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 \(c_{is}^\dagger c_{it}c_{ju}^\dagger c_{jv}\) term in the canonical general spin system when one of these sites is in the inter process region. More...
 
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. More...
 
void X_child_CisAit_spin_MPIdouble (int org_isite1, int org_ispin2, std::complex< double > tmp_trans, struct BindStruct *X, int nstate, std::complex< double > **tmp_v0, std::complex< double > **tmp_v1, long int idim_max)
 Hopping term in Spin + Canonical for CalcSpectrum When both site1 and site2 are in the inter process region. More...
 
void X_GC_child_CisAis_spin_MPIdouble (int org_isite1, int org_ispin1, 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. More...
 
void X_GC_child_AisCis_spin_MPIdouble (int org_isite1, int org_ispin1, 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. More...
 

Detailed Description

Functions for spin Hamiltonian + MPI (Core)

General two body term:

1/2 spin 1/2 spin
MPI single MPI double MPI single MPI double
\(c_{is}^\dagger c_{is} c_{ju}^\dagger c_{ju}\) ::GC_child_CisAisCjuAju_spin_MPIsingle, X_GC_child_CisAisCjuAjv_spin_MPIsingle ::GC_child_CisAisCjuAju_spin_MPIdouble, X_GC_child_CisAisCjuAjv_spin_MPIdouble X_child_CisAisCjuAju_GeneralSpin_MPIsingle, X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle X_child_CisAisCjuAju_GeneralSpin_MPIsingle, X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle
\(c_{is}^\dagger c_{is} c_{ju}^\dagger c_{jv}\) GC_child_CisAisCjuAjv_spin_MPIsingle, X_GC_child_CisAisCjuAjv_spin_MPIsingle GC_child_CisAisCjuAjv_spin_MPIdouble, X_GC_child_CisAisCjuAjv_spin_MPIdouble ::X_child_CisAisCjuAjv_GeneralSpin_MPIsingle, X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle ::X_child_CisAisCjuAjv_GeneralSpin_MPIsingle, X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle
\(c_{is}^\dagger c_{it} c_{ju}^\dagger c_{ju}\) GC_child_CisAitCjuAju_spin_MPIsingle, X_GC_child_CisAisCjuAjv_spin_MPIsingle GC_child_CisAitCjuAju_spin_MPIdouble, X_GC_child_CisAisCjuAjv_spin_MPIdouble ::X_child_CisAitCjuAju_GeneralSpin_MPIsingle, X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle ::X_child_CisAitCjuAju_GeneralSpin_MPIsingle, X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle
\(c_{is}^\dagger c_{it} c_{ju}^\dagger c_{jv}\) ::GC_child_CisAitCjuAjv_spin_MPIsingle, X_GC_child_CisAisCjuAjv_spin_MPIsingle ::GC_child_CisAitCjuAjv_spin_MPIdouble, X_GC_child_CisAisCjuAjv_spin_MPIdouble X_child_CisAitCjuAjv_GeneralSpin_MPIsingle, X_GC_child_CisAitCjuAjv_GeneralSpin_MPIsingle X_child_CisAitCjuAjv_GeneralSpin_MPIsingle, X_GC_child_CisAitCjuAjv_GeneralSpin_MPIsingle

Definition in file mltplyMPISpinCore.cpp.

Function Documentation

◆ GC_child_CisAisCjuAjv_spin_MPIdouble()

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

Author
Kazuyoshi Yoshimi (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 152 of file mltplyMPISpinCore.cpp.

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

Referenced by GC_child_general_int_spin_MPIdouble().

157  {
159  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
160  X->Def.InterAll_OffDiagonal[i_int][4], X->Def.InterAll_OffDiagonal[i_int][5],
161  X->Def.InterAll_OffDiagonal[i_int][7], X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
162 }/*void GC_child_CisAitCiuAiv_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_CisAisCjuAjv_spin_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)
CisAisCjuAjv term in Spin model + GC When both site1 and site2 are 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

◆ GC_child_CisAisCjuAjv_spin_MPIsingle()

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.

Author
Kazuyoshi Yoshimi (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 434 of file mltplyMPISpinCore.cpp.

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

Referenced by GC_child_general_int_spin_MPIsingle().

439  {
441  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
442  X->Def.InterAll_OffDiagonal[i_int][4], X->Def.InterAll_OffDiagonal[i_int][5],
443  X->Def.InterAll_OffDiagonal[i_int][7], X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
444 }/*void GC_child_CisAisCjuAjv_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
void X_GC_child_CisAisCjuAjv_spin_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)
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.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_CisAitCiuAiv_spin_MPIdouble()

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 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 76 of file mltplyMPISpinCore.cpp.

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

Referenced by GC_child_general_int_spin_MPIdouble().

81 {
83  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
84  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
85  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.InterAll_OffDiagonal[i_int][7],
86  X->Def.ParaInterAll_OffDiagonal[i_int],X, nstate, tmp_v0, tmp_v1);
87 }/*void GC_child_CisAitCiuAiv_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_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.
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_CisAitCiuAiv_spin_MPIsingle()

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.

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 356 of file mltplyMPISpinCore.cpp.

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

Referenced by GC_child_general_int_spin_MPIsingle().

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 }/*void GC_child_CisAitCiuAiv_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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 ** 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_CisAitCjuAju_spin_MPIdouble()

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

Author
Kazuyoshi Yoshimi (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 214 of file mltplyMPISpinCore.cpp.

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

Referenced by GC_child_general_int_spin_MPIdouble().

220 {
222  X->Def.InterAll_OffDiagonal[i_int][0], X->Def.InterAll_OffDiagonal[i_int][1],
223  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
224  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
225 }/*void GC_child_CisAitCiuAiv_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
void X_GC_child_CisAitCjuAju_spin_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)
CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region...
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_CisAitCjuAju_spin_MPIsingle()

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.

Author
Kazuyoshi Yoshimi (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 509 of file mltplyMPISpinCore.cpp.

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

Referenced by GC_child_general_int_spin_MPIsingle().

514  {
516  X->Def.InterAll_OffDiagonal[i_int][0],
517  X->Def.InterAll_OffDiagonal[i_int][3], X->Def.InterAll_OffDiagonal[i_int][4],
518  X->Def.InterAll_OffDiagonal[i_int][5], X->Def.ParaInterAll_OffDiagonal[i_int], X, nstate, tmp_v0, tmp_v1);
519 }/*void GC_child_CisAisCjuAjv_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 X_GC_child_CisAitCjuAju_spin_MPIsingle(int org_isite1, 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)
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().
Definition: struct.hpp:170

◆ X_child_CisAisCjuAju_GeneralSpin_MPIdouble()

void X_child_CisAisCjuAju_GeneralSpin_MPIdouble ( int  org_isite1,
int  org_ispin1,
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 \(c_{is}^\dagger c_{is}c_{ju}^\dagger c_{ju}\) term in the canonical general spin system when both sites are in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[in]tmp_JCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 1154 of file mltplyMPISpinCore.cpp.

References BitCheckGeneral(), BindStruct::Check, BindStruct::Def, CheckList::idim_max, myrank, DefineList::SiteToBit, DefineList::Tpow, and zaxpy_long().

Referenced by expec_cisajscktalt_SpinGeneral().

1163  {
1164  long int num1;
1165  std::complex<double> tmp_V;
1166 
1167  if (org_isite1 == org_isite3 && org_ispin1 == org_ispin3) {
1168  num1 = BitCheckGeneral((long int) myrank, org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow);
1169  if (num1 != FALSE) {
1170  tmp_V = tmp_J;
1171  }
1172  else {
1173  return;
1174  }
1175  }
1176  else {
1177  num1 = BitCheckGeneral((long int) myrank, org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow);
1178  if (num1 != FALSE) {
1179  num1 = BitCheckGeneral((long int) myrank, org_isite3 + 1, org_ispin3, X->Def.SiteToBit,
1180  X->Def.Tpow);
1181  if (num1 != FALSE) {
1182  tmp_V = tmp_J;
1183  }
1184  else {
1185  return;
1186  }
1187  }
1188  else {
1189  return;
1190  }
1191  }
1192 
1193  zaxpy_long(X->Check.idim_max*nstate, tmp_V, &tmp_v1[1][0], &tmp_v0[1][0]);
1194 }/*std::complex<double> X_child_CisAisCjuAju_GeneralSpin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: bitcalc.cpp:392
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_child_CisAisCjuAju_GeneralSpin_MPIsingle()

void X_child_CisAisCjuAju_GeneralSpin_MPIsingle ( int  org_isite1,
int  org_ispin1,
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 \(c_{is}^\dagger c_{is}c_{ju}^\dagger c_{ju}\) term in the canonical general spin system when one of these sites is in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[in]tmp_JCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 1199 of file mltplyMPISpinCore.cpp.

References BitCheckGeneral(), BindStruct::Check, BindStruct::Def, CheckList::idim_max, list_1, myrank, DefineList::SiteToBit, and DefineList::Tpow.

Referenced by expec_cisajscktalt_SpinGeneral().

1209 {
1210  long int j, num1;
1211  std::complex<double> tmp_V, dmv;
1212  int one = 1;
1213 
1214  num1 = BitCheckGeneral((long int) myrank, org_isite3 + 1, org_ispin3, X->Def.SiteToBit, X->Def.Tpow);
1215  if (num1 != FALSE) {
1216  tmp_V = tmp_J;
1217  }
1218  else return;
1219 
1220 #pragma omp parallel default(none) \
1221 firstprivate(X, tmp_V, org_isite1, org_ispin1) private(j, dmv, num1) \
1222  shared (tmp_v0, tmp_v1, list_1,nstate,one)
1223  {
1224 #pragma omp for
1225  for (j = 1; j <= X->Check.idim_max; j++) {
1226  num1 = BitCheckGeneral(list_1[j], org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow);
1227 
1228  dmv = tmp_V * (std::complex<double>)num1;
1229  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[j][0], &one);
1230  }/*for (j = 1; j <= X->Check.idim_max; j++)*/
1231  }/*End of parallel region*/
1232 }/*std::complex<double> X_child_CisAisCjuAju_GeneralSpin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: bitcalc.cpp:392
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
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_CisAit_GeneralSpin_MPIdouble()

void X_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,
long int  idim_max 
)

Compute \(c_{is}^\dagger c_{it}\) term in the canonical general spin system when both site is in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_ispin2Spin 2
[in]tmp_transCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction
[in]idim_maxSimilar to CheckList::idim_max

Definition at line 844 of file mltplyMPISpinCore.cpp.

References ConvertToList1GeneralSpin(), BindStruct::Def, GetOffCompGeneralSpin(), LargeList::ihfbit, BindStruct::Large, list_1_org, list_1buf_org, LargeList::mode, myrank, SendRecv_cv(), SendRecv_i(), SendRecv_iv(), DefineList::SiteToBit, DefineList::Tpow, and v1buf.

Referenced by GetPairExcitedStateGeneralSpin().

855 {
856  long int off, j, tmp_off,idim_max_buf;
857  int origin, one = 1;
858  std::complex<double> tmp_V;
859 
860  if (GetOffCompGeneralSpin((long int) myrank, org_isite1 + 1, org_ispin1, org_ispin2,
861  &off, X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
862  tmp_V = tmp_trans;
863  }
864  else if (GetOffCompGeneralSpin((long int) myrank,
865  org_isite1 + 1, org_ispin2, org_ispin1, &off,
866  X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
867  tmp_V = conj(tmp_trans);
868  if (X->Large.mode == M_CORR || X->Large.mode ==M_CALCSPEC) tmp_V = 0.0;
869  }
870  else return;
871 
872  origin = (int) off;
873 
874  idim_max_buf = SendRecv_i(origin, idim_max);
875  SendRecv_iv(origin, idim_max + 1, idim_max_buf + 1, list_1_org, list_1buf_org);
876  SendRecv_cv(origin, idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
877 
878 #pragma omp parallel for default(none)\
879 firstprivate(X, tmp_V, idim_max_buf, list_1buf_org) private(j, tmp_off) \
880 shared (tmp_v0, tmp_v1, v1buf,nstate,one)
881  for (j = 1; j <= idim_max_buf; j++) {
883  zaxpy_(&nstate, &tmp_V, &v1buf[j][0], &one, &tmp_v0[tmp_off][0], &one);
884  }/*for (j = 1; j <= idim_max_buf; j++)*/
885 }/*std::complex<double> X_child_CisAit_GeneralSpin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > ** v1buf
Definition: global.cpp:22
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int ConvertToList1GeneralSpin(const long int org_ibit, const long int ihlfbit, long int *_ilist1Comp)
function of converting component to list_1
Definition: bitcalc.cpp:285
long int * list_1_org
Definition: global.cpp:31
int mode
multiply or expectation value.
Definition: struct.hpp:331
long int SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
Definition: wrapperMPI.cpp:504
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
Definition: bitcalc.cpp:243
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 * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
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
long int * list_1buf_org
Definition: global.cpp:32

◆ X_child_CisAit_spin_MPIdouble()

void X_child_CisAit_spin_MPIdouble ( int  org_isite1,
int  org_ispin2,
std::complex< double >  tmp_trans,
struct BindStruct X,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1,
long int  idim_max 
)

Hopping term in Spin + Canonical for CalcSpectrum When both site1 and site2 are in the inter process region.

Author
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]org_isite1Site 1
[in]org_ispin2Spin 2
[in]tmp_transCoupling constant
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1
[in]idim_maxSimilar to CheckList::idim_max

Definition at line 1340 of file mltplyMPISpinCore.cpp.

References BindStruct::Def, GetOffComp(), LargeList::ihfbit, LargeList::ilft, LargeList::irght, BindStruct::Large, list_1_org, list_1buf_org, list_2_1, list_2_2, myrank, SendRecv_cv(), SendRecv_i(), SendRecv_iv(), DefineList::Tpow, and v1buf.

Referenced by GetPairExcitedStateHalfSpin().

1349  {
1350  int mask1, state1, origin, one = 1;
1351  long int idim_max_buf, j;
1352  long int tmp_off;
1353  std::complex<double> trans;
1354 
1355  mask1 = (int)X->Def.Tpow[org_isite1];
1356  origin = myrank ^ mask1;
1357  state1 = (origin & mask1)/mask1;
1358 
1359  if(state1 == org_ispin2){
1360  trans = tmp_trans;
1361  }
1362  else{
1363  trans =0.0;
1364  }
1365 
1366  // fprintf(stdout, "Debug: myrank=%d, origin=%d, trans=%lf\n", myrank, origin, trans);
1367 
1368  idim_max_buf = SendRecv_i(origin, idim_max);
1369  SendRecv_iv(origin, idim_max + 1, idim_max_buf + 1, list_1_org, list_1buf_org);
1370  SendRecv_cv(origin, idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
1371 
1372 #pragma omp parallel for default(none) private(j, tmp_off) \
1373 firstprivate(idim_max_buf, trans, X, list_1buf_org, list_2_1, list_2_2) \
1374 shared(v1buf, tmp_v0,nstate,one)
1375  for (j = 1; j <= idim_max_buf; j++) {
1376  GetOffComp(list_2_1, list_2_2, list_1buf_org[j], X->Large.irght, X->Large.ilft, X->Large.ihfbit, &tmp_off);
1377  zaxpy_(&nstate, &trans, &v1buf[j][0], &one, &tmp_v0[tmp_off][0], &one);
1378  }
1379 }/*std::complex<double> X_child_CisAit_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 * list_1_org
Definition: global.cpp:31
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 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
long int * list_1buf_org
Definition: global.cpp:32

◆ X_child_CisAitCjuAjv_GeneralSpin_MPIdouble()

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 \(c_{is}^\dagger c_{it}c_{ju}^\dagger c_{jv}\) term in the canonical general spin system when both sites are in the inter process region.

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_JCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 1088 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, ConvertToList1GeneralSpin(), BindStruct::Def, GetOffCompGeneralSpin(), CheckList::idim_max, BindStruct::Large, list_1, list_1buf, LargeList::mode, myrank, CheckList::sdim, SendRecv_cv(), SendRecv_i(), SendRecv_iv(), DefineList::SiteToBit, DefineList::Tpow, and v1buf.

Referenced by child_general_int_GeneralSpin_MPIdouble(), and expec_cisajscktalt_SpinGeneral().

1099  {
1100  long int tmp_off, off, j, idim_max_buf;
1101  int origin, one = 1;
1102  std::complex<double> tmp_V;
1103  int ihermite=TRUE;
1104 
1105  if (GetOffCompGeneralSpin((long int)myrank, org_isite1 + 1, org_ispin1, org_ispin2, &tmp_off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
1106  {
1107  if (GetOffCompGeneralSpin(tmp_off, org_isite3 + 1, org_ispin3, org_ispin4, &off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
1108  {
1109  tmp_V = tmp_J;
1110  }
1111  else{
1112  ihermite =FALSE;
1113  }
1114  }
1115  else{
1116  ihermite=FALSE;
1117  }
1118 
1119  if (ihermite == FALSE) {
1120  if (GetOffCompGeneralSpin((long int)myrank, org_isite3 + 1, org_ispin4, org_ispin3, &tmp_off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
1121  {
1122  if (GetOffCompGeneralSpin(tmp_off, org_isite1 + 1, org_ispin2, org_ispin1, &off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
1123  {
1124  tmp_V = conj(tmp_J);
1125  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
1126  tmp_V = 0.0;
1127  }
1128  }
1129  else return;
1130  }
1131  else return;
1132  }
1133 
1134  origin = (int)off;
1135 
1136  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
1137  SendRecv_iv(origin, X->Check.idim_max + 1, idim_max_buf + 1, list_1, list_1buf);
1138  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
1139 
1140 #pragma omp parallel default(none) firstprivate(X, tmp_V, idim_max_buf) \
1141 private(j, off) shared (tmp_v0, tmp_v1, list_1buf, v1buf,nstate,one)
1142  {
1143 #pragma omp for
1144  for (j = 1; j <= idim_max_buf; j++) {
1146  zaxpy_(&nstate, &tmp_V, &v1buf[j][0], &one, &tmp_v0[off][0], &one);
1147  }/*for (j = 1; j <= idim_max_buf; j++)*/
1148  }/*End of parallel region*/
1149 }/*std::complex<double> X_child_CisAitCjuAjv_GeneralSpin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > ** v1buf
Definition: global.cpp:22
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int ConvertToList1GeneralSpin(const long int org_ibit, const long int ihlfbit, long int *_ilist1Comp)
function of converting component to list_1
Definition: bitcalc.cpp:285
int mode
multiply or expectation value.
Definition: struct.hpp:331
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
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
Definition: bitcalc.cpp:243
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 * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
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 sdim
Dimension for Ogata-Lin ???
Definition: struct.hpp:309
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_CisAitCjuAjv_GeneralSpin_MPIsingle()

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 \(c_{is}^\dagger c_{it}c_{ju}^\dagger c_{jv}\) term in the canonical general spin system when one of these sites is in the inter process region.

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_JCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 1237 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, ConvertToList1GeneralSpin(), BindStruct::Def, GetOffCompGeneralSpin(), CheckList::idim_max, BindStruct::Large, list_1, list_1buf, LargeList::mode, myrank, CheckList::sdim, SendRecv_cv(), SendRecv_i(), SendRecv_iv(), DefineList::SiteToBit, DefineList::Tpow, and v1buf.

Referenced by child_general_int_GeneralSpin_MPIsingle(), and expec_cisajscktalt_SpinGeneral().

1248  {
1249  long int tmp_off, off, j, idim_max_buf;
1250  int origin, isite, IniSpin, FinSpin, one = 1;
1251  std::complex<double> tmp_V;
1252 
1253  if (GetOffCompGeneralSpin((long int)myrank,
1254  org_isite3 + 1, org_ispin3, org_ispin4, &off,
1255  X->Def.SiteToBit, X->Def.Tpow) == TRUE)
1256  {
1257  tmp_V = tmp_J;
1258  isite = org_isite1 + 1;
1259  IniSpin = org_ispin2;
1260  FinSpin = org_ispin1;
1261  }
1262  else if (GetOffCompGeneralSpin((long int)myrank,
1263  org_isite3 + 1, org_ispin4, org_ispin3, &off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
1264  {
1265  tmp_V = conj(tmp_J);
1266  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
1267  isite = org_isite1 + 1;
1268  IniSpin = org_ispin1;
1269  FinSpin = org_ispin2;
1270  }
1271  else return;
1272 
1273  origin = (int)off;
1274 
1275  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
1276  SendRecv_iv(origin, X->Check.idim_max + 1, idim_max_buf + 1, list_1, list_1buf);
1277  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
1278 
1279 #pragma omp parallel default(none) \
1280 firstprivate(X, tmp_V, idim_max_buf, IniSpin, FinSpin, isite) \
1281 private(j, off, tmp_off) shared (tmp_v0, tmp_v1, list_1buf, v1buf,nstate,one)
1282  {
1283 #pragma omp for
1284  for (j = 1; j <= idim_max_buf; j++) {
1285 
1286  if (GetOffCompGeneralSpin(list_1buf[j], isite, IniSpin, FinSpin, &tmp_off,
1287  X->Def.SiteToBit, X->Def.Tpow) == TRUE)
1288  {
1289  ConvertToList1GeneralSpin(tmp_off, X->Check.sdim, &off);
1290  zaxpy_(&nstate, &tmp_V, &v1buf[j][0], &one, &tmp_v0[off][0], &one);
1291  }
1292  }/*for (j = 1; j <= idim_max_buf; j++)*/
1293  }/*End of parallel region*/
1294 }/*std::complex<double> X_child_CisAitCjuAjv_GeneralSpin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > ** v1buf
Definition: global.cpp:22
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int ConvertToList1GeneralSpin(const long int org_ibit, const long int ihlfbit, long int *_ilist1Comp)
function of converting component to list_1
Definition: bitcalc.cpp:285
int mode
multiply or expectation value.
Definition: struct.hpp:331
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
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
Definition: bitcalc.cpp:243
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 * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
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 sdim
Dimension for Ogata-Lin ???
Definition: struct.hpp:309
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_GC_child_AisCis_GeneralSpin_MPIdouble()

void X_GC_child_AisCis_GeneralSpin_MPIdouble ( int  org_isite1,
int  org_ispin1,
std::complex< double >  tmp_trans,
struct BindStruct X,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1 
)

Compute \(c_{is} c_{is}^\dagger\) term in the grandcanonical general spin system when both site is in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]tmp_transCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 820 of file mltplyMPISpinCore.cpp.

References BitCheckGeneral(), BindStruct::Check, BindStruct::Def, CheckList::idim_max, myrank, DefineList::SiteToBit, DefineList::Tpow, and zaxpy_long().

Referenced by GetPairExcitedStateGeneralSpinGC().

827  {
828  long int num1;
829  std::complex<double> tmp_V;
830 
831  num1 = BitCheckGeneral((long int) myrank,
832  org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow);
833  if (num1 == 0) {
834  tmp_V = tmp_trans;
835  }
836  else return;
837 
838  zaxpy_long(X->Check.idim_max*nstate, tmp_V, &tmp_v1[1][0], &tmp_v0[1][0]);
839 }/*std::complex<double> X_GC_child_AisCis_GeneralSpin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: bitcalc.cpp:392
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_AisCis_spin_MPIdouble()

void X_GC_child_AisCis_spin_MPIdouble ( int  org_isite1,
int  org_ispin1,
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.

Author
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]tmp_transCoupling constant
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 1404 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, myrank, DefineList::Tpow, and zaxpy_long().

1411  {
1412  int mask1;
1413  int ibit1;
1414  mask1 = (int)X->Def.Tpow[org_isite1];
1415  ibit1 = (((long int)myrank& mask1) / mask1) ^ (1 - org_ispin1);
1416 
1417  if (ibit1 == 0) {
1418  zaxpy_long(X->Check.idim_max*nstate, tmp_trans, &tmp_v1[1][0], &tmp_v0[1][0]);
1419  }/*if (ibit1 == 0)*/
1420 }/*std::complex<double> X_GC_child_AisCis_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAis_GeneralSpin_MPIdouble()

void X_GC_child_CisAis_GeneralSpin_MPIdouble ( int  org_isite1,
int  org_ispin1,
std::complex< double >  tmp_trans,
struct BindStruct X,
int  nstate,
std::complex< double > **  tmp_v0,
std::complex< double > **  tmp_v1 
)

Compute \(c_{is}^\dagger c_{is}\) term in the grandcanonical general spin system when both site is in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]tmp_transCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 796 of file mltplyMPISpinCore.cpp.

References BitCheckGeneral(), BindStruct::Check, BindStruct::Def, CheckList::idim_max, myrank, DefineList::SiteToBit, DefineList::Tpow, and zaxpy_long().

Referenced by expec_cisajs_SpinGCGeneral(), GetPairExcitedStateGeneralSpinGC(), and X_GC_child_CisAitCjuAjv_GeneralSpin_MPIdouble().

803  {
804  long int num1;
805  std::complex<double> tmp_V;
806 
807  num1 = BitCheckGeneral((long int) myrank,
808  org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow);
809  if (num1 != 0) {
810  tmp_V = tmp_trans;
811  }
812  else return;
813 
814  zaxpy_long(X->Check.idim_max*nstate, tmp_V, &tmp_v1[1][0], &tmp_v0[1][0]);
815 }/*std::complex<double> X_GC_child_CisAis_GeneralSpin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: bitcalc.cpp:392
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAis_spin_MPIdouble()

void X_GC_child_CisAis_spin_MPIdouble ( int  org_isite1,
int  org_ispin1,
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.

Author
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]tmp_transCoupling constant
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 1385 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, myrank, DefineList::Tpow, and zaxpy_long().

Referenced by expec_cisajs_SpinGCHalf(), expec_cisajscktalt_SpinGCHalf(), and X_GC_child_CisAitCiuAiv_spin_MPIdouble().

1392  {
1393  int mask1, ibit1;
1394  mask1 = (int)X->Def.Tpow[org_isite1];
1395  ibit1 = (((long int)myrank& mask1)/mask1)^(1-org_ispin1);
1396  if (ibit1 != 0)
1397  zaxpy_long(X->Check.idim_max*nstate, tmp_trans, &tmp_v1[1][0], &tmp_v0[1][0]);
1398 }/*std::complex<double> X_GC_child_CisAis_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAisCjuAju_GeneralSpin_MPIdouble()

void X_GC_child_CisAisCjuAju_GeneralSpin_MPIdouble ( int  org_isite1,
int  org_ispin1,
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 \(c_{is}^\dagger c_{is} c_{ju}^\dagger c_{ju}\) term in the grandcanonical general spin system when both site is in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[in]tmp_JCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 731 of file mltplyMPISpinCore.cpp.

References BitCheckGeneral(), BindStruct::Check, BindStruct::Def, CheckList::idim_max, myrank, DefineList::SiteToBit, DefineList::Tpow, and zaxpy_long().

Referenced by expec_cisajscktalt_SpinGCGeneral().

740  {
741  long int num1;
742  std::complex<double> tmp_V;
743 
744  num1 = BitCheckGeneral((long int) myrank, org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow);
745 
746  if (num1 == TRUE) {
747  num1 = BitCheckGeneral((long int) myrank, org_isite3 + 1, org_ispin3, X->Def.SiteToBit, X->Def.Tpow);
748  if (num1 == TRUE) {
749  tmp_V = tmp_J;
750  }
751  else return;
752  }
753  else return;
754 
755  zaxpy_long(X->Check.idim_max*nstate, tmp_V, &tmp_v1[1][0], &tmp_v0[1][0]);
756 }/*std::complex<double> X_GC_child_CisAisCjuAju_GeneralSpin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: bitcalc.cpp:392
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAisCjuAju_GeneralSpin_MPIsingle()

void X_GC_child_CisAisCjuAju_GeneralSpin_MPIsingle ( int  org_isite1,
int  org_ispin1,
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 \(c_{is}^\dagger c_{is}c_{ju}^\dagger c_{ju}\) term in the grandcanonical general spin system when one of these site is in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[in]tmp_JCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 1051 of file mltplyMPISpinCore.cpp.

References BitCheckGeneral(), BindStruct::Check, BindStruct::Def, CheckList::idim_max, myrank, DefineList::SiteToBit, and DefineList::Tpow.

Referenced by expec_cisajscktalt_SpinGCGeneral().

1060  {
1061  long int j, num1;
1062  std::complex<double> tmp_V, dmv;
1063  int one = 1;
1064 
1065  num1 = BitCheckGeneral((long int)myrank, org_isite3+1, org_ispin3, X->Def.SiteToBit, X->Def.Tpow);
1066  if (num1 != FALSE) {
1067  tmp_V = tmp_J;
1068  }
1069  else return;
1070 
1071 #pragma omp parallel default(none) \
1072 firstprivate(X, tmp_V, org_isite1, org_ispin1) private(j, dmv, num1) \
1073  shared (tmp_v0, tmp_v1,nstate,one)
1074  {
1075 #pragma omp for
1076  for (j = 1; j <= X->Check.idim_max; j++) {
1077  num1 = BitCheckGeneral(j - 1, org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow);
1078 
1079  dmv = tmp_V * (std::complex<double>)num1;
1080  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[j][0], &one);
1081  }/*for (j = 1; j <= X->Check.idim_max; j++)*/
1082  }/*End of parallel region*/
1083 }/*std::complex<double> X_GC_child_CisAisCjuAju_GeneralSpin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: bitcalc.cpp:392
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAisCjuAju_spin_MPIdouble()

void X_GC_child_CisAisCjuAju_spin_MPIdouble ( int  org_isite1,
int  org_ispin1,
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 
)

CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region.

Author
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[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 287 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, myrank, DefineList::Tpow, and X_SpinGC_CisAis().

Referenced by expec_cisajscktalt_SpinGCHalf().

296  {
297  long int mask1, mask2, num1,num2;
298  long int j;
299  std::complex<double> dmv;
300  int one = 1;
301  mask1 = (int)X->Def.Tpow[org_isite1];
302  mask2 = (int)X->Def.Tpow[org_isite3];
303  num1 = X_SpinGC_CisAis((long int)myrank + 1, mask1, org_ispin1);
304  num2 = X_SpinGC_CisAis((long int)myrank + 1, mask2, org_ispin3);
305 
306 #pragma omp parallel default(none) private(j, dmv) \
307  firstprivate(tmp_J, X, num1, num2) shared(tmp_v1, tmp_v0,nstate,one)
308  {
309 #pragma omp for
310  for (j = 1; j <= X->Check.idim_max; j++) {
311  dmv = (std::complex<double>)(num1 * num2) * tmp_J;
312  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[j][0], &one);
313  }/*for (j = 1; j <= X->Check.idim_max; j++) */
314  }/*End of parallel region*/
315 }/*std::complex<double> X_GC_child_CisAisCjuAju_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
int X_SpinGC_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAisCjuAju_spin_MPIsingle()

void X_GC_child_CisAisCjuAju_spin_MPIsingle ( int  org_isite1,
int  org_ispin1,
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 
)

CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region.

Author
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[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 321 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, myrank, DefineList::Tpow, and X_SpinGC_CisAis().

Referenced by expec_cisajscktalt_SpinGCHalf().

330  {
331  long int mask1, mask2, num1, num2;
332  long int j;
333  std::complex<double> Jint, dmv;
334  int one = 1;
335  Jint = tmp_J;
336  mask1 = (int)X->Def.Tpow[org_isite1];
337  mask2 = (int)X->Def.Tpow[org_isite3];
338  num2 = X_SpinGC_CisAis((long int) myrank + 1, mask2, org_ispin3);
339 
340 #pragma omp parallel default(none) private(j, dmv, num1) \
341  firstprivate(Jint, X, num2, mask1, org_ispin1) shared(tmp_v1, tmp_v0,nstate,one)
342  {
343 #pragma omp for
344  for (j = 1; j <= X->Check.idim_max; j++) {
345  num1 = X_SpinGC_CisAis(j, mask1, org_ispin1);
346  dmv = Jint * (std::complex<double>)(num1 * num2);
347  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[j][0], &one);
348  }/*for (j = 1; j <= X->Check.idim_max; j++)*/
349  }/*End of parallel region*/
350 }/*std::complex<double> X_GC_child_CisAisCjuAju_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
int X_SpinGC_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAisCjuAjv_GeneralSpin_MPIdouble()

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 
)

\(c_{is}^\dagger c_{is} c_{ju}^\dagger c_{jv}\) term in Spin model. When both site1 and site3 are in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[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 577 of file mltplyMPISpinCore.cpp.

References BitCheckGeneral(), BindStruct::Check, BindStruct::Def, GetOffCompGeneralSpin(), CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), DefineList::SiteToBit, DefineList::Tpow, v1buf, and zaxpy_long().

Referenced by expec_cisajscktalt_SpinGCGeneral(), and GC_child_general_int_GeneralSpin_MPIdouble().

587  {
588  long int off;
589  int origin;
590  std::complex<double> tmp_V;
591  if (org_isite1 == org_isite3 && org_ispin1 == org_ispin4) {//cisaisciuais=0 && cisaiucisais=0
592  return;
593  }
594 
595  if (BitCheckGeneral(myrank, org_isite1 + 1, org_ispin1, X->Def.SiteToBit, X->Def.Tpow) == TRUE
596  && GetOffCompGeneralSpin((long int) myrank, org_isite3 + 1, org_ispin3, org_ispin4,
597  &off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
598  tmp_V = tmp_J;
599  else {
600  if (GetOffCompGeneralSpin((long int) myrank, org_isite3 + 1, org_ispin4, org_ispin3,
601  &off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
602  {
603  if (BitCheckGeneral((long int)off, org_isite1 + 1, org_ispin1, X->Def.SiteToBit,
604  X->Def.Tpow) == TRUE)
605  {
606  tmp_V = conj(tmp_J);
607  if(X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
608  }/*BitCheckGeneral(off, org_isite1 + 1, org_ispin1)*/
609  else return;
610  }/*GetOffCompGeneralSpin(myrank, org_isite3 + 1, org_ispin4, org_ispin3, &off)*/
611  else return;
612  }
613  origin = (int)off;
614  SendRecv_cv(origin, X->Check.idim_max*nstate, X->Check.idim_max*nstate, &tmp_v1[1][0], &v1buf[1][0]);
615 
616  zaxpy_long(X->Check.idim_max*nstate, tmp_V, &v1buf[1][0], &tmp_v0[1][0]);
617 }/*std::complex<double> X_GC_child_CisAisCjuAjv_GeneralSpin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: bitcalc.cpp:392
std::complex< double > ** v1buf
Definition: global.cpp:22
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int mode
multiply or expectation value.
Definition: struct.hpp:331
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
Definition: bitcalc.cpp:243
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 * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle()

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 \(c_{is}^\dagger c_{is}c_{ju}^\dagger c_{jv}\) term in the grandcanonical general spin system when one of these site is in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[in]org_ispin4Spin 4
[in]tmp_JCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 890 of file mltplyMPISpinCore.cpp.

References BitCheckGeneral(), BindStruct::Check, BindStruct::Def, GetOffCompGeneralSpin(), CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), DefineList::SiteToBit, DefineList::Tpow, and v1buf.

Referenced by expec_cisajscktalt_SpinGCGeneral(), and GC_child_general_int_GeneralSpin_MPIsingle().

900  {
901  long int off, j, num1;
902  int origin, isite, IniSpin, one = 1;
903  std::complex<double> tmp_V;
904 
905  if (GetOffCompGeneralSpin((long int)myrank,
906  org_isite3 + 1, org_ispin3, org_ispin4, &off,
907  X->Def.SiteToBit, X->Def.Tpow) == TRUE)
908  {
909  tmp_V = tmp_J;
910  isite = org_isite1 + 1;
911  IniSpin = org_ispin1;
912  }
913  else if (GetOffCompGeneralSpin((long int)myrank,
914  org_isite3 + 1, org_ispin4, org_ispin3, &off,
915  X->Def.SiteToBit, X->Def.Tpow) == TRUE)
916  {
917  tmp_V = conj(tmp_J);
918  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
919  isite = org_isite1 + 1;
920  IniSpin = org_ispin1;
921  }
922  else return;
923 
924  origin = (int)off;
925 
926  SendRecv_cv(origin, X->Check.idim_max*nstate, X->Check.idim_max*nstate, &tmp_v1[1][0], &v1buf[1][0]);
927 
928 #pragma omp parallel default(none) firstprivate(X, tmp_V, isite, IniSpin) \
929 private(j, num1) shared (tmp_v0, tmp_v1, v1buf,nstate,one)
930  {
931 #pragma omp for
932  for (j = 1; j <= X->Check.idim_max; j++) {
933  num1 = BitCheckGeneral(j - 1, isite, IniSpin, X->Def.SiteToBit, X->Def.Tpow);
934  if (num1 != 0) zaxpy_(&nstate, &tmp_V, &v1buf[j][0], &one, &tmp_v0[j][0], &one);
935  }/*for (j = 1; j <= X->Check.idim_max; j++)*/
936  }/*End of parallel region*/
937 }/*std::complex<double> X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: bitcalc.cpp:392
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
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
Definition: bitcalc.cpp:243
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 * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAisCjuAjv_spin_MPIdouble()

void X_GC_child_CisAisCjuAjv_spin_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 
)

CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region.

Author
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[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 168 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), SendRecv_i(), DefineList::Tpow, v1buf, X_SpinGC_CisAis(), and zaxpy_long().

Referenced by expec_cisajscktalt_SpinGCHalf(), and GC_child_CisAisCjuAjv_spin_MPIdouble().

178  {
179  int mask1, mask2, state2;
180  long int origin, num1;
181  long int idim_max_buf;
182  std::complex<double> Jint;
183 
184  if (org_isite1 == org_isite3 && org_ispin1 == org_ispin4) {//CisAisCitAis
185  return;
186  }
187 
188  mask1 = (int)X->Def.Tpow[org_isite1];
189  mask2 = (int)X->Def.Tpow[org_isite3];
190  origin = myrank ^ mask2;
191  state2 = (origin & mask2) / mask2;
192  num1 = X_SpinGC_CisAis((long int) myrank + 1, mask1, org_ispin1);
193  if (num1 != 0 && state2 == org_ispin4) {
194  Jint = tmp_J;
195  }
196  else if (X_SpinGC_CisAis(origin + 1, mask1, org_ispin1) == TRUE && state2 == org_ispin3) {
197  Jint = conj(tmp_J);
198  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) Jint = 0;
199  }
200  else {
201  return;
202  }
203 
204  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
205  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
206 
207  zaxpy_long(X->Check.idim_max*nstate, Jint, &v1buf[1][0], &tmp_v0[1][0]);
208 }/*std::complex<double> X_GC_child_CisAisCjuAjv_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > ** v1buf
Definition: global.cpp:22
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
int X_SpinGC_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int mode
multiply or expectation value.
Definition: struct.hpp:331
long int SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
Definition: wrapperMPI.cpp:504
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
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAisCjuAjv_spin_MPIsingle()

void X_GC_child_CisAisCjuAjv_spin_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 
)

CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region.

Author
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 2
[in]org_isite3Site 1
[in]org_ispin3Spin 2
[in]org_ispin4Spin 2
[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 450 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), SendRecv_i(), DefineList::Tpow, and v1buf.

Referenced by expec_cisajscktalt_SpinGCHalf(), and GC_child_CisAisCjuAjv_spin_MPIsingle().

460  {
461  int mask2, state2, origin;
462  long int mask1, idim_max_buf, j, state1, state1check;
463  std::complex<double> Jint;
464  int one = 1;
465  /*
466  Prepare index in the inter PE
467  */
468  mask2 = (int)X->Def.Tpow[org_isite3];
469  origin = myrank ^ mask2;
470  state2 = (origin & mask2) / mask2;
471  if (state2 == org_ispin4) {
472  state1check = (long int) org_ispin1;
473  Jint = tmp_J;
474  }
475  else if (state2 == org_ispin3) {
476  state1check = (long int) org_ispin1;
477  Jint = conj(tmp_J);
478  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
479  Jint = 0;
480  }
481  }
482  else return;
483 
484  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
485  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
486  /*
487  Index in the intra PE
488  */
489  mask1 = X->Def.Tpow[org_isite1];
490 
491 #pragma omp parallel default(none) private(j, state1) \
492  firstprivate(idim_max_buf, Jint, X, state1check, mask1) \
493  shared(v1buf, tmp_v1, tmp_v0,nstate,one)
494  {
495 #pragma omp for
496  for (j = 0; j < idim_max_buf; j++) {
497  state1 = (j & mask1) / mask1;
498  if (state1 == state1check) {
499  zaxpy_(&nstate, &Jint, &v1buf[j + 1][0], &one, &tmp_v0[j + 1][0], &one);
500  }/*if (state1 == state1check)*/
501  }/*for (j = 0; j < idim_max_buf; j++)*/
502  }/*End of parallel region*/
503 }/*void GC_child_CisAitCiuAiv_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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 SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
Definition: wrapperMPI.cpp:504
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
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAit_GeneralSpin_MPIdouble()

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 \(c_{is}^\dagger c_{it}\) term in the grandcanonical general spin system when both site is in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_ispin2Spin 2
[in]tmp_transCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 761 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, GetOffCompGeneralSpin(), CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), DefineList::SiteToBit, DefineList::Tpow, v1buf, and zaxpy_long().

Referenced by expec_cisajs_SpinGCGeneral(), GetPairExcitedStateGeneralSpinGC(), and mltplyGeneralSpinGC().

769  {
770  long int off;
771  int origin;
772  std::complex<double> tmp_V;
773 
774  if (GetOffCompGeneralSpin((long int) myrank, org_isite1 + 1, org_ispin1, org_ispin2,
775  &off, X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
776  tmp_V = tmp_trans;
777  }
778  else if (GetOffCompGeneralSpin((long int) myrank,
779  org_isite1 + 1, org_ispin2, org_ispin1, &off,
780  X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
781  tmp_V = conj(tmp_trans);
782  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
783  }
784  else return;
785 
786  origin = (int)off;
787 
788  SendRecv_cv(origin, X->Check.idim_max*nstate, X->Check.idim_max*nstate, &tmp_v1[1][0], &v1buf[1][0]);
789 
790  zaxpy_long(X->Check.idim_max*nstate, tmp_V, &v1buf[1][0], &tmp_v0[1][0]);
791 }/*std::complex<double> X_GC_child_CisAit_GeneralSpin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > ** v1buf
Definition: global.cpp:22
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int mode
multiply or expectation value.
Definition: struct.hpp:331
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
Definition: bitcalc.cpp:243
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 * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAit_spin_MPIdouble()

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.

Author
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_ispin2Spin 2
[in]tmp_transCoupling constant
[in,out]X
[out]tmp_v0Result v0 = H v1
[in]tmp_v1v0 = H v1

Definition at line 1300 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), SendRecv_i(), DefineList::Tpow, v1buf, and zaxpy_long().

Referenced by expec_cisajs_SpinGCHalf(), and mltplyHalfSpinGC().

1308 {
1309  int mask1, state1, origin;
1310  long int idim_max_buf;
1311  std::complex<double> trans;
1312 
1313  mask1 = (int)X->Def.Tpow[org_isite1];
1314  origin = myrank ^ mask1;
1315  state1 = (origin & mask1)/mask1;
1316 
1317  if(state1 == org_ispin2){
1318  trans = tmp_trans;
1319  }
1320  else if(state1 == org_ispin1) {
1321  trans = conj(tmp_trans);
1322  if(X->Large.mode == M_CORR|| X->Large.mode ==M_CALCSPEC){
1323  trans = 0.0;
1324  }
1325  }
1326  else{
1327  return;
1328  }
1329 
1330  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
1331  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
1332 
1333  zaxpy_long(X->Check.idim_max*nstate, trans, &v1buf[1][0], &tmp_v0[1][0]);
1334 }/*std::complex<double> X_GC_child_CisAit_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > ** v1buf
Definition: global.cpp:22
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int mode
multiply or expectation value.
Definition: struct.hpp:331
long int SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
Definition: wrapperMPI.cpp:504
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
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAitCiuAiv_spin_MPIdouble()

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 
)

\(c_{is}^\dagger c_{it} c_{iu}^\dagger c_{iv}\) term in Spin model + GC. When both site1 and site2 are in the inter process region.

Author
Kazuyoshi Yoshimi (The University of Tokyo)
Mitsuaki Kawamura (The University of Tokyo)
Parameters
[in]org_isite1site i
[in]org_ispin1spin s
[in]org_ispin2spin t
[in]org_isite3site i?
[in]org_ispin3spin u
[in]org_ispin4spin v
[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 95 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), SendRecv_i(), DefineList::Tpow, v1buf, X_GC_child_CisAis_spin_MPIdouble(), and zaxpy_long().

Referenced by expec_cisajscktalt_SpinGCHalf(), GC_child_CisAitCiuAiv_spin_MPIdouble(), and mltplyHalfSpinGC().

106  {
107  int mask1, mask2, state1, state2, origin;
108  long int idim_max_buf;
109  std::complex<double> Jint;
110 
111  mask1 = (int)X->Def.Tpow[org_isite1];
112  mask2 = (int)X->Def.Tpow[org_isite3];
113  if (org_isite1 != org_isite3) {
114  origin = myrank ^ (mask1 + mask2);
115  }
116  else {
117  if (org_ispin1 == org_ispin4 && org_ispin2 == org_ispin3) { //CisAitCitAis=CisAis
118  X_GC_child_CisAis_spin_MPIdouble(org_isite1, org_ispin1, tmp_J, X, nstate, tmp_v0, tmp_v1);
119  return;
120  }
121  else { //CisAitCisAit=0
122  return;
123  }
124  }
125 
126  state1 = (origin & mask1) / mask1;
127  state2 = (origin & mask2) / mask2;
128 
129  if (state1 == org_ispin2 && state2 == org_ispin4) {
130  Jint = tmp_J;
131  }
132  else if (state1 == org_ispin1 && state2 == org_ispin3) {
133  Jint = conj(tmp_J);
134  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
135  Jint = 0;
136  }
137  }
138  else {
139  return;
140  }
141 
142  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
143  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
144 
145  zaxpy_long(nstate * idim_max_buf, Jint, &v1buf[1][0], &tmp_v0[1][0]);
146 }/*void GC_child_CisAitCiuAiv_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > ** v1buf
Definition: global.cpp:22
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int mode
multiply or expectation value.
Definition: struct.hpp:331
long int SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
Definition: wrapperMPI.cpp:504
void X_GC_child_CisAis_spin_MPIdouble(int org_isite1, int org_ispin1, 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.
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
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAitCiuAiv_spin_MPIsingle()

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.

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 373 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), SendRecv_i(), DefineList::Tpow, v1buf, and X_SpinGC_CisAit().

Referenced by expec_cisajscktalt_SpinGCHalf(), GC_child_CisAitCiuAiv_spin_MPIsingle(), and mltplyHalfSpinGC().

384  {
385  int mask2, state2, origin;
386  long int mask1, idim_max_buf, j, ioff, state1, state1check;
387  std::complex<double> Jint;
388  int one = 1;
389  /*
390  Prepare index in the inter PE
391  */
392  mask2 = (int)X->Def.Tpow[org_isite3];
393  origin = myrank ^ mask2;
394  state2 = (origin & mask2) / mask2;
395 
396  if (state2 == org_ispin4) {
397  state1check = (long int) org_ispin2;
398  Jint = tmp_J;
399  }
400  else if (state2 == org_ispin3) {
401  state1check = (long int) org_ispin1;
402  Jint = conj(tmp_J);
403  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
404  Jint = 0;
405  }
406  }
407  else return;
408 
409  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
410  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
411  /*
412  Index in the intra PE
413  */
414  mask1 = X->Def.Tpow[org_isite1];
415 
416 #pragma omp parallel default(none) private(j, state1, ioff) \
417  firstprivate(idim_max_buf, Jint, X, state1check, mask1) \
418  shared(v1buf, tmp_v1, tmp_v0,nstate,one)
419  {
420 #pragma omp for
421  for (j = 0; j < idim_max_buf; j++) {
422  state1 = X_SpinGC_CisAit(j + 1, mask1, state1check, &ioff);
423  if (state1 != 0) {
424  zaxpy_(&nstate, &Jint, &v1buf[j + 1][0], &one, &tmp_v0[ioff + 1][0], &one);
425  }/*if (state1 != 0)*/
426  }/*for (j = 0; j < idim_max_buf; j++)*/
427  }/*End of parallel region*/
428 }/*void GC_child_CisAitCiuAiv_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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 SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
Definition: wrapperMPI.cpp:504
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
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).
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble()

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 
)

\(c_{is}^\dagger c_{it} c_{ju}^\dagger c_{ju}\) term in Spin model. When both site1 and site3 are in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_ispin2Spin 2
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[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 622 of file mltplyMPISpinCore.cpp.

References BitCheckGeneral(), BindStruct::Check, BindStruct::Def, GetOffCompGeneralSpin(), CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), DefineList::SiteToBit, DefineList::Tpow, v1buf, and zaxpy_long().

Referenced by expec_cisajscktalt_SpinGCGeneral(), and GC_child_general_int_GeneralSpin_MPIdouble().

632  {
633  long int off;
634  int origin;
635  std::complex<double> tmp_V;
636 
637  if (org_isite1 == org_isite3 && org_ispin1 == org_ispin3) {//cisaitcisais=0 && cisaiscitais=0
638  return;
639  }
640 
641  if (BitCheckGeneral(myrank, org_isite3 + 1, org_ispin3, X->Def.SiteToBit, X->Def.Tpow) == TRUE
642  && GetOffCompGeneralSpin((long int) myrank, org_isite1 + 1, org_ispin2, org_ispin1, &off,
643  X->Def.SiteToBit, X->Def.Tpow) == TRUE)
644  {
645  tmp_V = conj(tmp_J);
646  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
647  }
648  else if (GetOffCompGeneralSpin((long int) myrank, org_isite1 + 1, org_ispin1, org_ispin2,
649  &off, X->Def.SiteToBit, X->Def.Tpow) == TRUE)
650  {
651  if (BitCheckGeneral((long int)off, org_isite3 + 1, org_ispin3,
652  X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
653  tmp_V = tmp_J;
654  }
655  else return;
656  }
657  else return;
658 
659  origin = (int)off;
660 
661  SendRecv_cv(origin, X->Check.idim_max*nstate, X->Check.idim_max*nstate, &tmp_v1[1][0], &v1buf[1][0]);
662 
663  zaxpy_long(X->Check.idim_max*nstate, tmp_V, &v1buf[1][0], &tmp_v0[1][0]);
664 }/*std::complex<double> X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: bitcalc.cpp:392
std::complex< double > ** v1buf
Definition: global.cpp:22
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int mode
multiply or expectation value.
Definition: struct.hpp:331
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
Definition: bitcalc.cpp:243
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 * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle()

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 \(c_{is}^\dagger c_{it}c_{ju}^\dagger c_{ju}\) term in the grandcanonical general spin system when one of these site is in the inter process region.

Parameters
[in]org_isite1Site 1
[in]org_ispin1Spin 1
[in]org_ispin2Spin 2
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[in]tmp_JCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 942 of file mltplyMPISpinCore.cpp.

References BitCheckGeneral(), BindStruct::Check, BindStruct::Def, GetOffCompGeneralSpin(), CheckList::idim_max, myrank, DefineList::SiteToBit, and DefineList::Tpow.

Referenced by expec_cisajscktalt_SpinGCGeneral(), and GC_child_general_int_GeneralSpin_MPIsingle().

952  {
953  long int num1, j, off;
954  int isite, IniSpin, FinSpin, one = 1;
955  std::complex<double> tmp_V, dmv;
956 
957  num1 = BitCheckGeneral((long int)myrank,
958  org_isite3+1, org_ispin3, X->Def.SiteToBit, X->Def.Tpow);
959  if(num1 != 0){
960  tmp_V = tmp_J;
961  isite = org_isite1 + 1;
962  IniSpin = org_ispin2;
963  FinSpin = org_ispin1;
964  }
965  else return;
966 
967 #pragma omp parallel default(none) \
968 firstprivate(X, tmp_V, isite, IniSpin, FinSpin) private(j, dmv, num1, off) \
969 shared (tmp_v0, tmp_v1, v1buf,nstate,one)
970  {
971 #pragma omp for
972  for (j = 1; j <= X->Check.idim_max; j++) {
973  if (GetOffCompGeneralSpin(j - 1, isite, IniSpin, FinSpin, &off,
974  X->Def.SiteToBit, X->Def.Tpow) == TRUE)
975  {
976  dmv = tmp_V;
977  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[off + 1][0], &one);
978  }
979  else if (GetOffCompGeneralSpin(j - 1, isite, FinSpin, IniSpin, &off,
980  X->Def.SiteToBit, X->Def.Tpow) == TRUE)
981  {
982  dmv = conj(tmp_V);
983  zaxpy_(&nstate, &dmv, &tmp_v1[j][0], &one, &tmp_v0[off + 1][0], &one);
984  }
985  }/*for (j = 1; j <= X->Check.idim_max; j++)*/
986  }/*End of parallel region*/
987 }/*std::complex<double> X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
Definition: bitcalc.cpp:392
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
Definition: bitcalc.cpp:243
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAitCjuAju_spin_MPIdouble()

void X_GC_child_CisAitCjuAju_spin_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 
)

CisAisCjuAjv term in Spin model + GC When both site1 and site2 are in the inter process region.

Author
Kazuyoshi Yoshimi (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]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 231 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), SendRecv_i(), DefineList::Tpow, v1buf, X_SpinGC_CisAis(), and zaxpy_long().

Referenced by expec_cisajscktalt_SpinGCHalf(), and GC_child_CisAitCjuAju_spin_MPIdouble().

241  {
242  int mask1, mask2, state1, num1;
243  long int origin;
244  long int idim_max_buf;
245  std::complex<double> Jint;
246 
247  if (org_isite1 == org_isite3 && org_ispin1 == org_ispin3) {//cisaitcisais
248  return;
249  }
250 
251  mask1 = (int)X->Def.Tpow[org_isite1];
252  origin = myrank ^ mask1;
253  state1 = (origin & mask1) / mask1;
254  mask2 = (int)X->Def.Tpow[org_isite3];
255  num1 = X_SpinGC_CisAis(origin + 1, mask2, org_ispin3);
256  if (state1 == org_ispin2) {
257  if (num1 != 0) {
258  Jint = tmp_J;
259  }
260  else {
261  return;
262  }
263  }/*if (state1 == org_ispin2)*/
264  else {//state1 = org_ispin1
265  num1 = X_SpinGC_CisAis((long int) myrank + 1, mask2, org_ispin3);
266  if (num1 != 0) {
267  Jint = conj(tmp_J);
268  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) {
269  Jint = 0;
270  }
271  }
272  else {
273  return;
274  }
275  }
276 
277  idim_max_buf = SendRecv_i(origin, X->Check.idim_max);
278  SendRecv_cv(origin, X->Check.idim_max*nstate, idim_max_buf*nstate, &tmp_v1[1][0], &v1buf[1][0]);
279 
280  zaxpy_long(X->Check.idim_max*nstate, Jint, &v1buf[1][0], &tmp_v0[1][0]);
281 }/*std::complex<double> X_GC_child_CisAisCjuAjv_spin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > ** v1buf
Definition: global.cpp:22
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
int X_SpinGC_CisAis(long int j, long int is1_spin, long int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
int mode
multiply or expectation value.
Definition: struct.hpp:331
long int SendRecv_i(int origin, long int isend)
Wrapper of MPI_Sendrecv for long integer number.
Definition: wrapperMPI.cpp:504
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
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAitCjuAju_spin_MPIsingle()

void X_GC_child_CisAitCjuAju_spin_MPIsingle ( int  org_isite1,
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 
)

CisAisCjuAjv term in Spin model + GC When only site2 is in the inter process region.

Author
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]org_isite1Site 1
[in]org_ispin2Spin 2
[in]org_isite3Site 3
[in]org_ispin3Spin 3
[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 525 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, CheckList::idim_max, myrank, and DefineList::Tpow.

Referenced by expec_cisajscktalt_SpinGCHalf(), and GC_child_CisAitCjuAju_spin_MPIsingle().

534  {
535  int mask2, state2;
536  long int mask1, j, ioff, state1, state1check;
537  std::complex<double> Jint, dmv;
538  int one = 1;
539  /*
540  Prepare index in the inter PE
541  */
542  mask2 = (int)X->Def.Tpow[org_isite3];
543  state2 = (myrank & mask2) / mask2;
544 
545  if (state2 == org_ispin3) {
546  state1check = org_ispin2;
547  Jint = tmp_J;
548  }
549  else {
550  return;
551  }
552 
553  mask1 = (int)X->Def.Tpow[org_isite1];
554 
555 #pragma omp parallel default(none) private(j, dmv, state1, ioff) \
556  firstprivate(Jint, X, state1check, mask1) shared(tmp_v1, tmp_v0,nstate,one)
557  {
558 #pragma omp for
559  for (j = 0; j < X->Check.idim_max; j++) {
560 
561  state1 = (j & mask1) / mask1;
562  ioff = j ^ mask1;
563  if (state1 == state1check) {
564  dmv = Jint;
565  }
566  else {
567  dmv = conj(Jint);
568  }
569  zaxpy_(&nstate, &dmv, &tmp_v1[j + 1][0], &one, &tmp_v0[ioff + 1][0], &one);
570  }/*for (j = 0; j < X->Check.idim_max; j++)*/
571  }/*End of parallel region*/
572 }/*void GC_child_CisAitCiuAiv_spin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
int myrank
Process ID, defined in InitializeMPI()
Definition: global.cpp:73
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAitCjuAjv_GeneralSpin_MPIdouble()

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 \(c_{is}^\dagger c_{it} c_{ju}^\dagger c_{jv}\) term in the grandcanonical general spin system when both site is in the inter process region.

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_JCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 669 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, GetOffCompGeneralSpin(), CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), DefineList::SiteToBit, DefineList::Tpow, v1buf, X_GC_child_CisAis_GeneralSpin_MPIdouble(), and zaxpy_long().

Referenced by expec_cisajscktalt_SpinGCGeneral(), and GC_child_general_int_GeneralSpin_MPIdouble().

680  {
681  long int tmp_off, off;
682  int origin, ihermite;
683  std::complex<double> tmp_V;
684 
685  ihermite = TRUE;
686 
687  if (org_isite1 == org_isite3 && org_ispin1 == org_ispin4 &&
688  org_ispin2 == org_ispin3) { //cisaitcitais=cisais && cisaitcitais =cisais
689  X_GC_child_CisAis_GeneralSpin_MPIdouble(org_isite1, org_ispin1, tmp_J, X, nstate, tmp_v0, tmp_v1);
690  return;
691  }
692  //cisaitcisait
693  if (GetOffCompGeneralSpin((long int) myrank, org_isite1 + 1, org_ispin1, org_ispin2,
694  &tmp_off, X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
695 
696  if (GetOffCompGeneralSpin(tmp_off, org_isite3 + 1, org_ispin3, org_ispin4,
697  &off, X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
698 
699  tmp_V = tmp_J;
700  }
701  else ihermite = FALSE;
702  }
703  else {
704  ihermite = FALSE;
705  }
706 
707  if (ihermite == FALSE) {
708  if (GetOffCompGeneralSpin((long int) myrank, org_isite3 + 1, org_ispin4, org_ispin3, &tmp_off,
709  X->Def.SiteToBit, X->Def.Tpow) == TRUE) {
710 
711  if (GetOffCompGeneralSpin(tmp_off, org_isite1 + 1, org_ispin2, org_ispin1, &off, X->Def.SiteToBit,
712  X->Def.Tpow) == TRUE) {
713  tmp_V = conj(tmp_J);
714  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
715  }
716  else return;
717  }
718  else return;
719  }
720 
721  origin = (int)off;
722 
723  SendRecv_cv(origin, X->Check.idim_max*nstate, X->Check.idim_max*nstate, &tmp_v1[1][0], &v1buf[1][0]);
724 
725  zaxpy_long(X->Check.idim_max*nstate, tmp_V, &v1buf[1][0], &tmp_v0[1][0]);
726 }/*std::complex<double> X_GC_child_CisAitCjuAjv_GeneralSpin_MPIdouble*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
std::complex< double > ** v1buf
Definition: global.cpp:22
void zaxpy_long(long int n, std::complex< double > a, std::complex< double > *x, std::complex< double > *y)
Wrapper of zaxpy.
Definition: mltply.cpp:128
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.hpp:397
void X_GC_child_CisAis_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, 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...
int mode
multiply or expectation value.
Definition: struct.hpp:331
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
Definition: bitcalc.cpp:243
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 * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305

◆ X_GC_child_CisAitCjuAjv_GeneralSpin_MPIsingle()

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 \(c_{is}^\dagger c_{is}c_{ju}^\dagger c_{jv}\) term in the grandcanonical general spin system when one of these site is in the inter process region.

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_JCoupling constant
[in,out]X
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Input wavefunction

Definition at line 992 of file mltplyMPISpinCore.cpp.

References BindStruct::Check, BindStruct::Def, GetOffCompGeneralSpin(), CheckList::idim_max, BindStruct::Large, LargeList::mode, myrank, SendRecv_cv(), DefineList::SiteToBit, DefineList::Tpow, and v1buf.

Referenced by expec_cisajscktalt_SpinGCGeneral(), and GC_child_general_int_GeneralSpin_MPIsingle().

1003  {
1004  long int off, j;
1005  int origin, isite, IniSpin, FinSpin, one = 1;
1006  std::complex<double> tmp_V;
1007 
1008  if (GetOffCompGeneralSpin((long int)myrank,
1009  org_isite3 + 1, org_ispin3, org_ispin4, &off,
1010  X->Def.SiteToBit, X->Def.Tpow) == TRUE)
1011  {
1012  tmp_V = tmp_J;
1013  isite = org_isite1 + 1;
1014  IniSpin = org_ispin2;
1015  FinSpin = org_ispin1;
1016  }
1017  else if (GetOffCompGeneralSpin((long int)myrank,
1018  org_isite3 + 1, org_ispin4, org_ispin3, &off,
1019  X->Def.SiteToBit, X->Def.Tpow) == TRUE)
1020  {
1021  tmp_V = conj(tmp_J);
1022  if (X->Large.mode == M_CORR || X->Large.mode == M_CALCSPEC) tmp_V = 0.0;
1023  isite = org_isite1 + 1;
1024  IniSpin = org_ispin1;
1025  FinSpin = org_ispin2;
1026  }
1027  else return;
1028 
1029  origin = (int)off;
1030 
1031  SendRecv_cv(origin, X->Check.idim_max*nstate, X->Check.idim_max*nstate, &tmp_v1[1][0], &v1buf[1][0]);
1032 
1033 #pragma omp parallel default(none) \
1034 firstprivate(X, tmp_V, isite, IniSpin, FinSpin) private(j, off) \
1035  shared (tmp_v0, tmp_v1, v1buf,nstate,one)
1036  {
1037 #pragma omp for
1038  for (j = 1; j <= X->Check.idim_max; j++) {
1039  if (GetOffCompGeneralSpin(j - 1, isite, IniSpin, FinSpin, &off,
1040  X->Def.SiteToBit, X->Def.Tpow) == TRUE)
1041  {
1042  zaxpy_(&nstate, &tmp_V, &v1buf[j][0], &one, &tmp_v0[off + 1][0], &one);
1043  }
1044  }/*for (j = 1; j <= X->Check.idim_max; j++)*/
1045  }/*End of parallel region*/
1046 }/*std::complex<double> X_GC_child_CisAitCjuAjv_GeneralSpin_MPIsingle*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.hpp:395
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
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
Definition: bitcalc.cpp:243
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 * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.hpp:94
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.hpp:90
struct CheckList Check
Size of the Hilbert space.
Definition: struct.hpp:396
long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.hpp:305