HΦ  3.1.0
mltplyHubbardCore.c File Reference

Functions for Hubbard hamiltonian (Core) More...

#include <bitcalc.h>
#include "mfmemory.h"
#include "xsetmem.h"
#include "wrapperMPI.h"
#include "mltplyCommon.h"
#include "mltplyHubbardCore.h"

Go to the source code of this file.

Functions

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. More...
 
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. More...
 
int child_pairhopp_GetInfo (int iPairHopp, struct BindStruct *X)
 Compute mask for bit operation of pairhop term. More...
 
int child_exchange_GetInfo (int iExchange, struct BindStruct *X)
 Compute mask for bit operation of exchange term. More...
 
double complex GC_CisAis (long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int is1_spin, double complex tmp_trans)
 Operation of \(t c_{i\sigma}^\dagger c_{i\sigma}\) (Grandcanonical) More...
 
double complex GC_AisCis (long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, struct BindStruct *X, long unsigned int is1_spin, double complex tmp_trans)
 Operation of \(t c_{i\sigma} c_{i\sigma}^\dagger\) (Grandcanonical) More...
 
int X_CisAis (long unsigned int list_1_j, struct BindStruct *X, long unsigned int is1_spin)
 \(c_{is}\\dagger c_{is}\) term in Hubbard (canonical) More...
 
double complex 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)
 \(c_{is}^\dagger c_{jt}\) term for canonical Hubbard More...
 
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)
 \(c_{is}^\dagger c_{jt}\) term for grandcanonical Hubbard More...
 
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. More...
 
int X_GC_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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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 \(c_{is}^\dagger c_{is} c_{is}^\dagger c_{is}\) term of canonical Hubbard system. More...
 
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 \(c_{is}^\dagger c_{is} c_{jt}^\dagger c_{ku}\) term of canonical Hubbard system. More...
 
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 \(c_{is}^\dagger c_{jt} c_{ku}^\dagger c_{ku}\) term of canonical Hubbard system. More...
 
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 \(c_{is}^\dagger c_{jt} c_{ku}^\dagger c_{lv}\) term of canonical Hubbard system. More...
 
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 \(c_{is}^\dagger c_{is} c_{is}^\dagger c_{is}\) term of grandcanonical Hubbard system. More...
 
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 \(c_{is}^\dagger c_{is} c_{jt}^\dagger c_{ku}\) term of grandcanonical Hubbard system. More...
 
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 \(c_{is}^\dagger c_{jt} c_{ku}^\dagger c_{ku}\) term of grandcanonical Hubbard system. More...
 
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 \(c_{is}^\dagger c_{jt} c_{ku}^\dagger c_{lv}\) term of grandcanonical Hubbard system. More...
 
double complex GC_Cis (long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, long unsigned int is1_spin, double complex tmp_V, long unsigned int *tmp_off)
 Compute \(c_{is}^\dagger\) term of grandcanonical Hubbard system. More...
 
double complex GC_Ajt (long unsigned int j, double complex *tmp_v0, double complex *tmp_v1, long unsigned int is1_spin, double complex tmp_V, long unsigned int *tmp_off)
 Compute \(c_{jt}\) term of grandcanonical Hubbard system. More...
 
int X_Cis (long unsigned int j, long unsigned int is1_spin, long unsigned int *tmp_off, long unsigned int *list_1_org, long unsigned int *list_2_1_target, long unsigned int *list_2_2_target, long unsigned int _irght, long unsigned int _ilft, long unsigned int _ihfbit)
 Compute index of final wavefunction associatesd to \(c_{is}^\dagger\) term of canonical Hubbard system. More...
 
double complex X_Ajt (long unsigned int j, long unsigned int is1_spin, long unsigned int *tmp_off, long unsigned int *list_1_org, long unsigned int *list_2_1_target, long unsigned int *list_2_2_target, long unsigned int _irght, long unsigned int _ilft, long unsigned int _ihfbit)
 Compute index of final wavefunction associatesd to \(c_{jt}\) term of canonical Hubbard system. More...
 

Detailed Description

Functions for Hubbard hamiltonian (Core)

Definition in file mltplyHubbardCore.c.

Function Documentation

◆ child_CisAisCisAis_element()

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 \(c_{is}^\dagger c_{is} c_{is}^\dagger c_{is}\) term of canonical Hubbard system.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]isite1Site 1
[in]isite3Site 3
[in]tmp_VCoupling constant
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 690 of file mltplyHubbardCore.c.

References list_1, X, and X_CisAis().

Referenced by child_general_int(), expec_cisajscktalt_Hubbard(), and makeHam().

699  {
700  int tmp_sgn;
701  double complex dmv;
702  double complex dam_pr = 0 + 0 * I;
703  tmp_sgn = X_CisAis(list_1[j], X, isite3);
704  tmp_sgn *= X_CisAis(list_1[j], X, isite1);
705  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
706  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
707  tmp_v0[j] += dmv;
708  }
709  dam_pr = conj(tmp_v1[j]) * dmv;
710  return dam_pr;
711 }/*double complex child_CisAisCisAis_element*/
int X_CisAis(long unsigned int list_1_j, struct BindStruct *X, long unsigned int is1_spin)
term in Hubbard (canonical)
long unsigned int * list_1
Definition: global.h:47
struct EDMainCalStruct X
Definition: struct.h:431

◆ child_CisAisCjtAku_element()

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 \(c_{is}^\dagger c_{is} c_{jt}^\dagger c_{ku}\) term of canonical Hubbard system.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]isite1Site 1
[in]isite3Site 3
[in]isite4Site 4
[in]BsumBit mask for hopping
[in]BdiffBit mask for Fermion sign
[in]tmp_VCoupling constant
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 719 of file mltplyHubbardCore.c.

References list_1, X, X_CisAis(), and X_CisAjt().

Referenced by child_general_int(), expec_cisajscktalt_Hubbard(), and makeHam().

731  {
732  int tmp_sgn;
733  double complex dmv;
734  double complex dam_pr = 0 + 0 * I;
735  tmp_sgn = X_CisAjt(list_1[j], X, isite3, isite4, Bsum, Bdiff, tmp_off);
736  if (tmp_sgn != 0) {
737  tmp_sgn *= X_CisAis(list_1[*tmp_off], X, isite1);
738  if (tmp_sgn != 0) {
739  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
740  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
741  tmp_v0[*tmp_off] += dmv;
742  }
743  dam_pr = conj(tmp_v1[*tmp_off]) * dmv;
744  }
745  }
746  return dam_pr;
747 }/*double complex child_CisAisCjtAku_element*/
int X_CisAis(long unsigned int list_1_j, struct BindStruct *X, long unsigned int is1_spin)
term in Hubbard (canonical)
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.
long unsigned int * list_1
Definition: global.h:47
struct EDMainCalStruct X
Definition: struct.h:431

◆ child_CisAjtCkuAku_element()

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 \(c_{is}^\dagger c_{jt} c_{ku}^\dagger c_{ku}\) term of canonical Hubbard system.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]isite1Site 1
[in]isite2Site 2
[in]isite3Site 3
[in]AsumBit mask for hopping
[in]AdiffBit mask for Fermion sign
[in]tmp_VCoupling constant
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 755 of file mltplyHubbardCore.c.

