Making Hamiltonian for the full diagonalization method.
The Hamiltonian is stored in the two dimensional array \( \verb|Ham| \).
57 long unsigned int i, j;
58 long unsigned int is1_spin;
59 long unsigned int irght, ilft, ihfbit;
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;
73 long unsigned int i_max;
88 for (i = 0; i <= i_max; i++) {
89 for (j = 0; j <= i_max; j++) {
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++) {
104 for (ihermite = 0; ihermite < 2; ihermite++) {
105 idx = 2 * i + ihermite;
119 tmp_trans, &tmp_off);
120 Ham[tmp_off + 1][j] += dmv;
127 for (ihermite = 0; ihermite < 2; ihermite++) {
128 idx = 2 * i + ihermite;
165 if (isite1 == isite2 && isite3 == isite4) {
167 for (j = 1; j <= i_max; j++) {
171 }
else if (isite1 == isite2 && isite3 != isite4) {
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;
177 }
else if (isite1 != isite2 && isite3 == isite4) {
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;
183 }
else if (isite1 != isite2 && isite3 != isite4) {
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;
195 for (ihermite = 0; ihermite < 2; ihermite++) {
196 idx = 2 * i + ihermite;
200 Ham[tmp_off + 1][j] += dmv;
209 Ham[tmp_off + 1][j] += dmv;
218 for (ihermite = 0; ihermite < 2; ihermite++) {
219 idx = 2 * i + ihermite;
235 Ham[tmp_off][j] += dmv;
242 for (ihermite = 0; ihermite < 2; ihermite++) {
243 idx = 2 * i + ihermite;
253 if (isite1 == 1 && sigma1 == 0 && isite2 == 4 && sigma2 == 0 && isite3 == 17 && sigma3 == 0 && isite4 == 19 &&
285 if (isite1 == isite2 && isite3 == isite4) {
287 for (j = 1; j <= i_max; j++) {
291 }
else if (isite1 == isite2 && isite3 != isite4) {
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;
297 }
else if (isite1 != isite2 && isite3 == isite4) {
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;
303 }
else if (isite1 != isite2 && isite3 != isite4) {
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,
308 Ham[tmp_off_2][j] += dmv;
316 for (ihermite = 0; ihermite < 2; ihermite++) {
317 idx = 2 * i + ihermite;
321 Ham[tmp_off][j] += dmv;
330 Ham[tmp_off][j] += dmv;
339 for (ihermite = 0; ihermite < 2; ihermite++) {
340 idx = 2 * i + ihermite;
351 if (isite1 == isite2) {
352 is1_spin = X->
Def.
Tpow[isite1 - 1];
353 if (sigma1 == sigma2) {
355 for (j = 1; j <= i_max; j++) {
360 is1_spin = X->
Def.
Tpow[isite1 - 1];
362 for (j = 1; j <= i_max; j++) {
375 for (ihermite = 0; ihermite < 2; ihermite++) {
376 idx = 2 * i + ihermite;
386 isA_up = X->
Def.
Tpow[isite1 - 1];
387 isB_up = X->
Def.
Tpow[isite2 - 1];
389 if (sigma1 == sigma2 && sigma3 == sigma4) {
390 for (j = 1; j <= i_max; j++) {
394 }
else if (sigma1 == sigma2 && sigma3 != sigma4) {
395 for (j = 1; j <= i_max; j++) {
397 Ham[tmp_off + 1][j] += dmv;
399 }
else if (sigma1 != sigma2 && sigma3 == sigma4) {
400 for (j = 1; j <= i_max; j++) {
402 Ham[tmp_off + 1][j] += dmv;
404 }
else if (sigma1 != sigma2 && sigma3 != sigma4) {
405 for (j = 1; j <= i_max; j++) {
408 Ham[tmp_off_2 + 1][j] += dmv;
418 Ham[tmp_off + 1][j] += dmv;
424 for (ihermite = 0; ihermite < 2; ihermite++) {
425 idx = 2 * i + ihermite;
430 Ham[tmp_off + 1][j] += dmv;
436 for (ihermite = 0; ihermite < 2; ihermite++) {
437 idx = 2 * i + ihermite;
444 if (isite1 == isite2) {
447 for (j = 1; j <= i_max; j++) {
449 Ham[off + 1][j] += tmp_trans * num1;
460 for (ihermite = 0; ihermite < 2; ihermite++) {
461 idx = 2 * i + ihermite;
469 for (j = 1; j <= i_max; j++) {
474 Ham[off + 1][j] += tmp_V * num1;
488 for (ihermite = 0; ihermite < 2; ihermite++) {
489 idx = 2 * i + ihermite;
503 for (j = 1; j <= i_max; j++) {
505 dmv = tmp_sgn * tmp_V;
506 Ham[tmp_off][j] += dmv;
516 Ham[tmp_off][j] += dmv;
525 for (ihermite = 0; ihermite < 2; ihermite++) {
526 idx = 2 * i + ihermite;
535 for (j = 1; j <= i_max; j++) {
541 Ham[tmp_off][j] += tmp_V;
struct DefineList Def
Definision of system (Hamiltonian) etc.
long unsigned int B_spin
Mask used in the bit oeration.
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 ???
unsigned long int idim_max
The dimension of the Hilbert space of this process.
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.
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.
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.
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.
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.
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.
int ConvertToList1GeneralSpin(const long unsigned int org_ibit, const long unsigned int ihlfbit, long unsigned int *_ilist1Comp)
function of converting component to list_1
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...
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().
unsigned int NPairLiftCoupling
Number of pair-lift term.
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.
unsigned int NInterAll_OffDiagonal
Number of interall term (off-diagonal)
long unsigned int is3_spin
Mask used in the bit oeration.
unsigned long int sdim
Dimension for Ogata-Lin ???
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
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.
unsigned int Nsite
Number of sites in the INTRA process region.
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.
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.
double complex * EDParaGeneralTransfer
Value of general transfer integrals by a def file. malloc in setmem_def(). Data Format [DefineList::N...
long unsigned int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
long unsigned int ilft
Used for Ogata-Lin ???
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.
long int i_max
Length of eigenvector.
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.
int iFlgGeneralSpin
Flag for the general (Sz/=1/2) spin.
long unsigned int * list_1
unsigned int NPairHopping
Number of pair-hopping term.
long unsigned int is2_spin
Mask used in the bit oeration.
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.
double complex tmp_V
Coupling constant.
unsigned int EDNTransfer
Number of transfer integrals for calculation.
long unsigned int isA_spin
Mask used in the bit oeration.
long unsigned int irght
Used for Ogata-Lin ???
int iCalcModel
Switch for model. 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC, 6:HubbardNConserved.
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
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 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.
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.