Setup a Hamiltonian for the generalized Heisenberg model on a square lattice.
(3) Set local spin flag (StdIntList::locspinflag) and the number of sites (StdIntList::nsite)
(4) Compute the upper limit of the number of Transfer & Interaction and malloc them.
38 int isite, jsite, ntransMax, nintrMax;
40 std::complex<double> Cphase;
46 fp = fopen(
"lattice.gp",
"w");
48 fprintf(stdout,
" @ Lattice Size & Shape\n\n");
67 StdI->phase[1] = StdI->phase[0];
70 StdI->NsiteUC = StdI->W;
72 StdI->direct[0][0] = (double)StdI->NsiteUC;
74 for (isite = 0; isite < StdI->NsiteUC; isite++){
75 StdI->tau[isite][0] = (double)isite / (
double)StdI->NsiteUC;
76 StdI->tau[isite][1] = 0.0; StdI->tau[isite][2] = 0.0;
81 fprintf(stdout,
"\n @ Hamiltonian \n\n");
92 if (strcmp(StdI->model,
"spin") == 0 ) {
135 if (strcmp(StdI->model,
"hubbard") == 0 ) {
144 fprintf(stdout,
"\n @ Numerical conditions\n\n");
149 StdI->nsite = StdI->L * StdI->NsiteUC;
150 if (strcmp(StdI->model,
"kondo") == 0 ) StdI->nsite *= 2;
151 StdI->locspinflag = (
int *)malloc(
sizeof(
int) * StdI->nsite);
153 if (strcmp(StdI->model,
"spin") == 0 )
154 for (isite = 0; isite < StdI->nsite; isite++)StdI->locspinflag[isite] = StdI->S2;
155 else if (strcmp(StdI->model,
"hubbard") == 0 )
156 for (isite = 0; isite < StdI->nsite; isite++)StdI->locspinflag[isite] = 0;
157 else if (strcmp(StdI->model,
"kondo") == 0 )
158 for (isite = 0; isite < StdI->nsite / 2; isite++) {
159 StdI->locspinflag[isite] = StdI->S2;
160 StdI->locspinflag[isite + StdI->nsite / 2] = 0;
165 if (strcmp(StdI->model,
"spin") == 0 ) {
166 ntransMax = StdI->L * StdI->NsiteUC * (StdI->S2 + 1 + 2 * StdI->S2);
167 nintrMax = StdI->L * StdI->NsiteUC * (1 + 1 + 1)
168 * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1)
169 + StdI->L * (StdI->NsiteUC - 1) * (1 + 1 + 1)
170 * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
173 ntransMax = StdI->L*StdI->NsiteUC * (2 + 2 + 2)
174 + StdI->L*(StdI->NsiteUC - 1) * (2 + 2 + 2);
175 nintrMax = StdI->L*StdI->NsiteUC * 1
176 + StdI->L*StdI->NsiteUC * 4 * (1 + 1)
177 + StdI->L*(StdI->NsiteUC - 1) * 4 * (1 + 1 + 1);
179 if (strcmp(StdI->model,
"kondo") == 0) {
180 ntransMax += StdI->L * StdI->NsiteUC * (StdI->S2 + 1 + 2 * StdI->S2);
181 nintrMax += StdI->nsite / 2 * (3 * 1 + 1) * (3 * StdI->S2 + 1);
189 for (iL = 0; iL < StdI->L; iL++) {
190 for (isiteUC = 0; isiteUC < StdI->NsiteUC; isiteUC++) {
192 isite = isiteUC + iL * StdI->NsiteUC;
193 if (strcmp(StdI->model,
"kondo") == 0 ) isite += StdI->L * StdI->NsiteUC;
197 if (strcmp(StdI->model,
"spin") == 0 ) {
203 if (strcmp(StdI->model,
"kondo") == 0 ) {
204 jsite = isiteUC + iL * StdI->NsiteUC;
212 StdFace_SetLabel(StdI, fp, 0, iL, 0, 1, isiteUC, isiteUC, &isite, &jsite, 1, &Cphase, dR);
214 if (strcmp(StdI->model,
"spin") == 0 ) {
224 StdFace_SetLabel(StdI, fp, 0, iL, 0, 2, isiteUC, isiteUC, &isite, &jsite, 2, &Cphase, dR);
226 if (strcmp(StdI->model,
"spin") == 0 ) {
236 if (isiteUC < StdI->NsiteUC - 1) {
240 StdFace_SetLabel(StdI, fp, 0, iL, 0, 0, isiteUC, isiteUC + 1, &isite, &jsite, 1, &Cphase, dR);
242 if (strcmp(StdI->model,
"spin") == 0 ) {
252 StdFace_SetLabel(StdI, fp, 0, iL, 0, 1, isiteUC, isiteUC + 1, &isite, &jsite, 1, &Cphase, dR);
254 if (strcmp(StdI->model,
"spin") == 0 ) {
264 StdFace_SetLabel(StdI, fp, 0, iL, 0, -1, isiteUC, isiteUC + 1, &isite, &jsite, 1, &Cphase, dR);
266 if (strcmp(StdI->model,
"spin") == 0 ) {
279 fprintf(fp,
"plot \'-\' w d lc 7\n0.0 0.0\nend\npause -1\n");
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_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_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_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_InitSite(struct StdIntList *StdI, FILE *fp, int dim)
Initialize the super-cell where simulation is performed.
void StdFace_NotUsed_d(const char *valname, double val)
Stop HPhi if a variable (real) not used is specified in the input file (!=NaN).