21 #include "StdFace_vals.hpp" 25 #include "StdFace_ModelUtil.hpp" 34 struct StdIntList *StdI
38 int isite, jsite, ntransMax, nintrMax;
40 std::complex<double> Cphase;
46 fp = fopen(
"lattice.gp",
"w");
50 fprintf(stdout,
" @ Lattice Size & Shape\n\n");
62 StdI->phase[1] = StdI->phase[0];
69 StdI->tau[0][0] = 0.0; StdI->tau[0][1] = 0.0; StdI->tau[0][2] = 0.0;
73 fprintf(stdout,
"\n @ Hamiltonian \n\n");
90 if (strcmp(StdI->model,
"spin") == 0 ) {
121 if (strcmp(StdI->model,
"hubbard") == 0 ) {
125 else if (strcmp(StdI->model,
"kondo") == 0 ) {
130 fprintf(stdout,
"\n @ Numerical conditions\n\n");
135 StdI->nsite = StdI->L;
136 if (strcmp(StdI->model,
"kondo") == 0 ) StdI->nsite *= 2;
137 StdI->locspinflag = (
int *)malloc(
sizeof(
int) * StdI->nsite);
139 if (strcmp(StdI->model,
"spin") == 0 )
140 for (isite = 0; isite < StdI->nsite; isite++)StdI->locspinflag[isite] = StdI->S2;
141 else if (strcmp(StdI->model,
"hubbard") == 0 )
142 for (isite = 0; isite < StdI->nsite; isite++)StdI->locspinflag[isite] = 0;
143 else if (strcmp(StdI->model,
"kondo") == 0 )
144 for (isite = 0; isite < StdI->nsite / 2; isite++) {
145 StdI->locspinflag[isite] = StdI->S2;
146 StdI->locspinflag[isite + StdI->nsite / 2] = 0;
151 if (strcmp(StdI->model,
"spin") == 0 ) {
152 ntransMax = StdI->L * (StdI->S2 + 1 + 2 * StdI->S2);
153 nintrMax = StdI->L * (StdI->NsiteUC + 1 + 1 + 1)
154 * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
157 ntransMax = StdI->L * 2 * (2 * StdI->NsiteUC + 2 + 2 + 2);
158 nintrMax = StdI->L * (StdI->NsiteUC + 4 * (1 + 1 + 1));
160 if (strcmp(StdI->model,
"kondo") == 0) {
161 ntransMax += StdI->L * (StdI->S2 + 1 + 2 * StdI->S2);
162 nintrMax += StdI->nsite / 2 * (3 * 1 + 1) * (3 * StdI->S2 + 1);
170 for (iL = 0; iL < StdI->L; iL++){
173 if (strcmp(StdI->model,
"kondo") == 0 ) isite += StdI->L;
177 if (strcmp(StdI->model,
"spin") == 0 ) {
183 if (strcmp(StdI->model,
"kondo") == 0 ) {
192 StdFace_SetLabel(StdI, fp, 0, iL, 0, 1, 0, 0, &isite, &jsite, 1, &Cphase, dR);
194 if (strcmp(StdI->model,
"spin") == 0 ) {
204 StdFace_SetLabel(StdI, fp, 0, iL, 0, 2, 0, 0, &isite, &jsite, 2, &Cphase, dR);
206 if (strcmp(StdI->model,
"spin") == 0 ) {
216 StdFace_SetLabel(StdI, fp, 0, iL, 0, 3, 0, 0, &isite, &jsite, 3, &Cphase, dR);
218 if (strcmp(StdI->model,
"spin") == 0) {
227 fprintf(fp,
"plot \'-\' w d lc 7\n0.0 0.0\nend\npause -1\n");
247 fp = fopen(
"boost.def",
"w");
248 fprintf(fp,
"# Magnetic field\n");
249 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
250 -0.5 * StdI->Gamma, 0.0, -0.5 *StdI->h);
254 fprintf(fp,
"%d # Number of type of J\n", 2);
255 fprintf(fp,
"# J 1\n");
256 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
257 0.25 * StdI->J0[0][0], 0.25 * StdI->J0[0][1], 0.25 * StdI->J0[0][2]);
258 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
259 0.25 * StdI->J0[1][0], 0.25 * StdI->J0[1][1], 0.25 * StdI->J0[1][2]);
260 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
261 0.25 * StdI->J0[2][0], 0.25 * StdI->J0[2][1], 0.25 * StdI->J0[2][2]);
262 fprintf(fp,
"# J 2\n");
263 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
264 0.25 * StdI->Jp[0][0], 0.25 * StdI->Jp[0][1], 0.25 * StdI->Jp[0][2]);
265 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
266 0.25 * StdI->Jp[1][0], 0.25 * StdI->Jp[1][1], 0.25 * StdI->Jp[1][2]);
267 fprintf(fp,
"%25.15e %25.15e %25.15e\n",
268 0.25 * StdI->Jp[2][0], 0.25 * StdI->Jp[2][1], 0.25 * StdI->Jp[2][2]);
273 fprintf(stdout,
"\n ERROR! S2 must be 1 in Boost. \n\n");
276 StdI->ishift_nspin = 4;
277 if(StdI->L % 8 != 0){
278 fprintf(stdout,
"\n ERROR! L %% 8 != 0 \n\n");
281 StdI->W = StdI->L / 2;
283 StdI->num_pivot = StdI->W / 4;
285 fprintf(fp,
"# W0 R0 StdI->num_pivot StdI->ishift_nspin\n");
286 fprintf(fp,
"%d %d %d %d\n", StdI->W, StdI->L, StdI->num_pivot, StdI->ishift_nspin);
288 StdI->list_6spin_star = (
int **)malloc(
sizeof(
int*) * StdI->num_pivot);
289 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
290 StdI->list_6spin_star[ipivot] = (
int *)malloc(
sizeof(
int) * 7);
293 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
294 StdI->list_6spin_star[ipivot][0] = 8;
295 StdI->list_6spin_star[ipivot][1] = 1;
296 StdI->list_6spin_star[ipivot][2] = 1;
297 StdI->list_6spin_star[ipivot][3] = 1;
298 StdI->list_6spin_star[ipivot][4] = 1;
299 StdI->list_6spin_star[ipivot][5] = 1;
300 StdI->list_6spin_star[ipivot][6] = 1;
303 fprintf(fp,
"# StdI->list_6spin_star\n");
304 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
305 fprintf(fp,
"# pivot %d\n", ipivot);
306 for (isite = 0; isite < 7; isite++) {
307 fprintf(fp,
"%d ", StdI->list_6spin_star[ipivot][isite]);
312 StdI->list_6spin_pair = (
int ***)malloc(
sizeof(
int**) * StdI->num_pivot);
313 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
314 StdI->list_6spin_pair[ipivot] = (
int **)malloc(
sizeof(
int*) * 7);
315 for (isite = 0; isite < 7; isite++) {
316 StdI->list_6spin_pair[ipivot][isite] = (
int *)malloc(
sizeof(
int) * StdI->list_6spin_star[ipivot][0]);
320 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
321 StdI->list_6spin_pair[ipivot][0][0] = 0;
322 StdI->list_6spin_pair[ipivot][1][0] = 1;
323 StdI->list_6spin_pair[ipivot][2][0] = 2;
324 StdI->list_6spin_pair[ipivot][3][0] = 3;
325 StdI->list_6spin_pair[ipivot][4][0] = 4;
326 StdI->list_6spin_pair[ipivot][5][0] = 5;
327 StdI->list_6spin_pair[ipivot][6][0] = 1;
328 StdI->list_6spin_pair[ipivot][0][1] = 1;
329 StdI->list_6spin_pair[ipivot][1][1] = 2;
330 StdI->list_6spin_pair[ipivot][2][1] = 0;
331 StdI->list_6spin_pair[ipivot][3][1] = 3;
332 StdI->list_6spin_pair[ipivot][4][1] = 4;
333 StdI->list_6spin_pair[ipivot][5][1] = 5;
334 StdI->list_6spin_pair[ipivot][6][1] = 1;
335 StdI->list_6spin_pair[ipivot][0][2] = 2;
336 StdI->list_6spin_pair[ipivot][1][2] = 3;
337 StdI->list_6spin_pair[ipivot][2][2] = 0;
338 StdI->list_6spin_pair[ipivot][3][2] = 1;
339 StdI->list_6spin_pair[ipivot][4][2] = 4;
340 StdI->list_6spin_pair[ipivot][5][2] = 5;
341 StdI->list_6spin_pair[ipivot][6][2] = 1;
342 StdI->list_6spin_pair[ipivot][0][3] = 3;
343 StdI->list_6spin_pair[ipivot][1][3] = 4;
344 StdI->list_6spin_pair[ipivot][2][3] = 0;
345 StdI->list_6spin_pair[ipivot][3][3] = 1;
346 StdI->list_6spin_pair[ipivot][4][3] = 2;
347 StdI->list_6spin_pair[ipivot][5][3] = 5;
348 StdI->list_6spin_pair[ipivot][6][3] = 1;
349 StdI->list_6spin_pair[ipivot][0][4] = 0;
350 StdI->list_6spin_pair[ipivot][1][4] = 2;
351 StdI->list_6spin_pair[ipivot][2][4] = 1;
352 StdI->list_6spin_pair[ipivot][3][4] = 3;
353 StdI->list_6spin_pair[ipivot][4][4] = 4;
354 StdI->list_6spin_pair[ipivot][5][4] = 5;
355 StdI->list_6spin_pair[ipivot][6][4] = 2;
356 StdI->list_6spin_pair[ipivot][0][5] = 1;
357 StdI->list_6spin_pair[ipivot][1][5] = 3;
358 StdI->list_6spin_pair[ipivot][2][5] = 0;
359 StdI->list_6spin_pair[ipivot][3][5] = 2;
360 StdI->list_6spin_pair[ipivot][4][5] = 4;
361 StdI->list_6spin_pair[ipivot][5][5] = 5;
362 StdI->list_6spin_pair[ipivot][6][5] = 2;
363 StdI->list_6spin_pair[ipivot][0][6] = 2;
364 StdI->list_6spin_pair[ipivot][1][6] = 4;
365 StdI->list_6spin_pair[ipivot][2][6] = 0;
366 StdI->list_6spin_pair[ipivot][3][6] = 1;
367 StdI->list_6spin_pair[ipivot][4][6] = 3;
368 StdI->list_6spin_pair[ipivot][5][6] = 5;
369 StdI->list_6spin_pair[ipivot][6][6] = 2;
370 StdI->list_6spin_pair[ipivot][0][7] = 3;
371 StdI->list_6spin_pair[ipivot][1][7] = 5;
372 StdI->list_6spin_pair[ipivot][2][7] = 0;
373 StdI->list_6spin_pair[ipivot][3][7] = 1;
374 StdI->list_6spin_pair[ipivot][4][7] = 2;
375 StdI->list_6spin_pair[ipivot][5][7] = 4;
376 StdI->list_6spin_pair[ipivot][6][7] = 2;
379 fprintf(fp,
"# StdI->list_6spin_pair\n");
380 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
381 fprintf(fp,
"# pivot %d\n", ipivot);
382 for (kintr = 0; kintr < StdI->list_6spin_star[ipivot][0]; kintr++) {
383 for (isite = 0; isite < 7; isite++) {
384 fprintf(fp,
"%d ", StdI->list_6spin_pair[ipivot][isite][kintr]);
391 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
392 free(StdI->list_6spin_star[ipivot]);
394 free(StdI->list_6spin_star);
396 for (ipivot = 0; ipivot < StdI->num_pivot; ipivot++) {
397 for (isite = 0; isite < 7; isite++) {
398 free(StdI->list_6spin_pair[ipivot][isite]);
400 free(StdI->list_6spin_pair[ipivot]);
402 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_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_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_Chain(struct StdIntList *StdI)
Setup a Hamiltonian for the Hubbard model on a Chain lattice.
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_Chain_Boost(struct StdIntList *StdI)
Setup a Hamiltonian for the generalized Heisenberg model on a Chain lattice.
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).