def fock_loop(self): fock_opts = self.options['_fock_loop'] fock_opts['fock_func'] = self.get_fock se, rdm1, converged = fock_loop_uhf(self.se, self.hf, self.rdm1, **fock_opts) if converged: log.write('Fock loop converged.\n', self.verbose) log.write('Chemical potential (alpha) = %.6f\n' % self.chempot[0], self.verbose) log.write('Chemical potential (beta) = %.6f\n' % self.chempot[1], self.verbose) else: log.write('Fock loop did not converge.\n', self.verbose) log.write('Chemical potential (alpha) = %.6f\n' % self.chempot[0], self.verbose) log.write('Chemical potential (beta) = %.6f\n' % self.chempot[1], self.verbose) self.se = se self.rdm1 = rdm1 self.solve_dyson() e_hoqmo_a = util.amax(self.gf[0].e_occ) e_hoqmo_b = util.amax(self.gf[1].e_occ) e_luqmo_a = util.amin(self.gf[0].e_vir) e_luqmo_b = util.amin(self.gf[1].e_vir) log.write('HOQMO (alpha) = %.6f\n' % e_hoqmo_a, self.verbose) log.write('HOQMO (beta) = %.6f\n' % e_hoqmo_b, self.verbose) log.write('LUQMO (alpha) = %.6f\n' % e_luqmo_a, self.verbose) log.write('LUQMO (beta) = %.6f\n' % e_luqmo_b, self.verbose) log.array(self.rdm1[0], 'Density matrix (physical,alpha)', self.verbose) log.array(self.rdm1[1], 'Density matrix (physical,beta)', self.verbose)
def chempot(self): homo_a = util.amax(self.e[0][self.occ[0] > 0]) lumo_a = util.amin(self.e[0][self.occ[0] == 0]) homo_b = util.amax(self.e[1][self.occ[1] > 0]) lumo_b = util.amin(self.e[1][self.occ[1] == 0]) chempot_a = 0.5 * (homo_a + lumo_a) chempot_b = 0.5 * (homo_b + lumo_b) return chempot_a, chempot_b
def fock_loop(self): fock_opts = self.options['_fock_loop'] fock_opts['fock_func'] = self.get_fock se, rdm1, converged = fock_loop_rhf(self.se, self.hf, self.rdm1, **fock_opts) if converged: log.write('Fock loop converged.\n', self.verbose) log.write('Chemical potential = %.6f\n' % self.chempot, self.verbose) else: log.write('Fock loop did not converge.\n', self.verbose) log.write('Chemical potential = %.6f\n' % self.chempot, self.verbose) self.se = se self.rdm1 = rdm1 self.solve_dyson() e_hoqmo = util.amax(self.gf.e_occ) e_luqmo = util.amin(self.gf.e_vir) log.write('HOQMO = %.6f\n' % e_hoqmo, self.verbose) log.write('LUQMO = %.6f\n' % e_luqmo, self.verbose) log.array(self.rdm1, 'Density matrix (physical)', self.verbose)
def build_gf(self): e, c = self.se.eig(self.get_fock()) self.gf = aux.Aux(e, c, chempot=self.chempot) c_occ = c[:self.nphys, e < self.chempot] self.rdm1 = np.dot(c_occ, c_occ.T) * 2 log.write( 'HOQMO = %.6f\n' % util.amax(self.gf.e[self.gf.e < self.chempot]), self.verbose) log.write( 'LUQMO = %.6f\n' % util.amin(self.gf.e[self.gf.e >= self.chempot]), self.verbose) log.array(self.rdm1, 'Density matrix (physical)', self.verbose) return self.gf
def chempot(self): h**o = util.amax(self.e[self.occ > 0]) lumo = util.amin(self.e[self.occ == 0]) return 0.5 * (h**o + lumo)