40 #include "StdFace_vals.hpp" 41 #include "StdFace_ModelUtil.hpp" 55 for (ktrans = 0; ktrans < StdI->ntrans; ktrans++) {
56 LargeValue0 += std::abs(StdI->trans[ktrans]);
58 for (kintr = 0; kintr < StdI->nintr; kintr++) {
59 LargeValue0 += std::abs(StdI->intr[kintr]);
61 for (kintr = 0; kintr < StdI->NCintra; kintr++) {
62 LargeValue0 += std::abs(StdI->Cintra[kintr]);
64 for (kintr = 0; kintr < StdI->NCinter; kintr++) {
65 LargeValue0 += std::abs(StdI->Cinter[kintr]);
67 for (kintr = 0; kintr < StdI->NEx; kintr++) {
68 LargeValue0 += 2.0 * std::abs(StdI->Ex[kintr]);
70 for (kintr = 0; kintr < StdI->NPairLift; kintr++) {
71 LargeValue0 += 2.0 * std::abs(StdI->PairLift[kintr]);
73 for (kintr = 0; kintr < StdI->NHund; kintr++) {
74 LargeValue0 += 2.0 * std::abs(StdI->Hund[kintr]);
76 LargeValue0 /= (double)StdI->nsite;
86 int iCalcType, iCalcModel, iRestart, iCalcSpec,
87 iCalcEigenvec, iInitialVecTpye, InputEigenVec, OutputEigenVec;
91 fprintf(stdout,
"\n @ CalcMod\n\n");
96 if (strcmp(StdI->method,
"****") == 0){
97 fprintf(stdout,
"ERROR ! Method is NOT specified !\n");
100 else if (strcmp(StdI->method,
"lanczos") == 0) iCalcType = 0;
101 else if (strcmp(StdI->method,
"lanczosenergy") == 0) {
105 else if (strcmp(StdI->method,
"tpq") == 0) iCalcType = 1;
106 else if (strcmp(StdI->method,
"fulldiag") == 0 ) iCalcType = 2;
107 else if (strcmp(StdI->method,
"cg") == 0) iCalcType = 3;
108 else if (strcmp(StdI->method,
"timeevolution") == 0) iCalcType = 4;
110 fprintf(stdout,
"\n ERROR ! Unsupported Solver : %s\n", StdI->method);
113 if (iCalcType != 4) StdI->PumpBody = 0;
117 if (strcmp(StdI->model,
"hubbard") == 0) {
118 if (StdI->lGC == 0)iCalcModel = 0;
121 else if (strcmp(StdI->model,
"spin") == 0) {
122 if (StdI->lGC == 0)iCalcModel = 1;
125 else if (strcmp(StdI->model,
"kondo") == 0) {
126 if (StdI->lGC == 0)iCalcModel = 2;
132 if (strcmp(StdI->Restart,
"****") == 0) {
133 strcpy(StdI->Restart,
"none\0");
134 fprintf(stdout,
" Restart = none ###### DEFAULT VALUE IS USED ######\n");
138 fprintf(stdout,
" Restart = %s\n", StdI->Restart);
139 if (strcmp(StdI->Restart,
"none") == 0) iRestart = 0;
140 else if (strcmp(StdI->Restart,
"restart_out") == 0 ||
141 strcmp(StdI->Restart,
"save") == 0) iRestart = 1;
142 else if (strcmp(StdI->Restart,
"restartsave") == 0 ||
143 strcmp(StdI->Restart,
"restart") == 0) iRestart = 2;
144 else if (strcmp(StdI->Restart,
"restart_in") == 0) iRestart = 3;
146 fprintf(stdout,
"\n ERROR ! Restart Mode : %s\n", StdI->Restart);
153 if (strcmp(StdI->InitialVecType,
"****") == 0) {
154 strcpy(StdI->InitialVecType,
"c\0");
155 fprintf(stdout,
" InitialVecType = c ###### DEFAULT VALUE IS USED ######\n");
159 fprintf(stdout,
" InitialVecType = %s\n", StdI->InitialVecType);
160 if (strcmp(StdI->InitialVecType,
"c") == 0) iInitialVecTpye = 0;
161 else if (strcmp(StdI->InitialVecType,
"r") == 0) iInitialVecTpye = 1;
163 fprintf(stdout,
"\n ERROR ! Restart Mode : %s\n", StdI->Restart);
172 if (strcmp(StdI->EigenVecIO,
"****") == 0) {
173 strcpy(StdI->EigenVecIO,
"none\0");
174 fprintf(stdout,
" EigenVecIO = none ###### DEFAULT VALUE IS USED ######\n");
177 fprintf(stdout,
" EigenVecIO = %s\n", StdI->EigenVecIO);
178 if (strcmp(StdI->EigenVecIO,
"none") == 0) InputEigenVec = 0;
179 else if (strcmp(StdI->EigenVecIO,
"in") == 0) InputEigenVec = 1;
180 else if (strcmp(StdI->EigenVecIO,
"out") == 0) OutputEigenVec = 1;
181 else if (strcmp(StdI->EigenVecIO,
"inout") == 0) {
186 fprintf(stdout,
"\n ERROR ! EigenVecIO Mode : %s\n", StdI->Restart);
190 if (strcmp(StdI->method,
"timeevolution") == 0) InputEigenVec = 1;
194 if (strcmp(StdI->CalcSpec,
"****") == 0) {
195 strcpy(StdI->CalcSpec,
"none\0");
196 fprintf(stdout,
" CalcSpec = none ###### DEFAULT VALUE IS USED ######\n");
200 fprintf(stdout,
" CalcSpec = %s\n", StdI->CalcSpec);
201 if (strcmp(StdI->CalcSpec,
"none") == 0) iCalcSpec = 0;
202 else if (strcmp(StdI->CalcSpec,
"normal") == 0) iCalcSpec = 1;
203 else if (strcmp(StdI->CalcSpec,
"noiteration") == 0) iCalcSpec = 2;
204 else if (strcmp(StdI->CalcSpec,
"restart_out") == 0) iCalcSpec = 3;
205 else if (strcmp(StdI->CalcSpec,
"restart_in") == 0) iCalcSpec = 4;
206 else if (strcmp(StdI->CalcSpec,
"restartsave") == 0 ||
207 strcmp(StdI->CalcSpec,
"restart") == 0) iCalcSpec = 5;
208 else if (strcmp(StdI->CalcSpec,
"scratch") == 0) iCalcSpec = 6;
210 fprintf(stdout,
"\n ERROR ! CalcSpec : %s\n", StdI->CalcSpec);
215 fp = fopen(
"calcmod.def",
"w");
216 fprintf(fp,
"#CalcType = 0:Lanczos, 1:TPQCalc, 2:FullDiag, 3:CG, 4:Time-evolution\n");
217 fprintf(fp,
"#CalcModel = 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC\n");
218 fprintf(fp,
"#Restart = 0:None, 1:Save, 2:Restart&Save, 3:Restart\n");
219 fprintf(fp,
"#CalcSpec = 0:None, 1:Normal, 2:No H*Phi, 3:Save, 4:Restart, 5:Restart&Save, 6:Scratch\n");
220 fprintf(fp,
"CalcType %3d\n", iCalcType);
221 fprintf(fp,
"CalcModel %3d\n", iCalcModel);
222 fprintf(fp,
"ReStart %3d\n", iRestart);
223 fprintf(fp,
"CalcSpec %3d\n", iCalcSpec);
224 fprintf(fp,
"CalcEigenVec %3d\n", iCalcEigenvec);
225 fprintf(fp,
"InitialVecType %3d\n", iInitialVecTpye);
226 fprintf(fp,
"InputEigenVec %3d\n", InputEigenVec);
227 fprintf(fp,
"OutputEigenVec %3d\n", OutputEigenVec);
230 fprintf(stdout,
" calcmod.def is written.\n\n");
238 int NumOp, **spin, isite, ispin, icell, itau, iEx, lR;
239 double *coef, Cphase, S, Sz;
240 double *fourier_r, *fourier_i;
242 if (strcmp(StdI->model,
"spin") == 0 && StdI->S2 > 1) {
243 coef = (
double *)malloc(
sizeof(
double) * (StdI->S2 + 1));
244 spin = (
int **)malloc(
sizeof(
int*) * (StdI->S2 + 1));
245 for (ispin = 0; ispin < StdI->S2 + 1; ispin++) spin[ispin] = (
int *)malloc(
sizeof(
int) * 2);
248 coef = (
double *)malloc(
sizeof(
double) * 2);
249 spin = (
int **)malloc(
sizeof(
int*) * 2);
250 for (ispin = 0; ispin < 2; ispin++) spin[ispin] = (
int *)malloc(
sizeof(
int) * 2);
253 fourier_r = (
double *)malloc(
sizeof(
double) * StdI->nsite);
254 fourier_i = (
double *)malloc(
sizeof(
double) * StdI->nsite);
256 fprintf(stdout,
"\n @ Spectrum\n\n");
262 if (strcmp(StdI->SpectrumType,
"****") == 0) {
263 strcpy(StdI->SpectrumType,
"szsz\0");
264 fprintf(stdout,
" SpectrumType = szsz ###### DEFAULT VALUE IS USED ######\n");
265 if (strcmp(StdI->model,
"spin") == 0) {
266 NumOp = StdI->S2 + 1;
267 for (ispin = 0; ispin <= StdI->S2; ispin++) {
268 Sz = (double)ispin - (
double)StdI->S2 * 0.5;
270 spin[ispin][0] = ispin;
271 spin[ispin][1] = ispin;
283 StdI->SpectrumBody = 2;
287 fprintf(stdout,
" SpectrumType = %s\n", StdI->SpectrumType);
288 if (strcmp(StdI->SpectrumType,
"szsz") == 0 ||
289 strcmp(StdI->SpectrumType,
"szsz_r") == 0) {
290 if (strcmp(StdI->model,
"spin") == 0) {
291 NumOp = StdI->S2 + 1;
292 for (ispin = 0; ispin <= StdI->S2; ispin++) {
293 Sz = (double)ispin - (
double)StdI->S2 * 0.5;
295 spin[ispin][0] = ispin;
296 spin[ispin][1] = ispin;
308 if (strcmp(StdI->SpectrumType,
"szsz") == 0) lR = 0;
310 StdI->SpectrumBody = 2;
312 else if (strcmp(StdI->SpectrumType,
"s+s-") == 0 ||
313 strcmp(StdI->SpectrumType,
"s+s-_r") == 0) {
314 if (strcmp(StdI->model,
"spin") == 0 && StdI->S2 > 1) {
316 S = (double)StdI->S2 * 0.5;
317 for (ispin = 0; ispin < StdI->S2; ispin++) {
318 Sz = (double)ispin - (
double)StdI->S2 * 0.5;
319 coef[ispin] = sqrt(S*(S + 1.0) - Sz*(Sz + 1.0));
320 spin[ispin][0] = ispin;
321 spin[ispin][1] = ispin + 1;
330 if (strcmp(StdI->SpectrumType,
"s+s-") == 0) lR = 0;
332 StdI->SpectrumBody = 2;
334 else if (strcmp(StdI->SpectrumType,
"density") == 0 ||
335 strcmp(StdI->SpectrumType,
"density_r") == 0) {
343 if (strcmp(StdI->SpectrumType,
"density") == 0) lR = 0;
345 StdI->SpectrumBody = 2;
347 else if (strcmp(StdI->SpectrumType,
"up") == 0 ||
348 strcmp(StdI->SpectrumType,
"up_r") == 0) {
352 if (strcmp(StdI->SpectrumType,
"up") == 0) lR = 0;
354 StdI->SpectrumBody = 1;
356 else if (strcmp(StdI->SpectrumType,
"down") == 0 ||
357 strcmp(StdI->SpectrumType,
"down_r") == 0) {
361 if (strcmp(StdI->SpectrumType,
"down") == 0) lR = 0;
363 StdI->SpectrumBody = 1;
366 fprintf(stdout,
"\n ERROR ! SpectrumType : %s\n", StdI->SpectrumType);
372 for (icell = 0; icell < StdI->NCell; icell++) {
373 for (itau = 0; itau < StdI->NsiteUC; itau++) {
374 Cphase = (StdI->Cell[icell][0] + StdI->tau[itau][0])*StdI->SpectrumQ[0]
375 + (StdI->Cell[icell][1] + StdI->tau[itau][1])*StdI->SpectrumQ[1]
376 + (StdI->Cell[icell][2] + StdI->tau[itau][2])*StdI->SpectrumQ[2];
377 fourier_r[isite] = cos(2.0*StdI->pi*Cphase);
378 fourier_i[isite] = sin(2.0*StdI->pi*Cphase);
382 if (strcmp(StdI->model,
"kondo") == 0) {
383 for (isite = 0; isite < StdI->nsite / 2; isite++) {
384 fourier_r[isite + StdI->nsite / 2] = fourier_r[isite];
385 fourier_i[isite + StdI->nsite / 2] = fourier_i[isite];
389 if (StdI->SpectrumBody == 1) {
390 fp = fopen(
"single.def",
"w");
391 fprintf(fp,
"=============================================\n");
392 if (lR == 0) fprintf(fp,
"NSingle %d\n", 2);
393 else fprintf(fp,
"NSingle %d\n", 1+ StdI->nsite);
394 fprintf(fp,
"=============================================\n");
395 fprintf(fp,
"============== Single Excitation ============\n");
396 fprintf(fp,
"=============================================\n");
398 if (strcmp(StdI->model,
"kondo") == 0) {
399 for (iEx = 0; iEx < 2; iEx++) {
400 fprintf(fp,
"%d\n", StdI->nsite / 2 * NumOp);
401 for (isite = StdI->nsite / 2; isite < StdI->nsite; isite++) {
402 fprintf(fp,
"%d %d 0 %25.15f %25.15f\n", isite, spin[0][0],
403 fourier_r[isite] * coef[0], fourier_i[isite] * coef[0]);
408 for (iEx = 0; iEx < 2; iEx++) {
409 fprintf(fp,
"%d\n", StdI->nsite * NumOp);
410 for (isite = 0; isite < StdI->nsite; isite++) {
411 fprintf(fp,
"%d %d 0 %25.15f %25.15f\n", isite, spin[0][0],
412 fourier_r[isite] * coef[0], fourier_i[isite] * coef[0]);
418 if (strcmp(StdI->model,
"kondo") == 0) {
419 fprintf(fp,
"%d\n", NumOp);
420 fprintf(fp,
"%d %d 0 %25.15f 0.0\n", StdI->nsite / 2, spin[0][0], coef[0]);
421 for (isite = StdI->nsite / 2; isite < StdI->nsite; isite++) {
422 fprintf(fp,
"%d\n", NumOp);
423 fprintf(fp,
"%d %d 0 %25.15f 0.0\n", isite, spin[0][0], coef[0]);
427 fprintf(fp,
"%d\n", NumOp);
428 fprintf(fp,
"%d %d 0 %25.15f 0.0\n", 0, spin[0][0], coef[0]);
429 for (isite = 0; isite < StdI->nsite; isite++) {
430 fprintf(fp,
"%d\n", NumOp);
431 fprintf(fp,
"%d %d 0 %25.15f 0.0\n", isite, spin[0][0], coef[0]);
435 fprintf(stdout,
" single.def is written.\n\n");
438 fp = fopen(
"pair.def",
"w");
439 fprintf(fp,
"=============================================\n");
440 if (lR == 0) fprintf(fp,
"NPair %d\n", 2);
441 else fprintf(fp,
"NSingle %d\n", 1 + StdI->nsite);
442 fprintf(fp,
"=============================================\n");
443 fprintf(fp,
"=============== Pair Excitation =============\n");
444 fprintf(fp,
"=============================================\n");
446 for (iEx = 0; iEx < 2; iEx++) {
447 fprintf(fp,
"%d\n", StdI->nsite * NumOp);
448 for (isite = 0; isite < StdI->nsite; isite++) {
449 for (ispin = 0; ispin < NumOp; ispin++) {
450 fprintf(fp,
"%d %d %d %d 1 %25.15f %25.15f\n",
451 isite, spin[ispin][0], isite, spin[ispin][1],
452 fourier_r[isite] * coef[ispin], fourier_i[isite] * coef[ispin]);
458 fprintf(fp,
"%d\n", NumOp);
459 for (ispin = 0; ispin < NumOp; ispin++) {
460 fprintf(fp,
"%d %d %d %d 1 %25.15f 0.0\n",
461 0, spin[ispin][0], 0, spin[ispin][1], coef[ispin]);
463 for (isite = 0; isite < StdI->nsite; isite++) {
464 fprintf(fp,
"%d\n", NumOp);
465 for (ispin = 0; ispin < NumOp; ispin++) {
466 fprintf(fp,
"%d %d %d %d 1 %25.15f 0.0\n",
467 isite, spin[ispin][0], isite, spin[ispin][1], coef[ispin]);
471 fprintf(stdout,
" pair.def is written.\n\n");
478 if (strcmp(StdI->model,
"spin") == 0)
479 for (ispin = 0; ispin < StdI->S2 + 1; ispin++) free(spin[ispin]);
481 for (ispin = 0; ispin < 2; ispin++) free(spin[ispin]);
495 fprintf(stdout,
"\n @ Time-evolution\n\n");
507 StdI->At = (
double **)malloc(
sizeof(
double*) * StdI->Lanczos_max);
508 Et = (
double **)malloc(
sizeof(
double*) * StdI->Lanczos_max);
509 for (it = 0; it < StdI->Lanczos_max; it++) {
510 StdI->At[it] = (
double *)malloc(
sizeof(
double) * 3);
511 Et[it] = (
double *)malloc(
sizeof(
double) * 3);
514 if (strcmp(StdI->PumpType,
"****") == 0) {
515 strcpy(StdI->PumpType,
"quench\0");
516 fprintf(stdout,
" PumpType = quench ###### DEFAULT VALUE IS USED ######\n");
520 fprintf(stdout,
" PumpType = %s\n", StdI->PumpType);
521 if (strcmp(StdI->PumpType,
"quench") == 0) {
524 else if (strcmp(StdI->PumpType,
"pulselaser") == 0) {
525 for (it = 0; it < StdI->Lanczos_max; it++) {
526 time = StdI->dt*(double)it;
527 for (ii = 0; ii < 3; ii++) {
528 StdI->At[it][ii] = StdI->VecPot[ii] * cos(StdI->freq*(time - StdI->tshift))
529 * exp(-0.5* (time - StdI->tshift)*(time - StdI->tshift) / (StdI->tdump*StdI->tdump));
530 Et[it][ii] = -StdI->VecPot[ii]
532 (StdI->tshift - time) / (StdI->tdump*StdI->tdump) * cos(StdI->freq*(time - StdI->tshift))
533 - StdI->freq* sin(StdI->freq*(time - StdI->tshift))
535 * exp(-0.5* (time - StdI->tshift)*(time - StdI->tshift) / (StdI->tdump*StdI->tdump));
540 else if (strcmp(StdI->PumpType,
"aclaser") == 0) {
541 for (it = 0; it < StdI->Lanczos_max; it++) {
542 time = StdI->dt*(double)it;
543 for (ii = 0; ii < 3; ii++) {
544 StdI->At[it][ii] = StdI->VecPot[ii] * sin(StdI->freq*(time - StdI->tshift));
545 Et[it][ii] = StdI->VecPot[ii] * cos(StdI->freq*(time - StdI->tshift)) * StdI->freq;
550 else if (strcmp(StdI->PumpType,
"dclaser") == 0) {
551 for (it = 0; it < StdI->Lanczos_max; it++) {
552 time = StdI->dt*(double)it;
553 for (ii = 0; ii < 3; ii++) {
554 StdI->At[it][ii] = StdI->VecPot[ii] * time;
555 Et[it][ii] = -StdI->VecPot[ii];
561 fprintf(stdout,
"\n ERROR ! PumpType : %s\n", StdI->PumpType);
566 if (StdI->PumpBody == 1) {
567 fp = fopen(
"potential.dat",
"w");
568 fprintf(fp,
"# Time A_W A_L A_H E_W E_L E_H\n");
569 for (it = 0; it < StdI->Lanczos_max; it++) {
570 time = StdI->dt*(double)it;
571 fprintf(fp,
"%f %f %f %f %f %f %f\n",
572 time, StdI->At[it][0], StdI->At[it][1], StdI->At[it][2], Et[it][0], Et[it][1], Et[it][2]);
578 for (it = 0; it < StdI->Lanczos_max; it++) free(Et[it]);
587 int it, isite, ipump, jpump, npump0;
589 if (StdI->PumpBody == 1) {
591 fp = fopen(
"teone.def",
"w");
592 fprintf(fp,
"=============================================\n");
593 fprintf(fp,
"AllTimeStep %d\n", StdI->Lanczos_max);
594 fprintf(fp,
"=============================================\n");
595 fprintf(fp,
"========= OneBody Time Evolution ==========\n");
596 fprintf(fp,
"=============================================\n");
597 for (it = 0; it < StdI->Lanczos_max; it++) {
601 for (ipump = 0; ipump < StdI->npump[it]; ipump++) {
602 for (jpump = ipump + 1; jpump < StdI->npump[it]; jpump++) {
603 if (StdI->pumpindx[it][ipump][0] == StdI->pumpindx[it][jpump][0]
604 && StdI->pumpindx[it][ipump][1] == StdI->pumpindx[it][jpump][1]
605 && StdI->pumpindx[it][ipump][2] == StdI->pumpindx[it][jpump][2]
606 && StdI->pumpindx[it][ipump][3] == StdI->pumpindx[it][jpump][3]) {
607 StdI->pump[it][ipump] = StdI->pump[it][ipump] + StdI->pump[it][jpump];
608 StdI->pump[it][jpump] = 0.0;
616 for (ipump = 0; ipump < StdI->npump[it]; ipump++)
617 if (std::abs(StdI->pump[it][ipump]) > 0.000001) npump0 += 1;
619 fprintf(fp,
"%f %d\n", StdI->dt*(
double)it, npump0);
620 for (ipump = 0; ipump < StdI->npump[it]; ipump++) {
622 if (std::abs(StdI->pump[it][ipump]) <= 0.000001)
continue;
624 fprintf(fp,
"%5d %5d %5d %5d %25.15f %25.15f\n",
625 StdI->pumpindx[it][ipump][0], StdI->pumpindx[it][ipump][1],
626 StdI->pumpindx[it][ipump][2], StdI->pumpindx[it][ipump][3],
627 real(StdI->pump[it][ipump]), imag(StdI->pump[it][ipump]));
630 fprintf(stdout,
" teone.def is written.\n\n");
633 fp = fopen(
"tetwo.def",
"w");
634 fprintf(fp,
"=============================================\n");
635 fprintf(fp,
"AllTimeStep %d\n", StdI->Lanczos_max);
636 fprintf(fp,
"=============================================\n");
637 fprintf(fp,
"========== TwoBody Time Evolution ===========\n");
638 fprintf(fp,
"=============================================\n");
639 for (it = 0; it < StdI->Lanczos_max; it++) {
640 fprintf(fp,
"%f %d\n", StdI->dt*(
double)it, StdI->nsite);
641 for (isite = 0; isite < StdI->nsite; isite++) {
642 fprintf(fp,
"%5d %5d %5d %5d %5d %5d %5d %5d %25.15f %25.15f\n",
643 isite, 0, isite, 0, isite, 1, isite, 1, StdI->Uquench, 0.0);
646 fprintf(stdout,
" tetwo.def is written.\n\n");
656 static void PrintOrb(
struct StdIntList *StdI) {
658 int isite, jsite, iOrb;
660 fp = fopen(
"orbitalidx.def",
"w");
661 fprintf(fp,
"=============================================\n");
662 fprintf(fp,
"NOrbitalIdx %10d\n", StdI->NOrb);
663 fprintf(fp,
"ComplexType %10d\n", StdI->ComplexType);
664 fprintf(fp,
"=============================================\n");
665 fprintf(fp,
"=============================================\n");
667 for (isite = 0; isite < StdI->nsite; isite++) {
668 for (jsite = 0; jsite < StdI->nsite; jsite++) {
669 if (StdI->AntiPeriod[0] == 1 || StdI->AntiPeriod[1] == 1 || StdI->AntiPeriod[2] == 1) {
670 fprintf(fp,
"%5d %5d %5d %5d\n", isite, jsite, StdI->Orb[isite][jsite], StdI->AntiOrb[isite][jsite]);
673 fprintf(fp,
"%5d %5d %5d\n", isite, jsite, StdI->Orb[isite][jsite]);
678 for (iOrb = 0; iOrb < StdI->NOrb; iOrb++)
679 fprintf(fp,
"%5d %5d\n", iOrb, 1);
683 fprintf(stdout,
" orbitalidx.def is written.\n");
685 for (isite = 0; isite < StdI->nsite; isite++) free(StdI->Orb[isite]);
692 static void PrintOrbPara(
struct StdIntList *StdI) {
694 int isite, jsite, NOrbGC, iOrbGC, isite1, jsite1, iorb;
695 int **OrbGC, **AntiOrbGC;
699 OrbGC = (
int **)malloc(
sizeof(
int*) * StdI->nsite);
700 AntiOrbGC = (
int **)malloc(
sizeof(
int*) * StdI->nsite);
701 for (isite = 0; isite < StdI->nsite; isite++) {
702 OrbGC[isite] = (
int *)malloc(
sizeof(
int) * StdI->nsite);
703 AntiOrbGC[isite] = (
int *)malloc(
sizeof(
int) * StdI->nsite);
704 for (jsite = 0; jsite < StdI->nsite; jsite++) {
705 OrbGC[isite][jsite] = StdI->Orb[isite][jsite];
706 AntiOrbGC[isite][jsite] = StdI->AntiOrb[isite][jsite];
712 for (iorb = 0; iorb < StdI->NOrb; iorb++) {
713 for (isite = 0; isite < StdI->nsite; isite++) {
714 for (jsite = 0; jsite < StdI->nsite; jsite++) {
715 if (OrbGC[isite][jsite] == iorb) {
716 OrbGC[jsite][isite] = OrbGC[isite][jsite];
723 for (isite = 0; isite < StdI->nsite; isite++) {
724 for (jsite = 0; jsite < isite; jsite++) {
725 if (OrbGC[isite][jsite] >= 0) {
726 iOrbGC = OrbGC[isite][jsite];
728 for (isite1 = 0; isite1 < StdI->nsite; isite1++) {
729 for (jsite1 = 0; jsite1 < StdI->nsite; jsite1++) {
730 if (OrbGC[isite1][jsite1] == iOrbGC)
731 OrbGC[isite1][jsite1] = NOrbGC;
739 for (isite = 0; isite < StdI->nsite; isite++) {
740 for (jsite = 0; jsite < StdI->nsite; jsite++) {
741 OrbGC[isite][jsite] = -1 - OrbGC[isite][jsite];
745 fp = fopen(
"orbitalidxpara.def",
"w");
746 fprintf(fp,
"=============================================\n");
747 fprintf(fp,
"NOrbitalIdx %10d\n", NOrbGC);
748 fprintf(fp,
"ComplexType %10d\n", StdI->ComplexType);
749 fprintf(fp,
"=============================================\n");
750 fprintf(fp,
"=============================================\n");
752 for (isite = 0; isite < StdI->nsite; isite++) {
753 for (jsite = 0; jsite < StdI->nsite; jsite++) {
754 if (isite >= jsite)
continue;
755 if (StdI->AntiPeriod[0] == 1 || StdI->AntiPeriod[1] == 1 || StdI->AntiPeriod[2] == 1)
756 fprintf(fp,
"%5d %5d %5d %5d\n", isite, jsite, OrbGC[isite][jsite], AntiOrbGC[isite][jsite]);
758 fprintf(fp,
"%5d %5d %5d\n", isite, jsite, OrbGC[isite][jsite]);
762 for (iOrbGC = 0; iOrbGC < NOrbGC; iOrbGC++)
763 fprintf(fp,
"%5d %5d\n", iOrbGC, 1);
767 fprintf(stdout,
" orbitalidxpara.def is written.\n");
769 for (isite = 0; isite < StdI->nsite; isite++) {
771 free(AntiOrbGC[isite]);
779 static void PrintGutzwiller(
struct StdIntList *StdI)
782 int iCell, isite, jsite, NGutzwiller, iGutz;
785 Gutz = (
int *)malloc(
sizeof(
int) * StdI->nsite);
787 if (std::abs(StdI->NMPTrans) == 1 || StdI->NMPTrans == StdI->NaN_i) {
788 if (strcmp(StdI->model,
"hubbard") == 0) NGutzwiller = 0;
789 else NGutzwiller = -1;
791 for (isite = 0; isite < StdI->nsite; isite++) Gutz[isite] = StdI->Orb[isite][isite];
793 for (isite = 0; isite < StdI->nsite; isite++) {
797 if (StdI->locspinflag[isite] != 0) {
802 if (Gutz[isite] >= 0) {
805 for (jsite = 0; jsite < StdI->nsite; jsite++) {
806 if (Gutz[jsite] == iGutz)
807 Gutz[jsite] = NGutzwiller;
812 NGutzwiller = -NGutzwiller;
813 for (isite = 0; isite < StdI->nsite; isite++) {
814 Gutz[isite] = -1 - Gutz[isite];
818 if (strcmp(StdI->model,
"hubbard") == 0) NGutzwiller = StdI->NsiteUC;
819 else if (strcmp(StdI->model,
"spin") == 0) NGutzwiller = 1;
820 else NGutzwiller = StdI->NsiteUC + 1;
822 for (iCell = 0; iCell < StdI->NCell; iCell++) {
823 for (isite = 0; isite < StdI->NsiteUC; isite++) {
824 if (strcmp(StdI->model,
"hubbard") == 0)
825 Gutz[isite + StdI->NsiteUC*iCell] = isite;
826 else if (strcmp(StdI->model,
"spin") == 0)
827 Gutz[isite + StdI->NsiteUC*iCell] = 0;
829 Gutz[isite + StdI->NsiteUC*iCell] = 0;
830 Gutz[isite + StdI->NsiteUC*(iCell + StdI->NCell)] = isite + 1;
836 fp = fopen(
"gutzwilleridx.def",
"w");
837 fprintf(fp,
"=============================================\n");
838 fprintf(fp,
"NGutzwillerIdx %10d\n", NGutzwiller);
839 fprintf(fp,
"ComplexType %10d\n", 0);
840 fprintf(fp,
"=============================================\n");
841 fprintf(fp,
"=============================================\n");
843 for (isite = 0; isite < StdI->nsite; isite++)
844 fprintf(fp,
"%5d %5d\n", isite, Gutz[isite]);
846 for (iGutz = 0; iGutz < NGutzwiller; iGutz++) {
847 if (strcmp(StdI->model,
"hubbard") == 0 || iGutz > 0)
848 fprintf(fp,
"%5d %5d\n", iGutz, 1);
850 fprintf(fp,
"%5d %5d\n", iGutz, 0);
854 fprintf(stdout,
" gutzwilleridx.def is written.\n");
871 StdI->NaN_i = 2147483647;
872 StdI->pi = acos(-1.0);
875 for (i = 0; i < 3; i++) StdI->length[i] = NaN_d;
876 for (i = 0; i < 3; i++)
877 for (j = 0; j < 3; j++)
878 StdI->box[i][j] = StdI->NaN_i;
881 StdI->Height = StdI->NaN_i;
885 StdI->JppAll = NaN_d;
887 StdI->J0pAll = NaN_d;
888 StdI->J0ppAll = NaN_d;
890 StdI->J1pAll = NaN_d;
891 StdI->J1ppAll = NaN_d;
893 StdI->J2pAll = NaN_d;
894 StdI->J2ppAll = NaN_d;
895 for (i = 0; i < 3; i++) {
896 for (j = 0; j < 3; j++) {
897 StdI->J[i][j] = NaN_d;
898 StdI->Jp[i][j] = NaN_d;
899 StdI->Jpp[i][j] = NaN_d;
900 StdI->J0[i][j] = NaN_d;
901 StdI->J0p[i][j] = NaN_d;
902 StdI->J0pp[i][j] = NaN_d;
903 StdI->J1[i][j] = NaN_d;
904 StdI->J1p[i][j] = NaN_d;
905 StdI->J1pp[i][j] = NaN_d;
906 StdI->J2[i][j] = NaN_d;
907 StdI->J2p[i][j] = NaN_d;
908 StdI->J2pp[i][j] = NaN_d;
912 StdI->D[2][2] = NaN_d;
914 StdI->L = StdI->NaN_i;
915 for (i = 0; i < 3; i++)
916 for (j = 0; j < 3; j++)
917 StdI->direct[i][j] = NaN_d;
919 StdI->S2 = StdI->NaN_i;
945 StdI->W = StdI->NaN_i;
946 for (i = 0; i < 3; i++)StdI->phase[i] = NaN_d;
947 StdI->pi180 = StdI->pi / 180.0;
949 StdI->nelec = StdI->NaN_i;
950 StdI->Sz2 = StdI->NaN_i;
951 strcpy(StdI->model,
"****\0");
952 strcpy(StdI->lattice,
"****\0");
953 strcpy(StdI->outputmode,
"****\0");
954 strcpy(StdI->CDataFileHead,
"****\0");
955 StdI->cutoff_t = NaN_d;
956 StdI->cutoff_u = NaN_d;
957 StdI->cutoff_j = NaN_d;
958 StdI->cutoff_length_t = NaN_d;
959 StdI->cutoff_length_U = NaN_d;
960 StdI->cutoff_length_J = NaN_d;
961 for (i = 0; i < 3; i++)StdI->cutoff_tR[i] = StdI->NaN_i;
962 for (i = 0; i < 3; i++)StdI->cutoff_UR[i] = StdI->NaN_i;
963 for (i = 0; i < 3; i++)StdI->cutoff_JR[i] = StdI->NaN_i;
964 StdI->double_counting = StdI->NaN_i;
966 StdI->LargeValue = NaN_d;
967 StdI->OmegaMax = NaN_d;
968 StdI->OmegaMin = NaN_d;
969 StdI->OmegaIm = NaN_d;
970 StdI->Nomega = StdI->NaN_i;
971 for (i = 0; i < 3; i++)StdI->SpectrumQ[i] = NaN_d;
972 strcpy(StdI->method,
"****\0");
973 strcpy(StdI->Restart,
"****\0");
974 strcpy(StdI->EigenVecIO,
"****\0");
975 strcpy(StdI->InitialVecType,
"****\0");
976 strcpy(StdI->CalcSpec,
"****\0");
977 strcpy(StdI->SpectrumType,
"****\0");
979 StdI->Lanczos_max = StdI->NaN_i;
980 StdI->initial_iv = StdI->NaN_i;
981 StdI->nvec = StdI->NaN_i;
982 StdI->exct = StdI->NaN_i;
983 StdI->LanczosEps = StdI->NaN_i;
984 StdI->LanczosTarget = StdI->NaN_i;
985 StdI->NumAve = StdI->NaN_i;
986 StdI->ExpecInterval = StdI->NaN_i;
989 StdI->tshift = NaN_d;
991 StdI->Uquench = NaN_d;
992 for (i = 0; i < 3; i++)StdI->VecPot[i] = NaN_d;;
993 strcpy(StdI->PumpType,
"****\0");
994 StdI->ExpandCoef = StdI->NaN_i;
996 strcpy(StdI->CParaFileHead,
"****\0");
997 StdI->NVMCCalMode = StdI->NaN_i;
998 StdI->NLanczosMode = StdI->NaN_i;
999 StdI->NDataIdxStart = StdI->NaN_i;
1000 StdI->NDataQtySmp = StdI->NaN_i;
1001 StdI->NSPGaussLeg = StdI->NaN_i;
1002 StdI->NSPStot = StdI->NaN_i;
1003 StdI->NMPTrans = StdI->NaN_i;
1004 StdI->NSROptItrStep = StdI->NaN_i;
1005 StdI->NSROptItrSmp = StdI->NaN_i;
1006 StdI->DSROptRedCut = NaN_d;
1007 StdI->DSROptStaDel = NaN_d;
1008 StdI->DSROptStepDt = NaN_d;
1009 StdI->NVMCWarmUp = StdI->NaN_i;
1010 StdI->NVMCInterval = StdI->NaN_i;
1011 StdI->NVMCSample = StdI->NaN_i;
1012 StdI->NExUpdatePath = StdI->NaN_i;
1013 StdI->RndSeed = StdI->NaN_i;
1014 StdI->NSplitSize = StdI->NaN_i;
1015 StdI->NStore = StdI->NaN_i;
1016 StdI->NSRCG = StdI->NaN_i;
1017 StdI->ComplexType = StdI->NaN_i;
1018 for (i = 0; i < 3; i++)
1019 for (j = 0; j < 3; j++)
1020 StdI->boxsub[i][j] = StdI->NaN_i;
1021 StdI->Hsub = StdI->NaN_i;
1022 StdI->Lsub = StdI->NaN_i;
1023 StdI->Wsub = StdI->NaN_i;
1035 valuelen = strlen(value);
1036 for (ii = 0; ii < valuelen; ii++) {
1037 value2 = tolower(value[ii]);
1048 int valuelen, valuelen2, ii;
1050 valuelen = strlen(value);
1052 for (ii = 0; ii < valuelen; ii++){
1053 if (value[ii] !=
' ' &&
1056 value[ii] !=
'\"' &&
1057 value[ii] !=
'\b' &&
1058 value[ii] !=
'\\' &&
1059 value[ii] !=
'\v' &&
1060 value[ii] !=
'\n' &&
1062 value2[valuelen2] = value[ii];
1067 strncpy(value, value2, valuelen2);
1068 value[valuelen2] =
'\0';
1082 if (strcmp(value,
"****") != 0){
1083 fprintf(stdout,
"ERROR ! Keyword %s is duplicated ! \n", keyword);
1087 strcpy(value, valuestring);
1101 if (strcmp(value,
"****") != 0) {
1102 fprintf(stdout,
"ERROR ! Keyword %s is duplicated ! \n", keyword);
1106 strcpy(value, valuestring);
1121 int NaN_i = 2147483647;
1123 if (*value != NaN_i){
1124 fprintf(stdout,
"ERROR ! Keyword %s is duplicated ! \n", keyword);
1128 sscanf(valuestring,
"%d", value);
1142 if (std::isnan(*value) == 0){
1143 fprintf(stdout,
"ERROR ! Keyword %s is duplicated ! \n", keyword);
1147 sscanf(valuestring,
"%lf", value);
1158 std::complex<double> *value
1162 char *valuestring_r, *valuestring_i;
1163 double value_r, value_i;
1165 if (std::isnan(real(*value)) == 0) {
1166 fprintf(stdout,
"ERROR ! Keyword %s is duplicated ! \n", keyword);
1171 if (valuestring[0] ==
',') {
1172 valuestring_r = NULL;
1173 valuestring_i = strtok(valuestring,
",");
1176 valuestring_r = strtok(valuestring,
",");
1177 valuestring_i = strtok(NULL,
",");
1180 if (valuestring_r == NULL) {
1184 num = sscanf(valuestring_r,
"%lf", &value_r);
1185 if (num == 1) *value = value_r;
1189 if (valuestring_i == NULL) {
1190 *value += std::complex<double>(0.0, 0.0);
1193 num = sscanf(valuestring_i,
"%lf", &value_i);
1194 if (num == 1) *value += std::complex<double>(0.0, value_i);
1195 else *value += std::complex<double>(0.0, 0.0);
1205 int isite, nlocspin;
1208 for (isite = 0; isite < StdI->nsite; isite++)
1209 if (StdI->locspinflag[isite] != 0) nlocspin = nlocspin + 1;
1211 fp = fopen(
"locspn.def",
"w");
1212 fprintf(fp,
"================================ \n");
1213 fprintf(fp,
"NlocalSpin %5d \n", nlocspin);
1214 fprintf(fp,
"================================ \n");
1215 fprintf(fp,
"========i_0LocSpn_1IteElc ====== \n");
1216 fprintf(fp,
"================================ \n");
1218 for (isite = 0; isite < StdI->nsite; isite++)
1219 fprintf(fp,
"%5d %5d\n", isite, StdI->locspinflag[isite]);
1223 fprintf(stdout,
" locspn.def is written.\n");
1231 int jtrans, ktrans, ntrans0;
1233 for (jtrans = 0; jtrans < StdI->ntrans; jtrans++){
1234 for (ktrans = jtrans + 1; ktrans < StdI->ntrans; ktrans++){
1235 if (StdI->transindx[jtrans][0] == StdI->transindx[ktrans][0]
1236 && StdI->transindx[jtrans][1] == StdI->transindx[ktrans][1]
1237 && StdI->transindx[jtrans][2] == StdI->transindx[ktrans][2]
1238 && StdI->transindx[jtrans][3] == StdI->transindx[ktrans][3]){
1239 StdI->trans[jtrans] = StdI->trans[jtrans] + StdI->trans[ktrans];
1240 StdI->trans[ktrans] = 0.0;
1246 for (ktrans = 0; ktrans < StdI->ntrans; ktrans++){
1247 if (std::abs(StdI->trans[ktrans]) > 0.000001) ntrans0 = ntrans0 + 1;
1250 fp = fopen(
"trans.def",
"w");
1251 fprintf(fp,
"======================== \n");
1252 fprintf(fp,
"NTransfer %7d \n", ntrans0);
1253 fprintf(fp,
"======================== \n");
1254 fprintf(fp,
"========i_j_s_tijs====== \n");
1255 fprintf(fp,
"======================== \n");
1258 for (ktrans = 0; ktrans < StdI->ntrans; ktrans++) {
1259 if (std::abs(StdI->trans[ktrans]) > 0.000001)
1260 fprintf(fp,
"%5d %5d %5d %5d %25.15f %25.15f\n",
1261 StdI->transindx[ktrans][0], StdI->transindx[ktrans][1],
1262 StdI->transindx[ktrans][2], StdI->transindx[ktrans][3],
1263 real(StdI->trans[ktrans]), imag(StdI->trans[ktrans]));
1268 fprintf(stdout,
" trans.def is written.\n");
1277 fp = fopen(
"namelist.def",
"w");
1278 fprintf( fp,
" ModPara modpara.def\n");
1279 fprintf( fp,
" LocSpin locspn.def\n");
1280 fprintf( fp,
" Trans trans.def\n");
1281 if (StdI->LCintra == 1) fprintf( fp,
" CoulombIntra coulombintra.def\n");
1282 if (StdI->LCinter == 1) fprintf( fp,
" CoulombInter coulombinter.def\n");
1283 if (StdI->LHund == 1)fprintf( fp,
" Hund hund.def\n");
1284 if (StdI->LEx == 1)fprintf( fp,
" Exchange exchange.def\n");
1285 if (StdI->LPairLift == 1)fprintf(fp,
" PairLift pairlift.def\n");
1286 if (StdI->LPairHopp == 1)fprintf(fp,
" PairHop pairhopp.def\n");
1287 if (StdI->Lintr == 1)fprintf( fp,
" InterAll interall.def\n");
1288 if (StdI->ioutputmode != 0) {
1289 fprintf( fp,
" OneBodyG greenone.def\n");
1290 fprintf( fp,
" TwoBodyG greentwo.def\n");
1293 fprintf( fp,
" CalcMod calcmod.def\n");
1294 if(StdI->SpectrumBody == 1)
1295 fprintf( fp,
"SingleExcitation single.def\n");
1296 else fprintf( fp,
" PairExcitation pair.def\n");
1297 if (strcmp(StdI->method,
"timeevolution") == 0) {
1298 if (StdI->PumpBody == 1)
1299 fprintf(fp,
" TEOneBody teone.def\n");
1300 else if (StdI->PumpBody == 2)
1301 fprintf(fp,
" TETwoBody tetwo.def\n");
1303 fprintf( fp,
" SpectrumVec %s_eigenvec_0\n",
1304 StdI->CDataFileHead);
1305 if (StdI->lBoost == 1) fprintf( fp,
" Boost boost.def\n");
1306 #elif defined(_mVMC) 1307 fprintf( fp,
" Gutzwiller gutzwilleridx.def\n");
1308 fprintf( fp,
" Jastrow jastrowidx.def\n");
1309 fprintf( fp,
" Orbital orbitalidx.def\n");
1310 if (StdI->lGC == 1 || (StdI->Sz2 != 0 && StdI->Sz2 != StdI->NaN_i))
1311 fprintf(fp,
" OrbitalParallel orbitalidxpara.def\n");
1312 fprintf( fp,
" TransSym qptransidx.def\n");
1313 if(strcmp(StdI->lattice,
"wannier90") == 0)
1314 fprintf(fp,
" Initial initial.def\n");
1319 fprintf(stdout,
" namelist.def is written.\n");
1329 fp = fopen(
"modpara.def",
"w");
1330 fprintf(fp,
"--------------------\n");
1331 fprintf(fp,
"Model_Parameters 0\n");
1332 fprintf(fp,
"--------------------\n");
1334 fprintf(fp,
"HPhi_Cal_Parameters\n");
1335 fprintf(fp,
"--------------------\n");
1336 fprintf(fp,
"CDataFileHead %s\n", StdI->CDataFileHead);
1337 fprintf(fp,
"CParaFileHead zqp\n");
1338 fprintf(fp,
"--------------------\n");
1339 fprintf(fp,
"Nsite %-5d\n", StdI->nsite);
1340 if (StdI->Sz2 != StdI->NaN_i) fprintf(fp,
"2Sz %-5d\n", StdI->Sz2);
1341 if (StdI->nelec != StdI->NaN_i) fprintf(fp,
"Ncond %-5d\n", StdI->nelec);
1342 fprintf(fp,
"Lanczos_max %-5d\n", StdI->Lanczos_max);
1343 fprintf(fp,
"initial_iv %-5d\n", StdI->initial_iv);
1344 if(StdI->nvec != StdI->NaN_i) fprintf(fp,
"nvec %-5d\n", StdI->nvec);
1345 fprintf(fp,
"exct %-5d\n", StdI->exct);
1346 fprintf(fp,
"LanczosEps %-5d\n", StdI->LanczosEps);
1347 fprintf(fp,
"LanczosTarget %-5d\n", StdI->LanczosTarget);
1348 fprintf(fp,
"LargeValue %-25.15e\n", StdI->LargeValue);
1349 fprintf(fp,
"NumAve %-5d\n", StdI->NumAve);
1350 fprintf(fp,
"ExpecInterval %-5d\n", StdI->ExpecInterval);
1351 fprintf(fp,
"NOmega %-5d\n", StdI->Nomega);
1352 fprintf(fp,
"OmegaMax %-25.15e %-25.15e\n", StdI->OmegaMax, StdI->OmegaIm);
1353 fprintf(fp,
"OmegaMin %-25.15e %-25.15e\n", StdI->OmegaMin, StdI->OmegaIm);
1354 fprintf(fp,
"OmegaOrg 0.0 0.0\n");
1355 if (strcmp(StdI->method,
"timeevolution") == 0)
1356 fprintf(fp,
"ExpandCoef %-5d\n", StdI->ExpandCoef);
1357 #elif defined(_mVMC) 1358 fprintf(fp,
"VMC_Cal_Parameters\n");
1359 fprintf(fp,
"--------------------\n");
1360 fprintf(fp,
"CDataFileHead %s\n", StdI->CDataFileHead);
1361 fprintf(fp,
"CParaFileHead %s\n", StdI->CParaFileHead);
1362 fprintf(fp,
"--------------------\n");
1363 fprintf(fp,
"NVMCCalMode %d\n", StdI->NVMCCalMode);
1365 fprintf(fp,
"--------------------\n");
1366 fprintf(fp,
"NDataIdxStart %d\n", StdI->NDataIdxStart);
1367 fprintf(fp,
"NDataQtySmp %d\n", StdI->NDataQtySmp);
1368 fprintf(fp,
"--------------------\n");
1369 fprintf(fp,
"Nsite %d\n", StdI->nsite);
1370 fprintf(fp,
"Ncond %-5d\n", StdI->nelec);
1371 if (StdI->Sz2 != StdI->NaN_i)
1372 fprintf(fp,
"2Sz %d\n", StdI->Sz2);
1373 if (StdI->NSPGaussLeg != StdI->NaN_i)
1374 fprintf(fp,
"NSPGaussLeg %d\n", StdI->NSPGaussLeg);
1375 if (StdI->NSPStot != StdI->NaN_i)
1376 fprintf(fp,
"NSPStot %d\n", StdI->NSPStot);
1377 fprintf(fp,
"NMPTrans %d\n", StdI->NMPTrans);
1378 fprintf(fp,
"NSROptItrStep %d\n", StdI->NSROptItrStep);
1379 fprintf(fp,
"NSROptItrSmp %d\n", StdI->NSROptItrSmp);
1380 fprintf(fp,
"DSROptRedCut %.10f\n", StdI->DSROptRedCut);
1381 fprintf(fp,
"DSROptStaDel %.10f\n", StdI->DSROptStaDel);
1382 fprintf(fp,
"DSROptStepDt %.10f\n", StdI->DSROptStepDt);
1383 fprintf(fp,
"NVMCWarmUp %d\n", StdI->NVMCWarmUp);
1384 fprintf(fp,
"NVMCInterval %d\n", StdI->NVMCInterval);
1385 fprintf(fp,
"NVMCSample %d\n", StdI->NVMCSample);
1386 fprintf(fp,
"NExUpdatePath %d\n", StdI->NExUpdatePath);
1387 fprintf(fp,
"RndSeed %d\n", StdI->RndSeed);
1388 fprintf(fp,
"NSplitSize %d\n", StdI->NSplitSize);
1389 fprintf(fp,
"NStore %d\n", StdI->NStore);
1390 fprintf(fp,
"NSRCG %d\n", StdI->NSRCG);
1395 fprintf(stdout,
" modpara.def is written.\n");
1404 int ngreen, igreen, store, xkondo;
1405 int isite, jsite, ispin, jspin, SiMax, SjMax;
1411 if (StdI->ioutputmode != 0) {
1412 for (store = 0; store < 2; store++) {
1415 greenindx = (
int **)malloc(
sizeof(
int*) * (ngreen + 1));
1416 for (igreen = 0; igreen < ngreen; igreen++) {
1417 greenindx[igreen] = (
int *)malloc(
sizeof(
int) * 4);
1422 if (strcmp(StdI->model,
"kondo") == 0) xkondo = 2;
1425 if (StdI->ioutputmode == 1) {
1426 for (isite = 0; isite < StdI->NsiteUC*xkondo; isite++) {
1428 if (isite >= StdI->NsiteUC) isite += StdI->nsite / 2;
1430 if (StdI->locspinflag[isite] == 0) SiMax = 1;
1431 else SiMax = StdI->locspinflag[isite];
1433 for (ispin = 0; ispin <= SiMax; ispin++) {
1434 for (jsite = 0; jsite < StdI->nsite; jsite++) {
1436 if (StdI->locspinflag[jsite] == 0) SjMax = 1;
1437 else SjMax = StdI->locspinflag[jsite];
1439 for (jspin = 0; jspin <= SjMax; jspin++) {
1441 if (isite != jsite &&
1442 (StdI->locspinflag[isite] != 0 && StdI->locspinflag[jsite] != 0))
continue;
1444 if (ispin == jspin){
1446 greenindx[ngreen][0] = isite;
1447 greenindx[ngreen][1] = ispin;
1448 greenindx[ngreen][2] = jsite;
1449 greenindx[ngreen][3] = jspin;
1460 for (isite = 0; isite < StdI->nsite; isite++) {
1462 if (StdI->locspinflag[isite] == 0) SiMax = 1;
1463 else SiMax = StdI->locspinflag[isite];
1465 for (ispin = 0; ispin <= SiMax; ispin++) {
1466 for (jsite = 0; jsite < StdI->nsite; jsite++) {
1468 if (StdI->locspinflag[jsite] == 0) SjMax = 1;
1469 else SjMax = StdI->locspinflag[jsite];
1471 for (jspin = 0; jspin <= SjMax; jspin++) {
1473 if (isite != jsite &&
1474 (StdI->locspinflag[isite] != 0 && StdI->locspinflag[jsite] != 0))
continue;
1477 greenindx[ngreen][0] = isite;
1478 greenindx[ngreen][1] = ispin;
1479 greenindx[ngreen][2] = jsite;
1480 greenindx[ngreen][3] = jspin;
1491 fp = fopen(
"greenone.def",
"w");
1492 fprintf(fp,
"===============================\n");
1493 fprintf(fp,
"NCisAjs %10d\n", ngreen);
1494 fprintf(fp,
"===============================\n");
1495 fprintf(fp,
"======== Green functions ======\n");
1496 fprintf(fp,
"===============================\n");
1497 for (igreen = 0; igreen < ngreen; igreen++) {
1498 fprintf(fp,
"%5d %5d %5d %5d\n",
1499 greenindx[igreen][0], greenindx[igreen][1], greenindx[igreen][2], greenindx[igreen][3]);
1504 fprintf(stdout,
" greenone.def is written.\n");
1506 for (igreen = 0; igreen < ngreen; igreen++) {
1507 free(greenindx[igreen]);
1519 int ngreen, store, igreen, xkondo;
1520 int site1, site2, site3, site4;
1521 int spin1, spin2, spin3, spin4;
1522 int S1Max, S2Max, S3Max, S4Max;
1528 if (StdI->ioutputmode == 1) {
1529 for (store = 0; store < 2; store++) {
1532 greenindx = (
int **)malloc(
sizeof(
int*) * (ngreen + 1));
1533 for (igreen = 0; igreen < ngreen; igreen++)
1534 greenindx[igreen] = (
int *)malloc(
sizeof(
int) * 8);
1538 if (strcmp(StdI->model,
"kondo") == 0) xkondo = 2;
1541 for (site1 = 0; site1 < StdI->NsiteUC*xkondo; site1++) {
1543 if (site1 >= StdI->NsiteUC) site1 += StdI->nsite / 2;
1545 if (StdI->locspinflag[site1] == 0) S1Max = 1;
1546 else S1Max = StdI->locspinflag[site1];
1547 for (spin1 = 0; spin1 <= S1Max; spin1++) {
1548 for (spin2 = 0; spin2 <= S1Max; spin2++) {
1550 for (site3 = 0; site3 < StdI->nsite; site3++) {
1552 if (StdI->locspinflag[site3] == 0) S3Max = 1;
1553 else S3Max = StdI->locspinflag[site3];
1554 for (spin3 = 0; spin3 <= S3Max; spin3++) {
1555 for (spin4 = 0; spin4 <= S3Max; spin4++) {
1557 if (spin1 - spin2 + spin3 - spin4 == 0) {
1560 if (spin1 != spin2 || spin3 != spin4)
1562 greenindx[ngreen][0] = site1;
1563 greenindx[ngreen][1] = spin1;
1564 greenindx[ngreen][2] = site3;
1565 greenindx[ngreen][3] = spin4;
1566 greenindx[ngreen][4] = site3;
1567 greenindx[ngreen][5] = spin3;
1568 greenindx[ngreen][6] = site1;
1569 greenindx[ngreen][7] = spin2;
1574 greenindx[ngreen][0] = site1;
1575 greenindx[ngreen][1] = spin1;
1576 greenindx[ngreen][2] = site1;
1577 greenindx[ngreen][3] = spin2;
1578 greenindx[ngreen][4] = site3;
1579 greenindx[ngreen][5] = spin3;
1580 greenindx[ngreen][6] = site3;
1581 greenindx[ngreen][7] = spin4;
1596 else if (StdI->ioutputmode == 2) {
1597 for (store = 0; store < 2; store++) {
1600 greenindx = (
int **)malloc(
sizeof(
int*) * (ngreen + 1));
1601 for (igreen = 0; igreen < ngreen; igreen++)
1602 greenindx[igreen] = (
int *)malloc(
sizeof(
int) * 8);
1606 for (site1 = 0; site1 < StdI->nsite; site1++) {
1608 if (StdI->locspinflag[site1] == 0) S1Max = 1;
1609 else S1Max = StdI->locspinflag[site1];
1610 for (spin1 = 0; spin1 <= S1Max; spin1++) {
1612 for (site2 = 0; site2 < StdI->nsite; site2++) {
1614 if (StdI->locspinflag[site1] != 0 && StdI->locspinflag[site2] != 0
1615 && site1 != site2)
continue;
1617 if (StdI->locspinflag[site2] == 0) S2Max = 1;
1618 else S2Max = StdI->locspinflag[site2];
1619 for (spin2 = 0; spin2 <= S2Max; spin2++) {
1621 for (site3 = 0; site3 < StdI->nsite; site3++) {
1623 if (StdI->locspinflag[site3] == 0) S3Max = 1;
1624 else S3Max = StdI->locspinflag[site3];
1625 for (spin3 = 0; spin3 <= S3Max; spin3++) {
1627 for (site4 = 0; site4 < StdI->nsite; site4++) {
1629 if (StdI->locspinflag[site3] != 0 && StdI->locspinflag[site4] != 0
1630 && site3 != site4)
continue;
1632 if (StdI->locspinflag[site4] == 0) S4Max = 1;
1633 else S4Max = StdI->locspinflag[site4];
1634 for (spin4 = 0; spin4 <= S4Max; spin4++) {
1637 greenindx[ngreen][0] = site1;
1638 greenindx[ngreen][1] = spin1;
1639 greenindx[ngreen][2] = site2;
1640 greenindx[ngreen][3] = spin2;
1641 greenindx[ngreen][4] = site3;
1642 greenindx[ngreen][5] = spin3;
1643 greenindx[ngreen][6] = site4;
1644 greenindx[ngreen][7] = spin4;
1659 if (StdI->ioutputmode != 0) {
1660 fp = fopen(
"greentwo.def",
"w");
1661 fprintf(fp,
"=============================================\n");
1662 fprintf(fp,
"NCisAjsCktAltDC %10d\n", ngreen);
1663 fprintf(fp,
"=============================================\n");
1664 fprintf(fp,
"======== Green functions for Sq AND Nq ======\n");
1665 fprintf(fp,
"=============================================\n");
1666 for (igreen = 0; igreen < ngreen; igreen++) {
1667 fprintf(fp,
"%5d %5d %5d %5d %5d %5d %5d %5d\n",
1668 greenindx[igreen][0], greenindx[igreen][1], greenindx[igreen][2], greenindx[igreen][3],
1669 greenindx[igreen][4], greenindx[igreen][5], greenindx[igreen][6], greenindx[igreen][7]);
1674 fprintf(stdout,
" greentwo.def is written.\n");
1676 for (igreen = 0; igreen < ngreen; igreen++) {
1677 free(greenindx[igreen]);
1691 fprintf(stdout,
"\nSorry, specified combination, \n");
1692 fprintf(stdout,
" MODEL : %s \n", model);
1693 fprintf(stdout,
" LATTICE : %s, \n", lattice);
1694 fprintf(stdout,
"is unsupported in the STANDARD MODE...\n");
1695 fprintf(stdout,
"Please use the EXPART MODE, or write a NEW FUNCTION and post us.\n");
1707 if (strcmp(StdI->outputmode,
"non") == 0
1708 || strcmp(StdI->outputmode,
"none") == 0
1709 || strcmp(StdI->outputmode,
"off") == 0) {
1710 StdI->ioutputmode = 0;
1711 fprintf(stdout,
" ioutputmode = %-10d\n", StdI->ioutputmode);
1713 else if (strcmp(StdI->outputmode,
"cor") == 0
1714 || strcmp(StdI->outputmode,
"corr") == 0
1715 || strcmp(StdI->outputmode,
"correlation") == 0) {
1716 StdI->ioutputmode = 1;
1717 fprintf(stdout,
" ioutputmode = %-10d\n", StdI->ioutputmode);
1719 else if (strcmp(StdI->outputmode,
"****") == 0) {
1720 StdI->ioutputmode = 1;
1721 fprintf(stdout,
" ioutputmode = %-10d ###### DEFAULT VALUE IS USED ######\n", StdI->ioutputmode);
1723 else if (strcmp(StdI->outputmode,
"raw") == 0
1724 || strcmp(StdI->outputmode,
"all") == 0
1725 || strcmp(StdI->outputmode,
"full") == 0) {
1726 StdI->ioutputmode = 2;
1727 fprintf(stdout,
" ioutputmode = %-10d\n", StdI->ioutputmode);
1730 fprintf(stdout,
"\n ERROR ! Unsupported OutPutMode : %s\n", StdI->outputmode);
1750 if(StdI->LanczosTarget < StdI->exct) StdI->LanczosTarget = StdI->exct;
1757 #elif defined(_mVMC) 1758 if (strcmp(StdI->CParaFileHead,
"****") == 0) {
1759 strcpy(StdI->CParaFileHead,
"zqp\0");
1760 fprintf(stdout,
" CParaFileHead = %-12s###### DEFAULT VALUE IS USED ######\n", StdI->CParaFileHead);
1762 else fprintf(stdout,
" CParaFileHead = %-s\n", StdI->CParaFileHead);
1768 if (StdI->NVMCCalMode == 0)
StdFace_NotUsed_i(
"NDataQtySmp", StdI->NDataQtySmp);
1771 if (StdI->lGC == 0 && (StdI->Sz2 == 0 || StdI->Sz2 == StdI->NaN_i)) {
1780 if (StdI->AntiPeriod[0] == 1 || StdI->AntiPeriod[1] == 1 || StdI->AntiPeriod[2] == 2)
1786 if (StdI->NVMCCalMode == 1)
StdFace_NotUsed_i(
"NSROptItrSmp", StdI->NSROptItrSmp);
1793 if (strcmp(StdI->model,
"hubbard") == 0) StdI->NExUpdatePath = 0;
1794 else if (strcmp(StdI->model,
"spin") == 0) StdI->NExUpdatePath = 2;
1795 else if (strcmp(StdI->model,
"kondo") == 0) {
1796 if(StdI->lGC==0) StdI->NExUpdatePath = 1;
1797 else StdI->NExUpdatePath = 3;
1799 fprintf(stdout,
" %15s = %-10d\n",
"NExUpdatePath", StdI->NExUpdatePath);
1813 if (strcmp(StdI->model,
"hubbard") == 0){
1826 else if (strcmp(StdI->model,
"spin") == 0) {
1834 else if (strcmp(StdI->model,
"kondo") == 0) {
1855 int nintr0, kintr, jintr;
1859 for (kintr = 0; kintr < StdI->NCintra; kintr++) {
1860 for (jintr = kintr + 1; jintr < StdI->NCintra; jintr++)
1861 if(StdI->CintraIndx[jintr][0] == StdI->CintraIndx[kintr][0])
1863 StdI->Cintra[kintr] += StdI->Cintra[jintr];
1864 StdI->Cintra[jintr] = 0.0;
1868 for (kintr = 0; kintr < StdI->NCintra; kintr++) {
1869 if (fabs(StdI->Cintra[kintr]) > 0.000001) nintr0 = nintr0 + 1;
1871 if (nintr0 == 0 || StdI->lBoost == 1) StdI->LCintra = 0;
1872 else StdI->LCintra = 1;
1874 if (StdI->LCintra == 1) {
1875 fp = fopen(
"coulombintra.def",
"w");
1876 fprintf(fp,
"=============================================\n");
1877 fprintf(fp,
"NCoulombIntra %10d\n", nintr0);
1878 fprintf(fp,
"=============================================\n");
1879 fprintf(fp,
"================== CoulombIntra ================\n");
1880 fprintf(fp,
"=============================================\n");
1881 for (kintr = 0; kintr < StdI->NCintra; kintr++) {
1882 if (fabs(StdI->Cintra[kintr]) > 0.000001)
1883 fprintf(fp,
"%5d %25.15f\n",
1884 StdI->CintraIndx[kintr][0], StdI->Cintra[kintr]);
1888 fprintf(stdout,
" coulombintra.def is written.\n");
1893 for (kintr = 0; kintr < StdI->NCinter; kintr++) {
1894 for (jintr = kintr + 1; jintr < StdI->NCinter; jintr++)
1896 ( StdI->CinterIndx[jintr][0] == StdI->CinterIndx[kintr][0]
1897 && StdI->CinterIndx[jintr][1] == StdI->CinterIndx[kintr][1])
1899 ( StdI->CinterIndx[jintr][0] == StdI->CinterIndx[kintr][1]
1900 && StdI->CinterIndx[jintr][1] == StdI->CinterIndx[kintr][0])
1903 StdI->Cinter[kintr] += StdI->Cinter[jintr];
1904 StdI->Cinter[jintr] = 0.0;
1908 for (kintr = 0; kintr < StdI->NCinter; kintr++) {
1909 if (fabs(StdI->Cinter[kintr]) > 0.000001) nintr0 = nintr0 + 1;
1911 if (nintr0 == 0 || StdI->lBoost == 1) StdI->LCinter = 0;
1912 else StdI->LCinter = 1;
1914 if (StdI->LCinter == 1) {
1915 fp = fopen(
"coulombinter.def",
"w");
1916 fprintf(fp,
"=============================================\n");
1917 fprintf(fp,
"NCoulombInter %10d\n", nintr0);
1918 fprintf(fp,
"=============================================\n");
1919 fprintf(fp,
"================== CoulombInter ================\n");
1920 fprintf(fp,
"=============================================\n");
1921 for (kintr = 0; kintr < StdI->NCinter; kintr++) {
1922 if (fabs(StdI->Cinter[kintr]) > 0.000001)
1923 fprintf(fp,
"%5d %5d %25.15f\n",
1924 StdI->CinterIndx[kintr][0], StdI->CinterIndx[kintr][1], StdI->Cinter[kintr]);
1928 fprintf(stdout,
" coulombinter.def is written.\n");
1933 for (kintr = 0; kintr < StdI->NHund; kintr++) {
1934 for (jintr = kintr + 1; jintr < StdI->NHund; jintr++)
1936 (StdI->HundIndx[jintr][0] == StdI->HundIndx[kintr][0]
1937 && StdI->HundIndx[jintr][1] == StdI->HundIndx[kintr][1])
1939 (StdI->HundIndx[jintr][0] == StdI->HundIndx[kintr][1]
1940 && StdI->HundIndx[jintr][1] == StdI->HundIndx[kintr][0])
1943 StdI->Hund[kintr] += StdI->Hund[jintr];
1944 StdI->Hund[jintr] = 0.0;
1948 for (kintr = 0; kintr < StdI->NHund; kintr++) {
1949 if (fabs(StdI->Hund[kintr]) > 0.000001) nintr0 = nintr0 + 1;
1951 if (nintr0 == 0 || StdI->lBoost == 1) StdI->LHund = 0;
1952 else StdI->LHund = 1;
1954 if (StdI->LHund == 1) {
1955 fp = fopen(
"hund.def",
"w");
1956 fprintf(fp,
"=============================================\n");
1957 fprintf(fp,
"NHund %10d\n", nintr0);
1958 fprintf(fp,
"=============================================\n");
1959 fprintf(fp,
"=============== Hund coupling ===============\n");
1960 fprintf(fp,
"=============================================\n");
1961 for (kintr = 0; kintr < StdI->NHund; kintr++) {
1962 if (fabs(StdI->Hund[kintr]) > 0.000001)
1963 fprintf(fp,
"%5d %5d %25.15f\n",
1964 StdI->HundIndx[kintr][0], StdI->HundIndx[kintr][1], StdI->Hund[kintr]);
1968 fprintf(stdout,
" hund.def is written.\n");
1973 for (kintr = 0; kintr < StdI->NEx; kintr++) {
1974 for (jintr = kintr + 1; jintr < StdI->NEx; jintr++)
1976 (StdI->ExIndx[jintr][0] == StdI->ExIndx[kintr][0]
1977 && StdI->ExIndx[jintr][1] == StdI->ExIndx[kintr][1])
1979 (StdI->ExIndx[jintr][0] == StdI->ExIndx[kintr][1]
1980 && StdI->ExIndx[jintr][1] == StdI->ExIndx[kintr][0])
1983 StdI->Ex[kintr] += StdI->Ex[jintr];
1984 StdI->Ex[jintr] = 0.0;
1988 for (kintr = 0; kintr < StdI->NEx; kintr++) {
1989 if (fabs(StdI->Ex[kintr]) > 0.000001) nintr0 = nintr0 + 1;
1991 if (nintr0 == 0 || StdI->lBoost == 1) StdI->LEx = 0;
1994 if (StdI->LEx == 1) {
1995 fp = fopen(
"exchange.def",
"w");
1996 fprintf(fp,
"=============================================\n");
1997 fprintf(fp,
"NExchange %10d\n", nintr0);
1998 fprintf(fp,
"=============================================\n");
1999 fprintf(fp,
"====== ExchangeCoupling coupling ============\n");
2000 fprintf(fp,
"=============================================\n");
2001 for (kintr = 0; kintr < StdI->NEx; kintr++) {
2002 if (fabs(StdI->Ex[kintr]) > 0.000001)
2003 fprintf(fp,
"%5d %5d %25.15f\n",
2004 StdI->ExIndx[kintr][0], StdI->ExIndx[kintr][1], StdI->Ex[kintr]);
2008 fprintf(stdout,
" exchange.def is written.\n");
2013 for (kintr = 0; kintr < StdI->NPairLift; kintr++) {
2014 for (jintr = kintr + 1; jintr < StdI->NPairLift; jintr++)
2016 (StdI->PLIndx[jintr][0] == StdI->PLIndx[kintr][0]
2017 && StdI->PLIndx[jintr][1] == StdI->PLIndx[kintr][1])
2019 (StdI->PLIndx[jintr][0] == StdI->PLIndx[kintr][1]
2020 && StdI->PLIndx[jintr][1] == StdI->PLIndx[kintr][0])
2023 StdI->PairLift[kintr] += StdI->PairLift[jintr];
2024 StdI->PairLift[jintr] = 0.0;
2028 for (kintr = 0; kintr < StdI->NPairLift; kintr++) {
2029 if (fabs(StdI->PairLift[kintr]) > 0.000001) nintr0 = nintr0 + 1;
2031 if (nintr0 == 0 || StdI->lBoost == 1) StdI->LPairLift = 0;
2032 else StdI->LPairLift = 1;
2034 if (StdI->LPairLift == 1) {
2035 fp = fopen(
"pairlift.def",
"w");
2036 fprintf(fp,
"=============================================\n");
2037 fprintf(fp,
"NPairLift %10d\n", nintr0);
2038 fprintf(fp,
"=============================================\n");
2039 fprintf(fp,
"====== Pair-Lift term ============\n");
2040 fprintf(fp,
"=============================================\n");
2041 for (kintr = 0; kintr < StdI->NPairLift; kintr++) {
2042 if (fabs(StdI->PairLift[kintr]) > 0.000001)
2043 fprintf(fp,
"%5d %5d %25.15f\n",
2044 StdI->PLIndx[kintr][0], StdI->PLIndx[kintr][1], StdI->PairLift[kintr]);
2048 fprintf(stdout,
" pairlift.def is written.\n");
2053 for (kintr = 0; kintr < StdI->NPairHopp; kintr++) {
2054 for (jintr = kintr + 1; jintr < StdI->NPairHopp; jintr++)
2056 (StdI->PHIndx[jintr][0] == StdI->PHIndx[kintr][0]
2057 && StdI->PHIndx[jintr][1] == StdI->PHIndx[kintr][1])
2059 (StdI->PHIndx[jintr][0] == StdI->PHIndx[kintr][1]
2060 && StdI->PHIndx[jintr][1] == StdI->PHIndx[kintr][0])
2063 StdI->PairHopp[kintr] += StdI->PairHopp[jintr];
2064 StdI->PairHopp[jintr] = 0.0;
2068 for (kintr = 0; kintr < StdI->NPairHopp; kintr++) {
2069 if (fabs(StdI->PairHopp[kintr]) > 0.000001) nintr0 = nintr0 + 1;
2071 if (nintr0 == 0 || StdI->lBoost == 1) StdI->LPairHopp = 0;
2072 else StdI->LPairHopp = 1;
2074 if (StdI->LPairHopp == 1) {
2075 fp = fopen(
"pairhopp.def",
"w");
2076 fprintf(fp,
"=============================================\n");
2077 fprintf(fp,
"NPairHopp %10d\n", nintr0);
2078 fprintf(fp,
"=============================================\n");
2079 fprintf(fp,
"====== Pair-Hopping term ============\n");
2080 fprintf(fp,
"=============================================\n");
2081 for (kintr = 0; kintr < StdI->NPairHopp; kintr++) {
2082 if (fabs(StdI->PairHopp[kintr]) > 0.000001)
2083 fprintf(fp,
"%5d %5d %25.15f\n",
2084 StdI->PHIndx[kintr][0], StdI->PHIndx[kintr][1], StdI->PairHopp[kintr]);
2088 fprintf(stdout,
" pairhopp.def is written.\n");
2093 for (jintr = 0; jintr < StdI->nintr; jintr++) {
2094 for (kintr = jintr + 1; kintr < StdI->nintr; kintr++) {
2096 (StdI->intrindx[jintr][0] == StdI->intrindx[kintr][0]
2097 && StdI->intrindx[jintr][1] == StdI->intrindx[kintr][1]
2098 && StdI->intrindx[jintr][2] == StdI->intrindx[kintr][2]
2099 && StdI->intrindx[jintr][3] == StdI->intrindx[kintr][3]
2100 && StdI->intrindx[jintr][4] == StdI->intrindx[kintr][4]
2101 && StdI->intrindx[jintr][5] == StdI->intrindx[kintr][5]
2102 && StdI->intrindx[jintr][6] == StdI->intrindx[kintr][6]
2103 && StdI->intrindx[jintr][7] == StdI->intrindx[kintr][7])
2105 (StdI->intrindx[jintr][0] == StdI->intrindx[kintr][4]
2106 && StdI->intrindx[jintr][1] == StdI->intrindx[kintr][5]
2107 && StdI->intrindx[jintr][2] == StdI->intrindx[kintr][6]
2108 && StdI->intrindx[jintr][3] == StdI->intrindx[kintr][7]
2109 && StdI->intrindx[jintr][4] == StdI->intrindx[kintr][0]
2110 && StdI->intrindx[jintr][5] == StdI->intrindx[kintr][1]
2111 && StdI->intrindx[jintr][6] == StdI->intrindx[kintr][2]
2112 && StdI->intrindx[jintr][7] == StdI->intrindx[kintr][3])
2114 StdI->intr[jintr] = StdI->intr[jintr] + StdI->intr[kintr];
2115 StdI->intr[kintr] = 0.0;
2118 (StdI->intrindx[jintr][0] == StdI->intrindx[kintr][4]
2119 && StdI->intrindx[jintr][1] == StdI->intrindx[kintr][5]
2120 && StdI->intrindx[jintr][2] == StdI->intrindx[kintr][2]
2121 && StdI->intrindx[jintr][3] == StdI->intrindx[kintr][3]
2122 && StdI->intrindx[jintr][4] == StdI->intrindx[kintr][0]
2123 && StdI->intrindx[jintr][5] == StdI->intrindx[kintr][1]
2124 && StdI->intrindx[jintr][6] == StdI->intrindx[kintr][6]
2125 && StdI->intrindx[jintr][7] == StdI->intrindx[kintr][7])
2127 (StdI->intrindx[jintr][0] == StdI->intrindx[kintr][0]
2128 && StdI->intrindx[jintr][1] == StdI->intrindx[kintr][1]
2129 && StdI->intrindx[jintr][2] == StdI->intrindx[kintr][6]
2130 && StdI->intrindx[jintr][3] == StdI->intrindx[kintr][7]
2131 && StdI->intrindx[jintr][4] == StdI->intrindx[kintr][4]
2132 && StdI->intrindx[jintr][5] == StdI->intrindx[kintr][5]
2133 && StdI->intrindx[jintr][6] == StdI->intrindx[kintr][2]
2134 && StdI->intrindx[jintr][7] == StdI->intrindx[kintr][3])
2136 StdI->intr[jintr] = StdI->intr[jintr] - StdI->intr[kintr];
2137 StdI->intr[kintr] = 0.0;
2142 for (jintr = 0; jintr < StdI->nintr; jintr++) {
2143 for (kintr = jintr + 1; kintr < StdI->nintr; kintr++) {
2144 if (StdI->intrindx[jintr][6] == StdI->intrindx[kintr][4]
2145 && StdI->intrindx[jintr][7] == StdI->intrindx[kintr][5]
2146 && StdI->intrindx[jintr][4] == StdI->intrindx[kintr][6]
2147 && StdI->intrindx[jintr][5] == StdI->intrindx[kintr][7]
2148 && StdI->intrindx[jintr][2] == StdI->intrindx[kintr][0]
2149 && StdI->intrindx[jintr][3] == StdI->intrindx[kintr][1]
2150 && StdI->intrindx[jintr][0] == StdI->intrindx[kintr][2]
2151 && StdI->intrindx[jintr][1] == StdI->intrindx[kintr][3]
2153 StdI->intrindx[kintr][0] = StdI->intrindx[jintr][6];
2154 StdI->intrindx[kintr][1] = StdI->intrindx[jintr][7];
2155 StdI->intrindx[kintr][2] = StdI->intrindx[jintr][4];
2156 StdI->intrindx[kintr][3] = StdI->intrindx[jintr][5];
2157 StdI->intrindx[kintr][4] = StdI->intrindx[jintr][2];
2158 StdI->intrindx[kintr][5] = StdI->intrindx[jintr][3];
2159 StdI->intrindx[kintr][6] = StdI->intrindx[jintr][0];
2160 StdI->intrindx[kintr][7] = StdI->intrindx[jintr][1];
2163 (StdI->intrindx[jintr][6] == StdI->intrindx[kintr][4]
2164 && StdI->intrindx[jintr][7] == StdI->intrindx[kintr][5]
2165 && StdI->intrindx[jintr][4] == StdI->intrindx[kintr][2]
2166 && StdI->intrindx[jintr][5] == StdI->intrindx[kintr][3]
2167 && StdI->intrindx[jintr][2] == StdI->intrindx[kintr][0]
2168 && StdI->intrindx[jintr][3] == StdI->intrindx[kintr][1]
2169 && StdI->intrindx[jintr][0] == StdI->intrindx[kintr][6]
2170 && StdI->intrindx[jintr][1] == StdI->intrindx[kintr][7])
2172 (StdI->intrindx[jintr][6] == StdI->intrindx[kintr][0]
2173 && StdI->intrindx[jintr][7] == StdI->intrindx[kintr][1]
2174 && StdI->intrindx[jintr][4] == StdI->intrindx[kintr][6]
2175 && StdI->intrindx[jintr][5] == StdI->intrindx[kintr][7]
2176 && StdI->intrindx[jintr][2] == StdI->intrindx[kintr][4]
2177 && StdI->intrindx[jintr][3] == StdI->intrindx[kintr][5]
2178 && StdI->intrindx[jintr][0] == StdI->intrindx[kintr][2]
2179 && StdI->intrindx[jintr][1] == StdI->intrindx[kintr][3])
2181 StdI->intrindx[kintr][0] = StdI->intrindx[jintr][6];
2182 StdI->intrindx[kintr][1] = StdI->intrindx[jintr][7];
2183 StdI->intrindx[kintr][2] = StdI->intrindx[jintr][4];
2184 StdI->intrindx[kintr][3] = StdI->intrindx[jintr][5];
2185 StdI->intrindx[kintr][4] = StdI->intrindx[jintr][2];
2186 StdI->intrindx[kintr][5] = StdI->intrindx[jintr][3];
2187 StdI->intrindx[kintr][6] = StdI->intrindx[jintr][0];
2188 StdI->intrindx[kintr][7] = StdI->intrindx[jintr][1];
2190 StdI->intr[kintr] = -StdI->intr[kintr];
2195 for (jintr = 0; jintr < StdI->nintr; jintr++) {
2198 (StdI->intrindx[jintr][0] == StdI->intrindx[jintr][4]
2199 && StdI->intrindx[jintr][1] == StdI->intrindx[jintr][5]) ||
2200 (StdI->intrindx[jintr][2] == StdI->intrindx[jintr][6]
2201 && StdI->intrindx[jintr][3] == StdI->intrindx[jintr][7])
2205 (StdI->intrindx[jintr][0] == StdI->intrindx[jintr][2]
2206 && StdI->intrindx[jintr][1] == StdI->intrindx[jintr][3])
2208 (StdI->intrindx[jintr][0] == StdI->intrindx[jintr][6]
2209 && StdI->intrindx[jintr][1] == StdI->intrindx[jintr][7])
2211 (StdI->intrindx[jintr][4] == StdI->intrindx[jintr][2]
2212 && StdI->intrindx[jintr][5] == StdI->intrindx[jintr][3])
2214 (StdI->intrindx[jintr][4] == StdI->intrindx[jintr][6]
2215 && StdI->intrindx[jintr][5] == StdI->intrindx[jintr][7])
2217 StdI->intr[jintr] = 0.0;
2222 for (kintr = 0; kintr < StdI->nintr; kintr++) {
2223 if (std::abs(StdI->intr[kintr]) > 0.000001) nintr0 = nintr0 + 1;
2225 if (nintr0 == 0 || StdI->lBoost == 1) StdI->Lintr = 0;
2226 else StdI->Lintr = 1;
2228 if (StdI->Lintr == 1) {
2229 fp = fopen(
"interall.def",
"w");
2230 fprintf(fp,
"====================== \n");
2231 fprintf(fp,
"NInterAll %7d \n", nintr0);
2232 fprintf(fp,
"====================== \n");
2233 fprintf(fp,
"========zInterAll===== \n");
2234 fprintf(fp,
"====================== \n");
2236 if (StdI->lBoost == 0) {
2238 for (kintr = 0; kintr < StdI->nintr; kintr++) {
2239 if (std::abs(StdI->intr[kintr]) > 0.000001)
2240 fprintf(fp,
"%5d %5d %5d %5d %5d %5d %5d %5d %25.15f %25.15f\n",
2241 StdI->intrindx[kintr][0], StdI->intrindx[kintr][1],
2242 StdI->intrindx[kintr][2], StdI->intrindx[kintr][3],
2243 StdI->intrindx[kintr][4], StdI->intrindx[kintr][5],
2244 StdI->intrindx[kintr][6], StdI->intrindx[kintr][7],
2245 real(StdI->intr[kintr]), imag(StdI->intr[kintr]));
2251 fprintf(stdout,
" interall.def is written.\n");
2262 struct StdIntList *StdI;
2266 char *keyword, *value;
2268 StdI = (
struct StdIntList *)malloc(
sizeof(
struct StdIntList));
2270 fprintf(stdout,
"\n###### Input Parameter of Standard Intarface ######\n");
2271 if ((fp = fopen(fname,
"r")) == NULL) {
2272 fprintf(stdout,
"\n ERROR ! Cannot open input file %s !\n\n", fname);
2276 fprintf(stdout,
"\n Open Standard-Mode Inputfile %s \n\n", fname);
2281 while (fgets(ctmpline, 256, fp) != NULL) {
2284 if (strncmp(ctmpline,
"//", 2) == 0) {
2285 fprintf(stdout,
" Skipping a line.\n");
2288 else if (ctmpline[0] ==
'\0') {
2289 fprintf(stdout,
" Skipping a line.\n");
2292 keyword = strtok(ctmpline,
"=");
2293 value = strtok(NULL,
"=");
2294 if (value == NULL) {
2295 fprintf(stdout,
"\n ERROR ! \"=\" is NOT found !\n\n");
2299 fprintf(stdout,
" KEYWORD : %-20s | VALUE : %s \n", keyword, value);
2302 else if (strcmp(keyword,
"a0h") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->box[0][2]);
2303 else if (strcmp(keyword,
"a0l") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->box[0][1]);
2304 else if (strcmp(keyword,
"a0w") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->box[0][0]);
2305 else if (strcmp(keyword,
"a1h") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->box[1][2]);
2306 else if (strcmp(keyword,
"a1l") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->box[1][1]);
2307 else if (strcmp(keyword,
"a1w") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->box[1][0]);
2308 else if (strcmp(keyword,
"a2h") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->box[2][2]);
2309 else if (strcmp(keyword,
"a2l") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->box[2][1]);
2310 else if (strcmp(keyword,
"a2w") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->box[2][0]);
2311 else if (strcmp(keyword,
"cutoff_j") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_j);
2312 else if (strcmp(keyword,
"cutoff_jh") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_JR[2]);
2313 else if (strcmp(keyword,
"cutoff_jl") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_JR[1]);
2314 else if (strcmp(keyword,
"cutoff_jw") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_JR[0]);
2315 else if (strcmp(keyword,
"cutoff_length_j") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_length_J);
2316 else if (strcmp(keyword,
"cutoff_length_u") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_length_U);
2317 else if (strcmp(keyword,
"cutoff_length_t") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_length_t);
2318 else if (strcmp(keyword,
"cutoff_t") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_t);
2319 else if (strcmp(keyword,
"cutoff_th") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_tR[2]);
2320 else if (strcmp(keyword,
"cutoff_tl") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_tR[1]);
2321 else if (strcmp(keyword,
"cutoff_tw") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_tR[0]);
2322 else if (strcmp(keyword,
"cutoff_u") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_u);
2323 else if (strcmp(keyword,
"cutoff_uh") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_UR[2]);
2324 else if (strcmp(keyword,
"cutoff_ul") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_UR[1]);
2325 else if (strcmp(keyword,
"cutoff_uw") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_UR[0]);
2327 else if (strcmp(keyword,
"doublecounting") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->double_counting);
2328 else if (strcmp(keyword,
"gamma") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Gamma);
2330 else if (strcmp(keyword,
"height") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->Height);
2331 else if (strcmp(keyword,
"hlength") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->length[2]);
2332 else if (strcmp(keyword,
"hx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->direct[2][0]);
2333 else if (strcmp(keyword,
"hy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->direct[2][1]);
2334 else if (strcmp(keyword,
"hz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->direct[2][2]);
2337 else if (strcmp(keyword,
"jxy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J[0][1]);
2338 else if (strcmp(keyword,
"jxz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J[0][2]);
2340 else if (strcmp(keyword,
"jyx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J[1][0]);
2341 else if (strcmp(keyword,
"jyz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J[1][2]);
2343 else if (strcmp(keyword,
"jzx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J[2][0]);
2344 else if (strcmp(keyword,
"jzy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J[2][1]);
2346 else if (strcmp(keyword,
"j0x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0[0][0]);
2347 else if (strcmp(keyword,
"j0xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0[0][1]);
2348 else if (strcmp(keyword,
"j0xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0[0][2]);
2349 else if (strcmp(keyword,
"j0y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0[1][1]);
2350 else if (strcmp(keyword,
"j0yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0[1][0]);
2351 else if (strcmp(keyword,
"j0yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0[1][2]);
2352 else if (strcmp(keyword,
"j0z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0[2][2]);
2353 else if (strcmp(keyword,
"j0zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0[2][0]);
2354 else if (strcmp(keyword,
"j0zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0[2][1]);
2356 else if (strcmp(keyword,
"j0'x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0p[0][0]);
2357 else if (strcmp(keyword,
"j0'xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0p[0][1]);
2358 else if (strcmp(keyword,
"j0'xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0p[0][2]);
2359 else if (strcmp(keyword,
"j0'y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0p[1][1]);
2360 else if (strcmp(keyword,
"j0'yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0p[1][0]);
2361 else if (strcmp(keyword,
"j0'yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0p[1][2]);
2362 else if (strcmp(keyword,
"j0'z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0p[2][2]);
2363 else if (strcmp(keyword,
"j0'zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0p[2][0]);
2364 else if (strcmp(keyword,
"j0'zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0p[2][1]);
2365 else if (strcmp(keyword,
"j0''") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0ppAll);
2366 else if (strcmp(keyword,
"j0''x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[0][0]);
2367 else if (strcmp(keyword,
"j0''xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[0][1]);
2368 else if (strcmp(keyword,
"j0''xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[0][2]);
2369 else if (strcmp(keyword,
"j0''y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[1][1]);
2370 else if (strcmp(keyword,
"j0''yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[1][0]);
2371 else if (strcmp(keyword,
"j0''yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[1][2]);
2372 else if (strcmp(keyword,
"j0''z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[2][2]);
2373 else if (strcmp(keyword,
"j0''zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[2][0]);
2374 else if (strcmp(keyword,
"j0''zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[2][1]);
2376 else if (strcmp(keyword,
"j1x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1[0][0]);
2377 else if (strcmp(keyword,
"j1xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1[0][1]);
2378 else if (strcmp(keyword,
"j1xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1[0][2]);
2379 else if (strcmp(keyword,
"j1y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1[1][1]);
2380 else if (strcmp(keyword,
"j1yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1[1][0]);
2381 else if (strcmp(keyword,
"j1yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1[1][2]);
2382 else if (strcmp(keyword,
"j1z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1[2][2]);
2383 else if (strcmp(keyword,
"j1zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1[2][0]);
2384 else if (strcmp(keyword,
"j1zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1[2][1]);
2386 else if (strcmp(keyword,
"j1'x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1p[0][0]);
2387 else if (strcmp(keyword,
"j1'xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1p[0][1]);
2388 else if (strcmp(keyword,
"j1'xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1p[0][2]);
2389 else if (strcmp(keyword,
"j1'y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1p[1][1]);
2390 else if (strcmp(keyword,
"j1'yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1p[1][0]);
2391 else if (strcmp(keyword,
"j1'yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1p[1][2]);
2392 else if (strcmp(keyword,
"j1'z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1p[2][2]);
2393 else if (strcmp(keyword,
"j1'zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1p[2][0]);
2394 else if (strcmp(keyword,
"j1'zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1p[2][1]);
2395 else if (strcmp(keyword,
"j1''") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1ppAll);
2396 else if (strcmp(keyword,
"j1''x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[0][0]);
2397 else if (strcmp(keyword,
"j1''xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[0][1]);
2398 else if (strcmp(keyword,
"j1''xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[0][2]);
2399 else if (strcmp(keyword,
"j1''y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[1][1]);
2400 else if (strcmp(keyword,
"j1''yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[1][0]);
2401 else if (strcmp(keyword,
"j1''yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[1][2]);
2402 else if (strcmp(keyword,
"j1''z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[2][2]);
2403 else if (strcmp(keyword,
"j1''zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[2][0]);
2404 else if (strcmp(keyword,
"j1''zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[2][1]);
2406 else if (strcmp(keyword,
"j2x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2[0][0]);
2407 else if (strcmp(keyword,
"j2xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2[0][1]);
2408 else if (strcmp(keyword,
"j2xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2[0][2]);
2409 else if (strcmp(keyword,
"j2y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2[1][1]);
2410 else if (strcmp(keyword,
"j2yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2[1][0]);
2411 else if (strcmp(keyword,
"j2yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2[1][2]);
2412 else if (strcmp(keyword,
"j2z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2[2][2]);
2413 else if (strcmp(keyword,
"j2zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2[2][0]);
2414 else if (strcmp(keyword,
"j2zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2[2][1]);
2416 else if (strcmp(keyword,
"j2'x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2p[0][0]);
2417 else if (strcmp(keyword,
"j2'xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2p[0][1]);
2418 else if (strcmp(keyword,
"j2'xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2p[0][2]);
2419 else if (strcmp(keyword,
"j2'y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2p[1][1]);
2420 else if (strcmp(keyword,
"j2'yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2p[1][0]);
2421 else if (strcmp(keyword,
"j2'yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2p[1][2]);
2422 else if (strcmp(keyword,
"j2'z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2p[2][2]);
2423 else if (strcmp(keyword,
"j2'zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2p[2][0]);
2424 else if (strcmp(keyword,
"j2'zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2p[2][1]);
2425 else if (strcmp(keyword,
"j2''") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2ppAll);
2426 else if (strcmp(keyword,
"j2''x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[0][0]);
2427 else if (strcmp(keyword,
"j2''xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[0][1]);
2428 else if (strcmp(keyword,
"j2''xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[0][2]);
2429 else if (strcmp(keyword,
"j2''y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[1][1]);
2430 else if (strcmp(keyword,
"j2''yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[1][0]);
2431 else if (strcmp(keyword,
"j2''yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[1][2]);
2432 else if (strcmp(keyword,
"j2''z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[2][2]);
2433 else if (strcmp(keyword,
"j2''zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[2][0]);
2434 else if (strcmp(keyword,
"j2''zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[2][1]);
2436 else if (strcmp(keyword,
"j'x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jp[0][0]);
2437 else if (strcmp(keyword,
"j'xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jp[0][1]);
2438 else if (strcmp(keyword,
"j'xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jp[0][2]);
2439 else if (strcmp(keyword,
"j'y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jp[1][1]);
2440 else if (strcmp(keyword,
"j'yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jp[1][0]);
2441 else if (strcmp(keyword,
"j'yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jp[1][2]);
2442 else if (strcmp(keyword,
"j'z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jp[2][2]);
2443 else if (strcmp(keyword,
"j'zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jp[2][0]);
2444 else if (strcmp(keyword,
"j'zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jp[2][1]);
2446 else if (strcmp(keyword,
"j''x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jpp[0][0]);
2447 else if (strcmp(keyword,
"j''xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jpp[0][1]);
2448 else if (strcmp(keyword,
"j''xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jpp[0][2]);
2449 else if (strcmp(keyword,
"j''y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jpp[1][1]);
2450 else if (strcmp(keyword,
"j''yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jpp[1][0]);
2451 else if (strcmp(keyword,
"j''yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jpp[1][2]);
2452 else if (strcmp(keyword,
"j''z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jpp[2][2]);
2453 else if (strcmp(keyword,
"j''zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jpp[2][0]);
2454 else if (strcmp(keyword,
"j''zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Jpp[2][1]);
2458 else if (strcmp(keyword,
"llength") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->length[1]);
2459 else if (strcmp(keyword,
"lx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->direct[1][0]);
2460 else if (strcmp(keyword,
"ly") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->direct[1][1]);
2461 else if (strcmp(keyword,
"lz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->direct[1][2]);
2464 else if (strcmp(keyword,
"nelec") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->nelec);
2465 else if (strcmp(keyword,
"outputmode") == 0)
StoreWithCheckDup_sl(keyword, value, StdI->outputmode);
2466 else if (strcmp(keyword,
"phase0") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->phase[0]);
2467 else if (strcmp(keyword,
"phase1") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->phase[1]);
2468 else if (strcmp(keyword,
"phase2") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->phase[2]);
2495 else if (strcmp(keyword,
"wlength") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->length[0]);
2496 else if (strcmp(keyword,
"wx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->direct[0][0]);
2497 else if (strcmp(keyword,
"wy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->direct[0][1]);
2498 else if (strcmp(keyword,
"wz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->direct[0][2]);
2502 else if (strcmp(keyword,
"calcspec") == 0)
StoreWithCheckDup_sl(keyword, value, StdI->CalcSpec);
2504 else if (strcmp(keyword,
"eigenvecio") == 0)
StoreWithCheckDup_sl(keyword, value, StdI->EigenVecIO);
2505 else if (strcmp(keyword,
"expandcoef") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->ExpandCoef);
2506 else if (strcmp(keyword,
"expecinterval") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->ExpecInterval);
2507 else if (strcmp(keyword,
"cdatafilehead") == 0)
StoreWithCheckDup_s(keyword, value, StdI->CDataFileHead);
2509 else if (strcmp(keyword,
"flgtemp") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->FlgTemp);
2511 else if (strcmp(keyword,
"initialvectype") == 0)
StoreWithCheckDup_sl(keyword, value, StdI->InitialVecType);
2512 else if (strcmp(keyword,
"initial_iv") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->initial_iv);
2513 else if (strcmp(keyword,
"lanczoseps") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->LanczosEps);
2514 else if (strcmp(keyword,
"lanczostarget") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->LanczosTarget);
2515 else if (strcmp(keyword,
"lanczos_max") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->Lanczos_max);
2516 else if (strcmp(keyword,
"largevalue") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->LargeValue);
2518 else if (strcmp(keyword,
"nomega") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->Nomega);
2519 else if (strcmp(keyword,
"numave") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NumAve);
2521 else if (strcmp(keyword,
"omegamax") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->OmegaMax);
2522 else if (strcmp(keyword,
"omegamin") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->OmegaMin);
2523 else if (strcmp(keyword,
"omegaim") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->OmegaIm);
2524 else if (strcmp(keyword,
"pumptype") == 0)
StoreWithCheckDup_sl(keyword, value, StdI->PumpType);
2526 else if (strcmp(keyword,
"spectrumqh") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->SpectrumQ[2]);
2527 else if (strcmp(keyword,
"spectrumql") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->SpectrumQ[1]);
2528 else if (strcmp(keyword,
"spectrumqw") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->SpectrumQ[0]);
2529 else if (strcmp(keyword,
"spectrumtype") == 0)
StoreWithCheckDup_sl(keyword, value, StdI->SpectrumType);
2530 else if (strcmp(keyword,
"tdump") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->tdump);
2531 else if (strcmp(keyword,
"tshift") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->tshift);
2532 else if (strcmp(keyword,
"uquench") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->Uquench);
2533 else if (strcmp(keyword,
"vecpoth") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->VecPot[2]);
2534 else if (strcmp(keyword,
"vecpotl") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->VecPot[1]);
2535 else if (strcmp(keyword,
"vecpotw") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->VecPot[0]);
2537 #elif defined(_mVMC) 2538 else if (strcmp(keyword,
"a0hsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[0][2]);
2539 else if (strcmp(keyword,
"a0lsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[0][1]);
2540 else if (strcmp(keyword,
"a0wsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[0][0]);
2541 else if (strcmp(keyword,
"a1hsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[1][2]);
2542 else if (strcmp(keyword,
"a1lsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[1][1]);
2543 else if (strcmp(keyword,
"a1wsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[1][0]);
2544 else if (strcmp(keyword,
"a2hsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[2][2]);
2545 else if (strcmp(keyword,
"a2lsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[2][1]);
2546 else if (strcmp(keyword,
"a2wsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[2][0]);
2547 else if (strcmp(keyword,
"complextype") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->ComplexType);
2548 else if (strcmp(keyword,
"cparafilehead") == 0)
StoreWithCheckDup_s(keyword, value, StdI->CParaFileHead);
2549 else if (strcmp(keyword,
"dsroptredcut") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->DSROptRedCut);
2550 else if (strcmp(keyword,
"dsroptstadel") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->DSROptStaDel);
2551 else if (strcmp(keyword,
"dsroptstepdt") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->DSROptStepDt);
2554 else if (strcmp(keyword,
"nvmccalmode") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NVMCCalMode);
2555 else if (strcmp(keyword,
"ndataidxstart") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NDataIdxStart);
2556 else if (strcmp(keyword,
"ndataqtysmp") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NDataQtySmp);
2557 else if (strcmp(keyword,
"nlanczosmode") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NLanczosMode);
2558 else if (strcmp(keyword,
"nmptrans") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NMPTrans);
2559 else if (strcmp(keyword,
"nspgaussleg") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NSPGaussLeg);
2560 else if (strcmp(keyword,
"nsplitsize") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NSplitSize);
2561 else if (strcmp(keyword,
"nspstot") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NSPStot);
2562 else if (strcmp(keyword,
"nsroptitrsmp") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NSROptItrSmp);
2563 else if (strcmp(keyword,
"nsroptitrstep") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NSROptItrStep);
2564 else if (strcmp(keyword,
"nstore") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NStore);
2565 else if (strcmp(keyword,
"nsrcg") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NSRCG);
2566 else if (strcmp(keyword,
"nvmcinterval") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NVMCInterval);
2567 else if (strcmp(keyword,
"nvmcsample") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NVMCSample);
2568 else if (strcmp(keyword,
"nvmcwarmup") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NVMCWarmUp);
2569 else if (strcmp(keyword,
"rndseed") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->RndSeed);
2573 fprintf(stdout,
"ERROR ! Unsupported Keyword in Standard mode!\n");
2579 fprintf(stdout,
"\n");
2580 fprintf(stdout,
"####### Construct Model #######\n");
2581 fprintf(stdout,
"\n");
2585 if (strcmp(StdI->CDataFileHead,
"****") == 0) {
2586 strcpy(StdI->CDataFileHead,
"zvo\0");
2587 fprintf(stdout,
" CDataFileHead = %-12s###### DEFAULT VALUE IS USED ######\n", StdI->CDataFileHead);
2589 else fprintf(stdout,
" CDataFileHead = %-s\n", StdI->CDataFileHead);
2593 if (strcmp(StdI->model,
"fermionhubbard") == 0
2594 || strcmp(StdI->model,
"hubbard") == 0)
2595 strcpy(StdI->model,
"hubbard\0");
2596 else if(strcmp(StdI->model,
"fermionhubbardgc") == 0
2597 || strcmp(StdI->model,
"hubbardgc") == 0) {
2598 strcpy(StdI->model,
"hubbard\0");
2601 else if (strcmp(StdI->model,
"spin") == 0)
2602 strcpy(StdI->model,
"spin\0");
2603 else if (strcmp(StdI->model,
"spingc") == 0) {
2604 strcpy(StdI->model,
"spin\0");
2608 else if(strcmp(StdI->model,
"spingcboost") == 0 ||
2609 strcmp(StdI->model,
"spingccma") == 0) {
2610 strcpy(StdI->model,
"spin\0");
2615 else if (strcmp(StdI->model,
"kondolattice") == 0
2616 || strcmp(StdI->model,
"kondo") == 0) {
2617 strcpy(StdI->model,
"kondo\0");
2619 else if(strcmp(StdI->model,
"kondolatticegc") == 0
2620 || strcmp(StdI->model,
"kondogc") == 0) {
2621 strcpy(StdI->model,
"kondo\0");
2629 if (strcmp(StdI->method,
"direct") == 0
2630 || strcmp(StdI->method,
"alldiag") == 0)
2631 strcpy(StdI->method,
"fulldiag\0");
2632 else if (strcmp(StdI->method,
"te") == 0
2633 || strcmp(StdI->method,
"time-evolution") == 0) {
2634 strcpy(StdI->method,
"timeevolution\0");
2639 if (strcmp(StdI->method,
"timeevolution") == 0)
VectorPotential(StdI);
2644 if (strcmp(StdI->lattice,
"chain") == 0
2645 || strcmp(StdI->lattice,
"chainlattice") == 0)
StdFace_Chain(StdI);
2646 else if (strcmp(StdI->lattice,
"face-centeredorthorhombic") == 0
2647 || strcmp(StdI->lattice,
"fcorthorhombic") == 0
2649 else if (strcmp(StdI->lattice,
"honeycomb") == 0
2651 else if (strcmp(StdI->lattice,
"kagome") == 0
2652 || strcmp(StdI->lattice,
"kagomelattice") == 0)
StdFace_Kagome(StdI);
2653 else if (strcmp(StdI->lattice,
"ladder") == 0
2654 || strcmp(StdI->lattice,
"ladderlattice") == 0)
StdFace_Ladder(StdI);
2655 else if (strcmp(StdI->lattice,
"orthorhombic") == 0
2658 else if (strcmp(StdI->lattice,
"tetragonal") == 0
2659 || strcmp(StdI->lattice,
"tetragonallattice") == 0
2660 || strcmp(StdI->lattice,
"square") == 0
2662 else if (strcmp(StdI->lattice,
"triangular") == 0
2672 if (StdI->lBoost == 1) {
2673 if (strcmp(StdI->lattice,
"chain") == 0
2675 else if (strcmp(StdI->lattice,
"honeycomb") == 0
2677 else if (strcmp(StdI->lattice,
"kagome") == 0
2679 else if (strcmp(StdI->lattice,
"ladder") == 0
2685 fprintf(stdout,
"\n");
2686 fprintf(stdout,
"###### Print Expert input files ######\n");
2687 fprintf(stdout,
"\n");
2695 if (strcmp(StdI->method,
"timeevolution") == 0)
PrintPump(StdI);
2697 #elif defined(_mVMC) 2699 if(StdI->lGC == 0 && (StdI->Sz2 == 0 || StdI->Sz2 == StdI->NaN_i))
2703 StdFace_generate_orb(StdI);
2706 if(StdI->lGC == 1 || (StdI->Sz2 != 0 && StdI->Sz2 != StdI->NaN_i) )
2708 PrintGutzwiller(StdI);
2718 free(StdI->locspinflag);
2719 for (ktrans = 0; ktrans < StdI->ntrans; ktrans++) {
2720 free(StdI->transindx[ktrans]);
2722 free(StdI->transindx);
2724 for (kintr = 0; kintr < StdI->nintr; kintr++) {
2725 free(StdI->intrindx[kintr]);
2727 free(StdI->intrindx);
2730 fprintf(stdout,
"\n###### Input files are generated. ######\n\n");
void StdFace_Ladder(struct StdIntList *StdI)
Setup a Hamiltonian for the generalized Heisenberg model on a square lattice.
void StdFace_Ladder_Boost(struct StdIntList *StdI)
void StdFace_Honeycomb_Boost(struct StdIntList *StdI)
void StdFace_Tetragonal(struct StdIntList *StdI)
Setup a Hamiltonian for the square lattice.
void StdFace_PrintVal_d(const char *valname, double *val, double val0)
Print a valiable (real) read from the input file if it is not specified in the input file (=NaN)...
static void TrimSpaceQuote(char *value)
Remove : space etc. from keyword and value in an iput file.
static void Print2Green(struct StdIntList *StdI)
Print greentwo.def.
void StdFace_RequiredVal_i(const char *valname, int val)
Stop HPhi if a variable (integer) which must be specified is absent in the input file (=2147483647...
void StdFace_Pyrochlore(struct StdIntList *StdI)
Setup a Hamiltonian for the Pyrochlore structure.
static void PrintCalcMod(struct StdIntList *StdI)
Print calcmod.def.
void StdFace_exit(int errorcode)
MPI Abortation wrapper.
void StdFace_Kagome_Boost(struct StdIntList *StdI)
static void PrintNamelist(struct StdIntList *StdI)
Print namelist.def.
void StdFace_FCOrtho(struct StdIntList *StdI)
Setup a Hamiltonian for the Face-Centered Orthorhombic lattice.
static void VectorPotential(struct StdIntList *StdI)
static void PrintLocSpin(struct StdIntList *StdI)
Print the locspin file.
void StdFace_Orthorhombic(struct StdIntList *StdI)
Setup a Hamiltonian for the Simple Orthorhombic lattice.
static void UnsupportedSystem(char *model, char *lattice)
Stop HPhi if unsupported model is read.
void StdFace_main(char *fname)
Main routine for the standard mode.
void StdFace_Triangular(struct StdIntList *StdI)
Setup a Hamiltonian for the Triangular lattice.
static void Text2Lower(char *value)
static void PrintModPara(struct StdIntList *StdI)
Print modpara.def.
static void PrintInteractions(struct StdIntList *StdI)
Output .def file for Specific interaction.
static void StoreWithCheckDup_sl(char *keyword, char *valuestring, char *value)
Store an input value into the valiable (string) Force string lower. If duplicated, HPhi will stop.
void StdFace_Chain(struct StdIntList *StdI)
Setup a Hamiltonian for the Hubbard model on a Chain lattice.
void StdFace_Kagome(struct StdIntList *StdI)
Setup a Hamiltonian for the Kagome lattice.
static void StoreWithCheckDup_s(char *keyword, char *valuestring, char *value)
Store an input value into the valiable (string) If duplicated, HPhi will stop.
void StdFace_Wannier90(struct StdIntList *StdI)
Setup a Hamiltonian for the Wannier90 *_hr.dat.
static void StdFace_ResetVals(struct StdIntList *StdI)
Clear grobal variables in the standard mode All variables refered in this function is modified...
static void StoreWithCheckDup_d(char *keyword, char *valuestring, double *value)
Store an input value into the valiable (double) If duplicated, HPhi will stop.
void StdFace_NotUsed_i(const char *valname, int val)
Stop HPhi if a variable (integer) not used is specified in the input file (!=2147483647, the upper limt of Int).
static void StoreWithCheckDup_i(char *keyword, char *valuestring, int *value)
Store an input value into the valiable (integer) If duplicated, HPhi will stop.
static void Print1Green(struct StdIntList *StdI)
Print greenone.def.
void StdFace_PrintVal_i(const char *valname, int *val, int val0)
Print a valiable (integer) read from the input file if it is not specified in the input file (=214748...
static void PrintPump(struct StdIntList *StdI)
Print single.def or pair.def.
static void CheckModPara(struct StdIntList *StdI)
Summary numerical parameter check the combination of the number of sites, total spin, the number of electrons.
void StdFace_Honeycomb(struct StdIntList *StdI)
Setup a Hamiltonian for the Hubbard model on a Honeycomb lattice.
static void PrintExcitation(struct StdIntList *StdI)
Print single.def or pair.def.
static void PrintTrans(struct StdIntList *StdI)
Print the transfer file.
static void StoreWithCheckDup_c(char *keyword, char *valuestring, std::complex< double > *value)
Store an input value into the valiable (Double complex) If duplicated, HPhi will stop.
void StdFace_Chain_Boost(struct StdIntList *StdI)
Setup a Hamiltonian for the generalized Heisenberg model on a Chain lattice.
static void CheckOutputMode(struct StdIntList *StdI)
Verify outputmode.
static void StdFace_LargeValue(struct StdIntList *StdI)
Set Largevalue (StdIntList::LargeValue) for TPQ. Sum absolute-value of all one- and two- body terms...