17 #include "wrapperMPI.h" 47 long unsigned int *irght,
48 long unsigned int *ilft,
49 long unsigned int *ihfbit
56 *ihfbit=(*ihfbit<<(
unsigned long int)((Nsite+1)/2));
59 *ilft = (*ilft<<(
unsigned long int)Nsite)-1;
60 *ilft= *ilft ^ *irght;
81 long unsigned int *irght,
82 long unsigned int *ilft,
83 long unsigned int *ihfbit
90 case HubbardNConserved:
126 long unsigned int *ihfbit,
127 const long int *SiteToBit
130 long int isqrtMaxDim=1;
138 for(isite=1; isite<=Nsite ; isite++){
139 isqrtMaxDim *= SiteToBit[isite-1];
141 isqrtMaxDim =(
long int)sqrt(isqrtMaxDim);
143 for(isite=1; isite<=Nsite ; isite++){
144 tmpbit *= SiteToBit[isite-1];
145 if(tmpbit >= isqrtMaxDim)
break;
167 const long unsigned int ibit,
168 const long unsigned int irght,
169 const long unsigned int ilft,
170 const long unsigned int ihfbit,
171 long unsigned int *isplited_Bit_right,
172 long unsigned int *isplited_Bit_left
175 *isplited_Bit_right=ibit & irght;
176 *isplited_Bit_left=ibit & ilft;
177 *isplited_Bit_left=*isplited_Bit_left/ihfbit;
196 long unsigned int *_list_2_1,
197 long unsigned int *_list_2_2,
198 long unsigned int _ibit,
199 const long unsigned int _irght,
200 const long unsigned int _ilft,
201 const long unsigned int _ihfbit,
202 long unsigned int *_ioffComp
205 long unsigned int ia, ib;
206 SplitBit(_ibit, _irght, _ilft, _ihfbit, &ia, &ib);
215 if(_list_2_1[ia]*_list_2_2[ib]==0){
219 *_ioffComp =_list_2_1[ia]-1;
220 *_ioffComp+=_list_2_2[ib]-1;
244 const long unsigned int org_ibit,
248 long unsigned int *_ioffComp,
249 const long int *SiteToBit,
250 const long unsigned int *Tpow
253 if(off_ispin>SiteToBit[org_isite-1]-1 ||
255 org_ispin>SiteToBit[org_isite-1]-1 ||
267 tmp_off=(
long int)(off_ispin-org_ispin);
268 tmp_off *=Tpow[org_isite-1];
286 const long unsigned int org_ibit,
287 const long unsigned int ihlfbit,
288 long unsigned int *_ilist1Comp
291 long unsigned int ia, ib;
292 long unsigned int tmp_list;
314 const long unsigned int org_bit,
318 long unsigned int bit;
320 bit = org_bit^(org_bit>>1);
321 bit = (bit^(bit>>2) ) & 0x11111111;
322 bit = bit*0x11111111;
323 *sgn = 1-2*((bit>>28) & 1);
340 const long unsigned int org_bit,
344 long unsigned int bit;
346 bit = org_bit^(org_bit>>1);
352 *sgn = 1-2*(bit & 1);
368 const long unsigned int org_bit,
369 const long unsigned int target_bit
372 return (org_bit >> target_bit) &1;
394 const long unsigned int org_bit,
395 const unsigned int org_isite,
396 const unsigned int target_ispin,
397 const long int *SiteToBit,
398 const long unsigned int *Tpow
402 if(
GetBitGeneral(org_isite, org_bit, SiteToBit, Tpow) !=target_ispin){
423 const unsigned int isite,
424 const long unsigned int org_bit,
425 const long int *SiteToBit,
426 const long unsigned int *Tpow
429 long unsigned int tmp_bit=(org_bit/Tpow[isite-1])%SiteToBit[isite-1] ;
450 const unsigned int isite,
451 const long unsigned int org_bit,
452 const long int *SiteToBit,
453 const long unsigned int *Tpow
460 TwiceSz=-(SiteToBit[isite-1]-1)+2*bitAtSite;
474 unsigned long int snoob(
unsigned long int x){
475 unsigned long int smallest, ripple, ones;
477 ripple = x+ smallest;
479 ones = (ones>>2)/smallest;
493 x = x - ((x>>1) & 0x55555555);
494 x = (x & 0x33333333)+ ((x>>2)& 0x33333333);
495 x = (x+(x>>4)) & 0x0F0F0F0F;
498 return x & 0x0000003F;
int BitCheck(const long unsigned int org_bit, const long unsigned int target_bit)
bit check function
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.
int ConvertToList1GeneralSpin(const long unsigned int org_ibit, const long unsigned int ihlfbit, long unsigned int *_ilist1Comp)
function of converting component to list_1
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
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
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.
int GetSplitBitByModel(const int Nsite, const int iCalcModel, long unsigned int *irght, long unsigned int *ilft, long unsigned int *ihfbit)
function of splitting original bit into right and left spaces.
long unsigned int * list_2_1
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
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
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...
void SgnBit_old(const long unsigned int org_bit, int *sgn)
function of getting fermion signs (for 32bit)
char * cErrNoModel
Error Message in diagonal calc.c.
long unsigned int * list_2_2
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
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
char * cErrSiteNumber
Error Message in bitcalc.c.
void SgnBit(const long unsigned int org_bit, int *sgn)
function of getting fermion sign (64 bit)
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 ...