From: Jiaguo Yu <jia...@ya...> - 2016-06-12 02:43:51
|
Dear cclib users, The Mulliken atomic spin densities can be obtained after the following change :D diff -r cclib-master/src/cclib/method/mpa.py cclib-master-original/src/cclib/method/mpa.py 115c115,117 < --- > > alpha = numpy.zeros([size], "d") > beta = numpy.zeros([size], "d") 121a124,127 > if spin == 0: > alpha = numpy.add(alpha, temp) > elif spin == 1: > beta = numpy.add(beta, temp) 124a131,134 > else: > self.logger.info("Creating fragspins: array[1]") > self.fragspins = numpy.zeros([size], "d") > self.fragspins = numpy.subtract(alpha, beta) Best regards, Jiaguo Yu 11.06.2016, 18:30, "Jiaguo Yu" <jia...@ya...>: > Dear cclib users, > > From http://cclib.github.io/methods.html, cclib can perform Mulliken population analysis (MPA) and store the results in aoresults, fragresults and fragcharges. The fragcharges can be used to compute Mulliken atomic charges. Nonetheless, how can one compute Mulliken atomic spin densities (for example, from fragresults) ? > > The blunt snippet below shows that "alpha" and "beta" variables contains almost the same values... > > sum_alpha = 0.0 > sum_beta = 0.0 > for i in range(len(m.fragcharges)): > alpha = 0.0 > beta = 0.0 > for j in range(len(m.fragresults[0])): > alpha += m.fragresults[0][j][i] > beta += m.fragresults[1][j][i] > sum_alpha += alpha > sum_beta += beta > print("sum_alpha=%10.5f, sum_beta=%10.5f, alpha=%10.5f, beta=%10.5f" % (sum_alpha, sum_beta, alpha, beta)) > > Best regards, > Jiaguo Yu > , > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e > , > > _______________________________________________ > cclib-users mailing list > ccl...@li... > https://lists.sourceforge.net/lists/listinfo/cclib-users |