nd_imp = {} for i in icols_ind.keys(): nl_all = [] nd_all = [] for icix in icols_ind[i]: nl_all.append(nl[icix]) nd_all.append(nd[icix]) nl_imp[i] = reduce(lambda x, y: x + y, nl_all) / len(nl_all) nd_imp[i] = reduce(lambda x, y: x + y, nd_all) / len(nd_all) print >> fh_info, 'nl_imp=', nl_imp print >> fh_info, 'nd_imp=', nd_imp return (nl_imp, nd_imp) if __name__ == '__main__': w2k = utils.W2kEnvironment() # W2k filenames and paths m_extn = 'dn' inl = indmffile.Indmfl(w2k.case) # case.indmfl file inl.read() # case.indmfl read icols_ind = {0: [1]} (nl_imp, nd_imp) = FindLatticeNd(w2k.case, m_extn, inl.siginds, icols_ind, sys.stdout, 'scfdmft1', cmplx=True) print nl_imp, nd_imp
Saved the projector wave function into projectorw.dat file. There are two Rmt used in this code. The first Rmt1 is muffin-thin sphere from structure file. The second is Rmt2 and is written in case.indmfl file. """ parser = optparse.OptionParser(usage) parser.add_option("-l", "--localize", dest="localize", type="int", default=1, help="How localized should be the function") # Next, parse the arguments (options, args) = parser.parse_args() w2k = utils.W2kEnvironment() atms, Lsa, icpsa, Rm2 = ReadIndmfl(w2k.case) choice = raw_input( """Should linearization energy for the projector be\n [1]: EF or\n [2]: DFT linearization energy.\n Enter [1|2]: """ ) if choice.strip() == '1': Emu = 'EF' else: Emu = 'Emu' projw = main(w2k.case, atms, Lsa, icpsa, Rm2, options.localize, Emu) for Rx, Ag, Bg, A, B in projw: subplot(2, 1, 1)
To give filename, you can use the following expressions: - word 'case', which will be replaced by current case, determined by the presence of struct file. - '?', which will be replaced by icix. """ parser = optparse.OptionParser(usage) parser.add_option("-o", "--osig", dest="osig", default='sig.inp', help="filename of the output self-energy file. Default: 'sig.inp'") parser.add_option("-i", "--isig", dest="isig", default='imp.?/sig.out', help="filename of the input self-energy from all impurity problems. Default: 'imp.?/sig.out'") parser.add_option("-l", "--lext", dest="m_extn", default='', help="For magnetic calculation, it can be 'dn'.") parser.add_option("-m", "--mix", dest="mix", type=float, default=1.0, help="Mixing parameter for self-energy. Default=1 -- no mixing") # Next, parse the arguments (options, args) = parser.parse_args() env = utils.W2kEnvironment() case = env.case options.osig = re.sub(r'case', case, options.osig) options.isig = re.sub(r'case', case, options.isig) print 'case=%s, isig=%s, osig=%s' % (case, options.isig, options.osig) inl = indmffile.Indmfl(case) inl.read() if options.m_extn: inldn = indmffile.Indmfl(case, 'indmfl'+options.m_extn) inldn.read() iSiginds = utils.ParsIndmfi(case)