print("lmax = ", lmax)

# Setting up the atomic DFT instance(s) and
# calculating the eigenvalues and Hubbard values
atom = AtomicDFT(element,
                 configuration=configuration,
                 valence=valence,
                 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}

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_Tl=lmax,
                             Hamiltonian_PolynomialRepulsive='SetForAll {Yes}')

bs_gpaw = read_json('bs_gpaw.json')  # the reference band structure (DFT)
atoms = bulk(element, struct)
Exemple #2
0
elements = ['N', 'O']
atoms = []
for element in elements:
    occ_2p = 3 if element == 'N' else 4
    atom = AtomicDFT(element,
                     configuration='[He] 2s2 2p%d' % occ_2p,
                     valence=['2s', '2p'],
                     xc='LDA',
                     scalarrel=False,
                     confinement=PowerConfinement(r0=40., s=4),
                     txt='atomic.out')
    atom.run()
    atom.info = {}
    atom.info['eigenvalues'] = {
        nl: atom.get_eigenvalue(nl)
        for nl in atom.valence
    }
    U_p = atom.get_hubbard_value('2p', scheme='central', maxstep=1.)
    atom.info['hubbardvalues'] = {'s': U_p}
    atom.info['occupations'] = {'2s': 2, '2p': occ_2p}
    atoms.append(atom)

sk_kwargs = {
    'N': {
        'default': 380,
        'O-O': 420
    },
    'rmin': 0.4,
    'dr': 0.02,
    'stride': 5,
valence = ['2s', '2p']
occupations = {'2s': 2, '2p': 2}

# ------------------------------------
# Compute eigenvalues of the free atom
# ------------------------------------

atom = AtomicDFT(
    element,
    xc=xc,
    configuration=configuration,
    valence=valence,
    scalarrel=False,
)
atom.run()
eigenvalues = {nl: atom.get_eigenvalue(nl) for nl in valence}

# ---------------------------------------
# Compute Hubbard values of the free atom
# ---------------------------------------

atom = AtomicDFT(
    element,
    xc=xc,
    configuration=configuration,
    valence=valence,
    scalarrel=False,
    confinement=PowerConfinement(r0=40., s=4),
)
U = atom.get_hubbard_value('2p', scheme='central', maxstep=1.)
hubbardvalues = {'s': U}
Exemple #4
0
from hotcent.confinement import SoftConfinement
from hotcent.atomic_dft import AtomicDFT

kwargs = {'xc': 'LDA',
          'configuration': '[Ne] 3s2 3p2',
          'valence': ['3s', '3p'],
          'confinement': None,
          'scalarrel': True,
          'timing': True,
          'txt': '-'}

atom = AtomicDFT('Si',
                 wf_confinement=None,
                 **kwargs)
atom.run()
eps_free = {nl: atom.get_eigenvalue(nl) for nl in atom.valence}

wf_confinement = {'3s': SoftConfinement(amp=12., rc=6.74, x_ri=0.6),
                  '3p': SoftConfinement(amp=12., rc=8.70, x_ri=0.6)}
atom = AtomicDFT('Si',
                 wf_confinement=wf_confinement,
                 perturbative_confinement=True,
                 **kwargs)
atom.run()
eps_conf = {nl: atom.get_eigenvalue(nl) for nl in atom.valence}

print('\nChecking eigenvalues and their shifts upon confinement:')
# gpaw-setup Si -f LDA -a
eps_ref = {'3s': -0.399754, '3p': -0.152954}
# gpaw-basis Si -f LDA -t sz
shift_ref = {'3s': 0.104 / Ha, '3p': 0.103 / Ha}