References list_1, X, X_CisAis(), and X_CisAjt().

Referenced by child_general_int(), expec_cisajscktalt_Hubbard(), and makeHam().

767  {
768  int tmp_sgn;
769  double complex dmv;
770  double complex dam_pr;
771  dam_pr = 0;
772  tmp_sgn = X_CisAis(list_1[j], X, isite3);
773  if (tmp_sgn != 0) {
774  tmp_sgn *= X_CisAjt(list_1[j], X, isite1, isite2, Asum, Adiff, tmp_off);
775  if (tmp_sgn != 0) {
776  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
777  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
778  tmp_v0[*tmp_off] += dmv;
779  }
780  dam_pr = conj(tmp_v1[*tmp_off]) * dmv;
781  }
782  }
783  return dam_pr;
784 }/*double complex child_CisAjtCkuAku_element*/
int X_CisAis(long unsigned int list_1_j, struct BindStruct *X, long unsigned int is1_spin)
term in Hubbard (canonical)
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.
long unsigned int * list_1
Definition: global.h:47
struct EDMainCalStruct X
Definition: struct.h:431

◆ child_CisAjtCkuAlv_element()

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 \(c_{is}^\dagger c_{jt} c_{ku}^\dagger c_{lv}\) term of canonical Hubbard system.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]isite1Site 1
[in]isite2Site 2
[in]isite3Site 3
[in]isite4Site 4
[in]AsumBit mask for hopping
[in]AdiffBit mask for Fermion sign
[in]BsumBit mask for hopping
[in]BdiffBit mask for Fermion sign
[in]tmp_VCoupling constant
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_off_2Index of final wavefunction

Definition at line 792 of file mltplyHubbardCore.c.

References list_1, X, X_CisAjt(), and X_GC_CisAjt().

Referenced by child_general_int(), expec_cisajscktalt_Hubbard(), and makeHam().

807  {
808  int tmp_sgn;
809  long unsigned int tmp_off_1;
810 
811  double complex dmv;
812  double complex dam_pr = 0;
813  tmp_sgn = X_GC_CisAjt(list_1[j], X, isite3, isite4, Bsum, Bdiff, &tmp_off_1);
814 
815  if (tmp_sgn != 0) {
816  tmp_sgn *= X_CisAjt(tmp_off_1, X, isite1, isite2, Asum, Adiff, tmp_off_2);
817  if (tmp_sgn != 0) {
818  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
819  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
820  tmp_v0[*tmp_off_2] += dmv;
821  }
822  dam_pr = conj(tmp_v1[*tmp_off_2]) * dmv;
823  }
824  }
825  return dam_pr;
826 }/*double complex child_CisAjtCkuAlv_element*/
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.
long unsigned int * list_1
Definition: global.h:47
int X_GC_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.
struct EDMainCalStruct X
Definition: struct.h:431

◆ child_exchange_element()

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.

Returns
\(\langle v_1|{\hat H}_{\rm this}|v_1\rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in,out]tmp_v0\(v_0 = H v_1\)
[in]tmp_v1Vector to be producted
[in,out]X
tmp_off[off] Index of wavefunction of final state

Definition at line 473 of file mltplyHubbardCore.c.

References GetOffComp(), list_1, list_2_1, list_2_2, TRUE, and X.

Referenced by child_exchange(), and makeHam().

479  {
480  long unsigned int off;
481  long unsigned int ibit1_up, ibit2_up, ibit1_down, ibit2_down;
482  double complex dmv;
483  long unsigned int iexchg;
484  long unsigned int is1_up = X->Large.is1_up;
485  long unsigned int is2_up = X->Large.is2_up;
486  long unsigned int is1_down = X->Large.is1_down;
487  long unsigned int is2_down = X->Large.is2_down;
488  long unsigned int irght = X->Large.irght;
489  long unsigned int ilft = X->Large.ilft;
490  long unsigned int ihfbit = X->Large.ihfbit;
491  double complex tmp_J = X->Large.tmp_J;
492  int mode = X->Large.mode;
493  double complex dam_pr = 0;
494 
495  ibit1_up = list_1[j] & is1_up;
496  ibit2_up = list_1[j] & is2_up;
497  ibit1_down = list_1[j] & is1_down;
498  ibit2_down = list_1[j] & is2_down;
499 
500  if (ibit1_up == 0 && ibit1_down != 0 && ibit2_up != 0 && ibit2_down == 0) {
501  iexchg = list_1[j] - (is1_down + is2_up);
502  iexchg += (is1_up + is2_down);
503  if(GetOffComp(list_2_1, list_2_2, iexchg, irght, ilft, ihfbit, &off)!=TRUE){
504  return 0;
505  }
506  *tmp_off = off;
507  dmv = tmp_J * tmp_v1[j];
508  if (mode == M_MLTPLY) {
509  tmp_v0[off] += dmv;
510  }
511  dam_pr += dmv * conj(tmp_v1[off]);
512  }
513  else if (ibit1_up != 0 && ibit1_down == 0 && ibit2_up == 0 && ibit2_down != 0) {
514  iexchg = list_1[j] - (is1_up + is2_down);
515  iexchg += (is1_down + is2_up);
516  if(GetOffComp(list_2_1, list_2_2, iexchg, irght, ilft, ihfbit, &off)!=TRUE){
517  return 0;
518  }
519  *tmp_off = off;
520  dmv = tmp_J * tmp_v1[j];
521  if (mode == M_MLTPLY) {
522  tmp_v0[off] += dmv;
523  }
524  dam_pr += dmv * conj(tmp_v1[off]);
525  }
526  return dam_pr;
527 }/*double complex child_exchange_element*/
#define TRUE
Definition: global.h:26
long unsigned int * list_2_1
Definition: global.h:49
int GetOffComp(long unsigned int *_list_2_1, long unsigned int *_list_2_2, long unsigned int _ibit, const long unsigned int _irght, const long unsigned int _ilft, const long unsigned int _ihfbit, long unsigned int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.c:195
long unsigned int * list_1
Definition: global.h:47
long unsigned int * list_2_2
Definition: global.h:50
struct EDMainCalStruct X
Definition: struct.h:431

◆ child_exchange_GetInfo()

int child_exchange_GetInfo ( int  iExchange,
struct BindStruct X 
)

Compute mask for bit operation of exchange term.

Returns
Error-code, always return 0
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)



Copy coupling constant (LargeList::tmp_J)


Compute mask for checking occupations of \((i_1,\uparrow)\) (LargeList::is1_up), \((i_1,\downarrow)\) (LargeList::is1_down) \((i_2,\uparrow)\) (LargeList::is2_up), \((i_2,\downarrow)\) (LargeList::is2_down)

Parameters
[in]iExchangeIndex of exchange interaction
[in,out]X

Definition at line 198 of file mltplyHubbardCore.c.

References X.

Referenced by makeHam(), mltplyHubbard(), and mltplyHubbardGC().

201  {
202  int isite1 = X->Def.ExchangeCoupling[iExchange][0] + 1;
203  int isite2 = X->Def.ExchangeCoupling[iExchange][1] + 1;
207  X->Large.tmp_J = -X->Def.ParaExchangeCoupling[iExchange];
213  X->Large.is1_up = X->Def.Tpow[2 * isite1 - 2];
214  X->Large.is1_down = X->Def.Tpow[2 * isite1 - 1];
215  X->Large.is2_up = X->Def.Tpow[2 * isite2 - 2];
216  X->Large.is2_down = X->Def.Tpow[2 * isite2 - 1];
217 
218  return 0;
219 }/*int child_exchange_GetInfo*/
struct EDMainCalStruct X
Definition: struct.h:431

