HΦ  3.2.0
expec_cisajs.c
Go to the documentation of this file.
1 /* HPhi - Quantum Lattice Model Simulator */
2 /* Copyright (C) 2015 The University of Tokyo */
3 
4 /* This program is free software: you can redistribute it and/or modify */
5 /* it under the terms of the GNU General Public License as published by */
6 /* the Free Software Foundation, either version 3 of the License, or */
7 /* (at your option) any later version. */
8 
9 /* This program is distributed in the hope that it will be useful, */
10 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
11 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
12 /* GNU General Public License for more details. */
13 
14 /* You should have received a copy of the GNU General Public License */
15 /* along with this program. If not, see <http://www.gnu.org/licenses/>. */
16 
17 #include "mltplyCommon.h"
18 #include "mltply.h"
19 #include "FileIO.h"
20 #include "bitcalc.h"
21 #include "wrapperMPI.h"
22 #include "mltplyHubbard.h"
23 #include "mltplyHubbardCore.h"
24 #include "mltplySpinCore.h"
25 #include "mltplyMPIHubbard.h"
26 #include "mltplyMPISpinCore.h"
27 
41 int expec_cisajs_HubbardGC(struct BindStruct *X,double complex *vec, FILE **_fp);
42 int expec_cisajs_Hubbard(struct BindStruct *X,double complex *vec, FILE **_fp);
43 
44 int expec_cisajs_Spin(struct BindStruct *X,double complex *vec, FILE **_fp);
45 int expec_cisajs_SpinHalf(struct BindStruct *X,double complex *vec, FILE **_fp);
46 int expec_cisajs_SpinGeneral(struct BindStruct *X,double complex *vec, FILE **_fp);
47 
48 int expec_cisajs_SpinGC(struct BindStruct *X,double complex *vec, FILE **_fp);
49 int expec_cisajs_SpinGCHalf(struct BindStruct *X,double complex *vec, FILE **_fp);
50 int expec_cisajs_SpinGCGeneral(struct BindStruct *X,double complex *vec, FILE **_fp);
51 
52 
53 
69 int expec_cisajs(struct BindStruct *X,double complex *vec){
70 
71  FILE *fp;
72  char sdt[D_FileNameMax];
73 
74  long unsigned int irght,ilft,ihfbit;
75  long int i_max;
76  //For TPQ
77  int step=0;
78  int rand_i=0;
79 
80  if(X->Def.NCisAjt <1) return 0;
81 
82  i_max = X->Check.idim_max;
83  if(GetSplitBitByModel(X->Def.Nsite, X->Def.iCalcModel, &irght, &ilft, &ihfbit)!=0){
84  return -1;
85  }
86  X->Large.i_max = i_max;
87  X->Large.irght = irght;
88  X->Large.ilft = ilft;
89  X->Large.ihfbit = ihfbit;
90  X->Large.mode = M_CORR;
91 
92  switch(X->Def.iCalcType){
93  case Lanczos:
94  if(X->Def.St==0){
95  sprintf(sdt, cFileName1BGreen_Lanczos, X->Def.CDataFileHead);
98  }else if(X->Def.St==1){
99  sprintf(sdt, cFileName1BGreen_CG, X->Def.CDataFileHead);
101  fprintf(stdoutMPI, "%s", cLogCGExpecOneBodyGStart);
102  }
103  //vec=v0;
104  break;
105  case TPQCalc:
106  step=X->Def.istep;
107  rand_i=X->Def.irand;
109  sprintf(sdt, cFileName1BGreen_TPQ, X->Def.CDataFileHead, rand_i, step);
110  //vec=v0;
111  break;
112  case TimeEvolution:
113  step=X->Def.istep;
115  sprintf(sdt, cFileName1BGreen_TE, X->Def.CDataFileHead, step);
116  break;
117 
118  case FullDiag:
119  case CG:
121  //vec=v0;
122  break;
123  }
124 
125  if(childfopenMPI(sdt, "w", &fp)!=0){
126  return -1;
127  }
128  switch(X->Def.iCalcModel){
129  case HubbardGC:
130  if(expec_cisajs_HubbardGC(X, vec, &fp)!=0){
131  return -1;
132  }
133  break;
134 
135  case KondoGC:
136  case Hubbard:
137  case Kondo:
138  if(expec_cisajs_Hubbard(X, vec, &fp)!=0){
139  return -1;
140  }
141  break;
142 
143  case Spin: // for the Sz-conserved spin system
144  if(expec_cisajs_Spin(X, vec, &fp)!=0){
145  return -1;
146  }
147  break;
148 
149  case SpinGC:
150  if(expec_cisajs_SpinGC(X, vec, &fp)!=0){
151  return -1;
152  }
153  break;
154 
155  default:
156  return -1;
157  }
158 
159  fclose(fp);
160  if(X->Def.St==0){
161  if(X->Def.iCalcType==Lanczos){
163  fprintf(stdoutMPI, "%s", cLogLanczosExpecOneBodyGEnd);
165  }
166  else if(X->Def.iCalcType==TPQCalc){
168  }
169  else if(X->Def.iCalcType==TimeEvolution){
171  }
172  }else if(X->Def.St==1){
174  fprintf(stdoutMPI, "%s", cLogCGExpecOneBodyGEnd);
175  }
176  return 0;
177 }
178 
188 int expec_cisajs_HubbardGC(struct BindStruct *X, double complex *vec, FILE **_fp){
189  long unsigned int i,j;
190  long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
191  double complex dam_pr=0;
192  long int i_max;
193  long int ibit;
194  long unsigned int is;
195  double complex tmp_OneGreen=1.0;
196 
197  i_max = X->Check.idim_max;
198 
199  for(i=0;i<X->Def.NCisAjt;i++){
200  org_isite1 = X->Def.CisAjt[i][0]+1;
201  org_isite2 = X->Def.CisAjt[i][2]+1;
202  org_sigma1 = X->Def.CisAjt[i][1];
203  org_sigma2 = X->Def.CisAjt[i][3];
204  dam_pr=0;
205  if (org_isite1 > X->Def.Nsite &&
206  org_isite2 > X->Def.Nsite) {
207  if(org_isite1==org_isite2 && org_sigma1==org_sigma2){
208  if(org_sigma1==0){
209  is = X->Def.Tpow[2 * org_isite1 - 2];
210  }
211  else{
212  is = X->Def.Tpow[2 * org_isite1 - 1];
213  }
214  ibit = (unsigned long int)myrank & is;
215  if (ibit == is) {
216 #pragma omp parallel for default(none) reduction(+:dam_pr) shared(vec) \
217  firstprivate(i_max) private(j)
218  for (j = 1; j <= i_max; j++) dam_pr += vec[j]*conj(vec[j]);
219  }
220  }
221  else{
222  dam_pr =X_GC_child_general_hopp_MPIdouble(org_isite1-1, org_sigma1, org_isite2-1, org_sigma2, -tmp_OneGreen, X, vec, vec);
223  }
224  }
225  else if (org_isite2 > X->Def.Nsite || org_isite1 > X->Def.Nsite){
226  if(org_isite1<org_isite2){
227  dam_pr =X_GC_child_general_hopp_MPIsingle(org_isite1-1, org_sigma1, org_isite2-1, org_sigma2, -tmp_OneGreen, X, vec, vec);
228  }
229  else{
230  dam_pr =X_GC_child_general_hopp_MPIsingle(org_isite2-1, org_sigma2, org_isite1-1, org_sigma1, -tmp_OneGreen, X, vec, vec);
231  dam_pr = conj(dam_pr);
232  }
233  }
234  else{
235  if(child_general_hopp_GetInfo( X,org_isite1,org_isite2,org_sigma1,org_sigma2)!=0){
236  return -1;
237  }
238  dam_pr = GC_child_general_hopp(vec,vec,X,tmp_OneGreen);
239  }
240 
241  dam_pr= SumMPI_dc(dam_pr);
242  fprintf(*_fp," %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1,org_sigma1,org_isite2-1,org_sigma2,creal(dam_pr),cimag(dam_pr));
243  }
244 
245  return 0;
246 }
247 
257 int expec_cisajs_Hubbard(struct BindStruct *X, double complex *vec, FILE **_fp) {
258  long unsigned int i,j;
259  long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
260  double complex dam_pr=0;
261  long int i_max;
262  int num1;
263  long int ibit;
264  long unsigned int is;
265  double complex tmp_OneGreen=1.0;
266 
267  i_max = X->Check.idim_max;
268  for(i=0;i<X->Def.NCisAjt;i++){
269  org_isite1 = X->Def.CisAjt[i][0]+1;
270  org_isite2 = X->Def.CisAjt[i][2]+1;
271  org_sigma1 = X->Def.CisAjt[i][1];
272  org_sigma2 = X->Def.CisAjt[i][3];
273  dam_pr=0.0;
274 
275  if(X->Def.iFlgSzConserved ==TRUE){
276  if(org_sigma1 != org_sigma2){
277  dam_pr =0.0;
278  fprintf(*_fp," %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1,org_sigma1,org_isite2-1,org_sigma2,creal(dam_pr),cimag(dam_pr));
279  continue;
280  }
281  }
282 
283  if(X->Def.iCalcModel==Kondo || X->Def.iCalcModel==KondoGC) {
284  if( (X->Def.LocSpn[org_isite1 - 1] == 1 && X->Def.LocSpn[org_isite2 - 1] == 0) ||
285  (X->Def.LocSpn[org_isite1 - 1] == 0 && X->Def.LocSpn[org_isite2 - 1] == 1)
286  )
287  {
288  dam_pr =0.0;
289  fprintf(*_fp," %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1,org_sigma1,org_isite2-1,org_sigma2,creal(dam_pr),cimag(dam_pr));
290  continue;
291  }
292  }
293 
294  if (org_isite1 > X->Def.Nsite &&
295  org_isite2 > X->Def.Nsite) {
296  if(org_isite1==org_isite2 && org_sigma1==org_sigma2){//diagonal
297 
298  is = X->Def.Tpow[2 * org_isite1 - 2+org_sigma1];
299  ibit = (unsigned long int)myrank & is;
300  if (ibit == is) {
301 #pragma omp parallel for default(none) reduction(+:dam_pr) shared(vec) \
302  firstprivate(i_max) private(j)
303  for (j = 1; j <= i_max; j++) dam_pr += vec[j]*conj(vec[j]);
304  }
305 
306  }
307  else{
308  dam_pr =X_child_general_hopp_MPIdouble(org_isite1-1, org_sigma1, org_isite2-1, org_sigma2, -tmp_OneGreen, X, vec, vec);
309  }
310  }
311  else if (org_isite2 > X->Def.Nsite || org_isite1 > X->Def.Nsite){
312  if(org_isite1 < org_isite2){
313  dam_pr =X_child_general_hopp_MPIsingle(org_isite1-1, org_sigma1,org_isite2-1, org_sigma2, -tmp_OneGreen, X, vec, vec);
314  }
315  else{
316  dam_pr = X_child_general_hopp_MPIsingle(org_isite2-1, org_sigma2, org_isite1-1, org_sigma1, -tmp_OneGreen, X, vec, vec);
317  dam_pr = conj(dam_pr);
318  }
319  }
320  else{
321  if(child_general_hopp_GetInfo( X,org_isite1,org_isite2,org_sigma1,org_sigma2)!=0){
322  return -1;
323  }
324  if(org_isite1==org_isite2 && org_sigma1==org_sigma2){
325  //fprintf(stdoutMPI,"DEBUG1-3-1\n");
326  is = X->Def.Tpow[2 * org_isite1 - 2 + org_sigma1];
327 
328 #pragma omp parallel for default(none) shared(list_1, vec) reduction(+:dam_pr) firstprivate(i_max, is) private(num1, ibit)
329  for(j = 1;j <= i_max;j++){
330  ibit = list_1[j]&is;
331  num1 = ibit/is;
332  dam_pr += num1*conj(vec[j])*vec[j];
333  }
334  }
335  else{
336  dam_pr = child_general_hopp(vec,vec,X,tmp_OneGreen);
337  }
338  }
339  dam_pr= SumMPI_dc(dam_pr);
340  //fprintf(stdoutMPI, "rank=%d, dam_pr=%lf\n", myrank, creal(dam_pr));
341  fprintf(*_fp," %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1,org_sigma1,org_isite2-1,org_sigma2,creal(dam_pr),cimag(dam_pr));
342  }
343  return 0;
344 }
345 
355 int expec_cisajs_Spin(struct BindStruct *X, double complex *vec, FILE **_fp) {
356  int info=0;
357  if (X->Def.iFlgGeneralSpin == FALSE) {
358  info=expec_cisajs_SpinHalf(X,vec, _fp);
359  } else {
360  info=expec_cisajs_SpinGeneral(X,vec, _fp);
361  }
362  return info;
363 }
364 
374 int expec_cisajs_SpinHalf(struct BindStruct *X, double complex *vec, FILE **_fp) {
375  long unsigned int i,j;
376  long unsigned int isite1;
377  long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
378  double complex dam_pr=0;
379  long int i_max;
380  long int ibit1;
381  long unsigned int is1_up;
382 
383  i_max = X->Check.idim_max;
384 
385  for(i=0;i<X->Def.NCisAjt;i++){
386  org_isite1 = X->Def.CisAjt[i][0]+1;
387  org_isite2 = X->Def.CisAjt[i][2]+1;
388  org_sigma1 = X->Def.CisAjt[i][1];
389  org_sigma2 = X->Def.CisAjt[i][3];
390 
391  if(org_sigma1 == org_sigma2){
392  if(org_isite1==org_isite2){
393  if(org_isite1 > X->Def.Nsite){
394  is1_up = X->Def.Tpow[org_isite1 - 1];
395  ibit1 = X_SpinGC_CisAis((unsigned long int)myrank + 1, X, is1_up, org_sigma1);
396  dam_pr=0;
397  if(ibit1 !=0){
398 #pragma omp parallel for reduction(+:dam_pr)default(none) shared(vec) \
399  firstprivate(i_max) private(j)
400  for (j = 1; j <= i_max; j++) dam_pr += conj(vec[j])*vec[j];
401  }
402  }// org_isite1 > X->Def.Nsite
403  else{
404  isite1 = X->Def.Tpow[org_isite1-1];
405  dam_pr=0.0;
406 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j) firstprivate(i_max, isite1, org_sigma1, X) shared(vec)
407  for(j=1;j<=i_max;j++){
408  dam_pr+=X_Spin_CisAis(j,X, isite1,org_sigma1)*conj(vec[j])*vec[j];
409  }
410  }
411  }
412  else{
413  dam_pr=0.0;
414  }
415  }else{
416  // for the canonical case
417  dam_pr =0.0;
418  }
419  dam_pr = SumMPI_dc(dam_pr);
420  fprintf(*_fp," %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1, org_sigma1, org_isite2-1, org_sigma2, creal(dam_pr), cimag(dam_pr));
421  }
422  return 0;
423 }
424 
434 int expec_cisajs_SpinGeneral(struct BindStruct *X, double complex *vec, FILE **_fp) {
435  long unsigned int i,j;
436  long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
437  double complex dam_pr=0;
438  long int i_max;
439  int num1;
440  i_max = X->Check.idim_max;
441 
442  for(i=0;i<X->Def.NCisAjt;i++){
443  org_isite1 = X->Def.CisAjt[i][0]+1;
444  org_isite2 = X->Def.CisAjt[i][2]+1;
445  org_sigma1 = X->Def.CisAjt[i][1];
446  org_sigma2 = X->Def.CisAjt[i][3];
447 
448  if(org_isite1 == org_isite2){
449  if(org_isite1 >X->Def.Nsite){
450  if(org_sigma1==org_sigma2){
451  // longitudinal magnetic field
452  num1 = BitCheckGeneral((unsigned long int)myrank,
453  org_isite1, org_sigma1, X->Def.SiteToBit, X->Def.Tpow);
454  dam_pr=0.0;
455  if (num1 != 0) {
456 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j) firstprivate(i_max, org_isite1, org_sigma1, X) shared(vec)
457  for(j=1;j<=i_max;j++){
458  dam_pr+=conj(vec[j])*vec[j];
459  }
460  }
461  }else{
462  dam_pr=0.0;
463  }
464  }
465  else {//org_isite1 <= X->Def.Nsite
466  if(org_sigma1==org_sigma2){
467  // longitudinal magnetic field
468  dam_pr=0.0;
469 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, X) shared(vec, list_1)
470  for(j=1;j<=i_max;j++){
471  num1 = BitCheckGeneral(list_1[j], org_isite1, org_sigma1, X->Def.SiteToBit, X->Def.Tpow);
472  dam_pr+=conj(vec[j])*vec[j]*num1;
473  }
474  }else{
475  dam_pr=0.0;
476  }
477  }
478  }else{
479  // hopping is not allowed in localized spin system
480  dam_pr=0.0;
481  }//org_isite1 != org_isite2
482 
483  dam_pr = SumMPI_dc(dam_pr);
484  fprintf(*_fp," %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1, org_sigma1, org_isite2-1, org_sigma2,creal(dam_pr),cimag(dam_pr));
485  }
486 
487  return 0;
488 }
489 
499 int expec_cisajs_SpinGC(struct BindStruct *X, double complex *vec, FILE **_fp) {
500  int info=0;
501  if (X->Def.iFlgGeneralSpin == FALSE) {
502  info=expec_cisajs_SpinGCHalf(X,vec, _fp);
503  } else {
504  info=expec_cisajs_SpinGCGeneral(X,vec, _fp);
505  }
506  return info;
507 }
508 
518 int expec_cisajs_SpinGCHalf(struct BindStruct *X, double complex *vec, FILE **_fp) {
519  long unsigned int i,j;
520  long unsigned int isite1;
521  long unsigned int org_isite1,org_isite2,org_sigma1,org_sigma2;
522  double complex dam_pr=0;
523  long int i_max;
524  int tmp_sgn;
525  long unsigned int tmp_off=0;
526 
527  i_max = X->Check.idim_max;
528 
529  for(i=0;i<X->Def.NCisAjt;i++){
530  org_isite1 = X->Def.CisAjt[i][0]+1;
531  org_isite2 = X->Def.CisAjt[i][2]+1;
532  org_sigma1 = X->Def.CisAjt[i][1];
533  org_sigma2 = X->Def.CisAjt[i][3];
534  dam_pr=0.0;
535 
536  if(org_isite1 == org_isite2){
537  if(org_isite1 > X->Def.Nsite){
538  if(org_sigma1==org_sigma2){ // longitudinal magnetic field
539  dam_pr += X_GC_child_CisAis_spin_MPIdouble(org_isite1-1, org_sigma1, 1.0, X, vec, vec);
540  }
541  else{ // transverse magnetic field
542  dam_pr += X_GC_child_CisAit_spin_MPIdouble(org_isite1-1, org_sigma1, org_sigma2, 1.0, X, vec, vec);
543  }
544  }else{
545  isite1 = X->Def.Tpow[org_isite1-1];
546 
547  if(org_sigma1==org_sigma2){
548  // longitudinal magnetic field
549 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, tmp_sgn) firstprivate(i_max, isite1, org_sigma1, X) shared(vec)
550  for(j=1;j<=i_max;j++){
551  dam_pr += X_SpinGC_CisAis(j, X, isite1, org_sigma1)*conj(vec[j])*vec[j];
552  }
553  }else{
554  // transverse magnetic field
555 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, tmp_sgn, tmp_off) firstprivate(i_max, isite1, org_sigma2, X) shared(vec)
556  for(j=1;j<=i_max;j++){
557  tmp_sgn = X_SpinGC_CisAit(j,X, isite1,org_sigma2,&tmp_off);
558  if(tmp_sgn !=0){
559  dam_pr += tmp_sgn*conj(vec[tmp_off+1])*vec[j];
560  }
561  }
562  }
563  }
564  }else{
565  // hopping is not allowed in localized spin system
566  dam_pr=0.0;
567  }
568 
569  dam_pr = SumMPI_dc(dam_pr);
570  fprintf(*_fp," %4ld %4ld %4ld %4ld %.10lf %.10lf\n",org_isite1-1, org_sigma1, org_isite2-1, org_sigma2,creal(dam_pr),cimag(dam_pr));
571  }
572  return 0;
573 }
574 
584 int expec_cisajs_SpinGCGeneral(struct BindStruct *X, double complex *vec, FILE **_fp) {
585  long unsigned int i, j;
586  long unsigned int org_isite1, org_isite2, org_sigma1, org_sigma2;
587  double complex dam_pr = 0;
588  long int i_max;
589  long unsigned int tmp_off = 0;
590  int num1;
591 
592  i_max = X->Check.idim_max;
593 
594  for (i = 0; i < X->Def.NCisAjt; i++) {
595  org_isite1 = X->Def.CisAjt[i][0] + 1;
596  org_isite2 = X->Def.CisAjt[i][2] + 1;
597  org_sigma1 = X->Def.CisAjt[i][1];
598  org_sigma2 = X->Def.CisAjt[i][3];
599  if (org_isite1 == org_isite2) {
600  if (org_isite1 > X->Def.Nsite) {
601  if (org_sigma1 == org_sigma2) {
602 // longitudinal magnetic field
603  dam_pr = X_GC_child_CisAis_GeneralSpin_MPIdouble(org_isite1 - 1, org_sigma1, 1.0, X, vec, vec);
604  } else {
605 // transverse magnetic field
606  dam_pr = X_GC_child_CisAit_GeneralSpin_MPIdouble(org_isite1 - 1, org_sigma1, org_sigma2, 1.0, X,
607  vec, vec);
608  }
609  } else {//org_isite1 <= X->Def.Nsite
610  if (org_sigma1 == org_sigma2) {
611 // longitudinal magnetic field
612  dam_pr = 0.0;
613 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, X) shared(vec)
614  for (j = 1; j <= i_max; j++) {
615  num1 = BitCheckGeneral(j - 1, org_isite1, org_sigma1, X->Def.SiteToBit, X->Def.Tpow);
616  dam_pr += conj(vec[j]) * vec[j] * num1;
617  }
618  } else {
619 // transverse magnetic field
620  dam_pr = 0.0;
621 #pragma omp parallel for default(none) reduction(+:dam_pr) private(j, num1) firstprivate(i_max, org_isite1, org_sigma1, org_sigma2, X,tmp_off) shared(vec)
622  for (j = 1; j <= i_max; j++) {
623  num1 = GetOffCompGeneralSpin(j - 1, org_isite1, org_sigma2, org_sigma1, &tmp_off,
624  X->Def.SiteToBit, X->Def.Tpow);
625  if (num1 != 0) {
626  dam_pr += conj(vec[tmp_off + 1]) * vec[j] * num1;
627  }
628  }
629  }
630  }
631  } else {
632 // hopping is not allowed in localized spin system
633  dam_pr = 0.0;
634  }
635  dam_pr = SumMPI_dc(dam_pr);
636  fprintf(*_fp, " %4ld %4ld %4ld %4ld %.10lf %.10lf\n", org_isite1 - 1, org_sigma1, org_isite2 - 1, org_sigma2,
637  creal(dam_pr), cimag(dam_pr));
638  }
639  return 0;
640 }
const char * cFileName1BGreen_FullDiag
Definition: global.c:76
int irand
Input keyword TargetTPQRand ???
Definition: struct.h:79
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
int St
0 or 1, but it affects nothing.
Definition: struct.h:80
double complex X_GC_child_general_hopp_MPIdouble(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard + GC When both site1 and site2 are in the inter process region.
int iFlgSzConserved
Flag whether Sz is conserved.
Definition: struct.h:87
int expec_cisajs_Hubbard(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green&#39;s function for Hubbard model.
Definition: expec_cisajs.c:257
double complex X_GC_child_CisAis_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
double complex SumMPI_dc(double complex norm)
MPI wrapper function to obtain sum of Double complex across processes.
Definition: wrapperMPI.c:205
long unsigned int ihfbit
Used for Ogata-Lin ???
Definition: struct.h:345
unsigned long int idim_max
The dimension of the Hilbert space of this process.
Definition: struct.h:303
const char * cTPQExpecOneBodyGFinish
Definition: LogMessage.c:117
double complex X_GC_child_CisAis_spin_MPIdouble(int org_isite1, int org_ispin1, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Spin + GC When both site1 and site2 are in the inter process region.
const char * cTEExpecOneBodyGFinish
Definition: LogMessage.c:119
const char * cLogLanczosExpecOneBodyGEnd
Definition: LogMessage.c:111
double complex X_GC_child_CisAit_spin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Spin + GC When both site1 and site2 are in the inter process region.
int expec_cisajs_Spin(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green&#39;s function for Spin model.
Definition: expec_cisajs.c:355
#define D_FileNameMax
Definition: global.h:23
int X_SpinGC_CisAis(long unsigned int j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int sigma1)
Compute the grandcanonical spin state with bit mask is1_spin.
double complex ** vec
Definition: global.h:45
int expec_cisajs_HubbardGC(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green&#39;s function for Hubbard GC model.
Definition: expec_cisajs.c:188
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int * LocSpn
[DefineList::NLocSpn] Flag (and size) of the local spin. malloc in setmem_def().
Definition: struct.h:82
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.
Definition: FileIO.c:27
struct PhysList Phys
Physical quantities.
Definition: struct.h:413
int X_Spin_CisAis(long unsigned int j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int sigma1)
Compute the spin state with bit mask is1_spin.
const char * cTPQExpecOneBodyGStart
Definition: LogMessage.c:116
int mode
multiply or expectation value.
Definition: struct.h:330
#define TRUE
Definition: global.h:26
const char * cCGExpecOneBodyGStart
Definition: LogMessage.c:120
const char * cLanczosExpecOneBodyGFinish
Definition: LogMessage.c:114
double complex X_GC_child_CisAit_GeneralSpin_MPIdouble(int org_isite1, int org_ispin1, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Compute term in the grandcanonical general spin system when both site is in the inter process region...
double complex X_GC_child_general_hopp_MPIsingle(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard + GC When only site2 is in the inter process region.
const char * cFileName1BGreen_TE
Definition: global.c:62
const char * cFileName1BGreen_TPQ
Definition: global.c:60
int expec_cisajs_SpinHalf(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green&#39;s function for Half-Spin model.
Definition: expec_cisajs.c:374
int expec_cisajs_SpinGCHalf(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green&#39;s function for Half-SpinGC model.
Definition: expec_cisajs.c:518
double complex child_general_hopp(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, double complex trans)
Compute hopping (canonical)
const char * cTEExpecOneBodyGStart
Definition: LogMessage.c:118
Bind.
Definition: struct.h:409
unsigned int Nsite
Number of sites in the INTRA process region.
Definition: struct.h:56
const char * cFileName1BGreen_CG
Definition: global.c:44
const char * cLanczosExpecOneBodyGStart
Definition: LogMessage.c:115
int expec_cisajs(struct BindStruct *X, double complex *vec)
function of calculation for one body green&#39;s function
Definition: expec_cisajs.c:69
long unsigned int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.h:90
long unsigned int ilft
Used for Ogata-Lin ???
Definition: struct.h:344
const char * cLogLanczosExpecOneBodyGStart
Definition: LogMessage.c:109
int GetSplitBitByModel(const int Nsite, const int iCalcModel, long unsigned int *irght, long unsigned int *ilft, long unsigned int *ihfbit)
function of splitting original bit into right and left spaces.
Definition: bitcalc.c:78
double complex X_child_general_hopp_MPIsingle(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard (Kondo) + Canonical ensemble When only site2 is in the inter process region...
long int i_max
Length of eigenvector.
Definition: struct.h:317
int expec_cisajs_SpinGCGeneral(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green&#39;s function for General SpinGC model.
Definition: expec_cisajs.c:584
int iFlgGeneralSpin
Flag for the general (Sz/=1/2) spin.
Definition: struct.h:86
#define FALSE
Definition: global.h:25
long unsigned int * list_1
Definition: global.h:47
int child_general_hopp_GetInfo(struct BindStruct *X, unsigned long int isite1, unsigned long int isite2, unsigned long int sigma1, unsigned long int sigma2)
Compute mask for bit operation of hopping term.
unsigned int NCisAjt
Number of indices of two-body correlation function.
Definition: struct.h:175
const char * cLogCGExpecOneBodyGEnd
Definition: LogMessage.c:112
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.h:94
int istep
Index of TPQ step ???
Definition: struct.h:78
const char * cFileNameTimeKeep
Definition: global.c:23
int ** CisAjt
[DefineList::NCisAjt][4] Indices of one-body correlation function. malloc in setmem_def().
Definition: struct.h:174
int BitCheckGeneral(const long unsigned int org_bit, const unsigned int org_isite, const unsigned int target_ispin, const long int *SiteToBit, const long unsigned int *Tpow)
bit check function for general spin
Definition: bitcalc.c:393
int expec_cisajs_SpinGC(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green&#39;s function for SpinGC model.
Definition: expec_cisajs.c:499
int expec_cisajs_SpinGeneral(struct BindStruct *X, double complex *vec, FILE **_fp)
function of calculation for one body green&#39;s function for General-Spin model.
Definition: expec_cisajs.c:434
struct EDMainCalStruct X
Definition: struct.h:432
double complex GC_child_general_hopp(double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, double complex trans)
Commpute hopping term (grandcanonical)
const char * cLogCGExpecOneBodyGStart
Definition: LogMessage.c:110
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
int iCalcModel
Switch for model. 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC, 6:HubbardNConserved.
Definition: struct.h:198
int GetOffCompGeneralSpin(const long unsigned int org_ibit, const int org_isite, const int org_ispin, const int off_ispin, long unsigned int *_ioffComp, const long int *SiteToBit, const long unsigned int *Tpow)
function of getting off-diagonal component for general spin
Definition: bitcalc.c:243
int X_SpinGC_CisAit(long unsigned int j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int sigma2, long unsigned int *tmp_off)
Compute index of final wavefunction by term (grandcanonical).
int myrank
Process ID, defined in InitializeMPI()
Definition: global.h:163
const char * cFileName1BGreen_Lanczos
Definition: global.c:43
int eigen_num
Index of eigenstate used for the file name of the correlation function.
Definition: struct.h:367
double complex X_child_general_hopp_MPIdouble(int org_isite1, int org_ispin1, int org_isite2, int org_ispin2, double complex tmp_trans, struct BindStruct *X, double complex *tmp_v0, double complex *tmp_v1)
Hopping term in Hubbard (Kondo) + Canonical ensemble When both site1 and site2 are in the inter proce...
struct CheckList Check
Size of the Hilbert space.
Definition: struct.h:411
char * CDataFileHead
Read from Calcmod in readdef.h. Header of output file such as Green&#39;s function.
Definition: struct.h:42
int TimeKeeperWithStep(struct BindStruct *X, const char *cFileName, const char *cTimeKeeper_Message, const char *cWriteType, const int istep)
Functions for writing a time log.
Definition: log.c:78
const char * cCGExpecOneBodyGFinish
Definition: LogMessage.c:121
int TimeKeeperWithRandAndStep(struct BindStruct *X, const char *cFileName, const char *cTimeKeeper_Message, const char *cWriteType, const int irand, const int istep)
Functions for writing a time log.
Definition: log.c:117
int TimeKeeper(struct BindStruct *X, const char *cFileName, const char *cTimeKeeper_Message, const char *cWriteType)
Functions for writing a time log.
Definition: log.c:42
int iCalcType
Switch for calculation type. 0:Lanczos, 1:TPQCalc, 2:FullDiag.
Definition: struct.h:192
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
Definition: global.h:165