def _print_scf_info(scf, out): out.write(separator_string('SCF')) out.write('maxiter: {}\n'.format(scf.maxiter)) out.write('density_error_tol (e / # electrons): {}\n'.format( scf.density_error_tol)) out.write('energy_error_tol (eV / # electrons): {}\n'.format( scf.energy_error_tol))
def Setups(atoms, out): """Returns dict of {symbol : Setup(symbol)}.""" out.write(separator_string('Pseudopotentials')) setups = dict() for s in set(atoms.symbols): setups[s] = Setup(s) _print_pseudopotential(setups[s], out) return setups
def run(self, wfs, hamiltonian, density, fn): """ 1) update wfs based on hamiltonian orthogonalizes if needed 2) calculate new density from updated wfs mix with previous density 3) update the hamiltonian based on the new density 4) update energies and check convergence """ self.out.write(separator_string("SCF LOOP")) self.out.write("{} | {} | {} | {} | {}\n".format("iteration", "Q", "Energy", "Density Error", "Energy Error")) for i in xrange(1, self.maxiter + 1): wfs.iterate(hamiltonian) density.update(wfs) hamiltonian.update(density) if self.converged(i, hamiltonian, wfs, density): break self.out.write(separator_string())
def run(self, wfs, hamiltonian, density, fn): """ 1) update wfs based on hamiltonian orthogonalizes if needed 2) calculate new density from updated wfs mix with previous density 3) update the hamiltonian based on the new density 4) update energies and check convergence """ self.out.write(separator_string('SCF LOOP')) self.out.write("{} | {} | {} | {} | {}\n".format( 'iteration', 'Q', 'Energy', 'Density Error', 'Energy Error')) for i in xrange(1, self.maxiter+1): wfs.iterate(hamiltonian) density.update(wfs) hamiltonian.update(density) if self.converged(i, hamiltonian, wfs, density): break self.out.write(separator_string())
def _print_scf_info(scf, out): out.write(separator_string("SCF")) out.write("maxiter: {}\n".format(scf.maxiter)) out.write("density_error_tol (e / # electrons): {}\n".format(scf.density_error_tol)) out.write("energy_error_tol (eV / # electrons): {}\n".format(scf.energy_error_tol))
def _print_grid(grid, out): out.write(separator_string('Grid')) out.write('gpts: {} {} {}\n'.format(*grid.gpts)) out.write('spacing: {} {} {}\n'.format(*grid.h)) out.write('vol: {}\n'.format(grid.vol)) out.write('N pts: {}\n'.format(grid.n))