◆ child_general_hopp_GetInfo()

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.

Returns
Error-code, always return 0
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)




Compute mask for checking occupations of \((i_1,\sigma_1)\) (LargeList::is1_spin) and \((i_2,\sigma_2)\) (LargeList::is2_spin)



Compute mask for Fermion sign (LargeList::A_spin)


Compute mask for hopping (LargeList::isA_spin)

Parameters
[in,out]X
[in]isite1Site index
[in]isite2Site index
[in]sigma1Spin index
[in]sigma2Spin index

Definition at line 35 of file mltplyHubbardCore.c.

References X.

Referenced by expec_cisajs_Hubbard(), expec_cisajs_HubbardGC(), GetPairExcitedStateHubbard(), GetPairExcitedStateHubbardGC(), makeHam(), mltplyHalfSpinGC(), mltplyHubbard(), and mltplyHubbardGC().

41  {
46  X->Large.is1_spin = X->Def.Tpow[2 * isite1 - 2 + sigma1];
47  X->Large.is2_spin = X->Def.Tpow[2 * isite2 - 2 + sigma2];
51  if (isite1 > isite2) {
52  X->Large.A_spin = (X->Def.Tpow[2 * isite1 - 2 + sigma1] - X->Def.Tpow[2 * isite2 - 1 + sigma2]);
53  }
54  else if (isite1 < isite2) {
55  X->Large.A_spin = (X->Def.Tpow[2 * isite2 - 2 + sigma2] - X->Def.Tpow[2 * isite1 - 1 + sigma1]);
56  }
57  else {
58  if (sigma1 > sigma2) {
59  X->Large.A_spin = (X->Def.Tpow[2 * isite1 - 2 + sigma1] - X->Def.Tpow[2 * isite2 - 1 + sigma2]);
60  }
61  else {
62  X->Large.A_spin = (X->Def.Tpow[2 * isite2 - 2 + sigma2] - X->Def.Tpow[2 * isite1 - 1 + sigma1]);
63  }
64  }
68  X->Large.isA_spin = X->Large.is1_spin + X->Large.is2_spin;
69  return 0;
70 }/*int child_general_hopp_GetInfo*/
struct EDMainCalStruct X
Definition: struct.h:431

◆ child_general_int_GetInfo()

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.

Returns
Error-code, always return 0
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)







Compute mask for checking occupations of \((i_1,\sigma_1)\) (LargeList::is1_spin) and \((i_2,\sigma_2)\) (LargeList::is2_spin)






Compute mask for Fermion sign (LargeList::A_spin)





Compute mask for checking occupations of \((i_3,\sigma_3)\) (LargeList::is3_spin) and \((i_4,\sigma_4)\) (LargeList::is4_spin)




Compute mask for Fermion sign (LargeList::B_spin)



Compute mask for hopping (LargeList::isA_spin, LargeList::isB_spin)


Copy coupling constant (LargeList::tmp_V)

Parameters
[in]iInterAllIt is not used
[in,out]X
[in]isite1Site index
[in]isite2Site index
[in]isite3Site index
[in]isite4Site index
[in]sigma1Spin index
[in]sigma2Spin index
[in]sigma3Spin index
[in]sigma4Spin index
[in]tmp_VCoupling constant

Definition at line 77 of file mltplyHubbardCore.c.

References X.

Referenced by expec_cisajscktalt_Hubbard(), expec_cisajscktalt_HubbardGC(), makeHam(), mltplyHubbard(), and mltplyHubbardGC().

89  {
90  long unsigned int is1_spin, is2_spin, is3_spin, is4_spin;
91  long unsigned int A_spin, B_spin;
92  long unsigned int isA_spin, isB_spin;
97  is1_spin = X->Def.Tpow[2 * isite1 - 2 + sigma1];
98  is2_spin = X->Def.Tpow[2 * isite2 - 2 + sigma2];
102  if (isite1 > isite2) {
103  A_spin = (X->Def.Tpow[2 * isite1 - 2 + sigma1] - X->Def.Tpow[2 * isite2 - 1 + sigma2]);
104  }
105  else if (isite2 > isite1) {
106  A_spin = (X->Def.Tpow[2 * isite2 - 2 + sigma2] - X->Def.Tpow[2 * isite1 - 1 + sigma1]);
107  }
108  else {//isite1=isite2
109  if (sigma1 > sigma2) {
110  A_spin = (X->Def.Tpow[2 * isite1 - 2 + sigma1] - X->Def.Tpow[2 * isite2 - 1 + sigma2]);
111  }
112  else {
113  A_spin = (X->Def.Tpow[2 * isite2 - 2 + sigma2] - X->Def.Tpow[2 * isite1 - 1 + sigma1]);
114  }
115  }
120  is3_spin = X->Def.Tpow[2 * isite3 - 2 + sigma3];
121  is4_spin = X->Def.Tpow[2 * isite4 - 2 + sigma4];
125  if (isite3 > isite4) {
126  B_spin = (X->Def.Tpow[2 * isite3 - 2 + sigma3] - X->Def.Tpow[2 * isite4 - 1 + sigma4]);
127  }
128  else if (isite3 < isite4) {
129  B_spin = (X->Def.Tpow[2 * isite4 - 2 + sigma4] - X->Def.Tpow[2 * isite3 - 1 + sigma3]);
130  }
131  else {//isite3=isite4
132  if (sigma3 > sigma4) {
133  B_spin = (X->Def.Tpow[2 * isite3 - 2 + sigma3] - X->Def.Tpow[2 * isite4 - 1 + sigma4]);
134  }
135  else {
136  B_spin = (X->Def.Tpow[2 * isite4 - 2 + sigma4] - X->Def.Tpow[2 * isite3 - 1 + sigma3]);
137  }
138  }
142  isA_spin = is1_spin + is2_spin;
143  isB_spin = is3_spin + is4_spin;
144 
145  X->Large.is1_spin = is1_spin;
146  X->Large.is2_spin = is2_spin;
147  X->Large.is3_spin = is3_spin;
148  X->Large.is4_spin = is4_spin;
149  X->Large.isA_spin = isA_spin;
150  X->Large.isB_spin = isB_spin;
151  X->Large.A_spin = A_spin;
152  X->Large.B_spin = B_spin;
156  X->Large.tmp_V = tmp_V;
157  X->Large.isite1 = isite1;
158  X->Large.isite2 = isite2;
159  X->Large.isite3 = isite3;
160  X->Large.isite4 = isite4;
161 
162  return 0;
163 }/*int child_general_int_GetInfo*/
struct EDMainCalStruct X
Definition: struct.h:431

◆ child_pairhopp_element()

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.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 534 of file mltplyHubbardCore.c.

References GetOffComp(), list_1, list_2_1, list_2_2, TRUE, and X.

Referenced by child_pairhopp(), and makeHam().

