28 #include "readdef.hpp" 30 #include "wrapperMPI.hpp" 31 #include "common/setmemory.hpp" 72 int isite1,
int isigma1,
73 int isite2,
int isigma2,
74 int isite3,
int isigma3,
75 int isite4,
int isigma4
81 std::complex<double> *cInterAllValue,
82 int isite1,
int isigma1,
83 int isite2,
int isigma2,
84 int isite3,
int isigma3,
85 int isite4,
int isigma4,
86 double re_value,
double im_value
100 fprintf(
stdoutMPI,
"Error: %s (Broken file or Not exist)\n", defname);
116 const int icheckValue,
117 const int ilowestValue,
118 const int iHighestValue
121 if(icheckValue < ilowestValue || icheckValue > iHighestValue){
141 char cKWList[][D_CharTmpReadDef],
148 for(itmpKWidx=0; itmpKWidx<iSizeOfKWidx; itmpKWidx++){
149 if(strcmp(cKW,
"")==0){
152 else if(
CheckWords(cKW, cKWList[itmpKWidx])==0){
180 char csplit[] =
" ,.\t\n";
181 if(*ctmpLine==
'\n')
return 1;
182 ctmpRead = strtok(ctmpLine, csplit);
183 if(strncmp(ctmpRead,
"=", 1)==0 || strncmp(ctmpRead,
"#", 1)==0 || ctmpRead==NULL){
186 strcpy(ctmp, ctmpRead);
188 ctmpRead = strtok( NULL, csplit );
189 *itmp = strtol(ctmpRead, &cerror, 0);
192 fprintf(
stdoutMPI,
"Error: incorrect format= %s. \n", cerror);
196 ctmpRead = strtok( NULL, csplit );
197 if(ctmpRead != NULL){
198 fprintf(
stdoutMPI,
"Error: incorrect format= %s. \n", ctmpRead);
222 char ctmpLine[D_CharTmpReadDef+D_CharKWDMAX];
223 char ctmp[D_CharKWDMAX];
248 while(
fgetsMPI(ctmpLine, D_CharTmpReadDef+D_CharKWDMAX, fp)!=NULL ){
250 if(iret==1)
continue;
256 fprintf(
stdoutMPI,
" LOBPCG is used alternative to Lanczos.\n");
260 else if(
CheckWords(ctmp,
"FlgFiniteTemperature")==0){
272 else if(
CheckWords(ctmp,
"InitialVecType")==0){
305 fprintf(
stdoutMPI,
"Error: In %s, wrong parameter name:%s \n", defname, ctmp);
313 fprintf(
stdoutMPI,
"Error in %s\n CalcType: 0: Lanczos Method, 1: Thermal Pure Quantum State Method, 2: Full Diagonalization Method, 3: Calculation Spectrum mode.\n", defname);
317 fprintf(
stdoutMPI,
"Error in %s\n CalcType: 0: Lanczos Method, 1: Thermal Pure Quantum State Method, 2: Full Diagonalization Method, 3: Calculation Spectrum mode.\n", defname);
321 fprintf(
stdoutMPI,
"Error in %s\n OutputMode: \n 0: calc one body green function and two body green functions,\n 1: calc one body green function and two body green functions and correlatinos for charge and spin.\n", defname);
326 fprintf(
stdoutMPI,
"Error in %s\n CalcEigenVec: \n 0: Lanczos+CG method,\n 1: Lanczos method.\n", defname);
331 fprintf(
stdoutMPI,
"Error in %s\n InitialVecType: \n 0: complex type,\n 1: real type.\n", defname);
336 fprintf(
stdoutMPI,
"Error in %s\n OutputHam: \n 0: not output Hamiltonian,\n 1: output Hamiltonian.\n", defname);
340 fprintf(
stdoutMPI,
"Error in %s\n InputHam: 0: not input Hamiltonian,\n 1: input Hamiltonian.\n", defname);
345 "Error in %s\n OutputHam=1 and InputHam=1.\n", defname);
349 fprintf(
stdoutMPI,
"Error in %s Restart: \n 0: not restart (default).\n 1: output a restart vector.\n 2: input a restart vector and output a new restart vector.\n 3: input a restart vector.\n", defname);
353 fprintf(
stdoutMPI,
"Error in %s\n NGPU: NGPU must be greater than 0.\n", defname);
357 fprintf(
stdoutMPI,
"Error in %s\n NGPU: NGPU must be greater than 0.\n", defname);
364 "Error in %s\n FlgFiniteTemperature: Finite Temperature, 1: Zero Temperature.\n",
371 "Error in %s\n OutputHam is only defined for FullDiag mode, CalcType=2.\n",
390 const char* cFileListNameFile,
396 char ctmpFileName[D_FileNameMaxReadDef];
397 char ctmpKW[D_CharTmpReadDef], ctmp2[256];
400 strcpy(cFileNameList[i],
"");
403 fplist =
fopenMPI(cFileListNameFile,
"r");
406 while(
fgetsMPI(ctmp2, 256, fplist) != NULL){
407 memset(ctmpKW,
'\0', strlen(ctmpKW));
408 memset(ctmpFileName,
'\0', strlen(ctmpFileName));
409 sscanf(ctmp2,
"%s %s\n", ctmpKW, ctmpFileName);
411 if(strncmp(ctmpKW,
"#", 1)==0 || *ctmp2==
'\n' || (strcmp(ctmpKW,
"")&&strcmp(ctmpFileName,
""))==0){
414 else if(strcmp(ctmpKW,
"")*strcmp(ctmpFileName,
"")==0){
416 "Error: keyword and filename must be set as a pair in %s.\n",
423 fprintf(
stdoutMPI,
"Error: Wrong keywords %s in %s.\n", ctmpKW, cFileListNameFile);
424 fprintf(
stdoutMPI,
"%s",
"Choose Keywords as follows: \n");
432 if(strcmp(cFileNameList[itmpKWidx],
"") !=0){
433 fprintf(
stdoutMPI,
"Error: Same keywords exist in %s.\n", cFileListNameFile);
439 strcpy(cFileNameList[itmpKWidx], ctmpFileName);
463 char defname[D_FileNameMaxReadDef];
464 char ctmp[D_CharTmpReadDef], ctmp2[256];
475 int iReadNCond = FALSE;
480 cFileNameListFile = (
char**)malloc(
sizeof(
char*)*
D_iKWNumDef);
482 cFileNameListFile[i] = (
char*)malloc(
sizeof(
char)*D_CharTmpReadDef);
484 fprintf(
stdoutMPI,
" Read File %s.\n", xNameListFile);
485 if (
GetFileName(xNameListFile, cFileNameListFile) != 0) {
496 strcpy(defname, cFileNameListFile[iKWidx]);
497 if (strcmp(defname,
"") == 0) {
511 strcpy(defname, cFileNameListFile[iKWidx]);
513 if (strcmp(defname,
"") == 0)
continue;
514 if (iKWidx == KWSpectrumVec) {
533 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
535 sscanf(ctmp2,
"%s %d\n", ctmp, &itmp);
536 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
537 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
538 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
546 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
550 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
551 if (*ctmp2 ==
'\n')
continue;
552 sscanf(ctmp2,
"%s %lf %lf\n", ctmp, &dtmp, &dtmp2);
554 X->
Nsite = (int)dtmp;
560 X->
Ndown = (int)dtmp;
569 fprintf(
stdoutMPI,
"Error in %s\n Ncond must be greater than 0.\n", defname);
572 X->
NCond = (int)dtmp;
575 else if (
CheckWords(ctmp,
"Lanczos_max") == 0) {
578 else if (
CheckWords(ctmp,
"initial_iv") == 0) {
587 else if (
CheckWords(ctmp,
"LanczosEps") == 0) {
590 else if (
CheckWords(ctmp,
"LanczosTarget") == 0) {
593 else if (
CheckWords(ctmp,
"LargeValue") == 0) {
599 else if (strcmp(ctmp,
"TimeSlice") == 0) {
602 else if (strcmp(ctmp,
"ExpandCoef") == 0) {
605 else if (strcmp(ctmp,
"OutputInterval") == 0) {
608 else if (
CheckWords(ctmp,
"ExpecInterval") == 0) {
611 else if (strcmp(ctmp,
"Tinit") == 0) {
636 else if (
CheckWords(ctmp,
"TargetTPQRand") == 0) {
637 X->
irand = (int)dtmp;
648 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
650 sscanf(ctmp2,
"%s %d\n", ctmp, &(X->
NLocSpn));
654 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
656 sscanf(ctmp2,
"%s %d\n", ctmp, &(X->
NTransfer));
660 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
666 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
672 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
678 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
685 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
691 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
697 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
703 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
705 sscanf(ctmp2,
"%s %d\n", ctmp, &(X->
NInterAll));
709 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
711 sscanf(ctmp2,
"%s %d\n", ctmp, &(X->
NCisAjt));
715 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
721 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
723 sscanf(ctmp2,
"%s %d\n", ctmp, &(X->
NLaser));
727 if (X->
iCalcType != TimeEvolution)
break;
729 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
737 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
738 sscanf(ctmp2,
"%lf %d \n", &dtmp, &itmp);
739 for (i = 0; i < itmp; ++i) {
742 if (iTETransMax < itmp) iTETransMax = itmp;
749 if (X->
iCalcType != TimeEvolution)
break;
751 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
757 int iTEInterAllMax = 0;
759 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
760 sscanf(ctmp2,
"%lf %d \n", &dtmp, &itmp);
761 for (i = 0; i < itmp; ++i) {
764 if (iTEInterAllMax < itmp) iTEInterAllMax = itmp;
783 sscanf(ctmp2,
"%d\n", &(xBoost->
NumarrayJ));
785 for (iline = 0; iline < xBoost->
NumarrayJ * 3; iline++) {
790 sscanf(ctmp2,
"%ld %ld %ld %ld\n", &(xBoost->
W0), &(xBoost->
R0), &(xBoost->
num_pivot),
795 case KWSingleExcitation:
797 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
802 case KWPairExcitation:
804 fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
810 fprintf(
stdoutMPI,
"%s",
"Error: incorrect file.\n");
823 case SpinlessFermion:
825 if (iReadNCond == TRUE) {
827 fprintf(
stdoutMPI,
"For Spin, Ncond should not be defined.\n");
833 fprintf(
stdoutMPI,
" Warning: For Spinless fermion, 2Sz should not be defined.\n");
849 fprintf(
stdoutMPI,
"Ncond is incorrect.\n");
860 fprintf(
stdoutMPI,
" 2Sz is not defined.\n");
868 fprintf(
stdoutMPI,
" NCond is not defined.\n");
879 fprintf(
stdoutMPI,
" 2Sz is not defined.\n");
883 fprintf(
stdoutMPI,
" NCond is not defined.\n");
897 fprintf(
stdoutMPI,
"%s",
"Error: Ne=Nup+Ndown must be (Ne >= NLocalSpin).\n");
906 case SpinlessFermionGC:
908 fprintf(
stdoutMPI,
"\n Warning: For GC, both Ncond and 2Sz should not be defined.\n");
918 fprintf(
stdoutMPI,
"Error in %s\n Nsite must be positive value.\n", defname);
922 fprintf(
stdoutMPI,
"Error in %s\n Lanczos_max must be positive value.\n", defname);
926 fprintf(
stdoutMPI,
"Error in %s\n Lanczos_eps must be positive value.\n", defname);
930 fprintf(
stdoutMPI,
"Error in %s\n NumAve must be positive value.\n", defname);
934 fprintf(
stdoutMPI,
"Error in %s\n ExpecInterval must be positive value.\n", defname);
947 fprintf(
stdoutMPI,
"Error in %s \n exct=%d must be greater than 1 and smaller than nvec=%d.\n",
984 std::complex<double>* ParaInterAll,
985 int **InterAllOffDiagonal,
986 std::complex<double>*ParaInterAllOffDiagonal,
987 const int NInterAllOffDiagonal,
990 int i, j, icntincorrect, itmpret;
991 int isite1, isite2, isite3, isite4;
992 int isigma1, isigma2, isigma3, isigma4;
993 int itmpsite1, itmpsite2, itmpsite3, itmpsite4;
994 int itmpsigma1, itmpsigma2, itmpsigma3, itmpsigma4;
995 int itmpIdx, icntHermite;
996 int icheckHermiteCount = FALSE;
997 std::complex<double> ddiff_intall;
1000 for (i = 0; i < NInterAllOffDiagonal; i++) {
1002 isite1 = InterAllOffDiagonal[i][0];
1003 isigma1 = InterAllOffDiagonal[i][1];
1004 isite2 = InterAllOffDiagonal[i][2];
1005 isigma2 = InterAllOffDiagonal[i][3];
1006 isite3 = InterAllOffDiagonal[i][4];
1007 isigma3 = InterAllOffDiagonal[i][5];
1008 isite4 = InterAllOffDiagonal[i][6];
1009 isigma4 = InterAllOffDiagonal[i][7];
1010 icheckHermiteCount = FALSE;
1012 for (j = 0; j < NInterAllOffDiagonal; j++) {
1013 itmpsite1 = InterAllOffDiagonal[j][0];
1014 itmpsigma1 = InterAllOffDiagonal[j][1];
1015 itmpsite2 = InterAllOffDiagonal[j][2];
1016 itmpsigma2 = InterAllOffDiagonal[j][3];
1017 itmpsite3 = InterAllOffDiagonal[j][4];
1018 itmpsigma3 = InterAllOffDiagonal[j][5];
1019 itmpsite4 = InterAllOffDiagonal[j][6];
1020 itmpsigma4 = InterAllOffDiagonal[j][7];
1022 if (isite1 == itmpsite4 && isite2 == itmpsite3 && isite3 == itmpsite2 && isite4 == itmpsite1) {
1023 if (isigma1 == itmpsigma4 && isigma2 == itmpsigma3 && isigma3 == itmpsigma2 && isigma4 == itmpsigma1) {
1024 ddiff_intall = abs(ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j]));
1028 if (icheckHermiteCount == FALSE) {
1029 icheckHermiteCount = TRUE;
1031 if (2 * icntHermite >= NInterAllOffDiagonal) {
1032 fprintf(
stdoutMPI,
"Elements of InterAll are incorrect.\n");
1036 for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) {
1037 InterAll[2 * icntHermite][itmpIdx] = InterAllOffDiagonal[i][itmpIdx];
1038 InterAll[2 * icntHermite + 1][itmpIdx] = InterAllOffDiagonal[j][itmpIdx];
1041 ParaInterAll[2 * icntHermite] = ParaInterAllOffDiagonal[i];
1042 ParaInterAll[2 * icntHermite + 1] = ParaInterAllOffDiagonal[j];
1050 else if (isite1 == itmpsite2 && isite2 == itmpsite1 && isite3 == itmpsite4 &&
1051 isite4 == itmpsite3) {
1052 if (iCalcModel == Kondo || iCalcModel == KondoGC || iCalcModel == Spin || iCalcModel == SpinGC) {
1053 if (isigma1 == itmpsigma2 && isigma2 == itmpsigma1 && isigma3 == itmpsigma4 && isigma4 == itmpsigma3) {
1054 ddiff_intall = ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j]);
1057 if (icheckHermiteCount == FALSE) {
1058 icheckHermiteCount = TRUE;
1060 if (2 * icntHermite >= NInterAllOffDiagonal) {
1061 fprintf(
stdoutMPI,
"Elements of InterAll are incorrect.\n");
1064 for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) {
1065 InterAll[2 * icntHermite][itmpIdx] = InterAllOffDiagonal[i][itmpIdx];
1067 for (itmpIdx = 0; itmpIdx < 4; itmpIdx++) {
1068 InterAll[2 * icntHermite + 1][2 * itmpIdx] = InterAllOffDiagonal[i][6 -
1071 InterAll[2 * icntHermite + 1][2 * itmpIdx + 1] = InterAllOffDiagonal[i][7 - 2 *
1075 ParaInterAll[2 * icntHermite] = ParaInterAllOffDiagonal[i];
1076 ParaInterAll[2 * icntHermite + 1] = ParaInterAllOffDiagonal[j];
1088 fprintf(
stdoutMPI,
"Error: NonHermite (i, spni, j, spnj, k, spnk, l, spnl) = (%d, %d, %d, %d, %d, %d, %d, %d), InterAll_re= %lf, InterAll_im= %lf . \n", isite1, isigma1, isite2, isigma2, isite3, isigma3, isite4, isigma4,
1089 real(ParaInterAllOffDiagonal[i]), imag(ParaInterAllOffDiagonal[i]));
1094 if (icntincorrect != 0) {
1098 for (i = 0; i < NInterAllOffDiagonal; i++) {
1099 for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) {
1100 InterAllOffDiagonal[i][itmpIdx] = InterAll[i][itmpIdx];
1102 ParaInterAllOffDiagonal[i] = ParaInterAll[i];
1127 std::complex<double> *ParaInterAll,
1128 const int NInterAll,
1129 int **InterAllDiagonal,
1130 double *ParaInterAllDiagonal,
1131 int **InterAllOffDiagonal,
1132 std::complex<double> *ParaInterAllOffDiagonal,
1137 const int iCalcModel
1140 int i, icnt_diagonal, icnt_offdiagonal, tmp_i;
1141 int isite1, isite2, isite3, isite4;
1142 int isigma1, isigma2, isigma3, isigma4;
1145 icnt_offdiagonal = 0;
1147 for (i = 0; i < NInterAll; i++) {
1148 isite1 = InterAll[i][0];
1149 isigma1 = InterAll[i][1];
1150 isite2 = InterAll[i][2];
1151 isigma2 = InterAll[i][3];
1152 isite3 = InterAll[i][4];
1153 isigma3 = InterAll[i][5];
1154 isite4 = InterAll[i][6];
1155 isigma4 = InterAll[i][7];
1158 if (isite1 == isite2 && isite3 == isite4 &&
1159 isigma1 == isigma2 && isigma3 == isigma4)
1161 InterAllDiagonal[icnt_diagonal][0] = isite1;
1162 InterAllDiagonal[icnt_diagonal][1] = isigma1;
1163 InterAllDiagonal[icnt_diagonal][2] = isite3;
1164 InterAllDiagonal[icnt_diagonal][3] = isigma3;
1165 ParaInterAllDiagonal[icnt_diagonal] = real(ParaInterAll[i]);
1169 else if (isite1 == isite4 && isite2 == isite3 &&
1170 isigma1 == isigma4 && isigma2 == isigma3)
1172 InterAllDiagonal[icnt_diagonal][0] = isite1;
1173 InterAllDiagonal[icnt_diagonal][1] = isigma1;
1174 InterAllDiagonal[icnt_diagonal][2] = isite2;
1175 InterAllDiagonal[icnt_diagonal][3] = isigma2;
1176 ParaInterAllDiagonal[icnt_diagonal] = -real(ParaInterAll[i]);
1177 Chemi[*NChemi] = isite1;
1178 SpinChemi[*NChemi] = isigma1;
1180 ParaChemi[*NChemi] = -real(ParaInterAll[i]);
1187 switch (iCalcModel) {
1189 case HubbardNConserved:
1193 if (isigma1 == isigma2 && isigma3 == isigma4) {
1194 for (tmp_i = 0; tmp_i < 8; tmp_i++) {
1195 InterAllOffDiagonal[icnt_offdiagonal][tmp_i] = InterAll[i][tmp_i];
1197 ParaInterAllOffDiagonal[icnt_offdiagonal] = ParaInterAll[i];
1199 else if (isigma1 == isigma4 && isigma2 == isigma3) {
1200 InterAllOffDiagonal[icnt_offdiagonal][0] = isite1;
1201 InterAllOffDiagonal[icnt_offdiagonal][1] = isigma1;
1202 InterAllOffDiagonal[icnt_offdiagonal][2] = isite4;
1203 InterAllOffDiagonal[icnt_offdiagonal][3] = isigma1;
1204 InterAllOffDiagonal[icnt_offdiagonal][4] = isite3;
1205 InterAllOffDiagonal[icnt_offdiagonal][5] = isigma2;
1206 InterAllOffDiagonal[icnt_offdiagonal][6] = isite2;
1207 InterAllOffDiagonal[icnt_offdiagonal][7] = isigma2;
1208 ParaInterAllOffDiagonal[icnt_offdiagonal] = -ParaInterAll[i];
1212 if (iCalcModel == Hubbard || iCalcModel == Kondo) {
1214 "Error: This operator breaks Sz Symmetry (i, spni, j, spnj, k, spnk, l, spnl) = (%d, %d, %d, %d, %d, %d, %d, %d), InterAll_re= %lf, InterAll_im= %lf . \n",
1223 real(ParaInterAll[i]),
1224 imag(ParaInterAll[i])
1229 for (tmp_i = 0; tmp_i < 8; tmp_i++) {
1230 InterAllOffDiagonal[icnt_offdiagonal][tmp_i] = InterAll[i][tmp_i];
1232 ParaInterAllOffDiagonal[icnt_offdiagonal] = ParaInterAll[i];
1238 if (isite1 == isite2 && isite3 == isite4) {
1239 for (tmp_i = 0; tmp_i < 8; tmp_i++) {
1240 InterAllOffDiagonal[icnt_offdiagonal][tmp_i] = InterAll[i][tmp_i];
1242 ParaInterAllOffDiagonal[icnt_offdiagonal] = ParaInterAll[i];
1271 const int NTETransfer,
1277 int isigma1, isigma2;
1278 int itmpsite1, itmpsite2;
1279 int itmpsigma1, itmpsigma2;
1280 int itmperrsite1, itmperrsite2;
1281 int itmperrsigma1, itmperrsigma2;
1282 std::complex<double> dcerrTrans;
1283 int icheckHermiteCount;
1286 std::complex<double> ddiff_trans;
1287 int itmpIdx, icntHermite, icntchemi;
1291 int** tmp_TETransfer = i_2d_allocate(NTETransfer, 4);
1292 std::complex<double>*tmp_paraTETransfer = (std::complex<double>*)malloc((NTETransfer) *
sizeof(std::complex<double>));
1295 for (i = 0; i < NTETransfer; i++) {
1296 for (j = 0; j < 4; j++) {
1297 tmp_TETransfer[i][j] = X->
TETransfer[idx][i][j];
1304 for (i = 0; i < NTETransfer; i++) {
1305 isite1 = tmp_TETransfer[i][0];
1306 isigma1 = tmp_TETransfer[i][1];
1307 isite2 = tmp_TETransfer[i][2];
1308 isigma2 = tmp_TETransfer[i][3];
1309 icheckHermiteCount = FALSE;
1310 for (j = 0; j < NTETransfer; j++) {
1311 itmpsite1 = tmp_TETransfer[j][0];
1312 itmpsigma1 = tmp_TETransfer[j][1];
1313 itmpsite2 = tmp_TETransfer[j][2];
1314 itmpsigma2 = tmp_TETransfer[j][3];
1315 if (isite1 == itmpsite2 && isite2 == itmpsite1) {
1316 if (isigma1 == itmpsigma2 && isigma2 == itmpsigma1) {
1318 ddiff_trans = tmp_paraTETransfer[i] - conj(tmp_paraTETransfer[j]);
1320 itmperrsite1 = itmpsite1;
1321 itmperrsigma1 = itmpsigma1;
1322 itmperrsite2 = itmpsite2;
1323 itmperrsigma2 = itmpsigma2;
1324 dcerrTrans = tmp_paraTETransfer[j];
1326 "Error: NonHermite (i, spni, j, spnj) = (%d, %d, %d, %d), trans_re= %lf, trans_im= %lf.\n",
1327 isite1, isigma1, isite2, isigma2, real(tmp_paraTETransfer[i]), imag(tmp_paraTETransfer[i]));
1329 "Error: NonHermite (i, spni, j, spnj) = (%d, %d, %d, %d), trans_re= %lf, trans_im= %lf.\n",
1330 itmperrsite1, itmperrsigma1, itmperrsite2, itmperrsigma2, real(dcerrTrans), imag(dcerrTrans));
1334 if (icheckHermiteCount == FALSE) {
1336 if (2 * icntHermite >= NTETransfer) {
1337 fprintf(stderr,
"Elements of Transfers are incorrect.\n");
1340 if (isite1 != isite2 || isigma1 != isigma2) {
1341 for (itmpIdx = 0; itmpIdx < 4; itmpIdx++) {
1342 X->
TETransfer[idx][2 * icntHermite][itmpIdx] = tmp_TETransfer[i][itmpIdx];
1343 X->
TETransfer[idx][2 * icntHermite + 1][itmpIdx] = tmp_TETransfer[j][itmpIdx];
1346 X->
ParaTETransfer[idx][2 * icntHermite + 1] = tmp_paraTETransfer[j];
1356 icheckHermiteCount = TRUE;
1364 if (icheckHermiteCount == FALSE) {
1366 "Error: NonHermite (i, spni, j, spnj) = (%d, %d, %d, %d), trans_re= %lf, trans_im= %lf.\n",
1367 isite1, isigma1, isite2, isigma2,
1368 real(tmp_paraTETransfer[i]), imag(tmp_paraTETransfer[i]));
1383 free_i_2d_allocate(tmp_TETransfer);
1384 free(tmp_paraTETransfer);
1405 char defname[D_FileNameMaxReadDef];
1406 char ctmp[D_CharTmpReadDef], ctmp2[256];
1412 int isite1, isite2, isite3, isite4;
1413 int isigma1, isigma2, isigma3, isigma4;
1414 double dvalue_re, dvalue_im;
1415 double dArrayValue_re[3];
1416 int icnt_diagonal = 0;
1417 int ieps_CheckImag0 = -12;
1425 int icnt_interall = 0;
1429 for (iKWidx = KWLocSpin; iKWidx <
D_iKWNumDef; iKWidx++) {
1430 strcpy(defname, cFileNameListFile[iKWidx]);
1431 if (strcmp(defname,
"") == 0 || iKWidx == KWSpectrumVec)
continue;
1432 fprintf(
stdoutMPI,
" Read File %s.\n", defname);
1435 if (iKWidx != KWBoost) {
1436 for (i = 0; i < IgnoreLinesInDef; i++)
fgetsMPI(ctmp,
sizeof(ctmp) /
sizeof(
char), fp);
1444 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1445 if (idx == X->
Nsite) {
1450 sscanf(ctmp2,
"%d %d\n", &(xitmp[0]), &(xitmp[1]));
1451 X->
LocSpn[xitmp[0]] = xitmp[1];
1470 while (
fgetsMPI(ctmp2, 256, fp) != NULL)
1477 sscanf(ctmp2,
"%d %d %d %d %lf %lf\n",
1491 if (isite1 == isite2 && isigma1 == isigma2) {
1495 "Error: NonHermite (i, spni, j, spnj) = (%d, %d, %d, %d), trans_re= %lf, trans_im= %lf.\n",
1496 isite1, isigma1, isite2, isigma2, dvalue_re, dvalue_im);
1503 if (isite1 != isite2) {
1505 fprintf(
stdoutMPI,
"Warning: Site component of (i, j) =(%d, %d) is ignored.\n",
1510 if (X->
LocSpn[isite1] != ITINERANT || X->
LocSpn[isite2] != ITINERANT) {
1511 if (isite1 != isite2) {
1513 fprintf(
stdoutMPI,
"Error: Site component of (i, j) =(%d, %d) is incorrect.\n", isite1, isite2);
1518 if (isigma1 != 0 || isigma2 != 0) {
1521 "Error: NonHermite (i, spni, j, spnj) = (%d, %d, %d, %d), trans_re= %lf, trans_im= %lf.\n",
1522 isite1, isigma1, isite2, isigma2, dvalue_re, dvalue_im);
1529 for (i = 0; i < icnt_trans; i++) {
1539 if (iflg_trans == 0) {
1550 if (iboolLoc == 1) {
1564 fprintf(
stdoutMPI,
"%s",
"Error: NonHermite Pair exists in transfer integral. \n");
1570 case KWCoulombIntra:
1573 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1578 sscanf(ctmp2,
"%d %lf\n",
1592 case KWCoulombInter:
1595 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1601 sscanf(ctmp2,
"%d %d %lf\n",
1620 while (
fgetsMPI(ctmp2, 256, fp) != NULL)
1627 sscanf(ctmp2,
"%d %d %lf\n",
1645 fprintf(
stdoutMPI,
"PairHop is not active in Spin and SpinGC.\n");
1650 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1655 sscanf(ctmp2,
"%d %d %lf\n",
1676 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1682 sscanf(ctmp2,
"%d %d %lf\n",
1701 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1707 sscanf(ctmp2,
"%d %d %lf\n",
1735 fprintf(
stdoutMPI,
"PairLift is active only in SpinGC.\n");
1738 while (
fgetsMPI(ctmp2, 256, fp) != NULL)
1745 sscanf(ctmp2,
"%d %d %lf\n",
1768 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1773 sscanf(ctmp2,
"%d %d %d %d %d %d %d %d %lf %lf\n",
1787 isite1, isigma1, isite2, isigma2,
1788 isite3, isigma3, isite4, isigma4) != 0) {
1800 dvalue_re, dvalue_im
1828 fprintf(
stdoutMPI,
"%s",
"Error: NonHermite Pair exists in InterAll. \n");
1837 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1842 sscanf(ctmp2,
"%d %d %d %d\n",
1849 if (isite1 != isite2) {
1850 fprintf(
stdoutMPI,
"Warning: Site component of (i, j) =(%d, %d) is ignored.\n",
1857 X->
CisAjt[idx][0] = isite1;
1858 X->
CisAjt[idx][1] = isigma1;
1859 X->
CisAjt[idx][2] = isite2;
1860 X->
CisAjt[idx][3] = isigma2;
1875 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1881 sscanf(ctmp2,
"%d %d %d %d %d %d %d %d\n",
1924 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1925 sscanf(ctmp2,
"%s %lf\n", ctmp, &(X->
ParaLaser[idx]));
1939 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1943 sscanf(ctmp2,
"%d %d %d %d %lf %lf\n",
1974 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
1980 sscanf(ctmp2,
"%d %d %d %d %d %d %d %d %lf %lf\n",
1993 isite1, isigma1, isite2, isigma2,
1994 isite3, isigma3, isite4, isigma4) != 0) {
2005 dvalue_re, dvalue_im
2029 fprintf(
stdoutMPI,
"%s",
"Error: NonHermite Pair exists in InterAll. \n");
2047 sscanf(ctmp2,
"%lf %lf %lf\n",
2050 &dArrayValue_re[2]);
2051 for (iline = 0; iline < 3; iline++) {
2052 xBoost->
vecB[iline] = dArrayValue_re[iline];
2060 for (iline = 0; iline < xBoost->
NumarrayJ; iline++) {
2061 for (ilineIn = 0; ilineIn < 3; ilineIn++) {
2063 sscanf(ctmp2,
"%lf %lf %lf\n",
2066 &dArrayValue_re[2]);
2067 for (ilineIn2 = 0; ilineIn2 < 3; ilineIn2++) {
2068 xBoost->
arrayJ[iline][ilineIn][ilineIn2] = dArrayValue_re[ilineIn2];
2079 for (iline = 0; iline < xBoost->
num_pivot; iline++) {
2082 sscanf(ctmp2,
"%d %d %d %d %d %d %d\n",
2092 for (iloop = 0; iloop < xBoost->
R0; iloop++) {
2093 for (itmp = 0; itmp < 7; itmp++) {
2103 for (iline = 0; iline < xBoost->
num_pivot; iline++) {
2105 for (ilineIn2 = 0; ilineIn2 < xBoost->
list_6spin_star[iline][0]; ilineIn2++) {
2107 sscanf(ctmp2,
"%d %d %d %d %d %d %d\n",
2118 for (iloop = 0; iloop < xBoost->
R0; iloop++) {
2119 for (itmp = 0; itmp < 7; itmp++) {
2131 case KWSingleExcitation:
2135 fprintf(stderr,
"SingleExcitation is not allowed for spin system.\n");
2139 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
2146 sscanf(ctmp2,
"%d %d %d %lf %lf\n",
2174 case KWPairExcitation:
2177 while (
fgetsMPI(ctmp2, 256, fp) != NULL) {
2184 sscanf(ctmp2,
"%d %d %d %d %d %lf %lf\n",
2231 case KWCoulombIntra:
2232 case KWCoulombInter:
2240 "Error: Use only InterAll for setteing interactions for general spin.\n");
2268 if (iSite >= iMaxNum)
return(-1);
2345 int isigma1, isigma2;
2346 int itmpsite1, itmpsite2;
2347 int itmpsigma1, itmpsigma2;
2348 int itmperrsite1, itmperrsite2;
2349 int itmperrsigma1, itmperrsigma2;
2350 std::complex<double> dcerrTrans;
2351 int icheckHermiteCount = FALSE;
2354 std::complex<double> ddiff_trans;
2355 int itmpIdx, icntHermite, icntchemi;
2364 icheckHermiteCount = FALSE;
2370 if (isite1 == itmpsite2 && isite2 == itmpsite1) {
2371 if (isigma1 == itmpsigma2 && isigma2 == itmpsigma1) {
2375 itmperrsite1 = itmpsite1;
2376 itmperrsigma1 = itmpsigma1;
2377 itmperrsite2 = itmpsite2;
2378 itmperrsigma2 = itmpsigma2;
2380 fprintf(
stdoutMPI,
"Error: NonHermite (i, spni, j, spnj) = (%d, %d, %d, %d), trans_re= %lf, trans_im= %lf.\n",
2382 fprintf(
stdoutMPI,
"Error: NonHermite (i, spni, j, spnj) = (%d, %d, %d, %d), trans_re= %lf, trans_im= %lf.\n",
2383 itmperrsite1, itmperrsigma1, itmperrsite2, itmperrsigma2, real(dcerrTrans), imag(dcerrTrans));
2387 if (icheckHermiteCount == FALSE) {
2390 fprintf(stderr,
"Elements of Transfers are incorrect.\n");
2393 if (isite1 != isite2 || isigma1 != isigma2) {
2394 for (itmpIdx = 0; itmpIdx < 4; itmpIdx++) {
2409 icheckHermiteCount = TRUE;
2418 if (icheckHermiteCount == FALSE) {
2419 fprintf(
stdoutMPI,
"Error: NonHermite (i, spni, j, spnj) = (%d, %d, %d, %d), trans_re= %lf, trans_im= %lf.\n", isite1, isigma1, isite2, isigma2, real(X->
ParaGeneralTransfer[i]), imag(X->
ParaGeneralTransfer[i]));
2432 for (itmpIdx = 0; itmpIdx < 4; itmpIdx++) {
2460 #include "version_major.hpp" 2463 #include "version_miner.hpp" 2466 #include "version_patch.hpp" 2474 else if (argc == 3 &&
2477 *mode=STANDARD_MODE;
2479 else if (argc == 3 &&
2483 *mode = STANDARD_DRY_MODE;
2485 else if (argc >= 2 &&
2489 fprintf(
stdoutMPI,
"\nHPhi version %d.%d.%d \n\n", ver_maj, ver_min, ver_pat);
2495 fprintf(
stdoutMPI,
" $ HPhi -e {namelist_file} \n");
2496 fprintf(
stdoutMPI,
"* Standard mode \n");
2497 fprintf(
stdoutMPI,
" $ HPhi -s {input_file} \n");
2498 fprintf(
stdoutMPI,
"* Standard DRY mode \n");
2499 fprintf(
stdoutMPI,
" $ HPhi -sdry {input_file} \n");
2500 fprintf(
stdoutMPI,
" In this mode, Hphi stops after it generats expert input files. \n");
2501 fprintf(
stdoutMPI,
"* Print the version \n");
2530 if(site1==site2 && site3==site4){
2535 "Warning: Site component of (i, j, k, l) =(%d, %d, %d, %d) is not correct; i=j and k=l must be satisfied. \n",
2536 site1, site2, site3, site4);
2555 const int isite1,
const int isite2,
2556 const int isite3,
const int isite4,
2560 if (iLocInfo[isite1] != ITINERANT || iLocInfo[isite2] != ITINERANT) {
2561 if (isite1 != isite2) {
2562 fprintf(
stdoutMPI,
"Error: Site component of (i, j, k, l) =(%d, %d, %d, %d) is incorrect.\n", isite1, isite2, isite3, isite4);
2566 if (iLocInfo[isite3] != ITINERANT || iLocInfo[isite4] != ITINERANT) {
2567 if (isite3 != isite4) {
2568 fprintf(
stdoutMPI,
"Error: Site component of (i, j, k, l) =(%d, %d, %d, %d) is incorrect.\n", isite1, isite2, isite3, isite4);
2592 eps=pow(10.0, neps);
2593 eps_CG=pow(10.0, nepsCG);
2618 case HubbardNConserved:
2620 case SpinlessFermion:
2621 case SpinlessFermionGC:
2622 for(i=0; i<X->
Nsite; i++){
2623 if(X->
LocSpn[i]!=ITINERANT){
2631 for(i=0; i<X->
Nsite; i++){
2632 if(X->
LocSpn[i]>LOCSPIN){
2635 else if(X->
LocSpn[i]<ITINERANT){
2643 for(i=0; i<X->
Nsite; i++){
2644 if(X->
LocSpn[i]>LOCSPIN){
2647 else if(X->
LocSpn[i]<LOCSPIN){
2738 const int isite1,
const int isigma1,
2739 const int isite2,
const int isigma2,
2740 const int isite3,
const int isigma3,
2741 const int isite4,
const int isigma4,
2745 if( isigma1 > iLocInfo[isite1] || isigma2 >iLocInfo[isite2]
2746 ||isigma3 > iLocInfo[isite3] || isigma4 >iLocInfo[isite4]){
2747 fprintf(
stdoutMPI,
"%s",
"Error: Spin index is incorrect for interactions defined in InterAll file.\n");
2770 int isigma1, isigma2;
2777 if(isigma1 > X->
LocSpn[isite1] || isigma2 >X->
LocSpn[isite2]){
2778 fprintf(
stdoutMPI,
"%s",
"Error: Spin index is incorrect for transfers defined in Trans file.\n");
2804 if(tmp_Nup%2 != 0 && tmp_Ndown%2 !=0){
2805 printf(
"Nup=%d, Ndown=%d\n",X->
Nup,X->
Ndown);
2806 fprintf(
stdoutMPI,
"2Sz is incorrect.\n");
2826 const char* cKeyWord
2830 char ctmp_small[256] = { 0 };
2831 char cKW_small[256] = { 0 };
2832 int NcKeyWord, Nctmp;
2833 NcKeyWord = strlen(cKeyWord);
2834 strncpy(cKW_small, cKeyWord, NcKeyWord);
2836 for (i = 0; i < NcKeyWord; i++) {
2837 cKW_small[i] = tolower(cKW_small[i]);
2839 Nctmp = strlen(ctmp);
2840 strncpy(ctmp_small, ctmp, Nctmp);
2841 for (i = 0; i < Nctmp; i++) {
2842 ctmp_small[i] = tolower(ctmp_small[i]);
2844 if (Nctmp < NcKeyWord) Nctmp = NcKeyWord;
2845 return(strncmp(ctmp_small, cKW_small, Nctmp));
2857 if(cFileNameListFile == NULL){
2860 *FileName=cFileNameListFile[iKWidx];
2887 int iFlgGeneralSpin,
2889 int isite1,
int isigma1,
2890 int isite2,
int isigma2,
2891 int isite3,
int isigma3,
2892 int isite4,
int isigma4
2894 if(
CheckQuadSite(isite1, isite2, isite3, isite4, Nsite) !=0){
2895 fprintf(stderr,
"%s",
"Error: Site index of InterAll is incorrect.\n");
2899 if(iCalcModel == Spin || iCalcModel ==SpinGC){
2901 fprintf(stderr,
"%s",
"Error: Spin index of InterAll is incorrect.\n");
2905 else if(iCalcModel == SpinlessFermion || iCalcModel==SpinlessFermionGC){
2906 if(isigma1 !=0 || isigma2 != 0 || isigma3 != 0 || isigma4 !=0){
2907 fprintf(stderr,
"%s",
"Error: Spin index of InterAll is incorrect.\n");
2911 else if(iCalcModel == Kondo){
2917 if(iFlgGeneralSpin ==TRUE) {
2944 int **iInterAllInfo,
2945 std::complex<double> *cInterAllValue,
2946 int isite1,
int isigma1,
2947 int isite2,
int isigma2,
2948 int isite3,
int isigma3,
2949 int isite4,
int isigma4,
2950 double dvalue_re,
double dvalue_im
2953 int iflg_interall = 0;
2955 for (i = 0; i < *icnt_interall; i++) {
2956 if (isite1 == iInterAllInfo[i][0] && isite2 == iInterAllInfo[i][2] &&
2957 isite3 == iInterAllInfo[i][4] && isite4 == iInterAllInfo[i][6] &&
2958 isigma1 == iInterAllInfo[i][1] && isigma2 == iInterAllInfo[i][3] &&
2959 isigma3 == iInterAllInfo[i][5] && isigma4 == iInterAllInfo[i][7]) {
2960 cInterAllValue[i] += dvalue_re + dvalue_im *
I;
2967 if (iflg_interall == 0) {
2968 iInterAllInfo[*icnt_interall][0] = isite1;
2969 iInterAllInfo[*icnt_interall][1] = isigma1;
2970 iInterAllInfo[*icnt_interall][2] = isite2;
2971 iInterAllInfo[*icnt_interall][3] = isigma2;
2972 iInterAllInfo[*icnt_interall][4] = isite3;
2973 iInterAllInfo[*icnt_interall][5] = isigma3;
2974 iInterAllInfo[*icnt_interall][6] = isite4;
2975 iInterAllInfo[*icnt_interall][7] = isigma4;
2976 cInterAllValue[*icnt_interall] = dvalue_re +
I * dvalue_im;
2979 if (isite1 == isite2 && isite3 == isite4 &&
2980 isigma1 == isigma2 && isigma3 == isigma4) {
2982 }
else if (isite1 == isite4 && isite2 == isite3 &&
2983 isigma1 == isigma4 && isigma2 == isigma3) {
void exitMPI(int errorcode)
MPI Abortation wrapper.
int * NTETransferDiagonal
int Nup
Number of spin-up electrons in this process.
void SetConvergenceFactor(struct DefineList *X)
function to set convergence factors
int irand
Input keyword TargetTPQRand ???
int LanczosEps
log(10 base) of the convergence threshold. Read from Calcmod in readdef.h
int CheckKW(const char *cKW, char cKWList[][D_CharTmpReadDef], int iSizeOfKWidx, int *iKWidx)
Function of Checking keyword in NameList file.
int NeMPI
Total number of electrons across process. Differ from DefineList::Ne .
int iFlgSpecOmegaMin
Whether DefineList::dcOmegaMin is input or not.
std::complex< double > * EDParaGeneralTransfer
Value of general transfer integrals by a def file. malloc in setmem_def(). Data Format [DefineList::N...
int JudgeDefType(const int argc, char *argv[], int *mode)
function of judging a type of define files.
std::complex< double > * ParaInterAll
[DefineList::NInterAll] Coupling constant of inter-all term. malloc in setmem_def().
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
int NCoulombInter
Number of off-site Coulomb interaction.
std::complex< double > ** ParaTETransfer
int * EDSpinChemi
[DefineList::Nsite]
int NupMPI
Total number of spin-up electrons across processes. Deffer from DefineList::Nup. Read from modpara in...
std::complex< double > ** ParaTEInterAll
int iFlgSzConserved
Flag whether Sz is conserved.
int GetFileName(const char *cFileListNameFile, char **cFileNameList)
Function of Fitting FileName.
int ** ExchangeCoupling
[DefineList::NExchangeCoupling][2] Index of exchange term. malloc in setmem_def().
int GetFileNameByKW(int iKWidx, char **FileName)
function of getting file name labeled by the keyword
double * ParaInterAll_Diagonal
[DefineList::NInterAll_Diagonal] Coupling constant of diagonal inter-all term. malloc in setmem_def()...
int NPairLiftCoupling
Number of pair-lift term.
std::complex< double > ** ParaSingleExcitationOperator
[DefineList::NSingleExcitationOperator] Coefficient of single excitaion operator for spectrum...
int ReadDefFileError(const char *defname)
Error Function of reading def files.
int fidx
Always 0, it is not used ???
int Total2Sz
Total in this process.
int * NSingleExcitationOperator
Number of single excitaion operator for spectrum.
int *** TETransferDiagonal
std::complex< double > dcOmegaMin
Lower limit of the frequency for the spectrum.
void ResetInteractionNum(struct DefineList *X)
function of resetting number of interactions
int Nsite
Number of sites in the INTRA process region.
int ValidateValue(const int icheckValue, const int ilowestValue, const int iHighestValue)
Function of Validating value.
int CheckInterAllCondition(int iCalcModel, int Nsite, int iFlgGeneralSpin, int *iLocSpin, int isite1, int isigma1, int isite2, int isigma2, int isite3, int isigma3, int isite4, int isigma4)
Check InterAll condition.
int CheckTotal2Sz(struct DefineList *X)
function of checking an input data of total2Sz
std::complex< double > I(0.0, 1.0)
int iOutputEigenVec
ASwitch for outputting an eigenvector. 0: no output, 1:output.
FILE * fopenMPI(const char *FileName, const char *mode)
MPI file I/O (open) wrapper. Only the root node (myrank = 0) should be open/read/write (small) parame...
int * LocSpn
[DefineList::NLocSpn] Flag (and size) of the local spin. malloc in setmem_def().
int ** CisAjtCkuAlvDC
[DefineList::NCisAjtCkuAlvDC][4] Indices of two-body correlation function. malloc in setmem_def()...
int ** EDGeneralTransfer
Index of transfer integrals for calculation. malloc in setmem_def(). Data Format [DefineList::NTransf...
int nvec
Read from Calcmod in readdef.h.
int iNGPU
GPU mode ( only for FullDiag )
int * NPairExcitationOperator
Number of pair excitaion operator for spectrum.
int EDNChemi
Number of on-site term.
void InitializeInteractionNum(struct DefineList *X)
function of initializing interactions
int iFlgScaLAPACK
ScaLAPACK mode ( only for FullDiag )
int CheckGeneralSpinIndexForInterAll(const int isite1, const int isigma1, const int isite2, const int isigma2, const int isite3, const int isigma3, const int isite4, const int isigma4, int *iLocInfo)
function of checking spin index for all interactions
std::complex< double > vecB[3]
int NHundCoupling
Number of Hund coupling.
int NIsingCoupling
Number of Ising term.
std::complex< double > ** ParaPairExcitationOperator
[DefineList::NPairExcitationOperator] Coefficient of pair excitaion operator for spectrum. malloc in setmem_def().
int ReadcalcmodFile(const char *defname, struct DefineList *X)
Function of Reading calcmod file.
int NInterAll
Total Number of Interacted quartet.
int CheckWords(const char *ctmp, const char *cKeyWord)
function of checking whether ctmp is same as cKeyWord or not
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
int ** InterAll_Diagonal
[DefineList::NinterAll_Diagonal][4] Interacted quartet
int ** GeneralTransfer
Index of transfer integrals obtained by a def file. malloc in setmem_def(). Data Format [DefineList::...
int * NTEInterAllOffDiagonal
int ** PairHopping
[DefineList::NPairHopping][2] Index of pair-hopping. malloc in setmem_def().
double ** ParaTETransferDiagonal
int NNSingleExcitationOperator
Number of single excitaion operator for spectrum.
int ** PairLiftCoupling
[DefineList::NPairHopping][2] Index of pair-lift term. malloc in setmem_def().
int ** HundCoupling
[DefineList::NHundCoupling][2] Index of Hund coupling. malloc in setmem_def().
int iFlgFiniteTemperature
???
std::complex< double > dcOmegaOrg
Origin limit of the frequency for the spectrum.
int EDNTransfer
Number of transfer integrals for calculation.
int Ne
Number of electrons in this process.
int NCisAjt
Number of indices of two-body correlation function.
double * ParaExchangeCoupling
[DefineList::NExchangeCoupling] Coupling constant of exchange term. malloc in setmem_def().
double * ParaCoulombInter
[DefineList::NCoulombInter]Coupling constant of off-site Coulomb interaction. malloc in setmem_def()...
int READ
It is ALWAYS 0 ???
int read_hacker
Whether use an efficient method (=1) in sz.c or not (=0)
int NdownOrg
Number of spin-down electrons before exitation. Used only in the spectrum calculation. Read from modpara in readdef.h.
double * ParaPairLiftCoupling
[DefineList::NPairHopping] Coupling constant of pair-lift term. malloc in setmem_def().
char * fgetsMPI(char *InputString, int maxcount, FILE *fp)
MPI file I/O (get a line, fgets) wrapper. Only the root node (myrank = 0) reads and broadcast string...
static char cKWListOfFileNameList[][D_CharTmpReadDef]
Keyword List in NameListFile.
double * EDParaChemi
[DefineList::Nsite] On-site potential parameter. malloc in setmem_def().
int Lanczos_max
Maximum number of iterations.
int NExchangeCoupling
Number of exchange term.
int * NTEInterAllDiagonal
int CheckFormatForSpinInt(const int site1, const int site2, const int site3, const int site4)
function of checking format of spin interactions
static int CheckInterAllHermite(int **InterAll, std::complex< double > *ParaInterAll, int **InterAllOffDiagonal, std::complex< double > *ParaInterAllOffDiagonal, const int NInterAllOffDiagonal, const int iCalcModel)
function of checking hermite conditions about interall interactions
int NInterAll_Diagonal
Number of interall term (diagonal)
std::complex< double > * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
char * CParaFileHead
Read from Calcmod in readdef.h. It is not used. Just for the compatibility to mVMC.
int NTransfer
Number of transfer integrals obtained by a def file.
int iFlgGeneralSpin
Flag for the general (Sz/=1/2) spin.
int iNOmega
Number of frequencies for spectrum.
std::complex< double > dcOmegaMax
Upper limit of the frequency for the spectrum.
int iCalcEigenVec
Switch for method to calculate eigenvectors. 0:Lanczos+CG, 1: Lanczos. default value is set as 0 in r...
int NInterAll_OffDiagonal
Number of interall term (off-diagonal)
int iFlgSpecOmegaOrg
Whether DefineList::dcOmegaOrg is input or not.
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
int CheckPairSite(const int iSite1, const int iSite2, const int iMaxNum)
Check Site Number for a pair -> (siteA, siteB).
int ** CisAjt
[DefineList::NCisAjt][4] Indices of one-body correlation function. malloc in setmem_def().
int GetKWWithIdx(char *ctmpLine, char *ctmp, int *itmp)
Function of Getting keyword and it's variable from characters.
double ** ParaTEInterAllDiagonal
double * ParaPairHopping
[DefineList::NPairHopping] Coupling constant of pair-hopping term. malloc in setmem_def().
int ReadDefFileIdxPara(struct DefineList *X, struct BoostList *xBoost)
function of reading def files to get keyword index
int CheckSpinIndexForTrans(struct DefineList *X)
function of checking spin index for transfers
double * ParaHundCoupling
[DefineList::NHundCoupling] Hund coupling constant. malloc in setmem_def().
std::complex< double > * ParaGeneralTransfer
Value of general transfer integrals by a def file. malloc in setmem_def(). Data Format [DefineList::N...
int NPairHopping
Number of pair-hopping term.
int iFlgSpecOmegaMax
Whether DefineList::dcOmegaMax is input or not.
int CheckFormatForKondoInt(const int isite1, const int isite2, const int isite3, const int isite4, int *iLocInfo)
function of checking format of Kondo interactions
static char ** cFileNameListFile
int LanczosTarget
Which eigenstate is used to check convergence. Read from Calcmod in readdef.h.
int iCalcModel
Switch for model. 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC, 6:HubbardNConserved.
int *** TEInterAllOffDiagonal
long int initial_iv
Seed of random number for initial guesss of wavefunctions.
double * ParaCoulombIntra
int WRITE
It is ALWAYS 0 ???
int ReadDefFileNInt(char *xNameListFile, struct DefineList *X, struct BoostList *xBoost)
Function of reading information about "ModPara" file and total number of parameters from other def fi...
int flgBoost
Flag whether use CMA algorithm.
int *** TEInterAllDiagonal
int NdownMPI
Total number of spin-down electrons across processes. Deffer from DefineList::Ndown. Read from modpara in readdef.h.
int iFlgCalcSpec
Input parameter CalcSpec in teh CalcMod file.
int iOutputMode
Switch for output mode. 0: OneBodyG and TwoBodyG. 1: OneBodyG and TwoBodyG and correlations for charg...
int CheckTransferHermite(struct DefineList *X)
Check Hermite for Transfer integrals.
int k_exct
Read from Calcmod in readdef.h.
int Ndown
Number of spin-down electrons in this process.
int iInitialVecType
Switch for type of inital vectors. 0:complex type, 1: real type. default value is set as 0 in readdef...
int NCond
Number of itinerant electrons.
int ** InterAll
[DefineList::NinterAll][8] Interacted quartet
int InputInterAllInfo(int *icnt_interall, int **iInterAllInfo, std::complex< double > *cInterAllValue, int isite1, int isigma1, int isite2, int isigma2, int isite3, int isigma3, int isite4, int isigma4, double re_value, double im_value)
Input InterAll Interactions (Operators of the same kinds are grouped together).
static int CheckTETransferHermite(struct DefineList *X, const int NTETransfer, const int idx)
Check Hermite for TETransfer integrals.
int * EDChemi
[DefineList::Nsite] Chemical potential. malloc in setmem_def().
int NLocSpn
Number of local spins.
int iInputEigenVec
Switch for reading an eigenvector. 0: no input, 1:input.
int CheckLocSpin(struct DefineList *X)
function of checking indexies of localized spin
std::complex< double > *** arrayJ
char * CDataFileHead
Read from Calcmod in readdef.h. Header of output file such as Green's function.
int NupOrg
Number of spin-up electrons before exitation. Used only in the spectrum calculation. Read from modpara in readdef.h.
int NNPairExcitationOperator
Number of pair excitaion operator for spectrum.
int NCisAjtCkuAlvDC
Number of indices of two-body correlation function.
int *** SingleExcitationOperator
[DefineList::NSingleExcitationOperator][3] Indices of single excitaion operator for spectrum...
int CheckQuadSite(const int iSite1, const int iSite2, const int iSite3, const int iSite4, const int iMaxNum)
Check Site Number for a quad -> (siteA, siteB, siteC, siteD).
int *** PairExcitationOperator
[DefineList::NPairExcitationOperator][5] Indices of pair excitaion operator for spectrum. malloc in setmem_def().
int GetDiagonalInterAll(int **InterAll, std::complex< double > *ParaInterAll, const int NInterAll, int **InterAllDiagonal, double *ParaInterAllDiagonal, int **InterAllOffDiagonal, std::complex< double > *ParaInterAllOffDiagonal, int *Chemi, int *SpinChemi, double *ParaChemi, int *NChemi, const int iCalcModel)
function of getting diagonal components
Definision of system (Hamiltonian) etc.
std::complex< double > ** ParaTEInterAllOffDiagonal
int iCalcType
Switch for calculation type. 0:Lanczos, 1:TPQCalc, 2:FullDiag.
int CheckSite(const int iSite, const int iMaxNum)
Check Site Number.