# mpi barrier comm.Barrier() # init ctqmc impurity solver ctqmc.cat_init_ctqmc(comm.rank, comm.size) # setup hybridization function # for the first iteration, we just use the default value if i > 0: ctqmc.cat_set_hybf(size_t, hybf) # exec ctqmc impurity solver ctqmc.cat_exec_ctqmc(i + 1) # get green's function grnf = ctqmc.cat_get_grnf(size_t) # get new hybridization function hybf = do_dmft_loop(mfreq, norbs, grnf) # get occupation number nmat = ctqmc.cat_get_nmat(norbs) # calculate new chemical potential mune = mune + 0.3 * float(occup - sum(nmat)) # convergence analysis grnf_s = (grnf + grnf_s) / 2.0 if comm.rank == 0: print 'MAX_ERROR:', (numpy.absolute(grnf - grnf_s)).max() print 'curr_mune:', mune, 'curr_occu:', sum(nmat), 'need_occu:', occup
# mpi barrier comm.Barrier() # init ctqmc impurity solver ctqmc.cat_init_ctqmc(comm.rank, comm.size) # setup hybridization function # for the first iteration, we just use the default value if i > 0: ctqmc.cat_set_hybf(size_t, hybf) # exec ctqmc impurity solver ctqmc.cat_exec_ctqmc(i+1) # get green's function grnf = ctqmc.cat_get_grnf(size_t) # get new hybridization function hybf = do_dmft_loop(mfreq, norbs, grnf) # get occupation number nmat = ctqmc.cat_get_nmat(norbs) # calculate new chemical potential mune = mune + 0.3 * float( occup - sum(nmat) ) # convergence analysis grnf_s = (grnf + grnf_s) / 2.0 if comm.rank == 0: print 'MAX_ERROR:', (numpy.absolute(grnf - grnf_s)).max() print 'curr_mune:', mune, 'curr_occu:', sum(nmat), 'need_occu:', occup