540  {
541  long unsigned int off;
542  long unsigned int ibit1_up, ibit2_up, ibit1_down, ibit2_down;
543  double complex dmv;
544  long unsigned int iexchg;
545  long unsigned int is1_up = X->Large.is1_up;
546  long unsigned int is2_up = X->Large.is2_up;
547  long unsigned int is1_down = X->Large.is1_down;
548  long unsigned int is2_down = X->Large.is2_down;
549  long unsigned int irght = X->Large.irght;
550  long unsigned int ilft = X->Large.ilft;
551  long unsigned int ihfbit = X->Large.ihfbit;
552  double complex tmp_J = X->Large.tmp_J;
553  int mode = X->Large.mode;
554  double complex dam_pr = 0;
555 
556  ibit1_up = list_1[j] & is1_up;
557  ibit2_up = list_1[j] & is2_up;
558  ibit1_down = list_1[j] & is1_down;
559  ibit2_down = list_1[j] & is2_down;
560 
561  if (ibit1_up == 0 && ibit1_down == 0 && ibit2_up != 0 && ibit2_down != 0) {
562  iexchg = list_1[j] - (is2_up + is2_down);
563  iexchg += (is1_up + is1_down);
564 
565  if(GetOffComp(list_2_1, list_2_2, iexchg, irght, ilft, ihfbit, &off)!=TRUE){
566  return 0;
567  }
568  *tmp_off = off;
569  dmv = tmp_J * tmp_v1[j];
570  if (mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
571  tmp_v0[off] += dmv;
572  }
573  dam_pr += dmv * conj(tmp_v1[off]);
574  }
575  return dam_pr;
576 }/*double complex child_pairhopp_element*/
#define TRUE
Definition: global.h:26
long unsigned int * list_2_1
Definition: global.h:49
int GetOffComp(long unsigned int *_list_2_1, long unsigned int *_list_2_2, long unsigned int _ibit, const long unsigned int _irght, const long unsigned int _ilft, const long unsigned int _ihfbit, long unsigned int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.c:195
long unsigned int * list_1
Definition: global.h:47
long unsigned int * list_2_2
Definition: global.h:50
struct EDMainCalStruct X
Definition: struct.h:431

◆ child_pairhopp_GetInfo()

int child_pairhopp_GetInfo ( int  iPairHopp,
struct BindStruct X 
)

Compute mask for bit operation of pairhop term.

Returns
Error-code, always return 0
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)



Copy coupling constant (LargeList::tmp_J)


Compute mask for checking occupations of \((i_1,\uparrow)\) (LargeList::is1_up), \((i_1,\downarrow)\) (LargeList::is1_down) \((i_2,\uparrow)\) (LargeList::is2_up), \((i_2,\downarrow)\) (LargeList::is2_down)

Parameters
[in]iPairHoppIndex of pairhopp interaction
[in,out]X

Definition at line 170 of file mltplyHubbardCore.c.

References X.

Referenced by makeHam(), mltplyHubbard(), and mltplyHubbardGC().

173  {
174  int isite1 = X->Def.PairHopping[iPairHopp][0] + 1;
175  int isite2 = X->Def.PairHopping[iPairHopp][1] + 1;
179  X->Large.tmp_J = X->Def.ParaPairHopping[iPairHopp];
185  X->Large.is1_up = X->Def.Tpow[2 * isite1 - 2];
186  X->Large.is1_down = X->Def.Tpow[2 * isite1 - 1];
187  X->Large.is2_up = X->Def.Tpow[2 * isite2 - 2];
188  X->Large.is2_down = X->Def.Tpow[2 * isite2 - 1];
189 
190  return 0;
191 }/*int child_pairhopp_GetInfo*/
struct EDMainCalStruct X
Definition: struct.h:431

◆ CisAjt()

double complex 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 
)

\(c_{is}^\dagger c_{jt}\) term for canonical Hubbard

Returns
\(\langle v_1|{\hat H}_{\rm this}|v_1\rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of wavefunction
[in,out]tmp_v0\(v_0 = H v_1\)
[in]tmp_v1Vector to be producted
[in,out]X
[in]is1_spinMask for occupation of (is)
[in]is2_spinMask for occupation of (jt)
[in]sum_spinMask for hopping
[in]diff_spinMask for Fermion sign
[in]tmp_VHopping integral

Definition at line 306 of file mltplyHubbardCore.c.

References FALSE, GetOffComp(), list_1, list_2_1, list_2_2, SgnBit(), and X.

Referenced by child_general_hopp(), X_child_CisAjtCkuAku_Hubbard_MPI(), and X_child_CisAjtCkuAlv_Hubbard_MPI().

316  {
317  long unsigned int ibit_tmp_1, ibit_tmp_2;
318  long unsigned int bit, iexchg, off;
319  int sgn;
320  double complex dmv, dam_pr;
321 
322  ibit_tmp_1 = (list_1[j] & is1_spin);
323  ibit_tmp_2 = (list_1[j] & is2_spin);
324  if (ibit_tmp_1 == 0 && ibit_tmp_2 != 0) {
325  bit = list_1[j] & diff_spin;
326  SgnBit(bit, &sgn); // Fermion sign
327  iexchg = list_1[j] ^ sum_spin;
328 
329  if(GetOffComp(list_2_1, list_2_2, iexchg, X->Large.irght, X->Large.ilft, X->Large.ihfbit, &off)==FALSE){
330  return 0;
331  }
332 /*
333  if(X->Large.mode==M_CORR){
334  fprintf(stdout, "DEBUG-1: myrank=%d, org=%d, bit=%d, iexchg=%d, list_1[%d]=%d\n",
335  myrank, list_1[j], bit, iexchg, off, list_1[off]);
336  }
337 */
338  dmv = sgn * tmp_v1[j];
339  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
340  tmp_v0[off] += tmp_V * dmv;
341  }
342  dam_pr = dmv * conj(tmp_v1[off]);
343  return dam_pr;
344  }
345  else {
346  return 0;
347  }
348 }
long unsigned int * list_2_1
Definition: global.h:49
int GetOffComp(long unsigned int *_list_2_1, long unsigned int *_list_2_2, long unsigned int _ibit, const long unsigned int _irght, const long unsigned int _ilft, const long unsigned int _ihfbit, long unsigned int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.c:195
#define FALSE
Definition: global.h:25
long unsigned int * list_1
Definition: global.h:47
long unsigned int * list_2_2
Definition: global.h:50
struct EDMainCalStruct X
Definition: struct.h:431
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
Definition: bitcalc.c:339

◆ GC_AisCis()

double complex GC_AisCis ( long unsigned int  j,
double complex *  tmp_v0,
double complex *  tmp_v1,
struct BindStruct X,
long unsigned int  is1_spin,
double complex  tmp_trans 
)

Operation of \(t c_{i\sigma} c_{i\sigma}^\dagger\) (Grandcanonical)

Returns
Fragment of \(\langle v_1|{\hat H}|v_1\rangle\)
Author
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of element of wavefunction
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector
[in,out]X
[in]is1_spinMask for occupation of \((i \sigma)\)
[in]tmp_transTransfer integral

Definition at line 261 of file mltplyHubbardCore.c.

References X.

Referenced by GetPairExcitedStateHubbardGC().

268  {
269  long unsigned int A_ibit_tmp;
270  long unsigned int list_1_j;
271  double complex dmv;
272  double complex dam_pr;
273 
274  list_1_j = j - 1;
275  A_ibit_tmp = (list_1_j & is1_spin) / is1_spin;
276  dmv = tmp_v1[j] * (1 - A_ibit_tmp);
277  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
278  tmp_v0[j] += dmv * tmp_trans;
279  }/*if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC)*/
280  dam_pr = dmv * conj(tmp_v1[j]);
281  return dam_pr;
282 }/*double complex GC_AisCis*/
struct EDMainCalStruct X
Definition: struct.h:431

