HΦ  3.2.0
mltplyHubbardCore.c File Reference

Functions for Hubbard hamiltonian (Core) More...

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

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 689 of file mltplyHubbardCore.c.

References BindStruct::Large, list_1, LargeList::mode, and X_CisAis().

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

698  {
699  int tmp_sgn;
700  double complex dmv;
701  double complex dam_pr = 0 + 0 * I;
702  tmp_sgn = X_CisAis(list_1[j], X, isite3);
703  tmp_sgn *= X_CisAis(list_1[j], X, isite1);
704  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
705  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
706  tmp_v0[j] += dmv;
707  }
708  dam_pr = conj(tmp_v1[j]) * dmv;
709  return dam_pr;
710 }/*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)
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
long unsigned int * list_1
Definition: global.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 718 of file mltplyHubbardCore.c.

References BindStruct::Large, list_1, LargeList::mode, X_CisAis(), and X_CisAjt().

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

730  {
731  int tmp_sgn;
732  double complex dmv;
733  double complex dam_pr = 0 + 0 * I;
734  tmp_sgn = X_CisAjt(list_1[j], X, isite3, isite4, Bsum, Bdiff, tmp_off);
735  if (tmp_sgn != 0) {
736  tmp_sgn *= X_CisAis(list_1[*tmp_off], X, isite1);
737  if (tmp_sgn != 0) {
738  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
739  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
740  tmp_v0[*tmp_off] += dmv;
741  }
742  dam_pr = conj(tmp_v1[*tmp_off]) * dmv;
743  }
744  }
745  return dam_pr;
746 }/*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.
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
long unsigned int * list_1
Definition: global.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 754 of file mltplyHubbardCore.c.

References BindStruct::Large, list_1, LargeList::mode, X_CisAis(), and X_CisAjt().

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

766  {
767  int tmp_sgn;
768  double complex dmv;
769  double complex dam_pr;
770  dam_pr = 0;
771  tmp_sgn = X_CisAis(list_1[j], X, isite3);
772  if (tmp_sgn != 0) {
773  tmp_sgn *= X_CisAjt(list_1[j], X, isite1, isite2, Asum, Adiff, tmp_off);
774  if (tmp_sgn != 0) {
775  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
776  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
777  tmp_v0[*tmp_off] += dmv;
778  }
779  dam_pr = conj(tmp_v1[*tmp_off]) * dmv;
780  }
781  }
782  return dam_pr;
783 }/*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.
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
long unsigned int * list_1
Definition: global.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 791 of file mltplyHubbardCore.c.

References BindStruct::Large, list_1, LargeList::mode, X_CisAjt(), and X_GC_CisAjt().

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

806  {
807  int tmp_sgn;
808  long unsigned int tmp_off_1;
809 
810  double complex dmv;
811  double complex dam_pr = 0;
812  tmp_sgn = X_GC_CisAjt(list_1[j], X, isite3, isite4, Bsum, Bdiff, &tmp_off_1);
813 
814  if (tmp_sgn != 0) {
815  tmp_sgn *= X_CisAjt(tmp_off_1, X, isite1, isite2, Asum, Adiff, tmp_off_2);
816  if (tmp_sgn != 0) {
817  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
818  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
819  tmp_v0[*tmp_off_2] += dmv;
820  }
821  dam_pr = conj(tmp_v1[*tmp_off_2]) * dmv;
822  }
823  }
824  return dam_pr;
825 }/*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.
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 472 of file mltplyHubbardCore.c.

References GetOffComp(), LargeList::ihfbit, LargeList::ilft, LargeList::irght, LargeList::is1_down, LargeList::is1_up, LargeList::is2_down, LargeList::is2_up, BindStruct::Large, list_1, list_2_1, list_2_2, LargeList::mode, LargeList::tmp_J, and TRUE.

Referenced by child_exchange(), and makeHam().

478  {
479  long unsigned int off;
480  long unsigned int ibit1_up, ibit2_up, ibit1_down, ibit2_down;
481  double complex dmv;
482  long unsigned int iexchg;
483  long unsigned int is1_up = X->Large.is1_up;
484  long unsigned int is2_up = X->Large.is2_up;
485  long unsigned int is1_down = X->Large.is1_down;
486  long unsigned int is2_down = X->Large.is2_down;
487  long unsigned int irght = X->Large.irght;
488  long unsigned int ilft = X->Large.ilft;
489  long unsigned int ihfbit = X->Large.ihfbit;
490  double complex tmp_J = X->Large.tmp_J;
491  int mode = X->Large.mode;
492  double complex dam_pr = 0;
493 
494  ibit1_up = list_1[j] & is1_up;
495  ibit2_up = list_1[j] & is2_up;
496  ibit1_down = list_1[j] & is1_down;
497  ibit2_down = list_1[j] & is2_down;
498 
499  if (ibit1_up == 0 && ibit1_down != 0 && ibit2_up != 0 && ibit2_down == 0) {
500  iexchg = list_1[j] - (is1_down + is2_up);
501  iexchg += (is1_up + is2_down);
502  if(GetOffComp(list_2_1, list_2_2, iexchg, irght, ilft, ihfbit, &off)!=TRUE){
503  return 0;
504  }
505  *tmp_off = off;
506  dmv = tmp_J * tmp_v1[j];
507  if (mode == M_MLTPLY) {
508  tmp_v0[off] += dmv;
509  }
510  dam_pr += dmv * conj(tmp_v1[off]);
511  }
512  else if (ibit1_up != 0 && ibit1_down == 0 && ibit2_up == 0 && ibit2_down != 0) {
513  iexchg = list_1[j] - (is1_up + is2_down);
514  iexchg += (is1_down + is2_up);
515  if(GetOffComp(list_2_1, list_2_2, iexchg, irght, ilft, ihfbit, &off)!=TRUE){
516  return 0;
517  }
518  *tmp_off = off;
519  dmv = tmp_J * tmp_v1[j];
520  if (mode == M_MLTPLY) {
521  tmp_v0[off] += dmv;
522  }
523  dam_pr += dmv * conj(tmp_v1[off]);
524  }
525  return dam_pr;
526 }/*double complex child_exchange_element*/
long unsigned int ihfbit
Used for Ogata-Lin ???
Definition: struct.h:345
long unsigned int is2_up
Mask used in the bit oeration.
Definition: struct.h:327
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
#define TRUE
Definition: global.h:26
double complex tmp_J
Coupling constant.
Definition: struct.h:323
long unsigned int is2_down
Mask used in the bit oeration.
Definition: struct.h:328
long unsigned int is1_up
Mask used in the bit oeration.
Definition: struct.h:325
long unsigned int ilft
Used for Ogata-Lin ???
Definition: struct.h:344
long unsigned int is1_down
Mask used in the bit oeration.
Definition: struct.h:326
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
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 197 of file mltplyHubbardCore.c.

