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.
304 int isite, jsite, ispin, ntransMax, nintrMax;
305 int iL, iW, iH, kCell, it, ii;
306 double Jtmp[3][3] = { {0.0} };
308 double complex Cphase;
309 double dR[3], *Uspin;
311 double complex *W90_t, *W90_j, *W90_u;
312 int **t_indx, **u_indx, **j_indx;
315 fprintf(stdout,
"\n @ Wannier90 Geometry \n\n");
321 fp = fopen(
"lattice.xsf",
"w");
330 fprintf(stdout,
"\n @ Wannier90 hopping \n\n");
334 W90_t = (
double complex *)malloc(
sizeof(
double complex) * n_t);
335 t_indx = (
int **)malloc(
sizeof(
int*) * n_t);
336 for (ii = 0; ii < n_t; ii++) t_indx[ii] = (
int *)malloc(
sizeof(
int) * 5);
341 fprintf(stdout,
"\n @ Wannier90 Coulomb \n\n");
345 W90_u = (
double complex *)malloc(
sizeof(
double complex) * n_u);
346 u_indx = (
int **)malloc(
sizeof(
int*) * n_u);
347 for (ii = 0; ii < n_u; ii++) u_indx[ii] = (
int *)malloc(
sizeof(
int) * 5);
352 fprintf(stdout,
"\n @ Wannier90 Hund \n\n");
356 W90_j = (
double complex *)malloc(
sizeof(
double complex) * n_j);
357 j_indx = (
int **)malloc(
sizeof(
int*) * n_j);
358 for (ii = 0; ii < n_j; ii++) j_indx[ii] = (
int *)malloc(
sizeof(
int) * 5);
363 fprintf(stdout,
"\n @ Hamiltonian \n\n");
369 if (strcmp(StdI->
model,
"spin") == 0 ) {
372 else if (strcmp(StdI->
model,
"hubbard") == 0) {
376 printf(
"wannier + Kondo is not available !\n");
379 fprintf(stdout,
"\n @ Numerical conditions\n\n");
387 if(strcmp(StdI->
model,
"spin") == 0 )
389 else if(strcmp(StdI->
model,
"hubbard") == 0 )
394 if (strcmp(StdI->
model,
"spin") == 0 ) {
395 ntransMax = StdI->
nsite * (StdI->
S2 + 1 + 2 * StdI->
S2);
396 nintrMax = StdI->
NCell * (StdI->
NsiteUC + n_t + n_u + n_j)
397 * (3 * StdI->
S2 + 1) * (3 * StdI->
S2 + 1);
399 else if (strcmp(StdI->
model,
"hubbard") == 0) {
400 ntransMax = StdI->
NCell * 2 * (2 * StdI->
NsiteUC + n_t * 2);
401 nintrMax = StdI->
NCell * (n_u + n_j + 1);
408 if (strcmp(StdI->
model,
"spin") == 0) {
409 Uspin = (
double *)malloc(
sizeof(
double) * StdI->
NsiteUC);
410 for (it = 0; it < n_u; it++)
411 if (u_indx[it][0] == 0 && u_indx[it][1] == 0 && u_indx[it][2] == 0
412 && u_indx[it][3] == u_indx[it][4])
413 Uspin[u_indx[it][3]] = creal(W90_u[it]);
418 for (kCell = 0; kCell < StdI->
NCell; kCell++){
420 iW = StdI->
Cell[kCell][0];
421 iL = StdI->
Cell[kCell][1];
422 iH = StdI->
Cell[kCell][2];
426 if (strcmp(StdI->
model,
"spin") == 0) {
427 for (isite = StdI->
NsiteUC*kCell; isite < StdI->
NsiteUC*(kCell + 1); isite++) {
432 for (isite = StdI->
NsiteUC*kCell; isite < StdI->
NsiteUC*(kCell + 1); isite++) {
439 for (it = 0; it < n_t; it++) {
443 if (t_indx[it][0] == 0 && t_indx[it][1] == 0 && t_indx[it][2] == 0
444 && t_indx[it][3] == t_indx[it][4])
446 if (strcmp(StdI->
model,
"hubbard") == 0) {
447 isite = StdI->
NsiteUC*kCell + t_indx[it][3];
448 for (ispin = 0; ispin < 2; ispin++) {
463 t_indx[it][0], t_indx[it][1], t_indx[it][2],
464 t_indx[it][3], t_indx[it][4], &isite, &jsite, &Cphase, dR);
465 if (strcmp(StdI->
model,
"spin") == 0) {
466 for (ii = 0; ii < 3; ii++)
467 Jtmp[ii][ii] = 2.0 * W90_t[it] * conj(W90_t[it])
468 * (1.0 / Uspin[t_indx[it][3]] + 1.0 / Uspin[t_indx[it][4]]);
479 for (it = 0; it < n_u; it++) {
483 if (u_indx[it][0] == 0 && u_indx[it][1] == 0 && u_indx[it][2] == 0
484 && u_indx[it][3] == u_indx[it][4])
495 u_indx[it][0], u_indx[it][1], u_indx[it][2],
496 u_indx[it][3], u_indx[it][4], &isite, &jsite, &Cphase, dR);
503 for (it = 0; it < n_j; it++) {
507 if (j_indx[it][0] != 0 || j_indx[it][1] != 0 || j_indx[it][2] != 0
508 || j_indx[it][3] != j_indx[it][4])
511 j_indx[it][0], j_indx[it][1], j_indx[it][2],
512 j_indx[it][3], j_indx[it][4], &isite, &jsite, &Cphase, dR);
514 StdI->
Hund[StdI->
NHund] = creal(W90_j[it]);
519 if (strcmp(StdI->
model,
"hubbard") == 0) {
520 StdI->
Ex[StdI->
NEx] = creal(W90_j[it]);
532 StdI->
Ex[StdI->
NEx] = creal(W90_j[it]);
534 StdI->
Ex[StdI->
NEx] = -creal(W90_j[it]);
548 for (it = 0; it < n_t; it++) free(t_indx[it]);
551 for (it = 0; it < n_u; it++) free(u_indx[it]);
554 for (it = 0; it < n_j; it++) free(j_indx[it]);
557 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.
static int read_W90_query(struct StdIntList *StdI, char *filename, double cutoff)
Read Wannier90 hamiltonian file (*_hr) and compute the number of effective term.
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 ...
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 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.
static void read_W90(struct StdIntList *StdI, char *filename, double cutoff, double complex *Mat, int **Matindx)
Read Wannier90 hamiltonian file (*_hr)
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).
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...
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.