◆ GC_Ajt()

double complex GC_Ajt ( long unsigned int  j,
double complex *  tmp_v0,
double complex *  tmp_v1,
long unsigned int  is1_spin,
double complex  tmp_V,
long unsigned int *  tmp_off 
)

Compute \(c_{jt}\) term of grandcanonical Hubbard system.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Youhei Yamaji (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in]is1_spinBit mask
[in]tmp_VCoupling constant
[in]tmp_offIndex of final wavefunction

Definition at line 1032 of file mltplyHubbardCore.c.

References myrank, and SgnBit().

Referenced by GetSingleExcitedStateHubbardGC().

1039  {
1040  long unsigned int list_1_j, list_1_off;
1041  long unsigned int ibit_tmp_1;
1042  long unsigned int bit;
1043  int sgn, ipsgn;
1044  double complex dmv, dam_pr;
1045 
1046  list_1_j = j - 1;
1047 
1048  ibit_tmp_1 = (list_1_j & is1_spin);
1049  // is1_spin >= 1
1050 
1051  *tmp_off = 0;
1052 
1053  if (ibit_tmp_1 == is1_spin) {
1054  // able to create an electron at the is1_spin state
1055  bit = list_1_j - (list_1_j & (2 * is1_spin - 1));
1056  SgnBit(bit, &sgn); // Fermion sign
1057  ipsgn = 1;
1058 #ifdef MPI
1059  SgnBit(myrank, &ipsgn); // Fermion sign
1060 #endif
1061  list_1_off = list_1_j ^ is1_spin;
1062  *tmp_off = list_1_off;
1063  dmv = ipsgn * sgn * tmp_v1[j];
1064  //if (X->Large.mode == M_MLTPLY) { // for multply
1065  tmp_v0[list_1_off + 1] += dmv * tmp_V;
1066  //}
1067  dam_pr = dmv * conj(tmp_v1[list_1_off + 1]);
1068  return dam_pr;
1069  }
1070  else {
1071  return 0;
1072  }
1073 }/*double complex GC_Ajt*/
int myrank
Process ID, defined in InitializeMPI()
Definition: global.h:162
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
Definition: bitcalc.c:339

◆ GC_child_CisAisCisAis_element()

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 \(c_{is}^\dagger c_{is} c_{is}^\dagger c_{is}\) term of grandcanonical Hubbard system.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]isite1Site 1
[in]isite3Site 3
[in]tmp_VCoupling constant
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 835 of file mltplyHubbardCore.c.

References X, and X_CisAis().

Referenced by expec_cisajscktalt_HubbardGC(), GC_child_general_int(), and makeHam().

844  {
845  int tmp_sgn;
846  double complex dmv;
847  double complex dam_pr = 0;
848  tmp_sgn = X_CisAis(j - 1, X, isite3);
849  tmp_sgn *= X_CisAis(j - 1, X, isite1);
850  if (tmp_sgn != 0) {
851  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
852  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
853  tmp_v0[j] += dmv;
854  }
855  dam_pr = conj(tmp_v1[j]) * dmv;
856  }
857  return dam_pr;
858 }/*double complex GC_child_CisAisCisAis_element*/
int X_CisAis(long unsigned int list_1_j, struct BindStruct *X, long unsigned int is1_spin)
term in Hubbard (canonical)
struct EDMainCalStruct X
Definition: struct.h:431

◆ GC_child_CisAisCjtAku_element()

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 \(c_{is}^\dagger c_{is} c_{jt}^\dagger c_{ku}\) term of grandcanonical Hubbard system.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]isite1Site 1
[in]isite3Site 3
[in]isite4Site 4
[in]BsumBit mask for hopping
[in]BdiffBit mask for Fermion sign
[in]tmp_VCoupling constant
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 866 of file mltplyHubbardCore.c.

References X, X_CisAis(), and X_GC_CisAjt().

Referenced by expec_cisajscktalt_HubbardGC(), GC_child_general_int(), and makeHam().

878  {
879  int tmp_sgn;
880  double complex dmv;
881  double complex dam_pr = 0 + 0 * I;
882  tmp_sgn = X_GC_CisAjt((j - 1), X, isite3, isite4, Bsum, Bdiff, tmp_off);
883  if (tmp_sgn != 0) {
884  tmp_sgn *= X_CisAis(*tmp_off, X, isite1);
885  if (tmp_sgn != 0) {
886  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
887  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
888  tmp_v0[*tmp_off + 1] += dmv;
889  }
890  dam_pr = conj(tmp_v1[*tmp_off + 1]) * dmv;
891  }
892  }
893  return dam_pr;
894 }/*double complex GC_child_CisAisCjtAku_element*/
int X_CisAis(long unsigned int list_1_j, struct BindStruct *X, long unsigned int is1_spin)
term in Hubbard (canonical)
int X_GC_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.
struct EDMainCalStruct X
Definition: struct.h:431

◆ GC_child_CisAjtCkuAku_element()

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 \(c_{is}^\dagger c_{jt} c_{ku}^\dagger c_{ku}\) term of grandcanonical Hubbard system.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]isite1Site 1
[in]isite2Site 2
[in]isite3Site 3
[in]AsumBit mask for hopping
[in]AdiffBit mask for Fermion sign
[in]tmp_VCoupling constant
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 902 of file mltplyHubbardCore.c.

References X, X_CisAis(), and X_GC_CisAjt().

Referenced by expec_cisajscktalt_HubbardGC(), GC_child_general_int(), and makeHam().

914  {
915  int tmp_sgn;
916  double complex dmv;
917  double complex dam_pr = 0 + 0 * I;
918  tmp_sgn = X_CisAis((j - 1), X, isite3);
919  if (tmp_sgn != 0) {
920  tmp_sgn *= X_GC_CisAjt((j - 1), X, isite1, isite2, Asum, Adiff, tmp_off);
921  if (tmp_sgn != 0) {
922  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
923  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
924  tmp_v0[*tmp_off + 1] += dmv;
925  }
926  dam_pr = conj(tmp_v1[*tmp_off + 1]) * dmv;
927  }/*if (tmp_sgn != 0)*/
928  }/*if (tmp_sgn != 0)*/
929  return dam_pr;
930 }/*double complex GC_child_CisAjtCkuAku_element*/
int X_CisAis(long unsigned int list_1_j, struct BindStruct *X, long unsigned int is1_spin)
term in Hubbard (canonical)
int X_GC_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.
struct EDMainCalStruct X
Definition: struct.h:431

