A program to check size of dimension for Hilbert-space.
add function of calculating Hilbert space for canonical ensemble.
59 long int Ns,comb_1,comb_2,comb_3,comb_sum, comb_up, comb_down;
89 comb = li_2d_allocate(Ns+1,Ns+1);
105 comb_sum= 2*comb_sum;
118 comb_sum=comb_up*comb_down;
121 case HubbardNConserved:
128 for(i=iMinup; i<= iAllup; i++){
131 comb_sum +=comb_up*comb_down;
141 for(u_loc=0;u_loc<=X->
Def.
Nup;u_loc++){
142 comb_1 =
Binomial(NLocSpn,u_loc,comb,Ns);
143 comb_2 =
Binomial(NCond,Nup-u_loc,comb,Ns);
144 comb_3 =
Binomial(NCond,Ndown+u_loc-NLocSpn,comb,Ns);
145 comb_sum += comb_1*comb_2*comb_3;
153 for(u_loc=0;u_loc <(2*NCond+NLocSpn); u_loc++){
154 comb_sum= 2*comb_sum;
161 fprintf(stderr,
" 2Sz is incorrect.\n");
170 for(isite=0; isite<X->
Def.
Nsite;isite++){
175 #pragma omp parallel for default(none) reduction(+:comb_sum) private(tmp_sz, isite) firstprivate(idimmax, X) 176 for(idim=0; idim<idimmax; idim++){
178 for(isite=0; isite<X->
Def.
Nsite;isite++){
190 fprintf(stderr,
"Error: CalcModel %d is incorrect.\n", X->
Def.
iCalcModel);
191 free_li_2d_allocate(comb);
202 case HubbardNConserved:
217 case HubbardNConserved:
251 fprintf(
stdoutMPI,
" MAX DIMENSION idim_max=%ld \n",li_dim_max);
253 fprintf(
stdoutMPI,
" APPROXIMATE REQUIRED MEMORY max_mem=%lf GB \n",dmax_mem);
255 free_li_2d_allocate(comb);
258 fprintf(fp,
" MAX DIMENSION idim_max=%ld \n", li_dim_max);
259 fprintf(fp,
" APPROXIMATE REQUIRED MEMORY max_mem=%lf GB \n", dmax_mem);
275 case HubbardNConserved:
278 while(tmp <= X->Def.Nsite){
286 while(tmp <= X->Def.Nsite/2){
297 free_li_2d_allocate(comb);
303 free_li_2d_allocate(comb);
310 case HubbardNConserved:
327 free_li_2d_allocate(comb);
337 fprintf(fp,
"%ld %ld \n",i,u_tmp);
340 case HubbardNConserved:
346 fprintf(fp,
"%ld %ld \n",i,u_tmp);
354 fprintf(fp,
"%ld %ld \n",i,u_tmp);
359 fprintf(fp,
"%d %ld \n", 0, u_tmp);
363 fprintf(fp,
"%ld %ld \n",i,u_tmp);
372 fprintf(fp,
"%ld %ld \n",i,u_tmp);
377 fprintf(fp,
"%ld %ld \n",i,X->
Def.
Tpow[i]);
383 free_li_2d_allocate(comb);
long int Binomial(int n, int k, long int **comb, int Nsite)
int Nup
Number of spin-up electrons in this process.
struct DefineList Def
Definision of system (Hamiltonian) etc.
FILE * stdoutMPI
File pointer to the standard output defined in InitializeMPI()
int Total2Sz
Total in this process.
int Nsite
Number of sites in the INTRA process region.
double MaxMPI_d(double dvalue)
MPI wrapper function to obtain maximum Double across processes.
long int MaxMPI_li(long int idim)
MPI wrapper function to obtain maximum unsigned long integer across processes.
int iFlgScaLAPACK
ScaLAPACK mode ( only for FullDiag )
int CheckMPI(struct BindStruct *X)
Define the number of sites in each PE (DefineList.Nsite). Reduce the number of electrons (DefineList...
int NsiteMPI
Total number of sites, differ from DefineList::Nsite.
int Ne
Number of electrons in this process.
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.
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
int iFlgGeneralSpin
Flag for the general (Sz/=1/2) spin.
long int * SiteToBit
[DefineList::NsiteMPI] Similar to DefineList::Tpow. For general spin.
long int * Tpow
[2 * DefineList::NsiteMPI] malloc in setmem_def().
int iCalcModel
Switch for model. 0:Hubbard, 1:Spin, 2:Kondo, 3:HubbardGC, 4:SpinGC, 5:KondoGC, 6:HubbardNConserved.
int iFlgCalcSpec
Input parameter CalcSpec in teh CalcMod file.
double max_mem
Estimated memory size.
int k_exct
Read from Calcmod in readdef.h.
int Ndown
Number of spin-down electrons in this process.
int NLocSpn
Number of local spins.
struct CheckList Check
Size of the Hilbert space.
long int sdim
Dimension for Ogata-Lin ???
void CheckMPI_Summary(struct BindStruct *X)
Print infomation of MPI parallelization Modify Definelist::Tpow in the inter process region...
long int idim_max
The dimension of the Hilbert space of this process.
int Total2SzMPI
Total across processes.
int iCalcType
Switch for calculation type. 0:Lanczos, 1:TPQCalc, 2:FullDiag.
int childfopenMPI(const char *_cPathChild, const char *_cmode, FILE **_fp)
Only the root process open file in output/ directory.