Setup a Hamiltonian for the Wannier90 *_hr.dat.
(4) Compute the upper limit of the number of Transfer & Interaction and malloc them.
(4.5) For spin system, compute super exchange interaction.
346 int isite, jsite, ispin, ntransMax, nintrMax;
347 int iL, iW, iH, kCell, it, ii;
348 double Jtmp[3][3] = { {0.0} };
350 double complex Cphase;
351 double dR[3], *Uspin;
353 double complex *W90_t, *W90_j, *W90_u;
354 int **t_indx, **u_indx, **j_indx;
359 fp = fopen(
"lattice.xsf",
"w");
366 fprintf(stdout,
"\n @ Wannier90 Geometry \n\n");
371 fprintf(stdout,
"\n @ Wannier90 hopping \n\n");
377 W90_t = (
double complex *)malloc(
sizeof(
double complex) * n_t);
378 t_indx = (
int **)malloc(
sizeof(
int*) * n_t);
379 for (ii = 0; ii < n_t; ii++) t_indx[ii] = (
int *)malloc(
sizeof(
int) * 5);
385 fprintf(stdout,
"\n @ Wannier90 Coulomb \n\n");
391 W90_u = (
double complex *)malloc(
sizeof(
double complex) * n_u);
392 u_indx = (
int **)malloc(
sizeof(
int*) * n_u);
393 for (ii = 0; ii < n_u; ii++) u_indx[ii] = (
int *)malloc(
sizeof(
int) * 5);
399 fprintf(stdout,
"\n @ Wannier90 Hund \n\n");
405 W90_j = (
double complex *)malloc(
sizeof(
double complex) * n_j);
406 j_indx = (
int **)malloc(
sizeof(
int*) * n_j);
407 for (ii = 0; ii < n_j; ii++) j_indx[ii] = (
int *)malloc(
sizeof(
int) * 5);
413 fprintf(stdout,
"\n @ Hamiltonian \n\n");
419 if (strcmp(StdI->
model,
"spin") == 0 ) {
422 else if (strcmp(StdI->
model,
"hubbard") == 0) {
426 printf(
"wannier + Kondo is not available !\n");
429 fprintf(stdout,
"\n @ Numerical conditions\n\n");
437 if(strcmp(StdI->
model,
"spin") == 0 )
439 else if(strcmp(StdI->
model,
"hubbard") == 0 )
444 if (strcmp(StdI->
model,
"spin") == 0 ) {
445 ntransMax = StdI->
nsite * (StdI->
S2 + 1 + 2 * StdI->
S2);
446 nintrMax = StdI->
NCell * (StdI->
NsiteUC + n_t + n_u + n_j)
447 * (3 * StdI->
S2 + 1) * (3 * StdI->
S2 + StdI->
NsiteUC);
449 else if (strcmp(StdI->
model,
"hubbard") == 0) {
450 ntransMax = StdI->
NCell * 2 * (2 * StdI->
NsiteUC + n_t * 2);
458 if (strcmp(StdI->
model,
"spin") == 0) {
459 Uspin = (
double *)malloc(
sizeof(
double) * StdI->
NsiteUC);
460 for (it = 0; it < n_u; it++)
461 if (u_indx[it][0] == 0 && u_indx[it][1] == 0 && u_indx[it][2] == 0
462 && u_indx[it][3] == u_indx[it][4])
463 Uspin[u_indx[it][3]] = creal(W90_u[it]);
468 for (kCell = 0; kCell < StdI->
NCell; kCell++){
470 iW = StdI->
Cell[kCell][0];
471 iL = StdI->
Cell[kCell][1];
472 iH = StdI->
Cell[kCell][2];
476 if (strcmp(StdI->
model,
"spin") == 0) {
477 for (isite = StdI->
NsiteUC*kCell; isite < StdI->
NsiteUC*(kCell + 1); isite++) {
482 for (isite = StdI->
NsiteUC*kCell; isite < StdI->
NsiteUC*(kCell + 1); isite++) {
489 for (it = 0; it < n_t; it++) {
493 if (t_indx[it][0] == 0 && t_indx[it][1] == 0 && t_indx[it][2] == 0
494 && t_indx[it][3] == t_indx[it][4])
496 if (strcmp(StdI->
model,
"hubbard") == 0) {
497 isite = StdI->
NsiteUC*kCell + t_indx[it][3];
498 for (ispin = 0; ispin < 2; ispin++) {
513 t_indx[it][0], t_indx[it][1], t_indx[it][2],
514 t_indx[it][3], t_indx[it][4], &isite, &jsite, &Cphase, dR);
515 if (strcmp(StdI->
model,
"spin") == 0) {
516 for (ii = 0; ii < 3; ii++)
517 Jtmp[ii][ii] = 2.0 * W90_t[it] * conj(W90_t[it])
518 * (1.0 / Uspin[t_indx[it][3]] + 1.0 / Uspin[t_indx[it][4]]);
529 for (it = 0; it < n_u; it++) {
533 if (u_indx[it][0] == 0 && u_indx[it][1] == 0 && u_indx[it][2] == 0
534 && u_indx[it][3] == u_indx[it][4])
545 u_indx[it][0], u_indx[it][1], u_indx[it][2],
546 u_indx[it][3], u_indx[it][4], &isite, &jsite, &Cphase, dR);
553 for (it = 0; it < n_j; it++) {
557 if (j_indx[it][0] != 0 || j_indx[it][1] != 0 || j_indx[it][2] != 0
558 || j_indx[it][3] != j_indx[it][4])
561 j_indx[it][0], j_indx[it][1], j_indx[it][2],
562 j_indx[it][3], j_indx[it][4], &isite, &jsite, &Cphase, dR);
564 StdI->
Hund[StdI->
NHund] = creal(W90_j[it]);
569 if (strcmp(StdI->
model,
"hubbard") == 0) {
570 StdI->
Ex[StdI->
NEx] = creal(W90_j[it]);
582 StdI->
Ex[StdI->
NEx] = creal(W90_j[it]);
584 StdI->
Ex[StdI->
NEx] = -creal(W90_j[it]);
598 for (it = 0; it < n_t; it++) free(t_indx[it]);
601 for (it = 0; it < n_u; it++) free(u_indx[it]);
604 for (it = 0; it < n_j; it++) free(j_indx[it]);
607 if (strcmp(StdI->
model,
"spin") == 0) free(Uspin);
void StdFace_PrintVal_i(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...
int NPairHopp
Number of pair-hopping term, counted in each lattice file.
int NHund
Number of Hund term, counted in each lattice file.
double cutoff_t
Cutoof for the hopping in wannier90, input from file.
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_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_PrintGeometry(struct StdIntList *StdI)
Print geometry of sites for the pos-process of correlation function.
double * Ex
[StdIntList::NEx] Coefficient of exchange term, malloc in StdFace_MallocInteractions() and set in Std...
double complex * trans
[StdIntList::ntrans] Coefficient of one-body term, malloc in StdFace_MallocInteractions() and set in ...
static void read_W90(struct StdIntList *StdI, char *filename, double cutoff, int *cutoff_R, double cutoff_length, double complex *Mat, int **Matindx)
Read Wannier90 hamiltonian file (*_hr)
void StdFace_Hopping(struct StdIntList *StdI, double complex trans0, int isite, int jsite, double *dR)
Add Hopping for the both spin.
void StdFace_MallocInteractions(struct StdIntList *StdI, int ntransMax, int nintrMax)
Malloc Arrays for interactions.
int S2
Total spin |S| of a local spin, input from file.
int ** ExIndx
[StdIntList::NEx][2] Site indices of exchange term, malloc in StdFace_MallocInteractions() and set in...
double cutoff_j
Cutoof for the Hund in wannier90, input from file.
int NsiteUC
Number of sites in the unit cell. Defined in the beginning of each lattice function.
void StdFace_InitSite(struct StdIntList *StdI, FILE *fp, int dim)
Initialize the super-cell where simulation is performed.
int ntrans
Number of transfer, counted in each lattice file.
char model[256]
Name of model, input parameter.
int ** CintraIndx
[StdIntList::NCintra][1] Site indices of intra-site Coulomb term, malloc in StdFace_MallocInteraction...
double Gamma
Transvars magnetic field, input parameter.
int NCintra
Number of intra-site Coulomb interaction, counted in each lattice file.
double cutoff_length_J
Cutoof for R in wannier90, input from file.
double U
On-site Coulomb potential, input parameter.
double * Hund
[StdIntList::NHund] Coefficient of Hund term, malloc in StdFace_MallocInteractions() and set in StdFa...
int ** Cell
[StdIntList][3] The cell position in the fractional coordinate. Malloc and Set in StdFace_InitSite()...
double phase[3]
Boundary phase, input parameter phase0, etc.
int * locspinflag
[StdIntList::nsite] LocSpin in Expert mode, malloc and set in each lattice file.
int ** HundIndx
[StdIntList::NHund][2] Site indices of Hund term, malloc in StdFace_MallocInteractions() and set in S...
static void geometry_W90(struct StdIntList *StdI)
Read Geometry file for wannier90.
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_NotUsed_d(char *valname, double val)
Stop HPhi if a variable (real) not used is specified in the input file (!=NaN).
double cutoff_length_t
Cutoof for R in wannier90, input from file.
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).
int NEx
Number of exchange term, counted in each lattice file.
double mu
Chemical potential, input parameter.
void StdFace_PrintVal_d(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)...
int NCell
The number of the unit cell in the super-cell (determinant of StdIntList::box). Set in StdFace_InitSi...
static int read_W90_query(struct StdIntList *StdI, char *filename, double cutoff, int *cutoff_R, double cutoff_length)
Read Wannier90 hamiltonian file (*_hr) and compute the number of effective term.
double cutoff_length_U
Cutoof for R in wannier90, input from file.
double * PairHopp
[StdIntList::NPairLift] Coefficient of pair-hopping term, malloc in StdFace_MallocInteractions() and ...
int nsite
Number of sites, set in the each lattice file.
int ** transindx
[StdIntList::ntrans][4] Site/spin indices of one-body term, malloc in StdFace_MallocInteractions() an...
double * Cintra
[StdIntList::NCintra] Coefficient of intra-site Coulomb term, malloc in StdFace_MallocInteractions() ...
void StdFace_PrintXSF(struct StdIntList *StdI)
Print lattice.xsf (XCrysDen format)
double h
Longitudinal magnetic field, input parameter.
void StdFace_FindSite(struct StdIntList *StdI, int iW, int iL, int iH, int diW, int diL, int diH, int isiteUC, int jsiteUC, int *isite, int *jsite, double complex *Cphase, double *dR)
Find the index of transfer and interaction.
int ** PHIndx
[StdIntList::NPairLift][2] Site indices of pair-hopping term, malloc in StdFace_MallocInteractions() ...
void StdFace_exit(int errorcode)
MPI Abortation wrapper.
char CDataFileHead[256]
Header of the output files. Input from file.
double cutoff_u
Cutoof for the Coulomb in wannier90, input from file.
double K
4-spin term. Not used.