예제 #1
0
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))
예제 #2
0
파일: setups.py 프로젝트: theonov13/lfdft
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
예제 #3
0
파일: setups.py 프로젝트: yidapa/lfdft
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
예제 #4
0
파일: scf.py 프로젝트: yidapa/lfdft
    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())
예제 #5
0
    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())
예제 #6
0
파일: scf.py 프로젝트: yidapa/lfdft
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))
예제 #7
0
파일: grid.py 프로젝트: yidapa/lfdft
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))
예제 #8
0
파일: grid.py 프로젝트: theonov13/lfdft
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))