def mulliken(filename, key='scf'): '''Reading scf/mcscf information from chkfile, then do Mulliken population analysis for the density matrix ''' if key.lower() == 'mcscf': mol = chkfile.load_mol(filename) mo_coeff = chkfile.load(filename, 'mcscf/mo_coeff') mo_occ = chkfile.load(filename, 'mcscf/mo_occ') else: mol, mf = chkfile.load_scf(filename) mo_coeff = mf['mo_coeff'] mo_occ = mf['mo_occ'] dm = numpy.dot(mo_coeff*mo_occ, mo_coeff.T) hf.mulliken_meta(mol, dm)
def mulliken(filename, key='scf'): '''Reading scf/mcscf information from chkfile, then do Mulliken population analysis for the density matrix ''' if key.lower() == 'mcscf': mol = chkfile.load_mol(filename) mo_coeff = chkfile.load(filename, 'mcscf/mo_coeff') mo_occ = chkfile.load(filename, 'mcscf/mo_occ') else: mol, mf = chkfile.load_scf(filename) mo_coeff = mf['mo_coeff'] mo_occ = mf['mo_occ'] dm = numpy.dot(mo_coeff * mo_occ, mo_coeff.T) hf.mulliken_meta(mol, dm)
def dump_mo(filename, key='scf'): '''Read scf/mcscf information from chkfile, then dump the orbital coefficients. ''' from pyscf.tools import dump_mat if key.lower() == 'mcscf': mol = chkfile.load_mol(filename) mo_coeff = chkfile.load(filename, 'mcscf/mo_coeff') else: mol, mf = chkfile.load_scf(filename) mo_coeff = mf['mo_coeff'] dump_mat.dump_mo(mol, mo_coeff)
def update_from_chk(self, chkfile=None): from pyscf.scf import chkfile as chkmod if chkfile is None: chkfile = self.chkfile self.__dict__.update(chkmod.load(chkfile, 'scf')) return self