References BindStruct::Def, DefineList::ExchangeCoupling, LargeList::is1_down, LargeList::is1_up, LargeList::is2_down, LargeList::is2_up, BindStruct::Large, DefineList::ParaExchangeCoupling, LargeList::tmp_J, and DefineList::Tpow.

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

200  {
201  int isite1 = X->Def.ExchangeCoupling[iExchange][0] + 1;
202  int isite2 = X->Def.ExchangeCoupling[iExchange][1] + 1;
206  X->Large.tmp_J = -X->Def.ParaExchangeCoupling[iExchange];
212  X->Large.is1_up = X->Def.Tpow[2 * isite1 - 2];
213  X->Large.is1_down = X->Def.Tpow[2 * isite1 - 1];
214  X->Large.is2_up = X->Def.Tpow[2 * isite2 - 2];
215  X->Large.is2_down = X->Def.Tpow[2 * isite2 - 1];
216 
217  return 0;
218 }/*int child_exchange_GetInfo*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
int ** ExchangeCoupling
[DefineList::NExchangeCoupling][2] Index of exchange term. malloc in setmem_def().
Definition: struct.h:146
long unsigned int is2_up
Mask used in the bit oeration.
Definition: struct.h:327
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
double complex tmp_J
Coupling constant.
Definition: struct.h:323
long unsigned int is2_down
Mask used in the bit oeration.
Definition: struct.h:328
double * ParaExchangeCoupling
[DefineList::NExchangeCoupling] Coupling constant of exchange term. malloc in setmem_def().
Definition: struct.h:148
long unsigned int is1_up
Mask used in the bit oeration.
Definition: struct.h:325
long unsigned int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.h:90
long unsigned int is1_down
Mask used in the bit oeration.
Definition: struct.h:326
+ Here is the caller graph for this function:

◆ 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 34 of file mltplyHubbardCore.c.

References LargeList::A_spin, BindStruct::Def, LargeList::is1_spin, LargeList::is2_spin, LargeList::isA_spin, BindStruct::Large, and DefineList::Tpow.

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

40  {
45  X->Large.is1_spin = X->Def.Tpow[2 * isite1 - 2 + sigma1];
46  X->Large.is2_spin = X->Def.Tpow[2 * isite2 - 2 + sigma2];
50  if (isite1 > isite2) {
51  X->Large.A_spin = (X->Def.Tpow[2 * isite1 - 2 + sigma1] - X->Def.Tpow[2 * isite2 - 1 + sigma2]);
52  }
53  else if (isite1 < isite2) {
54  X->Large.A_spin = (X->Def.Tpow[2 * isite2 - 2 + sigma2] - X->Def.Tpow[2 * isite1 - 1 + sigma1]);
55  }
56  else {
57  if (sigma1 > sigma2) {
58  X->Large.A_spin = (X->Def.Tpow[2 * isite1 - 2 + sigma1] - X->Def.Tpow[2 * isite2 - 1 + sigma2]);
59  }
60  else {
61  X->Large.A_spin = (X->Def.Tpow[2 * isite2 - 2 + sigma2] - X->Def.Tpow[2 * isite1 - 1 + sigma1]);
62  }
63  }
68  return 0;
69 }/*int child_general_hopp_GetInfo*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
long unsigned int is1_spin
Mask used in the bit oeration.
Definition: struct.h:332
long unsigned int A_spin
Mask used in the bit oeration.
Definition: struct.h:341
long unsigned int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.h:90
long unsigned int is2_spin
Mask used in the bit oeration.
Definition: struct.h:333
long unsigned int isA_spin
Mask used in the bit oeration.
Definition: struct.h:346
+ Here is the caller graph for this function:

◆ 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 76 of file mltplyHubbardCore.c.

References LargeList::A_spin, LargeList::B_spin, BindStruct::Def, LargeList::is1_spin, LargeList::is2_spin, LargeList::is3_spin, LargeList::is4_spin, LargeList::isA_spin, LargeList::isB_spin, LargeList::isite1, LargeList::isite2, LargeList::isite3, LargeList::isite4, BindStruct::Large, LargeList::tmp_V, and DefineList::Tpow.

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

88  {
89  long unsigned int is1_spin, is2_spin, is3_spin, is4_spin;
90  long unsigned int A_spin, B_spin;
91  long unsigned int isA_spin, isB_spin;
96  is1_spin = X->Def.Tpow[2 * isite1 - 2 + sigma1];
97  is2_spin = X->Def.Tpow[2 * isite2 - 2 + sigma2];
101  if (isite1 > isite2) {
102  A_spin = (X->Def.Tpow[2 * isite1 - 2 + sigma1] - X->Def.Tpow[2 * isite2 - 1 + sigma2]);
103  }
104  else if (isite2 > isite1) {
105  A_spin = (X->Def.Tpow[2 * isite2 - 2 + sigma2] - X->Def.Tpow[2 * isite1 - 1 + sigma1]);
106  }
107  else {//isite1=isite2
108  if (sigma1 > sigma2) {
109  A_spin = (X->Def.Tpow[2 * isite1 - 2 + sigma1] - X->Def.Tpow[2 * isite2 - 1 + sigma2]);
110  }
111  else {
112  A_spin = (X->Def.Tpow[2 * isite2 - 2 + sigma2] - X->Def.Tpow[2 * isite1 - 1 + sigma1]);
113  }
114  }
119  is3_spin = X->Def.Tpow[2 * isite3 - 2 + sigma3];
120  is4_spin = X->Def.Tpow[2 * isite4 - 2 + sigma4];
124  if (isite3 > isite4) {
125  B_spin = (X->Def.Tpow[2 * isite3 - 2 + sigma3] - X->Def.Tpow[2 * isite4 - 1 + sigma4]);
126  }
127  else if (isite3 < isite4) {
128  B_spin = (X->Def.Tpow[2 * isite4 - 2 + sigma4] - X->Def.Tpow[2 * isite3 - 1 + sigma3]);
129  }
130  else {//isite3=isite4
131  if (sigma3 > sigma4) {
132  B_spin = (X->Def.Tpow[2 * isite3 - 2 + sigma3] - X->Def.Tpow[2 * isite4 - 1 + sigma4]);
133  }
134  else {
135  B_spin = (X->Def.Tpow[2 * isite4 - 2 + sigma4] - X->Def.Tpow[2 * isite3 - 1 + sigma3]);
136  }
137  }
141  isA_spin = is1_spin + is2_spin;
142  isB_spin = is3_spin + is4_spin;
143 
144  X->Large.is1_spin = is1_spin;
145  X->Large.is2_spin = is2_spin;
146  X->Large.is3_spin = is3_spin;
147  X->Large.is4_spin = is4_spin;
148  X->Large.isA_spin = isA_spin;
149  X->Large.isB_spin = isB_spin;
150  X->Large.A_spin = A_spin;
151  X->Large.B_spin = B_spin;
155  X->Large.tmp_V = tmp_V;
156  X->Large.isite1 = isite1;
157  X->Large.isite2 = isite2;
158  X->Large.isite3 = isite3;
159  X->Large.isite4 = isite4;
160 
161  return 0;
162 }/*int child_general_int_GetInfo*/
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
long unsigned int is4_spin
Mask used in the bit oeration.
Definition: struct.h:335
long unsigned int isB_spin
Mask used in the bit oeration.
Definition: struct.h:347
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
long unsigned int is1_spin
Mask used in the bit oeration.
Definition: struct.h:332
int isite2
Is it realy used ???
Definition: struct.h:337
long unsigned int is3_spin
Mask used in the bit oeration.
Definition: struct.h:334
int isite3
Is it realy used ???
Definition: struct.h:338
long unsigned int A_spin
Mask used in the bit oeration.
Definition: struct.h:341
long unsigned int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.h:90
long unsigned int is2_spin
Mask used in the bit oeration.
Definition: struct.h:333
int isite4
Is it realy used ???
Definition: struct.h:339
double complex tmp_V
Coupling constant.
Definition: struct.h:348
long unsigned int isA_spin
Mask used in the bit oeration.
Definition: struct.h:346
int isite1
Is it realy used ???
Definition: struct.h:336
+ Here is the caller graph for this function:

◆ 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 533 of file mltplyHubbardCore.c.

References GetOffComp(), LargeList::ihfbit, LargeList::ilft, LargeList::irght, LargeList::is1_down, LargeList::is1_up, LargeList::is2_down, LargeList::is2_up, BindStruct::Large, list_1, list_2_1, list_2_2, LargeList::mode, LargeList::tmp_J, and TRUE.

Referenced by child_pairhopp(), and makeHam().

539  {
540  long unsigned int off;
541  long unsigned int ibit1_up, ibit2_up, ibit1_down, ibit2_down;
542  double complex dmv;
543  long unsigned int iexchg;
544  long unsigned int is1_up = X->Large.is1_up;
545  long unsigned int is2_up = X->Large.is2_up;
546  long unsigned int is1_down = X->Large.is1_down;
547  long unsigned int is2_down = X->Large.is2_down;
548  long unsigned int irght = X->Large.irght;
549  long unsigned int ilft = X->Large.ilft;
550  long unsigned int ihfbit = X->Large.ihfbit;
551  double complex tmp_J = X->Large.tmp_J;
552  int mode = X->Large.mode;
553  double complex dam_pr = 0;
554 
555  ibit1_up = list_1[j] & is1_up;
556  ibit2_up = list_1[j] & is2_up;
557  ibit1_down = list_1[j] & is1_down;
558  ibit2_down = list_1[j] & is2_down;
559 
560  if (ibit1_up == 0 && ibit1_down == 0 && ibit2_up != 0 && ibit2_down != 0) {
561  iexchg = list_1[j] - (is2_up + is2_down);
562  iexchg += (is1_up + is1_down);
563 
564  if(GetOffComp(list_2_1, list_2_2, iexchg, irght, ilft, ihfbit, &off)!=TRUE){
565  return 0;
566  }
567  *tmp_off = off;
568  dmv = tmp_J * tmp_v1[j];
569  if (mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
570  tmp_v0[off] += dmv;
571  }
572  dam_pr += dmv * conj(tmp_v1[off]);
573  }
574  return dam_pr;
575 }/*double complex child_pairhopp_element*/
long unsigned int ihfbit
Used for Ogata-Lin ???
Definition: struct.h:345
long unsigned int is2_up
Mask used in the bit oeration.
Definition: struct.h:327
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
#define TRUE
Definition: global.h:26
double complex tmp_J
Coupling constant.
Definition: struct.h:323
long unsigned int is2_down
Mask used in the bit oeration.
Definition: struct.h:328
long unsigned int is1_up
Mask used in the bit oeration.
Definition: struct.h:325
long unsigned int ilft
Used for Ogata-Lin ???
Definition: struct.h:344
long unsigned int is1_down
Mask used in the bit oeration.
Definition: struct.h:326
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
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 169 of file mltplyHubbardCore.c.