◆ GC_child_CisAjtCkuAlv_element()

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 \(c_{is}^\dagger c_{jt} c_{ku}^\dagger c_{lv}\) term of grandcanonical Hubbard system.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]isite1Site 1
[in]isite2Site 2
[in]isite3Site 3
[in]isite4Site 4
[in]AsumBit mask for hopping
[in]AdiffBit mask for Fermion sign
[in]BsumBit mask for hopping
[in]BdiffBit mask for Fermion sign
[in]tmp_VCoupling constant
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_off_2Index of final wavefunction

Definition at line 938 of file mltplyHubbardCore.c.

References X, and X_GC_CisAjt().

Referenced by expec_cisajscktalt_HubbardGC(), GC_child_general_int(), and makeHam().

953  {
954  int tmp_sgn;
955  long unsigned int tmp_off_1;
956  double complex dmv;
957  double complex dam_pr = 0 + 0 * I;
958 
959  tmp_sgn = X_GC_CisAjt((j - 1), X, isite3, isite4, Bsum, Bdiff, &tmp_off_1);
960  if (tmp_sgn != 0) {
961  tmp_sgn *= X_GC_CisAjt(tmp_off_1, X, isite1, isite2, Asum, Adiff, tmp_off_2);
962  if (tmp_sgn != 0) {
963  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
964  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
965  tmp_v0[*tmp_off_2 + 1] += dmv;
966  }
967  dam_pr = conj(tmp_v1[*tmp_off_2 + 1]) * dmv;
968  }
969  }
970  return dam_pr;
971 }/*double complex GC_child_CisAjtCkuAlv_element*/
int X_GC_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.
struct EDMainCalStruct X
Definition: struct.h:431

◆ GC_child_exchange_element()

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.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 583 of file mltplyHubbardCore.c.

References X.

Referenced by GC_child_exchange(), and makeHam().

589  {
590  long unsigned int ibit1_up, ibit2_up, ibit1_down, ibit2_down;
591  double complex dmv;
592  long unsigned int iexchg;
593  long unsigned int is1_up = X->Large.is1_up;
594  long unsigned int is2_up = X->Large.is2_up;
595  long unsigned int is1_down = X->Large.is1_down;
596  long unsigned int is2_down = X->Large.is2_down;
597  long unsigned int list_1_j, list_1_off;
598  double complex tmp_J = X->Large.tmp_J;
599  int mode = X->Large.mode;
600  double complex dam_pr = 0;
601 
602  list_1_j = j - 1;
603  ibit1_up = list_1_j & is1_up;
604  ibit2_up = list_1_j & is2_up;
605  ibit1_down = list_1_j & is1_down;
606  ibit2_down = list_1_j & is2_down;
607 
608  if (ibit1_up == 0 && ibit1_down != 0 && ibit2_up != 0 && ibit2_down == 0) {
609 
610  iexchg = list_1_j - (is1_down + is2_up);
611  iexchg += (is1_up + is2_down);
612  list_1_off = iexchg;
613  *tmp_off = list_1_off;
614 
615  dmv = tmp_J * tmp_v1[j];
616  if (mode == M_MLTPLY) {
617  tmp_v0[list_1_off + 1] += dmv;
618  }
619  dam_pr += dmv * conj(tmp_v1[list_1_off + 1]);
620  }
621  else if (ibit1_up != 0 && ibit1_down == 0 && ibit2_up == 0 && ibit2_down != 0) {
622  iexchg = list_1_j - (is1_up + is2_down);
623  iexchg += (is1_down + is2_up);
624  list_1_off = iexchg;
625  *tmp_off = list_1_off;
626 
627  dmv = tmp_J * tmp_v1[j];
628  if (mode == M_MLTPLY) {
629  tmp_v0[list_1_off + 1] += dmv;
630  }
631  dam_pr += dmv * conj(tmp_v1[list_1_off + 1]);
632  }
633  return dam_pr;
634 }/*double complex GC_child_exchange_element*/
struct EDMainCalStruct X
Definition: struct.h:431

◆ GC_child_pairhopp_element()

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.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in,out]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in,out]X
[out]tmp_offIndex of final wavefunction

Definition at line 641 of file mltplyHubbardCore.c.

References X.

Referenced by GC_child_pairhopp(), and makeHam().

647  {
648  long unsigned int ibit1_up, ibit2_up, ibit1_down, ibit2_down;
649  double complex dmv;
650  long unsigned int iexchg;
651  long unsigned int is1_up = X->Large.is1_up;
652  long unsigned int is2_up = X->Large.is2_up;
653  long unsigned int is1_down = X->Large.is1_down;
654  long unsigned int is2_down = X->Large.is2_down;
655  long unsigned int list_1_j, list_1_off;
656  double complex tmp_J = X->Large.tmp_J;
657  int mode = X->Large.mode;
658 
659  double complex dam_pr = 0 + 0 * I;
660  list_1_j = j - 1;
661 
662  ibit1_up = list_1_j & is1_up;
663 
664  ibit2_up = list_1_j & is2_up;
665 
666  ibit1_down = list_1_j & is1_down;
667 
668  ibit2_down = list_1_j & is2_down;
669 
670  if (ibit1_up == 0 && ibit1_down == 0 && ibit2_up != 0 && ibit2_down != 0) {
671  iexchg = list_1_j - (is2_up + is2_down);
672  iexchg += (is1_up + is1_down);
673  list_1_off = iexchg;
674  *tmp_off = list_1_off;
675  dmv = tmp_J * tmp_v1[j];
676  if (mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
677  tmp_v0[list_1_off + 1] += dmv;
678  }
679  dam_pr += dmv * conj(tmp_v1[list_1_off + 1]);
680  }
681  return dam_pr;
682 }
struct EDMainCalStruct X
Definition: struct.h:431

◆ GC_Cis()

double complex GC_Cis ( long unsigned int  j,
double complex *  tmp_v0,
double complex *  tmp_v1,
long unsigned int  is1_spin,
double complex  tmp_V,
long unsigned int *  tmp_off 
)

Compute \(c_{is}^\dagger\) term of grandcanonical Hubbard system.

