HΦ
3.2.0
|
File for giving functions of treating bits on the target of Hilbert space. More...
#include "bitcalc.h"
#include "wrapperMPI.h"
Go to the source code of this file.
Functions | |
int | GetSplitBit (const int Nsite, long unsigned int *irght, long unsigned int *ilft, long unsigned int *ihfbit) |
function of getting right, left and half bits corresponding to a original Hilbert space. } More... | |
int | GetSplitBitByModel (const int Nsite, const int iCalcModel, long unsigned int *irght, long unsigned int *ilft, long unsigned int *ihfbit) |
function of splitting original bit into right and left spaces. More... | |
int | GetSplitBitForGeneralSpin (const int Nsite, long unsigned int *ihfbit, const long int *SiteToBit) |
function of getting right, left and half bits corresponding to a original space. More... | |
void | SplitBit (const long unsigned int ibit, const long unsigned int irght, const long unsigned int ilft, const long unsigned int ihfbit, long unsigned int *isplited_Bit_right, long unsigned int *isplited_Bit_left) |
function of splitting a original bit to right and left spaces More... | |
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 More... | |
int | GetOffCompGeneralSpin (const long unsigned int org_ibit, const int org_isite, const int org_ispin, const int off_ispin, long unsigned int *_ioffComp, const long int *SiteToBit, const long unsigned int *Tpow) |
function of getting off-diagonal component for general spin More... | |
int | ConvertToList1GeneralSpin (const long unsigned int org_ibit, const long unsigned int ihlfbit, long unsigned int *_ilist1Comp) |
function of converting component to list_1 More... | |
void | SgnBit_old (const long unsigned int org_bit, int *sgn) |
function of getting fermion signs (for 32bit) More... | |
void | SgnBit (const long unsigned int org_bit, int *sgn) |
function of getting fermion sign (64 bit) More... | |
int | BitCheck (const long unsigned int org_bit, const long unsigned int target_bit) |
bit check function More... | |
int | BitCheckGeneral (const long unsigned int org_bit, const unsigned int org_isite, const unsigned int target_ispin, const long int *SiteToBit, const long unsigned int *Tpow) |
bit check function for general spin More... | |
int | GetBitGeneral (const unsigned int isite, const long unsigned int org_bit, const long int *SiteToBit, const long unsigned int *Tpow) |
get bit at a site for general spin More... | |
int | GetLocal2Sz (const unsigned int isite, const long unsigned int org_bit, const long int *SiteToBit, const long unsigned int *Tpow) |
get 2sz at a site for general spin More... | |
unsigned long int | snoob (unsigned long int x) |
"finding the next higher number after a given number that has the same number of 1-bits" This method is introduced in S.H. Warren, Hacker$B!G(Bs Delight, second ed., Addison-Wesley, ISBN: 0321842685, 2012. More... | |
int | pop (unsigned int x) |
calculating number of 1-bits in x (32 bit) This method is introduced in S.H. Warren, Hacker$B!G(Bs Delight, second ed., Addison-Wesley, ISBN: 0321842685, 2012. More... | |
File for giving functions of treating bits on the target of Hilbert space.
Definition in file bitcalc.c.
int BitCheck | ( | const long unsigned int | org_bit, |
const long unsigned int | target_bit | ||
) |
int BitCheckGeneral | ( | const long unsigned int | org_bit, |
const unsigned int | org_isite, | ||
const unsigned int | target_ispin, | ||
const long int * | SiteToBit, | ||
const long unsigned int * | Tpow | ||
) |
bit check function for general spin
org_bit | original bit to check |
org_isite | site index (org_isite >= 1) |
target_ispin | target spin to check |
SiteToBit | List for getting bit at a site |
Tpow | List for getting total bit at a site before |
0 | bit does not exists |
1 | bit exists |
[in] | org_bit | |
[in] | org_isite | |
[in] | target_ispin | |
[in] | SiteToBit | |
[in] | Tpow |
Definition at line 393 of file bitcalc.c.
References FALSE, GetBitGeneral(), and TRUE.
Referenced by expec_cisajs_SpinGCGeneral(), expec_cisajs_SpinGeneral(), expec_cisajscktalt_SpinGCGeneral(), expec_cisajscktalt_SpinGeneral(), GetOffCompGeneralSpin(), GetPairExcitedStateGeneralSpin(), GetPairExcitedStateGeneralSpinGC(), mltplyGeneralSpinGC(), SetDiagonalChemi(), SetDiagonalInterAll(), SetDiagonalTEChemi(), SetDiagonalTEInterAll(), SetDiagonalTETransfer(), X_child_CisAisCjuAju_GeneralSpin_MPIdouble(), X_child_CisAisCjuAju_GeneralSpin_MPIsingle(), X_GC_child_AisCis_GeneralSpin_MPIdouble(), X_GC_child_CisAis_GeneralSpin_MPIdouble(), X_GC_child_CisAisCjuAju_GeneralSpin_MPIdouble(), X_GC_child_CisAisCjuAju_GeneralSpin_MPIsingle(), X_GC_child_CisAisCjuAjv_GeneralSpin_MPIdouble(), X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle(), X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble(), and X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle().
int ConvertToList1GeneralSpin | ( | const long unsigned int | org_ibit, |
const long unsigned int | ihlfbit, | ||
long unsigned int * | _ilist1Comp | ||
) |
function of converting component to list_1
org_ibit | a original bit |
ihlfbit | a split bit for general spin |
_ilist1Comp | a component converted to list_1 |
[in] | org_ibit | |
[in] | ihlfbit | |
[out] | _ilist1Comp |
Definition at line 285 of file bitcalc.c.
References FALSE, list_2_1, list_2_2, and TRUE.
Referenced by expec_cisajscktalt_SpinGeneral(), GetPairExcitedStateGeneralSpin(), makeHam(), mltplyGeneralSpin(), totalspin_Spin(), X_child_CisAit_GeneralSpin_MPIdouble(), X_child_CisAitCjuAjv_GeneralSpin_MPIdouble(), and X_child_CisAitCjuAjv_GeneralSpin_MPIsingle().
int GetBitGeneral | ( | const unsigned int | isite, |
const long unsigned int | org_bit, | ||
const long int * | SiteToBit, | ||
const long unsigned int * | Tpow | ||
) |
get bit at a site for general spin
isite | site index (isite >= 1) |
org_bit | original bit to check |
SiteToBit | List for getting bit at a site |
Tpow | List for getting total bit at a site before |
[in] | isite | |
[in] | org_bit | |
[in] | SiteToBit | |
[in] | Tpow |
Definition at line 422 of file bitcalc.c.
References GetLocal2Sz().
Referenced by BitCheckGeneral(), GetLocal2Sz(), totalspin_Spin(), and totalspin_SpinGC().
int GetLocal2Sz | ( | const unsigned int | isite, |
const long unsigned int | org_bit, | ||
const long int * | SiteToBit, | ||
const long unsigned int * | Tpow | ||
) |
get 2sz at a site for general spin
isite | site index (isite >= 1) |
org_bit | original bit to check |
SiteToBit | List for getting bit at a site |
Tpow | List for getting total bit at a site before |
[in] | isite | |
[in] | org_bit | |
[in] | SiteToBit | |
[in] | Tpow |
Definition at line 449 of file bitcalc.c.
References GetBitGeneral().
Referenced by check(), expec_cisajscktalt_SpinGeneral(), expec_energy_flct_GeneralSpin(), expec_energy_flct_GeneralSpinGC(), GetBitGeneral(), sz(), totalspin_Spin(), totalspin_SpinGC(), and totalSz_SpinGC().
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
_list_2_1 | list to right space |
_list_2_2 | list to left space |
_ibit | a original bit |
_irght | a bit to split original space into right space |
_ilft | a bit to split original space into left space |
_ihfbit | a half bit to split original space |
_ioffComp | an off diagonal component |
[in] | _list_2_1 | |
[in] | _list_2_2 | |
[in] | _ibit | |
[in] | _irght | |
[in] | _ilft | |
[in] | _ihfbit | |
[out] | _ioffComp |
Definition at line 195 of file bitcalc.c.
References FALSE, SplitBit(), and TRUE.
Referenced by child_exchange_element(), child_exchange_spin_element(), child_pairhopp_element(), CisAjt(), totalspin_Hubbard(), totalspin_Spin(), X_Ajt(), X_Ajt_MPI(), X_child_CisAit_spin_MPIdouble(), X_child_CisAjt_MPIdouble(), X_child_CisAjt_MPIsingle(), X_child_CisAjtCkuAku_Hubbard_MPI(), X_child_CisAjtCkuAlv_Hubbard_MPI(), X_child_exchange_spin_element(), X_child_general_hopp_MPIdouble(), X_child_general_hopp_MPIsingle(), X_child_general_int_spin_MPIdouble(), X_child_general_int_spin_MPIsingle(), X_child_general_int_spin_TotalS_MPIdouble(), X_Cis(), X_Cis_MPI(), X_CisAjt(), and X_Spin_CisAit().
int GetOffCompGeneralSpin | ( | const long unsigned int | org_ibit, |
const int | org_isite, | ||
const int | org_ispin, | ||
const int | off_ispin, | ||
long unsigned int * | _ioffComp, | ||
const long int * | SiteToBit, | ||
const long unsigned int * | Tpow | ||
) |
function of getting off-diagonal component for general spin
org_ibit | a original bit |
org_isite | a target site |
org_ispin | a target spin to delete. |
off_ispin | a target spin to create. |
_ioffComp | a generated bit |
SiteToBit | List for getting bit at a site |
Tpow | List for getting total bit at a site before |
FALSE | off-diagonal component does not exist |
TRUE | off-diagonal component exists |
[in] | org_ibit | |
[in] | org_isite | |
[in] | org_ispin | |
[in] | off_ispin | |
[out] | _ioffComp | |
[in] | SiteToBit | |
[in] | Tpow |
Definition at line 243 of file bitcalc.c.
References BitCheckGeneral(), FALSE, and TRUE.
Referenced by expec_cisajs_SpinGCGeneral(), expec_cisajscktalt_SpinGCGeneral(), expec_cisajscktalt_SpinGeneral(), GetPairExcitedStateGeneralSpin(), GetPairExcitedStateGeneralSpinGC(), makeHam(), mltplyGeneralSpin(), mltplyGeneralSpinGC(), totalspin_Spin(), totalspin_SpinGC(), X_child_CisAit_GeneralSpin_MPIdouble(), X_child_CisAitCjuAjv_GeneralSpin_MPIdouble(), X_child_CisAitCjuAjv_GeneralSpin_MPIsingle(), X_GC_child_CisAisCjuAjv_GeneralSpin_MPIdouble(), X_GC_child_CisAisCjuAjv_GeneralSpin_MPIsingle(), X_GC_child_CisAit_GeneralSpin_MPIdouble(), X_GC_child_CisAitCjuAju_GeneralSpin_MPIdouble(), X_GC_child_CisAitCjuAju_GeneralSpin_MPIsingle(), X_GC_child_CisAitCjuAjv_GeneralSpin_MPIdouble(), and X_GC_child_CisAitCjuAjv_GeneralSpin_MPIsingle().
int GetSplitBit | ( | const int | Nsite, |
long unsigned int * | irght, | ||
long unsigned int * | ilft, | ||
long unsigned int * | ihfbit | ||
) |
function of getting right, left and half bits corresponding to a original Hilbert space. }
Nsite | a total number of sites |
irght | a bit to split original Hilbert space into right space \(2^{(Ns+2)/2}-1\) |
ilft | a bit to split original Hilbert space into left space |
ihfbit | a half bit to split original Hilbert space \(2^{(Ns+2)/2}\) |
[in] | Nsite | |
[out] | irght | |
[out] | ilft | |
[out] | ihfbit |
Definition at line 45 of file bitcalc.c.
References cErrSiteNumber.
Referenced by GetSplitBitByModel().
int GetSplitBitByModel | ( | const int | Nsite, |
const int | iCalcModel, | ||
long unsigned int * | irght, | ||
long unsigned int * | ilft, | ||
long unsigned int * | ihfbit | ||
) |
function of splitting original bit into right and left spaces.
Nsite | a total number of sites |
iCalcModel | Calc model defined in CalcMode file |
irght | a bit to split original space into right space |
ilft | a bit to split original space into left space |
ihfbit | a half bit to split original space |
[in] | Nsite | |
[in] | iCalcModel | |
[out] | irght | |
[out] | ilft | |
[out] | ihfbit |
Definition at line 78 of file bitcalc.c.
References cErrNoModel, and GetSplitBit().
Referenced by expec_cisajs(), expec_cisajscktaltdc(), expec_energy_flct(), GetPairExcitedState(), GetPairExcitedStateHubbard(), makeHam(), mltply(), sz(), totalspin_Hubbard(), and totalspin_Spin().
int GetSplitBitForGeneralSpin | ( | const int | Nsite, |
long unsigned int * | ihfbit, | ||
const long int * | SiteToBit | ||
) |
function of getting right, left and half bits corresponding to a original space.
Nsite | a total number of sites |
ihfbit | a bit to split original space |
0 | normally finished |
-1 | unnormally finished |
[in] | Nsite | |
[out] | ihfbit | |
[in] | SiteToBit |
Definition at line 124 of file bitcalc.c.
References cErrSiteNumber.
Referenced by check(), GetPairExcitedState(), and mltply().
int pop | ( | unsigned int | x | ) |
calculating number of 1-bits in x (32 bit) This method is introduced in S.H. Warren, Hacker$B!G(Bs Delight, second ed., Addison-Wesley, ISBN: 0321842685, 2012.
x |
Definition at line 492 of file bitcalc.c.
Referenced by expec_energy_flct_HalfSpin(), expec_energy_flct_HalfSpinGC(), expec_energy_flct_Hubbard(), and expec_energy_flct_HubbardGC().
void SgnBit | ( | const long unsigned int | org_bit, |
int * | sgn | ||
) |
function of getting fermion sign (64 bit)
org_bit | an original bit |
sgn | fermion sign |
[in] | org_bit | |
[out] | sgn |
Definition at line 339 of file bitcalc.c.
Referenced by CisAjt(), GC_Ajt(), GC_Cis(), GC_CisAjt(), X_Ajt(), X_Ajt_MPI(), X_child_CisAjt_MPIdouble(), X_child_CisAjt_MPIsingle(), X_child_CisAjtCkuAku_Hubbard_MPI(), X_child_general_hopp_MPIdouble(), X_child_general_hopp_MPIsingle(), X_Cis(), X_Cis_MPI(), X_GC_Ajt_MPI(), X_GC_child_CisAjtCkuAku_Hubbard_MPI(), X_GC_child_general_hopp_MPIdouble(), X_GC_child_general_hopp_MPIsingle(), X_GC_Cis_MPI(), and X_GC_CisAjt().
void SgnBit_old | ( | const long unsigned int | org_bit, |
int * | sgn | ||
) |
function of getting fermion signs (for 32bit)
org_bit | an original bit |
sgn | fermion sign |
[in] | org_bit | |
[out] | sgn |
unsigned long int snoob | ( | unsigned long int | x | ) |
"finding the next higher number after a given number that has the same number of 1-bits" This method is introduced in S.H. Warren, Hacker$B!G(Bs Delight, second ed., Addison-Wesley, ISBN: 0321842685, 2012.
x |
Definition at line 474 of file bitcalc.c.
Referenced by child_omp_sz_hacker(), child_omp_sz_Kondo_hacker(), child_omp_sz_spin_hacker(), and sz().
void SplitBit | ( | const long unsigned int | ibit, |
const long unsigned int | irght, | ||
const long unsigned int | ilft, | ||
const long unsigned int | ihfbit, | ||
long unsigned int * | isplited_Bit_right, | ||
long unsigned int * | isplited_Bit_left | ||
) |
function of splitting a original bit to right and left spaces
ibit | a original bit |
irght | a bit to split original space into right space |
ilft | a bit to split original space into left space |
ihfbit | a half bit to split original space |
isplited_Bit_right | a splitted bit reflected on right space |
isplited_Bit_left | a splitted bit reflected on left space |
[in] | ibit | |
[in] | irght | |
[in] | ilft | |
[in] | ihfbit | |
[out] | isplited_Bit_right | |
[out] | isplited_Bit_left |
Definition at line 166 of file bitcalc.c.
Referenced by GetOffComp().