References BindStruct::Def, LargeList::is1_down, LargeList::is1_up, LargeList::is2_down, LargeList::is2_up, BindStruct::Large, DefineList::PairHopping, DefineList::ParaPairHopping, LargeList::tmp_J, and DefineList::Tpow.

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

172  {
173  int isite1 = X->Def.PairHopping[iPairHopp][0] + 1;
174  int isite2 = X->Def.PairHopping[iPairHopp][1] + 1;
178  X->Large.tmp_J = X->Def.ParaPairHopping[iPairHopp];
184  X->Large.is1_up = X->Def.Tpow[2 * isite1 - 2];
185  X->Large.is1_down = X->Def.Tpow[2 * isite1 - 1];
186  X->Large.is2_up = X->Def.Tpow[2 * isite2 - 2];
187  X->Large.is2_down = X->Def.Tpow[2 * isite2 - 1];
188 
189  return 0;
190 }/*int child_pairhopp_GetInfo*/
struct DefineList Def
Definision of system (Hamiltonian) etc.
Definition: struct.h:410
long unsigned int is2_up
Mask used in the bit oeration.
Definition: struct.h:327
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int ** PairHopping
[DefineList::NPairHopping][2] Index of pair-hopping. malloc in setmem_def().
Definition: struct.h:140
double complex tmp_J
Coupling constant.
Definition: struct.h:323
long unsigned int is2_down
Mask used in the bit oeration.
Definition: struct.h:328
long unsigned int is1_up
Mask used in the bit oeration.
Definition: struct.h:325
long unsigned int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
Definition: struct.h:90
long unsigned int is1_down
Mask used in the bit oeration.
Definition: struct.h:326
double * ParaPairHopping
[DefineList::NPairHopping] Coupling constant of pair-hopping term. malloc in setmem_def().
Definition: struct.h:142
+ Here is the caller graph for this function:

◆ 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 305 of file mltplyHubbardCore.c.

References FALSE, GetOffComp(), LargeList::ihfbit, LargeList::ilft, LargeList::irght, BindStruct::Large, list_1, list_2_1, list_2_2, LargeList::mode, and SgnBit().

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

315  {
316  long unsigned int ibit_tmp_1, ibit_tmp_2;
317  long unsigned int bit, iexchg, off;
318  int sgn;
319  double complex dmv, dam_pr;
320 
321  ibit_tmp_1 = (list_1[j] & is1_spin);
322  ibit_tmp_2 = (list_1[j] & is2_spin);
323  if (ibit_tmp_1 == 0 && ibit_tmp_2 != 0) {
324  bit = list_1[j] & diff_spin;
325  SgnBit(bit, &sgn); // Fermion sign
326  iexchg = list_1[j] ^ sum_spin;
327 
328  if(GetOffComp(list_2_1, list_2_2, iexchg, X->Large.irght, X->Large.ilft, X->Large.ihfbit, &off)==FALSE){
329  return 0;
330  }
331 /*
332  if(X->Large.mode==M_CORR){
333  fprintf(stdout, "DEBUG-1: myrank=%d, org=%d, bit=%d, iexchg=%d, list_1[%d]=%d\n",
334  myrank, list_1[j], bit, iexchg, off, list_1[off]);
335  }
336 */
337  dmv = sgn * tmp_v1[j];
338  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
339  tmp_v0[off] += tmp_V * dmv;
340  }
341  dam_pr = dmv * conj(tmp_v1[off]);
342  return dam_pr;
343  }
344  else {
345  return 0;
346  }
347 }
long unsigned int ihfbit
Used for Ogata-Lin ???
Definition: struct.h:345
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
long unsigned int ilft
Used for Ogata-Lin ???
Definition: struct.h:344
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
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
Definition: bitcalc.c:339
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 260 of file mltplyHubbardCore.c.

References BindStruct::Large, and LargeList::mode.

Referenced by GetPairExcitedStateHubbardGC().

267  {
268  long unsigned int A_ibit_tmp;
269  long unsigned int list_1_j;
270  double complex dmv;
271  double complex dam_pr;
272 
273  list_1_j = j - 1;
274  A_ibit_tmp = (list_1_j & is1_spin) / is1_spin;
275  dmv = tmp_v1[j] * (1 - A_ibit_tmp);
276  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
277  tmp_v0[j] += dmv * tmp_trans;
278  }/*if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC)*/
279  dam_pr = dmv * conj(tmp_v1[j]);
280  return dam_pr;
281 }/*double complex GC_AisCis*/
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
+ Here is the caller graph for this function:

◆ 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 1031 of file mltplyHubbardCore.c.

References myrank, and SgnBit().

Referenced by GetSingleExcitedStateHubbardGC().

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

◆ 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 834 of file mltplyHubbardCore.c.

References BindStruct::Large, LargeList::mode, and X_CisAis().

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

843  {
844  int tmp_sgn;
845  double complex dmv;
846  double complex dam_pr = 0;
847  tmp_sgn = X_CisAis(j - 1, X, isite3);
848  tmp_sgn *= X_CisAis(j - 1, X, isite1);
849  if (tmp_sgn != 0) {
850  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
851  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
852  tmp_v0[j] += dmv;
853  }
854  dam_pr = conj(tmp_v1[j]) * dmv;
855  }
856  return dam_pr;
857 }/*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 LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 865 of file mltplyHubbardCore.c.

References BindStruct::Large, LargeList::mode, X_CisAis(), and X_GC_CisAjt().

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

877  {
878  int tmp_sgn;
879  double complex dmv;
880  double complex dam_pr = 0 + 0 * I;
881  tmp_sgn = X_GC_CisAjt((j - 1), X, isite3, isite4, Bsum, Bdiff, tmp_off);
882  if (tmp_sgn != 0) {
883  tmp_sgn *= X_CisAis(*tmp_off, X, isite1);
884  if (tmp_sgn != 0) {
885  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
886  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
887  tmp_v0[*tmp_off + 1] += dmv;
888  }
889  dam_pr = conj(tmp_v1[*tmp_off + 1]) * dmv;
890  }
891  }
892  return dam_pr;
893 }/*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)
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 901 of file mltplyHubbardCore.c.

References BindStruct::Large, LargeList::mode, X_CisAis(), and X_GC_CisAjt().

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

913  {
914  int tmp_sgn;
915  double complex dmv;
916  double complex dam_pr = 0 + 0 * I;
917  tmp_sgn = X_CisAis((j - 1), X, isite3);
918  if (tmp_sgn != 0) {
919  tmp_sgn *= X_GC_CisAjt((j - 1), X, isite1, isite2, Asum, Adiff, tmp_off);
920  if (tmp_sgn != 0) {
921  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
922  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
923  tmp_v0[*tmp_off + 1] += dmv;
924  }
925  dam_pr = conj(tmp_v1[*tmp_off + 1]) * dmv;
926  }/*if (tmp_sgn != 0)*/
927  }/*if (tmp_sgn != 0)*/
928  return dam_pr;
929 }/*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)
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 937 of file mltplyHubbardCore.c.

References BindStruct::Large, LargeList::mode, and X_GC_CisAjt().

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

952  {
953  int tmp_sgn;
954  long unsigned int tmp_off_1;
955  double complex dmv;
956  double complex dam_pr = 0 + 0 * I;
957 
958  tmp_sgn = X_GC_CisAjt((j - 1), X, isite3, isite4, Bsum, Bdiff, &tmp_off_1);
959  if (tmp_sgn != 0) {
960  tmp_sgn *= X_GC_CisAjt(tmp_off_1, X, isite1, isite2, Asum, Adiff, tmp_off_2);
961  if (tmp_sgn != 0) {
962  dmv = tmp_V * tmp_v1[j] * tmp_sgn;
963  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) { // for multply
964  tmp_v0[*tmp_off_2 + 1] += dmv;
965  }
966  dam_pr = conj(tmp_v1[*tmp_off_2 + 1]) * dmv;
967  }
968  }
969  return dam_pr;
970 }/*double complex GC_child_CisAjtCkuAlv_element*/
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 582 of file mltplyHubbardCore.c.

References LargeList::is1_down, LargeList::is1_up, LargeList::is2_down, LargeList::is2_up, BindStruct::Large, LargeList::mode, and LargeList::tmp_J.

Referenced by GC_child_exchange(), and makeHam().

588  {
589  long unsigned int ibit1_up, ibit2_up, ibit1_down, ibit2_down;
590  double complex dmv;
591  long unsigned int iexchg;
592  long unsigned int is1_up = X->Large.is1_up;
593  long unsigned int is2_up = X->Large.is2_up;
594  long unsigned int is1_down = X->Large.is1_down;
595  long unsigned int is2_down = X->Large.is2_down;
596  long unsigned int list_1_j, list_1_off;
597  double complex tmp_J = X->Large.tmp_J;
598  int mode = X->Large.mode;
599  double complex dam_pr = 0;
600 
601  list_1_j = j - 1;
602  ibit1_up = list_1_j & is1_up;
603  ibit2_up = list_1_j & is2_up;
604  ibit1_down = list_1_j & is1_down;
605  ibit2_down = list_1_j & is2_down;
606 
607  if (ibit1_up == 0 && ibit1_down != 0 && ibit2_up != 0 && ibit2_down == 0) {
608 
609  iexchg = list_1_j - (is1_down + is2_up);
610  iexchg += (is1_up + is2_down);
611  list_1_off = iexchg;
612  *tmp_off = list_1_off;
613 
614  dmv = tmp_J * tmp_v1[j];
615  if (mode == M_MLTPLY) {
616  tmp_v0[list_1_off + 1] += dmv;
617  }
618  dam_pr += dmv * conj(tmp_v1[list_1_off + 1]);
619  }
620  else if (ibit1_up != 0 && ibit1_down == 0 && ibit2_up == 0 && ibit2_down != 0) {
621  iexchg = list_1_j - (is1_up + is2_down);
622  iexchg += (is1_down + is2_up);
623  list_1_off = iexchg;
624  *tmp_off = list_1_off;
625 
626  dmv = tmp_J * tmp_v1[j];
627  if (mode == M_MLTPLY) {
628  tmp_v0[list_1_off + 1] += dmv;
629  }
630  dam_pr += dmv * conj(tmp_v1[list_1_off + 1]);
631  }
632  return dam_pr;
633 }/*double complex GC_child_exchange_element*/
long unsigned int is2_up
Mask used in the bit oeration.
Definition: struct.h:327
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
double complex tmp_J
Coupling constant.
Definition: struct.h:323
long unsigned int is2_down
Mask used in the bit oeration.
Definition: struct.h:328
long unsigned int is1_up
Mask used in the bit oeration.
Definition: struct.h:325
long unsigned int is1_down
Mask used in the bit oeration.
Definition: struct.h:326
+ Here is the caller graph for this function:

◆ 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 640 of file mltplyHubbardCore.c.

References LargeList::is1_down, LargeList::is1_up, LargeList::is2_down, LargeList::is2_up, BindStruct::Large, LargeList::mode, and LargeList::tmp_J.

Referenced by GC_child_pairhopp(), and makeHam().

646  {
647  long unsigned int ibit1_up, ibit2_up, ibit1_down, ibit2_down;
648  double complex dmv;
649  long unsigned int iexchg;
650  long unsigned int is1_up = X->Large.is1_up;
651  long unsigned int is2_up = X->Large.is2_up;
652  long unsigned int is1_down = X->Large.is1_down;
653  long unsigned int is2_down = X->Large.is2_down;
654  long unsigned int list_1_j, list_1_off;
655  double complex tmp_J = X->Large.tmp_J;
656  int mode = X->Large.mode;
657 
658  double complex dam_pr = 0 + 0 * I;
659  list_1_j = j - 1;
660 
661  ibit1_up = list_1_j & is1_up;
662 
663  ibit2_up = list_1_j & is2_up;
664 
665  ibit1_down = list_1_j & is1_down;
666 
667  ibit2_down = list_1_j & is2_down;
668 
669  if (ibit1_up == 0 && ibit1_down == 0 && ibit2_up != 0 && ibit2_down != 0) {
670  iexchg = list_1_j - (is2_up + is2_down);
671  iexchg += (is1_up + is1_down);
672  list_1_off = iexchg;
673  *tmp_off = list_1_off;
674  dmv = tmp_J * tmp_v1[j];
675  if (mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
676  tmp_v0[list_1_off + 1] += dmv;
677  }
678  dam_pr += dmv * conj(tmp_v1[list_1_off + 1]);
679  }
680  return dam_pr;
681 }
long unsigned int is2_up
Mask used in the bit oeration.
Definition: struct.h:327
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
double complex tmp_J
Coupling constant.
Definition: struct.h:323
long unsigned int is2_down
Mask used in the bit oeration.
Definition: struct.h:328
long unsigned int is1_up
Mask used in the bit oeration.
Definition: struct.h:325
long unsigned int is1_down
Mask used in the bit oeration.
Definition: struct.h:326
+ Here is the caller graph for this function:

◆ 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 980 of file mltplyHubbardCore.c.

References myrank, and SgnBit().

Referenced by GetSingleExcitedStateHubbardGC().

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

◆ 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 233 of file mltplyHubbardCore.c.

References BindStruct::Large, and LargeList::mode.

Referenced by GC_child_general_hopp().

240  {
241  long unsigned int A_ibit_tmp;
242  long unsigned int list_1_j;
243  double complex dmv;
244  double complex dam_pr;
245 
246  list_1_j = j - 1;
247  A_ibit_tmp = (list_1_j & is1_spin) / is1_spin;
248  dmv = tmp_v1[j] * A_ibit_tmp;
249  if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC) {
250  tmp_v0[j] += dmv * tmp_trans;
251  }/*if (X->Large.mode == M_MLTPLY || X->Large.mode == M_CALCSPEC)*/
252  dam_pr = dmv * conj(tmp_v1[j]);
253  return dam_pr;
254 }/*double complex GC_CisAis*/
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
int mode
multiply or expectation value.
Definition: struct.h:330
+ Here is the caller graph for this function:

◆ 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 354 of file mltplyHubbardCore.c.

References BindStruct::Large, LargeList::mode, and SgnBit().

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

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