Returns
Fragment of \(\langle v_1 | H_{\rm this} | v_1 \rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Youhei Yamaji (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]tmp_v0Resulting wavefunction
[in]tmp_v1Wavefunction to be multiplied
[in]is1_spinBit mask
[in]tmp_VCoupling constant
[in]tmp_offIndex of final wavefunction

Definition at line 981 of file mltplyHubbardCore.c.

References myrank, and SgnBit().

Referenced by GetSingleExcitedStateHubbardGC().

988  {
989  long unsigned int list_1_j, list_1_off;
990  long unsigned int ibit_tmp_1;
991  long unsigned int bit;
992  int sgn, ipsgn;
993  double complex dmv, dam_pr;
994 
995  list_1_j = j - 1;
996 
997  ibit_tmp_1 = (list_1_j & is1_spin);
998  // is1_spin >= 1
999  // is1_spin = Tpow[2*isite + ispin]
1000 
1001  *tmp_off = 0;
1002 
1003  if (ibit_tmp_1 == 0) {
1004  // able to create an electron at the is1_spin state
1005  bit = list_1_j - (list_1_j & (2 * is1_spin - 1));
1006  SgnBit(bit, &sgn); // Fermion sign
1007  ipsgn = 1;
1008 #ifdef MPI
1009  SgnBit(myrank, &ipsgn); // Fermion sign
1010 #endif
1011  list_1_off = list_1_j | is1_spin; // OR
1012  *tmp_off = list_1_off;
1013  dmv = ipsgn * sgn * tmp_v1[j];
1014  //if (X->Large.mode == M_MLTPLY) { // for multply
1015  tmp_v0[list_1_off + 1] += dmv * tmp_V;
1016  //}
1017  dam_pr = dmv * conj(tmp_v1[list_1_off + 1]);
1018  return dam_pr;
1019  }
1020  else {
1021  return 0;
1022  }
1023 }/*double complex GC_Cis*/
int myrank
Process ID, defined in InitializeMPI()
Definition: global.h:162
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
Definition: bitcalc.c:339

◆ GC_CisAis()

double complex GC_CisAis ( long unsigned int  j,
double complex *  tmp_v0,
double complex *  tmp_v1,
struct BindStruct X,
long unsigned int  is1_spin,
double complex  tmp_trans 
)

Operation of \(t c_{i\sigma}^\dagger c_{i\sigma}\) (Grandcanonical)

Returns
Fragment of \(\langle v_1|{\hat H}|v_1\rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of element of wavefunction
[in,out]tmp_v0Result vector
[in]tmp_v1Input producted vector
[in,out]X
[in]is1_spinMask for occupation of \((i \sigma)\)
[in]tmp_transTransfer integral

Definition at line 234 of file mltplyHubbardCore.c.

References X.

Referenced by GC_child_general_hopp().

241  {
242  long unsigned int A_ibit_tmp;
243  long unsigned int list_1_j;
244  double complex dmv;
245  double complex dam_pr;
246 
247  list_1_j = j - 1;
248  A_ibit_tmp = (list_1_j & is1_spin) / is1_spin;
249  dmv = tmp_v1[j] * A_ibit_tmp;
250  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
251  tmp_v0[j] += dmv * tmp_trans;
252  }/*if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC)*/
253  dam_pr = dmv * conj(tmp_v1[j]);
254  return dam_pr;
255 }/*double complex GC_CisAis*/
struct EDMainCalStruct X
Definition: struct.h:431

◆ GC_CisAjt()

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 
)

\(c_{is}^\dagger c_{jt}\) term for grandcanonical Hubbard

Returns
\(\langle v_1|{\hat H}_{\rm this}|v_1\rangle\)
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]jIndex of wavefunction
[in]tmp_v0\(v_0 = H v_1\)
[in]tmp_v1Vector to be producted
[in,out]X
[in]is1_spinMask for occupation of (is)
[in]is2_spinMask for occupation of (jt)
[in]sum_spinMask for hopping
[in]diff_spinMask for Fermion sign
[in]tmp_VHopping
[in]tmp_offIndex of wavefunction of final state

Definition at line 355 of file mltplyHubbardCore.c.

References SgnBit(), and X.

Referenced by GC_child_general_hopp(), makeHam(), X_GC_child_CisAjtCkuAku_Hubbard_MPI(), and X_GC_child_CisAjtCkuAlv_Hubbard_MPI().

366  {
367  long unsigned int list_1_j, list_1_off;
368  long unsigned int ibit_tmp_1, ibit_tmp_2;
369  long unsigned int bit;
370  int sgn;
371  double complex dmv, dam_pr;
372 
373  list_1_j = j - 1;
374  ibit_tmp_1 = (list_1_j & is1_spin);
375  ibit_tmp_2 = (list_1_j & is2_spin);
376  *tmp_off = 0;
377 
378  if (ibit_tmp_1 == 0 && ibit_tmp_2 != 0) {
379  bit = list_1_j & diff_spin;
380  SgnBit(bit, &sgn); // Fermion sign
381  list_1_off = list_1_j ^ sum_spin;
382  *tmp_off = list_1_off;
383  dmv = sgn * tmp_v1[j];
384  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
385  tmp_v0[list_1_off + 1] += dmv * tmp_V;
386  }
387  dam_pr = dmv * conj(tmp_v1[list_1_off + 1]);
388  return dam_pr;
389  }
390  else {
391  return 0;
392  }
393 }/*double complex GC_CisAjt*/
struct EDMainCalStruct X
Definition: struct.h:431
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
Definition: bitcalc.c:339

◆ X_Ajt()

double complex X_Ajt ( long unsigned int  j,
long unsigned int  is1_spin,
long unsigned int *  tmp_off,
long unsigned int *  list_1_org,
long unsigned int *  list_2_1_target,
long unsigned int *  list_2_2_target,
long unsigned int  _irght,
long unsigned int  _ilft,
long unsigned int  _ihfbit 
)

Compute index of final wavefunction associatesd to \(c_{jt}\) term of canonical Hubbard system.

Returns
1 if electron (jt) exist, 0 if not.
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Youhei Yamaji (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]is1_spinBit mask
[out]tmp_offIndex of final wavefunction
[in]list_1_orgSimilar to list_1
[in]list_2_1_targetSimilar to list_2_1
[in]list_2_2_targetSimilar to list_2_2
[in]_irghtSimilar to LargeList::irght
[in]_ilftSimilar to LargeList::ilft
[in]_ihfbitSimilar to LargeList::ihfbit

Definition at line 1136 of file mltplyHubbardCore.c.

References GetOffComp(), list_1_org, myrank, SgnBit(), and TRUE.

Referenced by GetSingleExcitedStateHubbard().

