HPhi++
3.1.0
|
File for giving functions of treating bits on the target of Hilbert space. More...
#include "bitcalc.hpp"
#include "wrapperMPI.hpp"
Go to the source code of this file.
Functions | |
int | GetSplitBit (const int Nsite, long int *irght, long int *ilft, long 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 int *irght, long int *ilft, long int *ihfbit) |
function of splitting original bit into right and left spaces. More... | |
int | GetSplitBitForGeneralSpin (const int Nsite, long int *ihfbit, const long int *SiteToBit) |
function of getting right, left and half bits corresponding to a original space. More... | |
void | SplitBit (const long int ibit, const long int irght, const long int ilft, const long int ihfbit, long int *isplited_Bit_right, long int *isplited_Bit_left) |
function of splitting a original bit to right and left spaces More... | |
int | GetOffComp (long int *_list_2_1, long int *_list_2_2, long int _ibit, const long int _irght, const long int _ilft, const long int _ihfbit, long int *_ioffComp) |
function of getting off-diagonal component More... | |
int | GetOffCompGeneralSpin (const long int org_ibit, const int org_isite, const int org_ispin, const int off_ispin, long int *_ioffComp, const long int *SiteToBit, const long int *Tpow) |
function of getting off-diagonal component for general spin More... | |
int | ConvertToList1GeneralSpin (const long int org_ibit, const long int ihlfbit, long int *_ilist1Comp) |
function of converting component to list_1 More... | |
void | SgnBit_old (const long int org_bit, int *sgn) |
function of getting fermion signs (for 32bit) More... | |
void | SgnBit (const long int org_bit, int *sgn) |
function of getting fermion sign (64 bit) More... | |
int | BitCheck (const long int org_bit, const long int target_bit) |
bit check function More... | |
int | BitCheckGeneral (const long int org_bit, const int org_isite, const int target_ispin, const long int *SiteToBit, const long int *Tpow) |
bit check function for general spin More... | |
int | GetBitGeneral (const int isite, const long int org_bit, const long int *SiteToBit, const long int *Tpow) |
get bit at a site for general spin More... | |
int | GetLocal2Sz (const int isite, const long int org_bit, const long int *SiteToBit, const long int *Tpow) |
get 2sz at a site for general spin More... | |
long int | snoob (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’s Delight, second ed., Addison-Wesley, ISBN: 0321842685, 2012. More... | |
int | pop (int x) |
calculating number of 1-bits in x (32 bit) This method is introduced in S.H. Warren, Hacker’s 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.cpp.
int BitCheck | ( | const long int | org_bit, |
const long int | target_bit | ||
) |
bit check function
org_bit | original bit to check |
target_bit | target bit to check |
1 | |
0 |
[in] | org_bit | |
[in] | target_bit |
Definition at line 366 of file bitcalc.cpp.
int BitCheckGeneral | ( | const long int | org_bit, |
const int | org_isite, | ||
const int | target_ispin, | ||
const long int * | SiteToBit, | ||
const long 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 392 of file bitcalc.cpp.
References GetBitGeneral().
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 int | org_ibit, |
const long int | ihlfbit, | ||
long 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.cpp.
References list_2_1, and list_2_2.
Referenced by expec_cisajscktalt_SpinGeneral(), GetPairExcitedStateGeneralSpin(), mltplyGeneralSpin(), totalspin_Spin(), X_child_CisAit_GeneralSpin_MPIdouble(), X_child_CisAitCjuAjv_GeneralSpin_MPIdouble(), and X_child_CisAitCjuAjv_GeneralSpin_MPIsingle().
int GetBitGeneral | ( | const int | isite, |
const long int | org_bit, | ||
const long int * | SiteToBit, | ||
const long 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 421 of file bitcalc.cpp.
References GetLocal2Sz().
Referenced by BitCheckGeneral(), GetLocal2Sz(), totalspin_Spin(), and totalspin_SpinGC().
int GetLocal2Sz | ( | const int | isite, |
const long int | org_bit, | ||
const long int * | SiteToBit, | ||
const long 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 448 of file bitcalc.cpp.
References GetBitGeneral().
Referenced by check(), expec_cisajscktalt_SpinGeneral(), expec_energy_flct_GeneralSpin(), expec_energy_flct_GeneralSpinGC(), GetBitGeneral(), sz(), totalspin_Spin(), and totalspin_SpinGC().
int GetOffComp | ( | long int * | _list_2_1, |
long int * | _list_2_2, | ||
long int | _ibit, | ||
const long int | _irght, | ||
const long int | _ilft, | ||
const long int | _ihfbit, | ||
long 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.cpp.
References SplitBit().
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 int | org_ibit, |
const int | org_isite, | ||
const int | org_ispin, | ||
const int | off_ispin, | ||
long int * | _ioffComp, | ||
const long int * | SiteToBit, | ||
const long 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.cpp.
References BitCheckGeneral().
Referenced by expec_cisajs_SpinGCGeneral(), expec_cisajscktalt_SpinGCGeneral(), expec_cisajscktalt_SpinGeneral(), GetPairExcitedStateGeneralSpin(), GetPairExcitedStateGeneralSpinGC(), 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 int * | irght, | ||
long int * | ilft, | ||
long 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.cpp.
Referenced by GetSplitBitByModel().
int GetSplitBitByModel | ( | const int | Nsite, |
const int | iCalcModel, | ||
long int * | irght, | ||
long int * | ilft, | ||
long 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.cpp.
References GetSplitBit().
Referenced by expec_cisajs(), expec_cisajscktaltdc(), expec_energy_flct(), GetPairExcitedState(), GetPairExcitedStateHubbard(), mltply(), sz(), totalspin_Hubbard(), and totalspin_Spin().
int GetSplitBitForGeneralSpin | ( | const int | Nsite, |
long 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.cpp.
Referenced by check(), GetPairExcitedState(), and mltply().
int pop | ( | int | x | ) |
calculating number of 1-bits in x (32 bit) This method is introduced in S.H. Warren, Hacker’s Delight, second ed., Addison-Wesley, ISBN: 0321842685, 2012.
x |
Definition at line 491 of file bitcalc.cpp.
Referenced by expec_energy_flct_HalfSpin(), expec_energy_flct_HalfSpinGC(), expec_energy_flct_Hubbard(), and expec_energy_flct_HubbardGC().
void SgnBit | ( | const long 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 338 of file bitcalc.cpp.
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 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 |
Definition at line 312 of file bitcalc.cpp.
long int snoob | ( | 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’s Delight, second ed., Addison-Wesley, ISBN: 0321842685, 2012.
x |
Definition at line 473 of file bitcalc.cpp.
Referenced by child_omp_sz_hacker(), child_omp_sz_Kondo_hacker(), child_omp_sz_spin_hacker(), and sz().
void SplitBit | ( | const long int | ibit, |
const long int | irght, | ||
const long int | ilft, | ||
const long int | ihfbit, | ||
long int * | isplited_Bit_right, | ||
long 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.cpp.
Referenced by GetOffComp().