HPhi++  3.1.0
TriangularLattice.cpp File Reference

Standard mode for the triangular lattice. More...

#include "StdFace_vals.hpp"
#include "StdFace_ModelUtil.hpp"
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <complex>
#include <cstring>

Go to the source code of this file.

Functions

void StdFace_Triangular (struct StdIntList *StdI)
 Setup a Hamiltonian for the Triangular lattice. More...
 

Detailed Description

Standard mode for the triangular lattice.

Definition in file TriangularLattice.cpp.

Function Documentation

◆ StdFace_Triangular()

void StdFace_Triangular ( struct StdIntList *  StdI)

Setup a Hamiltonian for the Triangular lattice.

Author
Mitsuaki Kawamura (The University of Tokyo)

(1) Compute the shape of the super-cell and sites in the super-cell

(2) check & store parameters of Hamiltonian

(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.

(5) Set Transfer & Interaction

Definition at line 33 of file TriangularLattice.cpp.

References StdFace_Coulomb(), StdFace_GeneralJ(), StdFace_Hopping(), StdFace_HubbardLocal(), StdFace_InitSite(), StdFace_InputCoulombV(), StdFace_InputHopp(), StdFace_InputSpin(), StdFace_InputSpinNN(), StdFace_MagField(), StdFace_MallocInteractions(), StdFace_NotUsed_c(), StdFace_NotUsed_d(), StdFace_NotUsed_i(), StdFace_NotUsed_J(), StdFace_PrintGeometry(), StdFace_PrintVal_d(), StdFace_PrintVal_i(), and StdFace_SetLabel().

Referenced by StdFace_main().

34 {
35  int isite, jsite, kCell, ntransMax, nintrMax;
36  int iL, iW;
37  FILE *fp;
38  std::complex<double> Cphase;
39  double dR[3];
40 
44  fp = fopen("lattice.gp", "w");
45 
46  StdI->NsiteUC = 1;
47  fprintf(stdout, " @ Lattice Size & Shape\n\n");
48 
49  StdFace_PrintVal_d("a", &StdI->a, 1.0);
50  StdFace_PrintVal_d("Wlength", &StdI->length[0], StdI->a);
51  StdFace_PrintVal_d("Llength", &StdI->length[1], StdI->a);
52  StdFace_PrintVal_d("Wx", &StdI->direct[0][0], StdI->length[0]);
53  StdFace_PrintVal_d("Wy", &StdI->direct[0][1], 0.0);
54  StdFace_PrintVal_d("Lx", &StdI->direct[1][0], StdI->length[1] * 0.5);
55  StdFace_PrintVal_d("Ly", &StdI->direct[1][1], StdI->length[1] * 0.5 * sqrt(3.0));
56 
57  StdFace_PrintVal_d("phase0", &StdI->phase[0], 0.0);
58  StdFace_PrintVal_d("phase1", &StdI->phase[1], 0.0);
59 
60  StdFace_InitSite(StdI, fp, 2);
61  StdI->tau[0][0] = 0.0; StdI->tau[0][1] = 0.0; StdI->tau[0][2] = 0.0;
65  fprintf(stdout, "\n @ Hamiltonian \n\n");
66  StdFace_NotUsed_d("K", StdI->K);
67  StdFace_PrintVal_d("h", &StdI->h, 0.0);
68  StdFace_PrintVal_d("Gamma", &StdI->Gamma, 0.0);
69 
70  if (strcmp(StdI->model, "spin") == 0 ) {
71  StdFace_PrintVal_i("2S", &StdI->S2, 1);
72  StdFace_PrintVal_d("D", &StdI->D[2][2], 0.0);
73  StdFace_InputSpinNN(StdI->J, StdI->JAll, StdI->J0, StdI->J0All, "J0");
74  StdFace_InputSpinNN(StdI->J, StdI->JAll, StdI->J1, StdI->J1All, "J1");
75  StdFace_InputSpinNN(StdI->J, StdI->JAll, StdI->J2, StdI->J2All, "J2");
76  StdFace_InputSpinNN(StdI->Jp, StdI->JpAll, StdI->J0p, StdI->J0pAll, "J0'");
77  StdFace_InputSpinNN(StdI->Jp, StdI->JpAll, StdI->J1p, StdI->J1pAll, "J1'");
78  StdFace_InputSpinNN(StdI->Jp, StdI->JpAll, StdI->J2p, StdI->J2pAll, "J2'");
79  StdFace_InputSpinNN(StdI->Jpp, StdI->JppAll, StdI->J0pp, StdI->J0ppAll, "J0'");
80  StdFace_InputSpinNN(StdI->Jpp, StdI->JppAll, StdI->J1pp, StdI->J1ppAll, "J1'");
81  StdFace_InputSpinNN(StdI->Jpp, StdI->JppAll, StdI->J2pp, StdI->J2ppAll, "J2'");
82 
83  StdFace_NotUsed_d("mu", StdI->mu);
84  StdFace_NotUsed_d("U", StdI->U);
85  StdFace_NotUsed_c("t", StdI->t);
86  StdFace_NotUsed_c("t0", StdI->t0);
87  StdFace_NotUsed_c("t1", StdI->t1);
88  StdFace_NotUsed_c("t2", StdI->t2);
89  StdFace_NotUsed_c("t'", StdI->tp);
90  StdFace_NotUsed_c("t0'", StdI->t0p);
91  StdFace_NotUsed_c("t1'", StdI->t1p);
92  StdFace_NotUsed_c("t2'", StdI->t2p);
93  StdFace_NotUsed_c("t''", StdI->tp);
94  StdFace_NotUsed_c("t0''", StdI->t0pp);
95  StdFace_NotUsed_c("t1''", StdI->t1pp);
96  StdFace_NotUsed_c("t2''", StdI->t2pp);
97  StdFace_NotUsed_d("V", StdI->V);
98  StdFace_NotUsed_d("V0", StdI->V0);
99  StdFace_NotUsed_d("V1", StdI->V1);
100  StdFace_NotUsed_d("V2", StdI->V2);
101  StdFace_NotUsed_d("V'", StdI->Vp);
102  StdFace_NotUsed_d("V0'", StdI->V0p);
103  StdFace_NotUsed_d("V1'", StdI->V1p);
104  StdFace_NotUsed_d("V2'", StdI->V2p);
105  StdFace_NotUsed_d("V''", StdI->Vpp);
106  StdFace_NotUsed_d("V0''", StdI->V0pp);
107  StdFace_NotUsed_d("V1''", StdI->V1pp);
108  StdFace_NotUsed_d("V2''", StdI->V2pp);
109  }/*if (strcmp(StdI->model, "spin") == 0 )*/
110  else {
111  StdFace_PrintVal_d("mu", &StdI->mu, 0.0);
112  StdFace_PrintVal_d("U", &StdI->U, 0.0);
113  StdFace_InputHopp(StdI->t, &StdI->t0, "t0");
114  StdFace_InputHopp(StdI->t, &StdI->t1, "t1");
115  StdFace_InputHopp(StdI->t, &StdI->t2, "t2");
116  StdFace_InputHopp(StdI->tp, &StdI->t0p, "t0'");
117  StdFace_InputHopp(StdI->tp, &StdI->t1p, "t1'");
118  StdFace_InputHopp(StdI->tp, &StdI->t2p, "t2'");
119  StdFace_InputHopp(StdI->tpp, &StdI->t0pp, "t0''");
120  StdFace_InputHopp(StdI->tpp, &StdI->t1pp, "t1''");
121  StdFace_InputHopp(StdI->tpp, &StdI->t2pp, "t2''");
122  StdFace_InputCoulombV(StdI->V, &StdI->V0, "V0");
123  StdFace_InputCoulombV(StdI->V, &StdI->V1, "V1");
124  StdFace_InputCoulombV(StdI->V, &StdI->V2, "V2");
125  StdFace_InputCoulombV(StdI->Vp, &StdI->V0p, "V0'");
126  StdFace_InputCoulombV(StdI->Vp, &StdI->V1p, "V1'");
127  StdFace_InputCoulombV(StdI->Vp, &StdI->V2p, "V2'");
128  StdFace_InputCoulombV(StdI->Vpp, &StdI->V0pp, "V0''");
129  StdFace_InputCoulombV(StdI->Vpp, &StdI->V1pp, "V1''");
130  StdFace_InputCoulombV(StdI->Vpp, &StdI->V2pp, "V2''");
131 
132  StdFace_NotUsed_J("J0", StdI->J0All, StdI->J0);
133  StdFace_NotUsed_J("J1", StdI->J1All, StdI->J1);
134  StdFace_NotUsed_J("J2", StdI->J2All, StdI->J2);
135  StdFace_NotUsed_J("J0'", StdI->J0pAll, StdI->J0p);
136  StdFace_NotUsed_J("J1'", StdI->J1pAll, StdI->J1p);
137  StdFace_NotUsed_J("J2'", StdI->J2pAll, StdI->J2p);
138  StdFace_NotUsed_J("J0''", StdI->J0ppAll, StdI->J0pp);
139  StdFace_NotUsed_J("J1''", StdI->J1ppAll, StdI->J1pp);
140  StdFace_NotUsed_J("J2''", StdI->J2ppAll, StdI->J2pp);
141  StdFace_NotUsed_d("D", StdI->D[2][2]);
142 
143  if (strcmp(StdI->model, "hubbard") == 0 ) {
144  StdFace_NotUsed_i("2S", StdI->S2);
145  StdFace_NotUsed_J("J", StdI->JAll, StdI->J);
146  }/*if (strcmp(StdI->model, "hubbard") == 0 )*/
147  else {
148  StdFace_PrintVal_i("2S", &StdI->S2, 1);
149  StdFace_InputSpin(StdI->J, StdI->JAll, "J");
150  }/*if (model != "hubbard")*/
151 
152  }/*if (model != "spin")*/
153  fprintf(stdout, "\n @ Numerical conditions\n\n");
158  StdI->nsite = StdI->NsiteUC * StdI->NCell;
159  if (strcmp(StdI->model, "kondo") == 0 ) StdI->nsite *= 2;
160  StdI->locspinflag = (int *)malloc(sizeof(int) * StdI->nsite);
161 
162  if (strcmp(StdI->model, "spin") == 0 )
163  for (isite = 0; isite < StdI->nsite; isite++) StdI->locspinflag[isite] = StdI->S2;
164  else if (strcmp(StdI->model, "hubbard") == 0 )
165  for (isite = 0; isite < StdI->nsite; isite++) StdI->locspinflag[isite] = 0;
166  else
167  for (iL = 0; iL < StdI->nsite / 2; iL++) {
168  StdI->locspinflag[iL] = StdI->S2;
169  StdI->locspinflag[iL + StdI->nsite / 2] = 0;
170  }
174  if (strcmp(StdI->model, "spin") == 0 ) {
175  ntransMax = StdI->nsite * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
176  nintrMax = StdI->NCell * (StdI->NsiteUC/*D*/ + 3/*J*/ + 3/*J'*/ + 3/*J''*/)
177  * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
178  }
179  else {
180  ntransMax = StdI->NCell * 2/*spin*/ * (2 * StdI->NsiteUC/*mu+h+Gamma*/ + 6/*t*/ + 6/*t'*/ + 6/*t''*/);
181  nintrMax = StdI->NCell * (StdI->NsiteUC/*U*/ + 4 * (3/*V*/ + 3/*V'*/ + 3/*V''*/));
182 
183  if (strcmp(StdI->model, "kondo") == 0) {
184  ntransMax += StdI->nsite / 2 * (StdI->S2 + 1/*h*/ + 2 * StdI->S2/*Gamma*/);
185  nintrMax += StdI->nsite / 2 * (3 * StdI->S2 + 1) * (3 * StdI->S2 + 1);
186  }/*if (strcmp(StdI->model, "kondo") == 0)*/
187  }
188 
189  StdFace_MallocInteractions(StdI, ntransMax, nintrMax);
193  for (kCell = 0; kCell < StdI->NCell; kCell++) {
194 
195  iW = StdI->Cell[kCell][0];
196  iL = StdI->Cell[kCell][1];
197  /*
198  Local term
199  */
200  isite = kCell;
201  if (strcmp(StdI->model, "kondo") == 0 ) isite += StdI->NCell;
202 
203  if (strcmp(StdI->model, "spin") == 0 ) {
204  StdFace_MagField(StdI, StdI->S2, -StdI->h, -StdI->Gamma, isite);
205  StdFace_GeneralJ(StdI, StdI->D, StdI->S2, StdI->S2, isite, isite);
206  }/*if (strcmp(StdI->model, "spin") == 0 )*/
207  else {
208  StdFace_HubbardLocal(StdI, StdI->mu, -StdI->h, -StdI->Gamma, StdI->U, isite);
209  if (strcmp(StdI->model, "kondo") == 0 ) {
210  jsite = kCell;
211  StdFace_GeneralJ(StdI, StdI->J, 1, StdI->S2, isite, jsite);
212  StdFace_MagField(StdI, StdI->S2, -StdI->h, -StdI->Gamma, jsite);
213  }/*if (strcmp(StdI->model, "kondo") == 0 )*/
214  }
215  /*
216  Nearest neighbor along W
217  */
218  StdFace_SetLabel(StdI, fp, iW, iL, 1, 0, 0, 0, &isite, &jsite, 1, &Cphase, dR);
219 
220  if (strcmp(StdI->model, "spin") == 0 ) {
221  StdFace_GeneralJ(StdI, StdI->J0, StdI->S2, StdI->S2, isite, jsite);
222  }/*if (strcmp(StdI->model, "spin") == 0 )*/
223  else {
224  StdFace_Hopping(StdI, Cphase * StdI->t0, isite, jsite, dR);
225  StdFace_Coulomb(StdI, StdI->V0, isite, jsite);
226  }
227  /*
228  Nearest neighbor along L
229  */
230  StdFace_SetLabel(StdI, fp, iW, iL, 0, 1, 0, 0, &isite, &jsite, 1, &Cphase, dR);
231 
232  if (strcmp(StdI->model, "spin") == 0 ) {
233  StdFace_GeneralJ(StdI, StdI->J1, StdI->S2, StdI->S2, isite, jsite);
234  }
235  else {
236  StdFace_Hopping(StdI, Cphase * StdI->t1, isite, jsite, dR);
237  StdFace_Coulomb(StdI, StdI->V1, isite, jsite);
238  }
239  /*
240  Nearest neighbor along W - L
241  */
242  StdFace_SetLabel(StdI, fp, iW, iL, 1, - 1, 0, 0, &isite, &jsite, 1, &Cphase, dR);
243 
244  if (strcmp(StdI->model, "spin") == 0 ) {
245  StdFace_GeneralJ(StdI, StdI->J2, StdI->S2, StdI->S2, isite, jsite);
246  }
247  else {
248  StdFace_Hopping(StdI, Cphase * StdI->t2, isite, jsite, dR);
249  StdFace_Coulomb(StdI, StdI->V2, isite, jsite);
250  }
251  /*
252  Second nearest neighbor 2W - L
253  */
254  StdFace_SetLabel(StdI, fp, iW, iL, 2, - 1, 0, 0, &isite, &jsite, 2, &Cphase, dR);
255 
256  if (strcmp(StdI->model, "spin") == 0 ) {
257  StdFace_GeneralJ(StdI, StdI->J1p, StdI->S2, StdI->S2, isite, jsite);
258  }/*if (strcmp(StdI->model, "spin") == 0 )*/
259  else {
260  StdFace_Hopping(StdI, Cphase * StdI->t1p, isite, jsite, dR);
261  StdFace_Coulomb(StdI, StdI->V1p, isite, jsite);
262  }
263  /*
264  Second nearest neighbor W+L
265  */
266  StdFace_SetLabel(StdI, fp, iW, iL, 1, 1, 0, 0, &isite, &jsite, 2, &Cphase, dR);
267 
268  if (strcmp(StdI->model, "spin") == 0 ) {
269  StdFace_GeneralJ(StdI, StdI->J2p, StdI->S2, StdI->S2, isite, jsite);
270  }/*if (strcmp(StdI->model, "spin") == 0 )*/
271  else {
272  StdFace_Hopping(StdI, Cphase * StdI->t2p, isite, jsite, dR);
273  StdFace_Coulomb(StdI, StdI->V2p, isite, jsite);
274  }/*if (model != "spin")*/
275  /*
276  Second nearest neighbor -W+2L
277  */
278  StdFace_SetLabel(StdI, fp, iW, iL, - 1, 2, 0, 0, &isite, &jsite, 2, &Cphase, dR);
279 
280  if (strcmp(StdI->model, "spin") == 0 ) {
281  StdFace_GeneralJ(StdI, StdI->J0p, StdI->S2, StdI->S2, isite, jsite);
282  }/*if (strcmp(StdI->model, "spin") == 0 )*/
283  else {
284  StdFace_Hopping(StdI, Cphase * StdI->t0p, isite, jsite, dR);
285  StdFace_Coulomb(StdI, StdI->V0p, isite, jsite);
286  }/*if (model != "spin")*/
287  /*
288  Third neighbor along 2W
289  */
290  StdFace_SetLabel(StdI, fp, iW, iL, 2, 0, 0, 0, &isite, &jsite, 3, &Cphase, dR);
291 
292  if (strcmp(StdI->model, "spin") == 0) {
293  StdFace_GeneralJ(StdI, StdI->J0pp, StdI->S2, StdI->S2, isite, jsite);
294  }/*if (strcmp(StdI->model, "spin") == 0 )*/
295  else {
296  StdFace_Hopping(StdI, Cphase * StdI->t0pp, isite, jsite, dR);
297  StdFace_Coulomb(StdI, StdI->V0pp, isite, jsite);
298  }
299  /*
300  Third neighbor along 2L
301  */
302  StdFace_SetLabel(StdI, fp, iW, iL, 0, 2, 0, 0, &isite, &jsite, 3, &Cphase, dR);
303 
304  if (strcmp(StdI->model, "spin") == 0) {
305  StdFace_GeneralJ(StdI, StdI->J1pp, StdI->S2, StdI->S2, isite, jsite);
306  }
307  else {
308  StdFace_Hopping(StdI, Cphase * StdI->t1pp, isite, jsite, dR);
309  StdFace_Coulomb(StdI, StdI->V1pp, isite, jsite);
310  }
311  /*
312  Nearest neighbor along 2W - 2L
313  */
314  StdFace_SetLabel(StdI, fp, iW, iL, 2, -2, 0, 0, &isite, &jsite, 3, &Cphase, dR);
315 
316  if (strcmp(StdI->model, "spin") == 0) {
317  StdFace_GeneralJ(StdI, StdI->J2pp, StdI->S2, StdI->S2, isite, jsite);
318  }
319  else {
320  StdFace_Hopping(StdI, Cphase * StdI->t2pp, isite, jsite, dR);
321  StdFace_Coulomb(StdI, StdI->V2pp, isite, jsite);
322  }
323  }/*for (kCell = 0; kCell < StdI->NCell; kCell++)*/
324 
325  fprintf(fp, "plot \'-\' w d lc 7\n0.0 0.0\nend\npause -1\n");
326  fclose(fp);
327  StdFace_PrintGeometry(StdI);
328 }
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&#39; + 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_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_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).