HΦ  3.2.0
makeHam.c File Reference

Making Hamiltonian for the full diagonalization method. More...

#include <bitcalc.h>
#include "mltplyCommon.h"
#include "mltplyHubbardCore.h"
#include "mltplySpinCore.h"
#include "makeHam.h"
#include "wrapperMPI.h"
+ Include dependency graph for makeHam.c:

Go to the source code of this file.

Functions

int makeHam (struct BindStruct *X)
 Making Hamiltonian for the full diagonalization method.
The Hamiltonian is stored in the two dimensional array \( \verb|Ham| \). More...
 

Detailed Description

Making Hamiltonian for the full diagonalization method.

Version
0.2

add function to treat the case of generalspin

Version
0.1
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)

Definition in file makeHam.c.

Function Documentation

◆ makeHam()

int makeHam ( struct BindStruct X)

Making Hamiltonian for the full diagonalization method.
The Hamiltonian is stored in the two dimensional array \( \verb|Ham| \).

Parameters
X[in] Struct for getting the information of the operators
Return values
0normally finished
-1unnormally finished
Version
0.2

add function to treat the case of generalspin

Version
0.1
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)

Definition at line 55 of file makeHam.c.

References LargeList::A_spin, LargeList::B_spin, BindStruct::Check, child_CisAisCisAis_element(), child_CisAisCjtAku_element(), child_CisAjtCkuAku_element(), child_CisAjtCkuAlv_element(), child_exchange_element(), child_exchange_GetInfo(), child_exchange_spin_element(), child_exchange_spin_GetInfo(), child_general_hopp_GetInfo(), child_general_int_GetInfo(), child_general_int_spin_GetInfo(), child_pairhopp_element(), child_pairhopp_GetInfo(), child_pairlift_spin_GetInfo(), ConvertToList1GeneralSpin(), BindStruct::Def, DefineList::EDGeneralTransfer, DefineList::EDNTransfer, DefineList::EDParaGeneralTransfer, FALSE, GC_child_CisAisCisAis_element(), GC_child_CisAisCisAis_spin_element(), GC_child_CisAisCitAiu_spin_element(), GC_child_CisAisCjtAku_element(), GC_child_CisAitCiuAiu_spin_element(), GC_child_CisAitCiuAiv_spin_element(), GC_child_CisAjtCkuAku_element(), GC_child_CisAjtCkuAlv_element(), GC_child_exchange_element(), GC_child_exchange_spin_element(), GC_child_pairhopp_element(), GC_child_pairlift_spin_element(), GC_CisAjt(), GetOffCompGeneralSpin(), GetSplitBitByModel(), Ham, LargeList::i_max, DefineList::iCalcModel, CheckList::idim_max, DefineList::iFlgGeneralSpin, LargeList::ihfbit, LargeList::ilft, DefineList::InterAll_OffDiagonal, LargeList::irght, LargeList::is1_spin, LargeList::is1_up, LargeList::is2_spin, LargeList::is2_up, LargeList::is3_spin, LargeList::is4_spin, LargeList::isA_spin, LargeList::isB_spin, BindStruct::Large, list_1, list_Diagonal, LargeList::mode, DefineList::NExchangeCoupling, DefineList::NInterAll_OffDiagonal, DefineList::NPairHopping, DefineList::NPairLiftCoupling, DefineList::Nsite, DefineList::ParaInterAll_OffDiagonal, LargeList::prdct, CheckList::sdim, DefineList::SiteToBit, LargeList::tmp_V, DefineList::Tpow, v0, v1, X_child_exchange_spin_element(), X_CisAjt(), X_Spin_CisAis(), and X_SpinGC_CisAit().

Referenced by CalcByFullDiag(), and CalcSpectrumByFullDiag().

