17 #include "mltplyCommon.h" 21 #include "wrapperMPI.h" 22 #include "mltplyHubbard.h" 23 #include "mltplyHubbardCore.h" 24 #include "mltplySpinCore.h" 25 #include "mltplyMPIHubbard.h" 26 #include "mltplyMPISpinCore.h" 74 long unsigned int irght,ilft,ihfbit;
98 }
else if(X->
Def.
St==1){
172 }
else if(X->
Def.
St==1){
189 long unsigned int i,j;
190 long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
191 double complex dam_pr=0;
194 long unsigned int is;
195 double complex tmp_OneGreen=1.0;
207 if(org_isite1==org_isite2 && org_sigma1==org_sigma2){
209 is = X->
Def.
Tpow[2 * org_isite1 - 2];
212 is = X->
Def.
Tpow[2 * org_isite1 - 1];
214 ibit = (
unsigned long int)
myrank & is;
216 #pragma omp parallel for default(none) reduction(+:dam_pr) shared(vec) \ 217 firstprivate(i_max) private(j) 218 for (j = 1; j <= i_max; j++) dam_pr += vec[j]*conj(vec[j]);
226 if(org_isite1<org_isite2){
231 dam_pr = conj(dam_pr);
242 fprintf(*_fp,
" %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1,org_sigma1,org_isite2-1,org_sigma2,creal(dam_pr),cimag(dam_pr));
258 long unsigned int i,j;
259 long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
260 double complex dam_pr=0;
264 long unsigned int is;
265 double complex tmp_OneGreen=1.0;
276 if(org_sigma1 != org_sigma2){
278 fprintf(*_fp,
" %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1,org_sigma1,org_isite2-1,org_sigma2,creal(dam_pr),cimag(dam_pr));
289 fprintf(*_fp,
" %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1,org_sigma1,org_isite2-1,org_sigma2,creal(dam_pr),cimag(dam_pr));
296 if(org_isite1==org_isite2 && org_sigma1==org_sigma2){
298 is = X->
Def.
Tpow[2 * org_isite1 - 2+org_sigma1];
299 ibit = (
unsigned long int)
myrank & is;
301 #pragma omp parallel for default(none) reduction(+:dam_pr) shared(vec) \ 302 firstprivate(i_max) private(j) 303 for (j = 1; j <= i_max; j++) dam_pr += vec[j]*conj(vec[j]);
312 if(org_isite1 < org_isite2){
317 dam_pr = conj(dam_pr);
324 if(org_isite1==org_isite2 && org_sigma1==org_sigma2){
326 is = X->
Def.
Tpow[2 * org_isite1 - 2 + org_sigma1];
328 #pragma omp parallel for default(none) shared(list_1, vec) reduction(+:dam_pr) firstprivate(i_max, is) private(num1, ibit) 329 for(j = 1;j <= i_max;j++){
332 dam_pr += num1*conj(vec[j])*vec[j];
341 fprintf(*_fp,
" %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1,org_sigma1,org_isite2-1,org_sigma2,creal(dam_pr),cimag(dam_pr));
375 long unsigned int i,j;
376 long unsigned int isite1;
377 long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
378 double complex dam_pr=0;
381 long unsigned int is1_up;
391 if(org_sigma1 == org_sigma2){
392 if(org_isite1==org_isite2){
394 is1_up = X->
Def.
Tpow[org_isite1 - 1];
398 #pragma omp parallel for reduction(+:dam_pr)default(none) shared(vec) \ 399 firstprivate(i_max) private(j) 400 for (j = 1; j <= i_max; j++) dam_pr += conj(vec[j])*vec[j];
404 isite1 = X->
Def.
Tpow[org_isite1-1];
406 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j) firstprivate(i_max, isite1, org_sigma1, X) shared(vec) 407 for(j=1;j<=i_max;j++){
408 dam_pr+=
X_Spin_CisAis(j,X, isite1,org_sigma1)*conj(vec[j])*vec[j];
420 fprintf(*_fp,
" %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1, org_sigma1, org_isite2-1, org_sigma2, creal(dam_pr), cimag(dam_pr));
435 long unsigned int i,j;
436 long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
437 double complex dam_pr=0;
448 if(org_isite1 == org_isite2){
450 if(org_sigma1==org_sigma2){
456 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j) firstprivate(i_max, org_isite1, org_sigma1, X) shared(vec) 457 for(j=1;j<=i_max;j++){
458 dam_pr+=conj(vec[j])*vec[j];
466 if(org_sigma1==org_sigma2){
469 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, X) shared(vec, list_1) 470 for(j=1;j<=i_max;j++){
472 dam_pr+=conj(vec[j])*vec[j]*num1;
484 fprintf(*_fp,
" %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1, org_sigma1, org_isite2-1, org_sigma2,creal(dam_pr),cimag(dam_pr));
519 long unsigned int i,j;
520 long unsigned int isite1;
521 long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
522 double complex dam_pr=0;
525 long unsigned int tmp_off=0;
536 if(org_isite1 == org_isite2){
538 if(org_sigma1==org_sigma2){
545 isite1 = X->
Def.
Tpow[org_isite1-1];
547 if(org_sigma1==org_sigma2){
549 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, tmp_sgn) firstprivate(i_max, isite1, org_sigma1, X) shared(vec) 550 for(j=1;j<=i_max;j++){
551 dam_pr +=
X_SpinGC_CisAis(j, X, isite1, org_sigma1)*conj(vec[j])*vec[j];
555 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, tmp_sgn, tmp_off) firstprivate(i_max, isite1, org_sigma2, X) shared(vec) 556 for(j=1;j<=i_max;j++){
559 dam_pr += tmp_sgn*conj(vec[tmp_off+1])*vec[j];
570 fprintf(*_fp,
" %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1, org_sigma1, org_isite2-1, org_sigma2,creal(dam_pr),cimag(dam_pr));
585 long unsigned int i, j;
586 long unsigned int org_isite1, org_isite2, org_sigma1, org_sigma2;
587 double complex dam_pr = 0;
589 long unsigned int tmp_off = 0;
599 if (org_isite1 == org_isite2) {
601 if (org_sigma1 == org_sigma2) {
610 if (org_sigma1 == org_sigma2) {
613 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, X) shared(vec) 614 for (j = 1; j <= i_max; j++) {
616 dam_pr += conj(vec[j]) * vec[j] * num1;
621 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, org_sigma2, X,tmp_off) shared(vec) 622 for (j = 1; j <= i_max; j++) {
626 dam_pr += conj(vec[tmp_off + 1]) * vec[j] * num1;
636 fprintf(*_fp,
" %4ld %4ld %4ld %4ld %.10lf %.10lf\n", org_isite1 - 1, org_sigma1, org_isite2 - 1, org_sigma2,
637 creal(dam_pr), cimag(dam_pr));
const char * cFileName1BGreen_FullDiag
int irand
Input keyword TargetTPQRand ???
struct DefineList Def
Definision of system (Hamiltonian) etc.
int St
0 or 1, but it affects nothing.
double complex X_GC_child_general_hopp_MPIdouble(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard + GC When both site1 and site2 are in the inter process region.
int iFlgSzConserved
Flag whether Sz is conserved.
int expec_cisajs_Hubbard(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green's function for Hubbard model.
double complex X_GC_child_CisAis_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
double complex SumMPI_dc(double complex norm)
MPI wrapper function to obtain sum of Double complex across processes.
long unsigned int ihfbit
Used for Ogata-Lin ???
unsigned long int idim_max
The dimension of the Hilbert space of this process.
const char * cTPQExpecOneBodyGFinish
double complex X_GC_child_CisAis_spin_MPIdouble(int org_isite1, int org_ispin1, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Spin + GC When both site1 and site2 are in the inter process region.
const char * cTEExpecOneBodyGFinish
const char * cLogLanczosExpecOneBodyGEnd
double complex X_GC_child_CisAit_spin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Spin + GC When both site1 and site2 are in the inter process region.
int expec_cisajs_Spin(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green's function for Spin model.
int X_SpinGC_CisAis(long unsigned int j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
int expec_cisajs_HubbardGC(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green's function for Hubbard GC model.
struct LargeList Large
Variables for Matrix-Vector product.
int * LocSpn
[DefineList::NLocSpn] Flag (and size) of the local spin. malloc in setmem_def().
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.
struct PhysList Phys
Physical quantities.
int X_Spin_CisAis(long unsigned int j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int sigma1)
Compute the spin state with bit mask is1_spin.
const char * cTPQExpecOneBodyGStart
int mode
multiply or expectation value.
const char * cCGExpecOneBodyGStart
const char * cLanczosExpecOneBodyGFinish
double complex X_GC_child_CisAit_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
double complex X_GC_child_general_hopp_MPIsingle(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard + GC When only site2 is in the inter process region.
const char * cFileName1BGreen_TE
const char * cFileName1BGreen_TPQ
int expec_cisajs_SpinHalf(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green's function for Half-Spin model.
int expec_cisajs_SpinGCHalf(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green's function for Half-SpinGC model.
double complex child_general_hopp(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, double complex trans)
Compute hopping (canonical)
const char * cTEExpecOneBodyGStart
unsigned int Nsite
Number of sites in the INTRA process region.
const char * cFileName1BGreen_CG
const char * cLanczosExpecOneBodyGStart
int expec_cisajs(struct BindStruct *X, double complex *vec)
function of calculation for one body green's function
long unsigned int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
long unsigned int ilft
Used for Ogata-Lin ???
const char * cLogLanczosExpecOneBodyGStart
int GetSplitBitByModel(const int Nsite, const int iCalcModel, long unsigned int *irght, long unsigned int *ilft, long unsigned int *ihfbit)
function of splitting original bit into right and left spaces.
double complex X_child_general_hopp_MPIsingle(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard (Kondo) + Canonical ensemble When only site2 is in the inter process region...
long int i_max
Length of eigenvector.
int expec_cisajs_SpinGCGeneral(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green's function for General SpinGC model.
int iFlgGeneralSpin
Flag for the general (Sz/=1/2) spin.
long unsigned int * list_1
int child_general_hopp_GetInfo(struct BindStruct *X, unsigned long int isite1, unsigned long int isite2, unsigned long int sigma1, unsigned long int sigma2)
Compute mask for bit operation of hopping term.
unsigned int NCisAjt
Number of indices of two-body correlation function.
const char * cLogCGExpecOneBodyGEnd
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
int istep
Index of TPQ step ???
const char * cFileNameTimeKeep
int ** CisAjt
[DefineList::NCisAjt][4] Indices of one-body correlation function. malloc in setmem_def().
int BitCheckGeneral(const long unsigned int org_bit, const unsigned int org_isite, const unsigned int target_ispin, const long int *SiteToBit, const long unsigned int *Tpow)
bit check function for general spin
int expec_cisajs_SpinGC(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green's function for SpinGC model.
int expec_cisajs_SpinGeneral(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green's function for General-Spin model.
double complex GC_child_general_hopp(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, double complex trans)
Commpute hopping term (grandcanonical)
const char * cLogCGExpecOneBodyGStart
long unsigned int irght
Used for Ogata-Lin ???
int iCalcModel
Switch for model. 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC, 6:HubbardNConserved.
int GetOffCompGeneralSpin(const long unsigned int org_ibit, const int org_isite, const int org_ispin, const int off_ispin, long unsigned int *_ioffComp, const long int *SiteToBit, const long unsigned int *Tpow)
function of getting off-diagonal component for general spin
int X_SpinGC_CisAit(long unsigned int j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int sigma2, long unsigned int *tmp_off)
Compute index of final wavefunction by term (grandcanonical).
int myrank
Process ID, defined in InitializeMPI()
const char * cFileName1BGreen_Lanczos
int eigen_num
Index of eigenstate used for the file name of the correlation function.
double complex X_child_general_hopp_MPIdouble(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard (Kondo) + Canonical ensemble When both site1 and site2 are in the inter proce...
struct CheckList Check
Size of the Hilbert space.
char * CDataFileHead
Read from Calcmod in readdef.h. Header of output file such as Green's function.
int TimeKeeperWithStep(struct BindStruct *X, const char *cFileName, const char *cTimeKeeper_Message, const char *cWriteType, const int istep)
Functions for writing a time log.
const char * cCGExpecOneBodyGFinish
int TimeKeeperWithRandAndStep(struct BindStruct *X, const char *cFileName, const char *cTimeKeeper_Message, const char *cWriteType, const int irand, const int istep)
Functions for writing a time log.
int TimeKeeper(struct BindStruct *X, const char *cFileName, const char *cTimeKeeper_Message, const char *cWriteType)
Functions for writing a time log.
int iCalcType
Switch for calculation type. 0:Lanczos, 1:TPQCalc, 2:FullDiag.
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()