◆ 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 1135 of file mltplyHubbardCore.c.

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

Referenced by GetSingleExcitedStateHubbard().

1145  {
1146  long unsigned int list_1_j, list_1_off;
1147  long unsigned int ibit_tmp_1;
1148  long unsigned int bit;
1149  int sgn, ipsgn;
1150 
1151  list_1_j = list_1_org[j];
1152 
1153  ibit_tmp_1 = (list_1_j & is1_spin);
1154 // is1_spin >= 1
1155 // is1_spin = Tpow[2*isite + ispin]
1156 
1157  *tmp_off = 0;
1158  if (ibit_tmp_1 != 0) {
1159  // able to delete an electron at the is1_spin state
1160  bit = list_1_j - (list_1_j & (2 * is1_spin - 1));
1161  SgnBit(bit, &sgn); // Fermion sign
1162  ipsgn = 1;
1163 #ifdef MPI
1164  SgnBit(myrank, &ipsgn); // Fermion sign
1165 #endif
1166  list_1_off = list_1_j ^ is1_spin;
1167  if(GetOffComp(list_2_1_target, list_2_2_target, list_1_off, _irght, _ilft, _ihfbit, tmp_off)!=TRUE){
1168  *tmp_off=0;
1169  return 0;
1170  }
1171  sgn *= ipsgn;
1172  return(sgn);
1173  }
1174  else {
1175  *tmp_off = 0;
1176  return 0;
1177  }
1178 }/*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:163
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
Definition: bitcalc.c:339
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 1081 of file mltplyHubbardCore.c.

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

Referenced by GetSingleExcitedStateHubbard().

1091  {
1092  long unsigned int list_1_j, list_1_off;
1093  long unsigned int ibit_tmp_1;
1094  long unsigned int bit;
1095  int sgn, ipsgn;
1096 
1097  list_1_j = list_1_org[j];
1098 
1099  ibit_tmp_1 = (list_1_j & is1_spin);
1100  // is1_spin >= 1
1101  // is1_spin = Tpow[2*isite + ispin]
1102 
1103  *tmp_off = 0;
1104 
1105  if (ibit_tmp_1 == 0) {
1106  // able to create an electron at the is1_spin state
1107  bit = list_1_j - (list_1_j & (2 * is1_spin - 1));
1108  SgnBit(bit, &sgn); // Fermion sign
1109  ipsgn = 1;
1110 #ifdef MPI
1111  SgnBit(myrank, &ipsgn); // Fermion sign
1112 #endif
1113  list_1_off = list_1_j | is1_spin; // OR
1114 
1115  if(GetOffComp(list_2_1_target, list_2_2_target, list_1_off, _irght, _ilft, _ihfbit, tmp_off)!=TRUE){
1116  *tmp_off=0;
1117  return 0;
1118  }
1119  sgn *= ipsgn;
1120  return (sgn);
1121  }
1122  else {
1123  *tmp_off = 0;
1124  return 0;
1125  }
1126 }/*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:163
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
Definition: bitcalc.c:339
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 288 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().

292  {
293  int A_ibit_tmp;
294 
295  // off = j
296  A_ibit_tmp = (list_1_j & is1_spin) / is1_spin;
297  return A_ibit_tmp;
298 }
+ Here is the caller graph for this function:

◆ 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 399 of file mltplyHubbardCore.c.

References GetOffComp(), LargeList::ihfbit, LargeList::ilft, LargeList::irght, BindStruct::Large, list_2_1, list_2_2, TRUE, and X_GC_CisAjt().

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

407  {
408  long unsigned int off;
409  int sgn = 1;
410 
411  sgn = X_GC_CisAjt(list_1_j, X, is1_spin, is2_spin, sum_spin, diff_spin, tmp_off);
412  if (sgn != 0) {
413  if(GetOffComp(list_2_1, list_2_2, *tmp_off, X->Large.irght, X->Large.ilft, X->Large.ihfbit, &off)!=TRUE){
414  *tmp_off = 0;
415  return 0;
416  }
417  *tmp_off = off;
418  return sgn;
419  }
420  else {
421  *tmp_off = 0;
422  return 0;
423  }
424 }/*int X_CisAjt*/
long unsigned int ihfbit
Used for Ogata-Lin ???
Definition: struct.h:345
struct LargeList Large
Variables for Matrix-Vector product.
Definition: struct.h:412
#define TRUE
Definition: global.h:26
long unsigned int ilft
Used for Ogata-Lin ???
Definition: struct.h:344
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
long unsigned int irght
Used for Ogata-Lin ???
Definition: struct.h:343
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 431 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().

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