55  {
56 
57  long unsigned int i, j;
58  long unsigned int is1_spin;
59  long unsigned int irght, ilft, ihfbit;
60  double complex dmv;
61  double num1;
62  long unsigned int off;
63  long unsigned int isite1, isite2, isite3, isite4;
64  int sigma1, sigma2, sigma3, sigma4;
65  long unsigned int isA_up, isB_up;
66  double complex tmp_trans, tmp_V;
67  long unsigned int Asum, Bsum, Adiff, Bdiff;
68  long unsigned int tmp_off, tmp_off_2;
69  int tmp_sgn;
70  off = 0;
71  tmp_off = 0;
72  tmp_off_2 = 0;
73  long unsigned int i_max;
74  i_max = X->Check.idim_max;
75  int ihermite = 0;
76  int idx = 0;
77 
78  if (GetSplitBitByModel(X->Def.Nsite, X->Def.iCalcModel, &irght, &ilft, &ihfbit) != 0) {
79  return -1;
80  }
81  X->Large.i_max = i_max;
82  X->Large.irght = irght;
83  X->Large.ilft = ilft;
84  X->Large.ihfbit = ihfbit;
85  X->Large.prdct = 0.0;
86  X->Large.mode = M_Ham;
87 
88  for (i = 0; i <= i_max; i++) {
89  for (j = 0; j <= i_max; j++) {
90  Ham[i][j] = 0;
91  }
92  }
93 #pragma omp parallel for default(none) firstprivate(i_max) private(j) shared(Ham, list_Diagonal, v0, v1)
94  for (j = 1; j <= i_max; j++) {
95  Ham[j][j] += list_Diagonal[j];
96  v0[j] = 1.0;
97  v1[j] = 1.0;
98  //printf("%ld, %f\n", j, list_Diagonal[j]);
99  }
100  switch (X->Def.iCalcModel) {
101  case HubbardGC:
102  //Transfer
103  for (i = 0; i < X->Def.EDNTransfer / 2; i++) {
104  for (ihermite = 0; ihermite < 2; ihermite++) {
105  idx = 2 * i + ihermite;
106  isite1 = X->Def.EDGeneralTransfer[idx][0] + 1;
107  isite2 = X->Def.EDGeneralTransfer[idx][2] + 1;
108  sigma1 = X->Def.EDGeneralTransfer[idx][1];
109  sigma2 = X->Def.EDGeneralTransfer[idx][3];
110 
111  if (child_general_hopp_GetInfo(X, isite1, isite2, sigma1, sigma2) != 0) {
112  return -1;
113  }
114  tmp_trans = -X->Def.EDParaGeneralTransfer[idx];
115 
116  for (j = 1; j <= X->Large.i_max; j++) {
117  dmv = tmp_trans *
119  tmp_trans, &tmp_off);
120  Ham[tmp_off + 1][j] += dmv;
121  }
122  }
123  }
124 
125 
126  for (i = 0; i < X->Def.NInterAll_OffDiagonal / 2; i++) {
127  for (ihermite = 0; ihermite < 2; ihermite++) {
128  idx = 2 * i + ihermite;
129  isite1 = X->Def.InterAll_OffDiagonal[idx][0] + 1;
130  isite2 = X->Def.InterAll_OffDiagonal[idx][2] + 1;
131  isite3 = X->Def.InterAll_OffDiagonal[idx][4] + 1;
132  isite4 = X->Def.InterAll_OffDiagonal[idx][6] + 1;
133  sigma1 = X->Def.InterAll_OffDiagonal[idx][1];
134  sigma2 = X->Def.InterAll_OffDiagonal[idx][3];
135  sigma3 = X->Def.InterAll_OffDiagonal[idx][5];
136  sigma4 = X->Def.InterAll_OffDiagonal[idx][7];
137  tmp_V = X->Def.ParaInterAll_OffDiagonal[idx];
139  i,
140  X,
141  isite1,
142  isite2,
143  isite3,
144  isite4,
145  sigma1,
146  sigma2,
147  sigma3,
148  sigma4,
149  tmp_V
150  );
151 
152  i_max = X->Large.i_max;
153  isite1 = X->Large.is1_spin;
154  isite2 = X->Large.is2_spin;
155  Asum = X->Large.isA_spin;
156  Adiff = X->Large.A_spin;
157 
158  isite3 = X->Large.is3_spin;
159  isite4 = X->Large.is4_spin;
160  Bsum = X->Large.isB_spin;
161  Bdiff = X->Large.B_spin;
162 
163  tmp_V = X->Large.tmp_V;
164 
165  if (isite1 == isite2 && isite3 == isite4) {
166 
167  for (j = 1; j <= i_max; j++) {
168  dmv = GC_child_CisAisCisAis_element(j, isite1, isite3, tmp_V, v0, v1, X, &tmp_off);
169  Ham[j][j] += dmv;
170  }
171  } else if (isite1 == isite2 && isite3 != isite4) {
172 
173  for (j = 1; j <= i_max; j++) {
174  dmv = GC_child_CisAisCjtAku_element(j, isite1, isite3, isite4, Bsum, Bdiff, tmp_V, v0, v1, X, &tmp_off);
175  Ham[tmp_off + 1][j] += dmv;
176  }
177  } else if (isite1 != isite2 && isite3 == isite4) {
178 
179  for (j = 1; j <= i_max; j++) {
180  dmv = GC_child_CisAjtCkuAku_element(j, isite1, isite2, isite3, Asum, Adiff, tmp_V, v0, v1, X, &tmp_off);
181  Ham[tmp_off + 1][j] += dmv;
182  }
183  } else if (isite1 != isite2 && isite3 != isite4) {
184 
185  for (j = 1; j <= i_max; j++) {
186  dmv = GC_child_CisAjtCkuAlv_element(j, isite1, isite2, isite3, isite4, Asum, Adiff, Bsum, Bdiff, tmp_V,
187  v0, v1, X, &tmp_off_2);
188  Ham[tmp_off_2 + 1][j] += dmv;
189  }
190  }
191  }
192  }
193  //Pair hopping
194  for (i = 0; i < X->Def.NPairHopping / 2; i++) {
195  for (ihermite = 0; ihermite < 2; ihermite++) {
196  idx = 2 * i + ihermite;
197  child_pairhopp_GetInfo(idx, X);
198  for (j = 1; j <= X->Large.i_max; j++) {
199  dmv = GC_child_pairhopp_element(j, v0, v1, X, &tmp_off);
200  Ham[tmp_off + 1][j] += dmv;
201  }
202  }
203  }
204  //Exchange
205  for (i = 0; i < X->Def.NExchangeCoupling; i++) {
207  for (j = 1; j <= X->Large.i_max; j++) {
208  dmv = GC_child_exchange_element(j, v0, v1, X, &tmp_off);
209  Ham[tmp_off + 1][j] += dmv;
210  }
211  }
212  break;
213  case KondoGC:
214  case Hubbard:
215  case Kondo:
216  //Transfer
217  for (i = 0; i < X->Def.EDNTransfer / 2; i++) {
218  for (ihermite = 0; ihermite < 2; ihermite++) {
219  idx = 2 * i + ihermite;
220 
221  isite1 = X->Def.EDGeneralTransfer[idx][0] + 1;
222  isite2 = X->Def.EDGeneralTransfer[idx][2] + 1;
223  sigma1 = X->Def.EDGeneralTransfer[idx][1];
224  sigma2 = X->Def.EDGeneralTransfer[idx][3];
225 
226  if (child_general_hopp_GetInfo(X, isite1, isite2, sigma1, sigma2) != 0) {
227  return -1;
228  }
229  tmp_trans = -X->Def.EDParaGeneralTransfer[idx];
230 
231  for (j = 1; j <= X->Large.i_max; j++) {
232  dmv = tmp_trans *
234  &tmp_off);
235  Ham[tmp_off][j] += dmv;
236  }
237  }
238  }
239 
240  //InterAll
241  for (i = 0; i < X->Def.NInterAll_OffDiagonal / 2; i++) {
242  for (ihermite = 0; ihermite < 2; ihermite++) {
243  idx = 2 * i + ihermite;
244  isite1 = X->Def.InterAll_OffDiagonal[idx][0] + 1;
245  isite2 = X->Def.InterAll_OffDiagonal[idx][2] + 1;
246  isite3 = X->Def.InterAll_OffDiagonal[idx][4] + 1;
247  isite4 = X->Def.InterAll_OffDiagonal[idx][6] + 1;
248  sigma1 = X->Def.InterAll_OffDiagonal[idx][1];
249  sigma2 = X->Def.InterAll_OffDiagonal[idx][3];
250  sigma3 = X->Def.InterAll_OffDiagonal[idx][5];
251  sigma4 = X->Def.InterAll_OffDiagonal[idx][7];
252  tmp_V = X->Def.ParaInterAll_OffDiagonal[idx];
253  if (isite1 == 1 && sigma1 == 0 && isite2 == 4 && sigma2 == 0 && isite3 == 17 && sigma3 == 0 && isite4 == 19 &&
254  sigma4 == 0) {
255  tmp_V = tmp_V * 1.0;
256  }
257 // fprintf(stdoutMPI, "Debug: %d, %d, %d, %d, %d, %d, %d, %d\n ", isite1, sigma1,isite2, sigma2,isite3, sigma3,isite4, sigma4);
259  i,
260  X,
261  isite1,
262  isite2,
263  isite3,
264  isite4,
265  sigma1,
266  sigma2,
267  sigma3,
268  sigma4,
269  tmp_V
270  );
271 
272  i_max = X->Large.i_max;
273  isite1 = X->Large.is1_spin;
274  isite2 = X->Large.is2_spin;
275  Asum = X->Large.isA_spin;
276  Adiff = X->Large.A_spin;
277 
278  isite3 = X->Large.is3_spin;
279  isite4 = X->Large.is4_spin;
280  Bsum = X->Large.isB_spin;
281  Bdiff = X->Large.B_spin;
282 
283  tmp_V = X->Large.tmp_V;
284 
285  if (isite1 == isite2 && isite3 == isite4) {
286 
287  for (j = 1; j <= i_max; j++) {
288  dmv = child_CisAisCisAis_element(j, isite1, isite3, tmp_V, v0, v1, X, &tmp_off);
289  Ham[j][j] += dmv;
290  }
291  } else if (isite1 == isite2 && isite3 != isite4) {
292 
293  for (j = 1; j <= i_max; j++) {
294  dmv = child_CisAisCjtAku_element(j, isite1, isite3, isite4, Bsum, Bdiff, tmp_V, v0, v1, X, &tmp_off);
295  Ham[tmp_off][j] += dmv;
296  }
297  } else if (isite1 != isite2 && isite3 == isite4) {
298 
299  for (j = 1; j <= i_max; j++) {
300  dmv = child_CisAjtCkuAku_element(j, isite1, isite2, isite3, Asum, Adiff, tmp_V, v0, v1, X, &tmp_off);
301  Ham[tmp_off][j] += dmv;
302  }
303  } else if (isite1 != isite2 && isite3 != isite4) {
304 
305  for (j = 1; j <= i_max; j++) {
306  dmv = child_CisAjtCkuAlv_element(j, isite1, isite2, isite3, isite4, Asum, Adiff, Bsum, Bdiff, tmp_V, v0,
307  v1, X, &tmp_off_2);
308  Ham[tmp_off_2][j] += dmv;
309  }
310  }
311  }
312  }
313 
314  //Pair hopping
315  for (i = 0; i < X->Def.NPairHopping / 2; i++) {
316  for (ihermite = 0; ihermite < 2; ihermite++) {
317  idx = 2 * i + ihermite;
318  child_pairhopp_GetInfo(idx, X);
319  for (j = 1; j <= X->Large.i_max; j++) {
320  dmv = child_pairhopp_element(j, v0, v1, X, &tmp_off);
321  Ham[tmp_off][j] += dmv;
322  }
323  }
324  }
325  //Exchange
326  for (i = 0; i < X->Def.NExchangeCoupling; i++) {
328  for (j = 1; j <= X->Large.i_max; j++) {
329  dmv = child_exchange_element(j, v0, v1, X, &tmp_off);
330  Ham[tmp_off][j] += dmv;
331  }
332  }
333  break;
334 
335  case SpinGC:
336  if (X->Def.iFlgGeneralSpin == FALSE) {
337  //Transfer
338  for (i = 0; i < X->Def.EDNTransfer / 2; i++) {
339  for (ihermite = 0; ihermite < 2; ihermite++) {
340  idx = 2 * i + ihermite;
341  isite1 = X->Def.EDGeneralTransfer[idx][0] + 1;
342  isite2 = X->Def.EDGeneralTransfer[idx][2] + 1;
343  sigma1 = X->Def.EDGeneralTransfer[idx][1];
344  sigma2 = X->Def.EDGeneralTransfer[idx][3];
345  tmp_trans = -X->Def.EDParaGeneralTransfer[idx];
346 
347  if (child_general_hopp_GetInfo(X, isite1, isite2, sigma1, sigma2) != 0) {
348  return -1;
349  }
350 
351  if (isite1 == isite2) {
352  is1_spin = X->Def.Tpow[isite1 - 1];
353  if (sigma1 == sigma2) {
354  // longitudinal magnetic field
355  for (j = 1; j <= i_max; j++) {
356  Ham[j][j] += tmp_trans * X_Spin_CisAis(j, X, is1_spin, sigma1);
357  }
358  } else {
359  // transverse magnetic field
360  is1_spin = X->Def.Tpow[isite1 - 1];
361 
362  for (j = 1; j <= i_max; j++) {
363  Ham[off + 1][j] += tmp_trans * X_SpinGC_CisAit(j, X, is1_spin, sigma2, &off);
364  }
365  }
366  } else {
367  // hopping is not allowed in localized spin system
368  return -1;
369  }
370  }
371  }
372 
373  //InterAll
374  for (i = 0; i < X->Def.NInterAll_OffDiagonal / 2; i++) {
375  for (ihermite = 0; ihermite < 2; ihermite++) {
376  idx = 2 * i + ihermite;
377  isite1 = X->Def.InterAll_OffDiagonal[idx][0] + 1;
378  isite2 = X->Def.InterAll_OffDiagonal[idx][4] + 1;
379  sigma1 = X->Def.InterAll_OffDiagonal[idx][1];
380  sigma2 = X->Def.InterAll_OffDiagonal[idx][3];
381  sigma3 = X->Def.InterAll_OffDiagonal[idx][5];
382  sigma4 = X->Def.InterAll_OffDiagonal[idx][7];
383  tmp_V = X->Def.ParaInterAll_OffDiagonal[idx];
384 
385  child_general_int_spin_GetInfo(X, isite1, isite2, sigma1, sigma2, sigma3, sigma4, tmp_V);
386  isA_up = X->Def.Tpow[isite1 - 1];
387  isB_up = X->Def.Tpow[isite2 - 1];
388 
389  if (sigma1 == sigma2 && sigma3 == sigma4) { //diagonal
390  for (j = 1; j <= i_max; j++) {
391  dmv = GC_child_CisAisCisAis_spin_element(j, isA_up, isB_up, sigma2, sigma4, tmp_V, v0, v1, X);
392  Ham[j][j] += dmv;
393  }
394  } else if (sigma1 == sigma2 && sigma3 != sigma4) {
395  for (j = 1; j <= i_max; j++) {
396  dmv = GC_child_CisAisCitAiu_spin_element(j, sigma2, sigma4, isA_up, isB_up, tmp_V, v0, v1, X, &tmp_off);
397  Ham[tmp_off + 1][j] += dmv;
398  }
399  } else if (sigma1 != sigma2 && sigma3 == sigma4) {
400  for (j = 1; j <= i_max; j++) {
401  dmv = GC_child_CisAitCiuAiu_spin_element(j, sigma2, sigma4, isA_up, isB_up, tmp_V, v0, v1, X, &tmp_off);
402  Ham[tmp_off + 1][j] += dmv;
403  }
404  } else if (sigma1 != sigma2 && sigma3 != sigma4) {
405  for (j = 1; j <= i_max; j++) {
406  dmv = GC_child_CisAitCiuAiv_spin_element(j, sigma2, sigma4, isA_up, isB_up, tmp_V, v0, v1, X,
407  &tmp_off_2);
408  Ham[tmp_off_2 + 1][j] += dmv;
409  }
410  }
411  }
412  }
413  //Exchange
414  for (i = 0; i < X->Def.NExchangeCoupling; i++) {
416  for (j = 1; j <= X->Large.i_max; j++) {
417  dmv = GC_child_exchange_spin_element(j, v0, v1, X, &tmp_off);
418  Ham[tmp_off + 1][j] += dmv;
419  }
420  }
421 
422  //PairLift
423  for (i = 0; i < X->Def.NPairLiftCoupling / 2; i++) {
424  for (ihermite = 0; ihermite < 2; ihermite++) {
425  idx = 2 * i + ihermite;
427 
428  for (j = 1; j <= X->Large.i_max; j++) {
429  dmv = GC_child_pairlift_spin_element(j, v0, v1, X, &tmp_off);
430  Ham[tmp_off + 1][j] += dmv;
431  }
432  }
433  }
434  } else { //For General spin
435  for (i = 0; i < X->Def.EDNTransfer / 2; i++) {
436  for (ihermite = 0; ihermite < 2; ihermite++) {
437  idx = 2 * i + ihermite;
438  isite1 = X->Def.EDGeneralTransfer[idx][0] + 1;
439  isite2 = X->Def.EDGeneralTransfer[idx][2] + 1;
440  sigma1 = X->Def.EDGeneralTransfer[idx][1];
441  sigma2 = X->Def.EDGeneralTransfer[idx][3];
442  tmp_trans = -X->Def.EDParaGeneralTransfer[idx];
443 
444  if (isite1 == isite2) {
445  // longitudinal magnetic field is absorbed in diagonal calculation.
446  // transverse magnetic field
447  for (j = 1; j <= i_max; j++) {
448  num1 = GetOffCompGeneralSpin(j - 1, isite1, sigma2, sigma1, &off, X->Def.SiteToBit, X->Def.Tpow);
449  Ham[off + 1][j] += tmp_trans * num1;
450  }
451  } else {
452  // hopping is not allowed in localized spin system
453  return -1;
454  }
455  }
456  }
457 
458  //InterAll
459  for (i = 0; i < X->Def.NInterAll_OffDiagonal / 2; i++) {
460  for (ihermite = 0; ihermite < 2; ihermite++) {
461  idx = 2 * i + ihermite;
462  isite1 = X->Def.InterAll_OffDiagonal[idx][0] + 1;
463  isite2 = X->Def.InterAll_OffDiagonal[idx][4] + 1;
464  sigma1 = X->Def.InterAll_OffDiagonal[idx][1];
465  sigma2 = X->Def.InterAll_OffDiagonal[idx][3];
466  sigma3 = X->Def.InterAll_OffDiagonal[idx][5];
467  sigma4 = X->Def.InterAll_OffDiagonal[idx][7];
468  tmp_V = X->Def.ParaInterAll_OffDiagonal[idx];
469  for (j = 1; j <= i_max; j++) {
470  num1 = GetOffCompGeneralSpin(j - 1, isite1, sigma2, sigma1, &tmp_off, X->Def.SiteToBit, X->Def.Tpow);
471  if (num1 != 0) {
472  num1 = GetOffCompGeneralSpin(tmp_off, isite2, sigma4, sigma3, &off, X->Def.SiteToBit, X->Def.Tpow);
473  if (num1 != 0) {
474  Ham[off + 1][j] += tmp_V * num1;
475  }
476  }
477  }
478  }
479  }
480  }
481  break;
482 
483  case Spin:
484  if (X->Def.iFlgGeneralSpin == FALSE) {
485  //Transfer is abosrbed in diagonal term.
486  //InterAll
487  for (i = 0; i < X->Def.NInterAll_OffDiagonal / 2; i++) {
488  for (ihermite = 0; ihermite < 2; ihermite++) {
489  idx = 2 * i + ihermite;
490 
491  isite1 = X->Def.InterAll_OffDiagonal[idx][0] + 1;
492  isite2 = X->Def.InterAll_OffDiagonal[idx][4] + 1;
493  sigma1 = X->Def.InterAll_OffDiagonal[idx][1];
494  sigma2 = X->Def.InterAll_OffDiagonal[idx][3];
495  sigma3 = X->Def.InterAll_OffDiagonal[idx][5];
496  sigma4 = X->Def.InterAll_OffDiagonal[idx][7];
497  tmp_V = X->Def.ParaInterAll_OffDiagonal[idx];
498 
499  child_general_int_spin_GetInfo(X, isite1, isite2, sigma1, sigma2, sigma3, sigma4, tmp_V);
500  isA_up = X->Large.is1_up;
501  isB_up = X->Large.is2_up;
502 
503  for (j = 1; j <= i_max; j++) {
504  tmp_sgn = X_child_exchange_spin_element(j, X, isA_up, isB_up, sigma2, sigma4, &tmp_off);
505  dmv = tmp_sgn * tmp_V;
506  Ham[tmp_off][j] += dmv;
507  }
508  }
509  }
510 
511  //Exchange
512  for (i = 0; i < X->Def.NExchangeCoupling; i++) {
514  for (j = 1; j <= X->Large.i_max; j++) {
515  dmv = child_exchange_spin_element(j, v0, v1, X, &tmp_off);
516  Ham[tmp_off][j] += dmv;
517  }
518  }
519 
520  } else { //For General spin
521  //Transfer absorbed in Diagonal term.
522 
523  //InterAll
524  for (i = 0; i < X->Def.NInterAll_OffDiagonal / 2; i++) {
525  for (ihermite = 0; ihermite < 2; ihermite++) {
526  idx = 2 * i + ihermite;
527  isite1 = X->Def.InterAll_OffDiagonal[idx][0] + 1;
528  isite2 = X->Def.InterAll_OffDiagonal[idx][4] + 1;
529  sigma1 = X->Def.InterAll_OffDiagonal[idx][1];
530  sigma2 = X->Def.InterAll_OffDiagonal[idx][3];
531  sigma3 = X->Def.InterAll_OffDiagonal[idx][5];
532  sigma4 = X->Def.InterAll_OffDiagonal[idx][7];
533  tmp_V = X->Def.ParaInterAll_OffDiagonal[idx];
534 
535  for (j = 1; j <= i_max; j++) {
536  num1 = GetOffCompGeneralSpin(list_1[j], isite1, sigma2, sigma1, &tmp_off, X->Def.SiteToBit, X->Def.Tpow);
537  if (num1 != 0) {
538  num1 = GetOffCompGeneralSpin(tmp_off, isite2, sigma4, sigma3, &off, X->Def.SiteToBit, X->Def.Tpow);
539  if (num1 != 0) {
540  ConvertToList1GeneralSpin(off, X->Check.sdim, &tmp_off);
541  Ham[tmp_off][j] += tmp_V;
542  }
543  }
544  }
545  }
546  }
547  }
548 
549  break;
550  }
551  return 0;
552 }
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
long unsigned int B_spin
Mask used in the bit oeration.
Definition: struct.h:342
double complex GC_child_exchange_spin_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Multiply Hamiltonian of exchange term of grandcanonical spin system.
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
int X_CisAjt(long unsigned int list_1_j, struct BindStruct *X, long unsigned int is1_spin, long unsigned int is2_spin, long unsigned int sum_spin, long unsigned int diff_spin, long unsigned int *tmp_off)
Compute index of wavefunction of final state.
double complex GC_child_CisAitCiuAiu_spin_element(long unsigned int j, long unsigned int org_sigma2, long unsigned int org_sigma4, long unsigned int isA_up, long unsigned int isB_up, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of grandcanonical spsin system.
long unsigned int is2_up
Mask used in the bit oeration.
Definition: struct.h:327
double complex GC_child_CisAisCitAiu_spin_element(long unsigned int j, long unsigned int org_sigma2, long unsigned int org_sigma4, long unsigned int isA_up, long unsigned int isB_up, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of grandcanonical spsin system.
long unsigned int is4_spin
Mask used in the bit oeration.
Definition: struct.h:335
int X_child_exchange_spin_element(long unsigned int j, struct BindStruct *X, long unsigned int isA_up, long unsigned int isB_up, long unsigned int sigmaA, long unsigned int sigmaB, long unsigned int *tmp_off)
Compute index of final wavefunction associated to spin-exchange term.
long unsigned int isB_spin
Mask used in the bit oeration.
Definition: struct.h:347
double complex * v1
Definition: global.h:35
int child_general_int_GetInfo(int iInterAll, struct BindStruct *X, long unsigned int isite1, long unsigned int isite2, long unsigned int isite3, long unsigned int isite4, long unsigned int sigma1, long unsigned int sigma2, long unsigned int sigma3, long unsigned int sigma4, double complex tmp_V)
Compute mask for bit operation of general interaction term.
double complex prdct
The expectation value of the energy.
Definition: struct.h:314
double complex child_CisAjtCkuAku_element(long unsigned int j, long unsigned int isite1, long unsigned int isite2, long unsigned int isite3, long unsigned int Asum, long unsigned int Adiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of canonical Hubbard system.
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
double complex child_pairhopp_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute pairhopp term of canonical Hubbard system.
long unsigned int is1_spin
Mask used in the bit oeration.
Definition: struct.h:332
int ConvertToList1GeneralSpin(const long unsigned int org_ibit, const long unsigned int ihlfbit, long unsigned int *_ilist1Comp)
function of converting component to list_1
Definition: bitcalc.c:285
double complex GC_child_CisAitCiuAiv_spin_element(long unsigned int j, long unsigned int org_sigma2, long unsigned int org_sigma4, long unsigned int isA_up, long unsigned int isB_up, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off_2)
Compute term of grandcanonical spsin system.
int ** EDGeneralTransfer
Index of transfer integrals for calculation. malloc in setmem_def(). Data Format [DefineList::NTransf...
Definition: struct.h:110
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.
double complex * ParaInterAll_OffDiagonal
[DefineList::NInterAll_OffDiagonal] Coupling constant of off-diagonal inter-all term. malloc in setmem_def().
Definition: struct.h:170
unsigned int NPairLiftCoupling
Number of pair-lift term.
Definition: struct.h:153
int child_general_int_spin_GetInfo(struct BindStruct *X, long unsigned int isite1, long unsigned int isite2, long unsigned int sigma1, long unsigned int sigma2, long unsigned int sigma3, long unsigned int sigma4, double complex tmp_V)
Set parameters for the bit operation of spin-general interaction term.
double complex GC_child_pairhopp_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute pairhopp term of grandcanonical Hubbard system.
int mode
multiply or expectation value.
Definition: struct.h:330
unsigned int NInterAll_OffDiagonal
Number of interall term (off-diagonal)
Definition: struct.h:165
long unsigned int is3_spin
Mask used in the bit oeration.
Definition: struct.h:334
unsigned long int sdim
Dimension for Ogata-Lin ???
Definition: struct.h:307
int child_pairlift_spin_GetInfo(int iPairLift, struct BindStruct *X)
Set parameters for the bit operation of spin-pairlift term.
double complex GC_CisAjt(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int is1_spin, long unsigned int is2_spin, long unsigned int sum_spin, long unsigned int diff_spin, double complex tmp_V, long unsigned int *tmp_off)
term for grandcanonical Hubbard
int ** InterAll_OffDiagonal
[DefineList::NinterAll_OffDiagonal][8] Interacted quartet
Definition: struct.h:161
double complex child_exchange_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute exchange term of canonical-Hubbard.
double complex GC_child_exchange_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute exchange term of grandcanonical Hubbard system.
long unsigned int A_spin
Mask used in the bit oeration.
Definition: struct.h:341
unsigned int Nsite
Number of sites in the INTRA process region.
Definition: struct.h:56
double complex GC_child_CisAisCisAis_spin_element(long unsigned int j, long unsigned int isA_up, long unsigned int isB_up, long unsigned int org_sigma2, long unsigned int org_sigma4, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X)
Compute term of grandcanonical spsin system.
double complex ** Ham
Definition: global.h:73
int child_exchange_spin_GetInfo(int iExchange, struct BindStruct *X)
Set parameters for the bit operation of spin-exchange term.
long unsigned int is1_up
Mask used in the bit oeration.
Definition: struct.h:325
double complex * EDParaGeneralTransfer
Value of general transfer integrals by a def file. malloc in setmem_def(). Data Format [DefineList::N...
Definition: struct.h:116
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
int child_pairhopp_GetInfo(int iPairHopp, struct BindStruct *X)
Compute mask for bit operation of pairhop term.
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
long int i_max
Length of eigenvector.
Definition: struct.h:317
double complex GC_child_CisAisCisAis_element(long unsigned int j, long unsigned int isite1, long unsigned int isite3, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of grandcanonical Hubbard system.
unsigned int NExchangeCoupling
Number of exchange term.
Definition: struct.h:145
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
unsigned int NPairHopping
Number of pair-hopping term.
Definition: struct.h:139
long unsigned int is2_spin
Mask used in the bit oeration.
Definition: struct.h:333
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.
double complex child_CisAisCisAis_element(long unsigned int j, long unsigned int isite1, long unsigned int isite3, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of canonical Hubbard system.
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
Definition: struct.h:94
double complex tmp_V
Coupling constant.
Definition: struct.h:348
unsigned int EDNTransfer
Number of transfer integrals for calculation.
Definition: struct.h:105
long unsigned int isA_spin
Mask used in the bit oeration.
Definition: struct.h:346
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
double * list_Diagonal
Definition: global.h:46
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).
double complex GC_child_pairlift_spin_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Multiply Hamiltonian of pairlift term of grandcanonical spin system.
int child_exchange_GetInfo(int iExchange, struct BindStruct *X)
Compute mask for bit operation of exchange term.
double complex child_exchange_spin_element(long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Multiply Hamiltonian of exchange term of canonical spin system.
double complex * v0
Definition: global.h:34
double complex GC_child_CisAisCjtAku_element(long unsigned int j, long unsigned int isite1, long unsigned int isite3, long unsigned int isite4, long unsigned int Bsum, long unsigned int Bdiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of grandcanonical Hubbard system.
struct CheckList Check
Size of the Hilbert space.
Definition: struct.h:411
double complex GC_child_CisAjtCkuAku_element(long unsigned int j, long unsigned int isite1, long unsigned int isite2, long unsigned int isite3, long unsigned int Asum, long unsigned int Adiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of grandcanonical Hubbard system.
double complex child_CisAjtCkuAlv_element(long unsigned int j, long unsigned int isite1, long unsigned int isite2, long unsigned int isite3, long unsigned int isite4, long unsigned int Asum, long unsigned int Adiff, long unsigned int Bsum, long unsigned int Bdiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off_2)
Compute term of canonical Hubbard system.
double complex GC_child_CisAjtCkuAlv_element(long unsigned int j, long unsigned int isite1, long unsigned int isite2, long unsigned int isite3, long unsigned int isite4, long unsigned int Asum, long unsigned int Adiff, long unsigned int Bsum, long unsigned int Bdiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off_2)
Compute term of grandcanonical Hubbard system.
double complex child_CisAisCjtAku_element(long unsigned int j, long unsigned int isite1, long unsigned int isite3, long unsigned int isite4, long unsigned int Bsum, long unsigned int Bdiff, double complex tmp_V, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int *tmp_off)
Compute term of canonical Hubbard system.
+ Here is the call graph for this function:
+ Here is the caller graph for this function: