21 #include "StdFace_vals.hpp" 22 #include "StdFace_ModelUtil.hpp" 35 int isite, jsite, kCell, ntransMax, nintrMax;
38 std::complex<double> Cphase;
44 fp = fopen(
"lattice.gp",
"w");
48 fprintf(stdout,
" @ Lattice Size & Shape\n\n");
62 StdI->tau[0][0] = 0.0; StdI->tau[0][1] = 0.0; StdI->tau[0][2] = 0.0;
63 StdI->tau[1][0] = 1.0 / 3.0; StdI->tau[1][1] = 1.0 / 3.0; StdI->tau[1][2] = 0.0;
67 fprintf(stdout,
"\n @ Hamiltonian \n\n");
72 if (strcmp(StdI->model,
"spin") == 0 ) {
133 if (strcmp(StdI->model,
"hubbard") == 0 ) {
143 fprintf(stdout,
"\n @ Numerical conditions\n\n");
148 StdI->nsite = StdI->NsiteUC * StdI->NCell;
149 if (strcmp(StdI->model,
"kondo") == 0 ) StdI->nsite *= 2;
150 StdI->locspinflag = (
int *)malloc(
sizeof(
int) * StdI->nsite);
152 if (strcmp(StdI->model,
"spin") == 0 )
153 for (isite = 0; isite < StdI->nsite; isite++) StdI->locspinflag[isite] = StdI->S2;
154 else if (strcmp(StdI->model,
"hubbard") == 0 )
155 for (isite = 0; isite < StdI->nsite; isite++) StdI->locspinflag[isite] = 0;
157 for (iL = 0; iL < StdI->nsite / 2; iL++) {
158 StdI->locspinflag[iL] = StdI->S2;
159 StdI->locspinflag[iL + StdI->nsite / 2] = 0;
164 if (strcmp(StdI->model,
"spin") == 0 ) {
165 ntransMax = StdI->nsite * (StdI->S2 + 1 + 2 * StdI->S2);
166 nintrMax = StdI->NCell * (StdI->NsiteUC + 3 + 6 + 3)
167 * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
170 ntransMax = StdI->NCell * 2 * (
171 2 * StdI->NsiteUC + 6 + 12 + 6);
172 nintrMax = StdI->NCell * (StdI->NsiteUC + 4 * (3 + 6 + 3));
174 if (strcmp(StdI->model,
"kondo") == 0) {
175 ntransMax += StdI->nsite / 2 * (StdI->S2 + 1 + 2 * StdI->S2);
176 nintrMax += StdI->nsite / 2 * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
184 for (kCell = 0; kCell < StdI->NCell; kCell++) {
186 iW = StdI->Cell[kCell][0];
187 iL = StdI->Cell[kCell][1];
191 isite = StdI->NsiteUC * kCell;
192 if (strcmp(StdI->model,
"kondo") == 0 ) isite += 2 * StdI->NCell;
194 if (strcmp(StdI->model,
"spin") == 0 ) {
204 if (strcmp(StdI->model,
"kondo") == 0 ) {
205 jsite = StdI->NsiteUC * kCell;
215 StdFace_SetLabel(StdI, fp, iW, iL, 0, 0, 0, 1, &isite, &jsite, 1, &Cphase, dR);
217 if (strcmp(StdI->model,
"spin") == 0 ) {
227 StdFace_SetLabel(StdI, fp, iW, iL, 1, 0, 1, 0, &isite, &jsite, 1, &Cphase, dR);
229 if (strcmp(StdI->model,
"spin") == 0 ) {
239 StdFace_SetLabel(StdI, fp, iW, iL, 0, 1, 1, 0, &isite, &jsite, 1, &Cphase, dR);
241 if (strcmp(StdI->model,
"spin") == 0 ) {
251 StdFace_SetLabel(StdI, fp, iW, iL, 1, 0, 0, 0, &isite, &jsite, 2, &Cphase, dR);
253 if (strcmp(StdI->model,
"spin") == 0 ) {
263 StdFace_SetLabel(StdI, fp, iW, iL, 1, 0, 1, 1, &isite, &jsite, 2, &Cphase, dR);
265 if (strcmp(StdI->model,
"spin") == 0 ) {
275 StdFace_SetLabel(StdI, fp, iW, iL, 0, 1, 0, 0, &isite, &jsite, 2, &Cphase, dR);
277 if (strcmp(StdI->model,
"spin") == 0 ) {
287 StdFace_SetLabel(StdI, fp, iW, iL, 0, 1, 1, 1, &isite, &jsite, 2, &Cphase, dR);
289 if (strcmp(StdI->model,
"spin") == 0 ) {
299 StdFace_SetLabel(StdI, fp, iW, iL, 1, - 1, 0, 0, &isite, &jsite, 2, &Cphase, dR);
301 if (strcmp(StdI->model,
"spin") == 0 ) {
311 StdFace_SetLabel(StdI, fp, iW, iL, 1, -1, 1, 1, &isite, &jsite, 2, &Cphase, dR);
313 if (strcmp(StdI->model,
"spin") == 0 ) {
323 StdFace_SetLabel(StdI, fp, iW, iL, 1, -1, 0, 1, &isite, &jsite, 3, &Cphase, dR);
325 if (strcmp(StdI->model,
"spin") == 0) {
335 StdFace_SetLabel(StdI, fp, iW, iL, -1, -1, 0, 1, &isite, &jsite, 3, &Cphase, dR);
337 if (strcmp(StdI->model,
"spin") == 0) {
347 StdFace_SetLabel(StdI, fp, iW, iL, -1, 1, 0, 1, &isite, &jsite, 3, &Cphase, dR);
349 if (strcmp(StdI->model,
"spin") == 0) {
358 fprintf(fp,
"plot \'-\' w d lc 7\n0.0 0.0\nend\npause -1\n");
372 int isite, ipivot, i1, i2;
376 if (StdI->box[0][1] != 0 || StdI->box[1][0] != 0) {
377 fprintf(stdout,
"\nERROR ! (a0W, a0L, a1W, a1L) can not be used with SpinGCBoost.\n\n");
380 for (i1 = 0; i1 < 3; i1++) {
381 for (i2 = 0; i2 < 3; i2++) {
382 if (fabs(StdI->Jp[i1][i2]) > 1.0e-8) {
383 fprintf(stdout,
"\nERROR ! J' can not be used with SpinGCBoost.\n\n");
391 fp = fopen(
"boost.def",
"w");
392 fprintf(fp,
"# Magnetic field\n");
393 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
394 -0.5 * StdI->Gamma, 0.0, -0.5 *StdI->h);
398 fprintf(fp,
"%d # Number of type of J\n", 3);
399 fprintf(fp,
"# J 0\n");
400 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
401 0.25 * StdI->J0[0][0], 0.25 * StdI->J0[0][1], 0.25 * StdI->J0[0][2]);
402 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
403 0.25 * StdI->J0[0][1], 0.25 * StdI->J0[1][1], 0.25 * StdI->J0[1][2]);
404 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
405 0.25 * StdI->J0[0][2], 0.25 * StdI->J0[1][2], 0.25 * StdI->J0[2][2]);
406 fprintf(fp,
"# J 1\n");
407 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
408 0.25 * StdI->J1[0][0], 0.25 * StdI->J1[0][1], 0.25 * StdI->J1[0][2]);
409 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
410 0.25 * StdI->J1[0][1], 0.25 * StdI->J1[1][1], 0.25 * StdI->J1[1][2]);
411 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
412 0.25 * StdI->J1[0][2], 0.25 * StdI->J1[1][2], 0.25 * StdI->J1[2][2]);
413 fprintf(fp,
"# J 2\n");
414 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
415 0.25 * StdI->J2[0][0], 0.25 * StdI->J2[0][1], 0.25 * StdI->J2[0][2]);
416 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
417 0.25 * StdI->J2[0][1], 0.25 * StdI->J2[1][1], 0.25 * StdI->J2[1][2]);
418 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
419 0.25 * StdI->J2[0][2], 0.25 * StdI->J2[1][2], 0.25 * StdI->J2[2][2]);
424 fprintf(stdout,
"\n ERROR! S2 must be 1 in Boost. \n\n");
427 StdI->ishift_nspin = 3;
429 fprintf(stdout,
"\n ERROR! L < 2 \n\n");
432 if (StdI->W % StdI->ishift_nspin != 0) {
433 fprintf(stdout,
"\n ERROR! W %% %d != 0 \n\n", StdI->ishift_nspin);
438 fprintf(stdout,
"DEBUG: W != 3\n");
442 fprintf(fp,
"# W0 R0 StdI->num_pivot StdI->ishift_nspin\n");
443 fprintf(fp,
"%d %d %d %d\n", StdI->W, StdI->L, StdI->num_pivot, StdI->ishift_nspin);
445 StdI->list_6spin_star = (
int **)malloc(
sizeof(
int*) * StdI->num_pivot);
446 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
447 StdI->list_6spin_star[ipivot] = (
int *)malloc(
sizeof(
int) * 7);
450 StdI->list_6spin_star[0][0] = 5;
451 StdI->list_6spin_star[0][1] = 1;
452 StdI->list_6spin_star[0][2] = 1;
453 StdI->list_6spin_star[0][3] = 1;
454 StdI->list_6spin_star[0][4] = 2;
455 StdI->list_6spin_star[0][5] = 1;
456 StdI->list_6spin_star[0][6] = 1;
458 StdI->list_6spin_star[1][0] = 4;
459 StdI->list_6spin_star[1][1] = 1;
460 StdI->list_6spin_star[1][2] = 1;
461 StdI->list_6spin_star[1][3] = 1;
462 StdI->list_6spin_star[1][4] = 2;
463 StdI->list_6spin_star[1][5] = 2;
464 StdI->list_6spin_star[1][6] = 1;
466 fprintf(fp,
"# StdI->list_6spin_star\n");
467 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
468 fprintf(fp,
"# pivot %d\n", ipivot);
469 for (isite = 0; isite < 7; isite++) {
470 fprintf(fp,
"%d ", StdI->list_6spin_star[ipivot][isite]);
475 StdI->list_6spin_pair = (
int ***)malloc(
sizeof(
int**) * StdI->num_pivot);
476 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
477 StdI->list_6spin_pair[ipivot] = (
int **)malloc(
sizeof(
int*) * 7);
478 for (isite = 0; isite < 7; isite++) {
479 StdI->list_6spin_pair[ipivot][isite] = (
int *)malloc(
sizeof(
int) * StdI->list_6spin_star[ipivot][0]);
483 StdI->list_6spin_pair[0][0][0] = 0;
484 StdI->list_6spin_pair[0][1][0] = 1;
485 StdI->list_6spin_pair[0][2][0] = 2;
486 StdI->list_6spin_pair[0][3][0] = 3;
487 StdI->list_6spin_pair[0][4][0] = 4;
488 StdI->list_6spin_pair[0][5][0] = 5;
489 StdI->list_6spin_pair[0][6][0] = 1;
490 StdI->list_6spin_pair[0][0][1] = 1;
491 StdI->list_6spin_pair[0][1][1] = 2;
492 StdI->list_6spin_pair[0][2][1] = 0;
493 StdI->list_6spin_pair[0][3][1] = 3;
494 StdI->list_6spin_pair[0][4][1] = 4;
495 StdI->list_6spin_pair[0][5][1] = 5;
496 StdI->list_6spin_pair[0][6][1] = 2;
497 StdI->list_6spin_pair[0][0][2] = 2;
498 StdI->list_6spin_pair[0][1][2] = 3;
499 StdI->list_6spin_pair[0][2][2] = 0;
500 StdI->list_6spin_pair[0][3][2] = 1;
501 StdI->list_6spin_pair[0][4][2] = 4;
502 StdI->list_6spin_pair[0][5][2] = 5;
503 StdI->list_6spin_pair[0][6][2] = 1;
504 StdI->list_6spin_pair[0][0][3] = 0;
505 StdI->list_6spin_pair[0][1][3] = 4;
506 StdI->list_6spin_pair[0][2][3] = 1;
507 StdI->list_6spin_pair[0][3][3] = 2;
508 StdI->list_6spin_pair[0][4][3] = 3;
509 StdI->list_6spin_pair[0][5][3] = 5;
510 StdI->list_6spin_pair[0][6][3] = 2;
511 StdI->list_6spin_pair[0][0][4] = 1;
512 StdI->list_6spin_pair[0][1][4] = 5;
513 StdI->list_6spin_pair[0][2][4] = 0;
514 StdI->list_6spin_pair[0][3][4] = 2;
515 StdI->list_6spin_pair[0][4][4] = 3;
516 StdI->list_6spin_pair[0][5][4] = 4;
517 StdI->list_6spin_pair[0][6][4] = 3;
519 StdI->list_6spin_pair[1][0][0] = 0;
520 StdI->list_6spin_pair[1][1][0] = 1;
521 StdI->list_6spin_pair[1][2][0] = 2;
522 StdI->list_6spin_pair[1][3][0] = 3;
523 StdI->list_6spin_pair[1][4][0] = 4;
524 StdI->list_6spin_pair[1][5][0] = 5;
525 StdI->list_6spin_pair[1][6][0] = 2;
526 StdI->list_6spin_pair[1][0][1] = 1;
527 StdI->list_6spin_pair[1][1][1] = 2;
528 StdI->list_6spin_pair[1][2][1] = 0;
529 StdI->list_6spin_pair[1][3][1] = 3;
530 StdI->list_6spin_pair[1][4][1] = 4;
531 StdI->list_6spin_pair[1][5][1] = 5;
532 StdI->list_6spin_pair[1][6][1] = 1;
533 StdI->list_6spin_pair[1][0][2] = 0;
534 StdI->list_6spin_pair[1][1][2] = 4;
535 StdI->list_6spin_pair[1][2][2] = 1;
536 StdI->list_6spin_pair[1][3][2] = 2;
537 StdI->list_6spin_pair[1][4][2] = 3;
538 StdI->list_6spin_pair[1][5][2] = 5;
539 StdI->list_6spin_pair[1][6][2] = 3;
540 StdI->list_6spin_pair[1][0][3] = 2;
541 StdI->list_6spin_pair[1][1][3] = 5;
542 StdI->list_6spin_pair[1][2][3] = 0;
543 StdI->list_6spin_pair[1][3][3] = 1;
544 StdI->list_6spin_pair[1][4][3] = 3;
545 StdI->list_6spin_pair[1][5][3] = 4;
546 StdI->list_6spin_pair[1][6][3] = 3;
548 fprintf(fp,
"# StdI->list_6spin_pair\n");
549 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
550 fprintf(fp,
"# pivot %d\n", ipivot);
551 for (kintr = 0; kintr < StdI->list_6spin_star[ipivot][0]; kintr++) {
552 for (isite = 0; isite < 7; isite++) {
553 fprintf(fp,
"%d ", StdI->list_6spin_pair[ipivot][isite][kintr]);
560 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
561 free(StdI->list_6spin_star[ipivot]);
563 free(StdI->list_6spin_star);
565 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
566 for (isite = 0; isite < 7; isite++) {
567 free(StdI->list_6spin_pair[ipivot][isite]);
569 free(StdI->list_6spin_pair[ipivot]);
571 free(StdI->list_6spin_pair);
void StdFace_InputHopp(std::complex< double > t, std::complex< double > *t0, const char *t0name)
Input hopping integral from the input file, if it is not specified, use the default value(0 or the is...
void StdFace_SetLabel(struct StdIntList *StdI, FILE *fp, int iW, int iL, int diW, int diL, int isiteUC, int jsiteUC, int *isite, int *jsite, int connect, std::complex< double > *Cphase, double *dR)
Set Label in the gnuplot display (Only used in 2D system)
void StdFace_Coulomb(struct StdIntList *StdI, double V, int isite, int jsite)
Add onsite/offsite Coulomb term to the list StdIntList::Cinter and StdIntList::CinterIndx, and increase the number of them (StdIntList::NCinter).
void StdFace_GeneralJ(struct StdIntList *StdI, double J[3][3], int Si2, int Sj2, int isite, int jsite)
Treat J as a 3*3 matrix [(6S + 1)*(6S' + 1) interactions].
void StdFace_Honeycomb_Boost(struct StdIntList *StdI)
void StdFace_InputSpin(double Jp[3][3], double JpAll, const char *Jpname)
Input spin-spin interaction other than nearest-neighbor.
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)...
void StdFace_exit(int errorcode)
MPI Abortation wrapper.
void StdFace_Hopping(struct StdIntList *StdI, std::complex< double > trans0, int isite, int jsite, double *dR)
Add Hopping for the both spin.
void StdFace_NotUsed_c(const char *valname, std::complex< double > val)
Stop HPhi if a variable (complex) not used is specified in the input file (!=NaN).
void StdFace_HubbardLocal(struct StdIntList *StdI, double mu0, double h0, double Gamma0, double U0, int isite)
Add intra-Coulomb, magnetic field, chemical potential for the itenerant electron. ...
void StdFace_NotUsed_J(const char *valname, double JAll, double J[3][3])
Stop HPhi if variables (real) not used is specified in the input file (!=NaN).
void StdFace_MagField(struct StdIntList *StdI, int S2, double h, double Gamma, int isite)
Add longitudinal and transvars magnetic field to the list.
void StdFace_PrintGeometry(struct StdIntList *StdI)
Print geometry of sites for the pos-process of correlation function.
void StdFace_InputCoulombV(double V, double *V0, const char *V0name)
Input off-site Coulomb interaction from the input file, if it is not specified, use the default value...
void StdFace_MallocInteractions(struct StdIntList *StdI, int ntransMax, int nintrMax)
Malloc Arrays for interactions.
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).
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...
void StdFace_Honeycomb(struct StdIntList *StdI)
Setup a Hamiltonian for the Hubbard model on a Honeycomb lattice.
void StdFace_InitSite(struct StdIntList *StdI, FILE *fp, int dim)
Initialize the super-cell where simulation is performed.
void StdFace_InputSpinNN(double J[3][3], double JAll, double J0[3][3], double J0All, const char *J0name)
Input nearest-neighbor spin-spin interaction.
void StdFace_NotUsed_d(const char *valname, double val)
Stop HPhi if a variable (real) not used is specified in the input file (!=NaN).