1146  {
1147  long unsigned int list_1_j, list_1_off;
1148  long unsigned int ibit_tmp_1;
1149  long unsigned int bit;
1150  int sgn, ipsgn;
1151 
1152  list_1_j = list_1_org[j];
1153 
1154  ibit_tmp_1 = (list_1_j & is1_spin);
1155 // is1_spin >= 1
1156 // is1_spin = Tpow[2*isite + ispin]
1157 
1158  *tmp_off = 0;
1159  if (ibit_tmp_1 != 0) {
1160  // able to delete an electron at the is1_spin state
1161  bit = list_1_j - (list_1_j & (2 * is1_spin - 1));
1162  SgnBit(bit, &sgn); // Fermion sign
1163  ipsgn = 1;
1164 #ifdef MPI
1165  SgnBit(myrank, &ipsgn); // Fermion sign
1166 #endif
1167  list_1_off = list_1_j ^ is1_spin;
1168  if(GetOffComp(list_2_1_target, list_2_2_target, list_1_off, _irght, _ilft, _ihfbit, tmp_off)!=TRUE){
1169  *tmp_off=0;
1170  return 0;
1171  }
1172  sgn *= ipsgn;
1173  return(sgn);
1174  }
1175  else {
1176  *tmp_off = 0;
1177  return 0;
1178  }
1179 }/*double complex X_Ajt*/
#define TRUE
Definition: global.h:26
long unsigned int * list_1_org
Definition: global.h:53
int GetOffComp(long unsigned int *_list_2_1, long unsigned int *_list_2_2, long unsigned int _ibit, const long unsigned int _irght, const long unsigned int _ilft, const long unsigned int _ihfbit, long unsigned int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.c:195
int myrank
Process ID, defined in InitializeMPI()
Definition: global.h:162
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
Definition: bitcalc.c:339

◆ X_Cis()

int X_Cis ( long unsigned int  j,
long unsigned int  is1_spin,
long unsigned int *  tmp_off,
long unsigned int *  list_1_org,
long unsigned int *  list_2_1_target,
long unsigned int *  list_2_2_target,
long unsigned int  _irght,
long unsigned int  _ilft,
long unsigned int  _ihfbit 
)

Compute index of final wavefunction associatesd to \(c_{is}^\dagger\) term of canonical Hubbard system.

Returns
1 if electron (is) absent, 0 if not.
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Youhei Yamaji (The University of Tokyo)
Parameters
[in]jIndex of initial wavefunction
[in]is1_spinBit mask
[out]tmp_offIndex of final wavefunction
[in]list_1_orgSimilar to list_1
[in]list_2_1_targetSimilar to list_2_1
[in]list_2_2_targetSimilar to list_2_2
[in]_irghtSimilar to LargeList::irght
[in]_ilftSimilar to LargeList::ilft
[in]_ihfbitSimilar to LargeList::ihfbit

Definition at line 1082 of file mltplyHubbardCore.c.

References GetOffComp(), list_1_org, myrank, SgnBit(), and TRUE.

Referenced by GetSingleExcitedStateHubbard().

1092  {
1093  long unsigned int list_1_j, list_1_off;
1094  long unsigned int ibit_tmp_1;
1095  long unsigned int bit;
1096  int sgn, ipsgn;
1097 
1098  list_1_j = list_1_org[j];
1099 
1100  ibit_tmp_1 = (list_1_j & is1_spin);
1101  // is1_spin >= 1
1102  // is1_spin = Tpow[2*isite + ispin]
1103 
1104  *tmp_off = 0;
1105 
1106  if (ibit_tmp_1 == 0) {
1107  // able to create an electron at the is1_spin state
1108  bit = list_1_j - (list_1_j & (2 * is1_spin - 1));
1109  SgnBit(bit, &sgn); // Fermion sign
1110  ipsgn = 1;
1111 #ifdef MPI
1112  SgnBit(myrank, &ipsgn); // Fermion sign
1113 #endif
1114  list_1_off = list_1_j | is1_spin; // OR
1115 
1116  if(GetOffComp(list_2_1_target, list_2_2_target, list_1_off, _irght, _ilft, _ihfbit, tmp_off)!=TRUE){
1117  *tmp_off=0;
1118  return 0;
1119  }
1120  sgn *= ipsgn;
1121  return (sgn);
1122  }
1123  else {
1124  *tmp_off = 0;
1125  return 0;
1126  }
1127 }/*int X_Cis*/
#define TRUE
Definition: global.h:26
long unsigned int * list_1_org
Definition: global.h:53
int GetOffComp(long unsigned int *_list_2_1, long unsigned int *_list_2_2, long unsigned int _ibit, const long unsigned int _irght, const long unsigned int _ilft, const long unsigned int _ihfbit, long unsigned int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.c:195
int myrank
Process ID, defined in InitializeMPI()
Definition: global.h:162
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
Definition: bitcalc.c:339

◆ X_CisAis()

int X_CisAis ( long unsigned int  list_1_j,
struct BindStruct X,
long unsigned int  is1_spin 
)

\(c_{is}\\dagger c_{is}\) term in Hubbard (canonical)

Returns
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)

Definition at line 289 of file mltplyHubbardCore.c.

Referenced by child_CisAisCisAis_element(), child_CisAisCjtAku_element(), child_CisAjtCkuAku_element(), GC_child_CisAisCisAis_element(), GC_child_CisAisCjtAku_element(), GC_child_CisAjtCkuAku_element(), and X_child_CisAis_Hubbard_MPI().

293  {
294  int A_ibit_tmp;
295 
296  // off = j
297  A_ibit_tmp = (list_1_j & is1_spin) / is1_spin;
298  return A_ibit_tmp;
299 }

◆ X_CisAjt()

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.

Returns
Fermion sign
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]list_1_jSimiler to list_1 ?
[in]X
[in]is1_spinMask for occupation of (is)
[in]is2_spinMask for occupation of (jt)
[in]sum_spinMask for hopping
[in]diff_spinMask for Fermion sign
[in]tmp_offIndex of wavefunction of final state

Definition at line 400 of file mltplyHubbardCore.c.

References GetOffComp(), list_2_1, list_2_2, TRUE, X, and X_GC_CisAjt().

Referenced by child_CisAisCjtAku_element(), child_CisAjtCkuAku_element(), child_CisAjtCkuAlv_element(), GetPairExcitedStateHubbard(), and makeHam().

408  {
409  long unsigned int off;
410  int sgn = 1;
411 
412  sgn = X_GC_CisAjt(list_1_j, X, is1_spin, is2_spin, sum_spin, diff_spin, tmp_off);
413  if (sgn != 0) {
414  if(GetOffComp(list_2_1, list_2_2, *tmp_off, X->Large.irght, X->Large.ilft, X->Large.ihfbit, &off)!=TRUE){
415  *tmp_off = 0;
416  return 0;
417  }
418  *tmp_off = off;
419  return sgn;
420  }
421  else {
422  *tmp_off = 0;
423  return 0;
424  }
425 }/*int X_CisAjt*/
#define TRUE
Definition: global.h:26
long unsigned int * list_2_1
Definition: global.h:49
int GetOffComp(long unsigned int *_list_2_1, long unsigned int *_list_2_2, long unsigned int _ibit, const long unsigned int _irght, const long unsigned int _ilft, const long unsigned int _ihfbit, long unsigned int *_ioffComp)
function of getting off-diagonal component
Definition: bitcalc.c:195
int X_GC_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.
long unsigned int * list_2_2
Definition: global.h:50
struct EDMainCalStruct X
Definition: struct.h:431

◆ X_GC_CisAjt()

int X_GC_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.

Returns
Fermion sign
Author
Takahiro Misawa (The University of Tokyo)
Kazuyoshi Yoshimi (The University of Tokyo)
Parameters
[in]list_1_jlist_1 ?
[in]X
[in]is1_spinMask for occupation of (is)
[in]is2_spinMask for occupation of (jt)
[in]sum_spinMask for hopping
[in]diff_spinMask for Fermion sign
[out]tmp_offIndex of wavefunction of final state

Definition at line 432 of file mltplyHubbardCore.c.

References SgnBit().

Referenced by child_CisAjtCkuAlv_element(), GC_child_CisAisCjtAku_element(), GC_child_CisAjtCkuAku_element(), GC_child_CisAjtCkuAlv_element(), GetSgnInterAll(), X_child_CisAjtCkuAlv_Hubbard_MPI(), X_CisAjt(), and X_GC_child_CisAjtCkuAlv_Hubbard_MPI().

440  {
441  long unsigned int ibit_tmp_1, ibit_tmp_2;
442  long unsigned int bit, off;
443  int sgn = 1;
444 
445  ibit_tmp_1 = (list_1_j & is1_spin);
446  ibit_tmp_2 = (list_1_j & is2_spin);
447 
448  if (ibit_tmp_1 == 0 && ibit_tmp_2 != 0) {
449  bit = list_1_j & diff_spin;
450  SgnBit(bit, &sgn); // Fermion sign
451  off = list_1_j ^ sum_spin;
452  *tmp_off = off;
453  return sgn; // pm 1
454  }
455  else {
456  *tmp_off = 0;
457  return 0;
458  }
459 }
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
Definition: bitcalc.c:339