from ase.units import Ha from hotcent.atomic_dft import AtomicDFT from hotcent.confinement import PowerConfinement atom = AtomicDFT('C', xc='LDA', confinement=PowerConfinement(r0=40., s=4), configuration='[He] 2s2 2p2', valence=['2s', '2p'], scalarrel=False, timing=False, ) values = [] schemes = ['central', 'forward', 'backward'] for scheme in ['central', 'forward', 'backward']: u = atom.get_hubbard_value('2p', scheme=scheme, maxstep=1.) values.append(u) references = [0.35665217698348783, 0.2694950932099687, 0.4310705719360044] eps = 1e-4 print('\n========================================================') print('# Scheme\tU_ref [Ha]\tU [Ha]\t\tU [eV]') for s, v, r in zip(schemes, values, references): print('%s\t%.6f\t%.6f\t%.3f' % (s.ljust(8), r, v, v * Ha)) assert abs(v - r) < eps, (s, v, r, eps)
xc=xc, scalarrel=True, mix=0.005, maxiter=50000, confinement=PowerConfinement(r0=40., s=4), txt=None) atom.run() atom.info = {} atom.info['eigenvalues'] = {nl: atom.get_eigenvalue(nl) for nl in atom.valence} if (element == "H"): # https://webbook.nist.gov/cgi/cbook.cgi?ID=C12385136&Mask=20 # hubbard value = U = IE - EA = 13.59844 - 0.75497 = 12.84347 [eV] U_p = 12.84347/Ha else: U_p = atom.get_hubbard_value(nls, scheme='central', maxstep=1.) atom.info['hubbardvalues'] = {'s': U_p} atom.info['occupations'] = occupations # Creating a DFTB+ band structure evaluator and # supplying it with a reference (DFT) band structure dpbs = DftbPlusBandStructure(Hamiltonian_SCC='Yes', Hamiltonian_OrbitalResolvedSCC='No', Hamiltonian_MaxAngularMomentum_='', Hamiltonian_MaxAngularMomentum_C=lmax, Hamiltonian_PolynomialRepulsive='SetForAll {Yes}') bs_qe = read_json('bs_qe.json') # the reference band structure (DFT) atoms = ase.io.read("./primCIFs/C.cif") #atoms = bulk(element,struct) # see hotcent.tools.DftbPlusBandStructure for more information
# -------------------------------------------------------- for el in elements: valence = valences[el] atom = AtomicDFT( el, xc=xc, configuration=configurations[el], valence=valence, scalarrel=True, confinement=PowerConfinement(r0=40., s=4), txt='-', ) nl = '2p' if el == 'O' else '3s' scheme = 'central' if el == 'O' else 'backward' u = atom.get_hubbard_value(nl, scheme=scheme) hubbardvalues[el] = {'s': u} atom.run() eigenvalues[el] = {nl: atom.get_eigenvalue(nl) for nl in valence} # -------------------------------------------------- # Get KS all-electron ground state of confined atoms # -------------------------------------------------- atoms = {} for el in elements: r_cov = covalent_radii[atomic_numbers[el]] / Bohr r_wfc = 2 * r_cov r_rho = 3 * r_cov atom = AtomicDFT( el,