def generate_skf(self, opt_val):
        """ Generates all *-*.skf files for a given set of
        confinement parameters

        opt_val: the (internally defined) list of parameter values used
                 in setting up the confinement potentials (and hence
                 changing the Slater-Koster integrals).
        """
        # Update the confinement parameters:
        for i, (key, param) in enumerate(self.opt_param):
            self.vconf[key].__setattr__(param, opt_val[i])

        if self.verbose:
            print('VCONF:')
            for key in sorted(self.vconf):
                print('  ' + key + ' : ' + str(self.vconf[key]))

        # Run the atomic DFT calculations
        for atom in self.atoms:
            conf, wf_conf = None, {}
            for key, vconf in self.vconf.items():
                if '%s_n' % atom.symbol in key:
                    conf = vconf
                else:
                    for nl in atom.valence:
                        if '%s_%s' % (atom.symbol, nl) in key:
                            wf_conf[nl] = vconf
            if conf is not None:
                atom.set_confinement(conf)
            if wf_conf:
                atom.set_wf_confinement(wf_conf)
            atom.run()

        # Perform the Slater-Koster integrations
        for i, atom1 in enumerate(self.atoms):
            s1 = atom1.symbol
            for j in range(i + 1):
                atom2 = self.atoms[j]
                s2 = atom2.symbol

                prefix1 = s1 + '-' + s2
                prefix2 = s2 + '-' + s1
                sk_kwargs = {}
                for key, val in self.sk_kwargs.items():
                    if isinstance(val, dict):
                        if prefix1 in val:
                            sk_kwargs[key] = val[prefix1]
                        elif prefix2 in val:
                            sk_kwargs[key] = val[prefix2]
                        else:
                            sk_kwargs[key] = val['default']
                    else:
                        sk_kwargs[key] = val

                sk = SlaterKosterTable(atom1, atom2, timing=False, txt=None)
                sk.run(**sk_kwargs)

                filename = '%s-%s.skf' % (s1, s2)
                if s1 == s2:
                    sk.write(filename=filename, pair=(s1, s2), **atom1.info)
                else:
                    sk.write(filename=filename, pair=(s1, s2))
                    filename = '%s-%s.skf' % (s2, s1)
                    sk.write(filename=filename, pair=(s2, s1))
        return
Beispiel #2
0
             default='potential',
             help='Which superposition scheme? '
                  'Choose "potential" (default) or "density"')
p.add_option('-t', '--stride', default=1, type=int,
             help='Which SK-table stride length? Default = 1. '
                  'See hotcent.slako.run for more information.')
opt, args = p.parse_args()

# Get KS all-electron ground state of confined atom:
element = 'C'
r0 = 1.85 * covalent_radii[atomic_numbers[element]] / Bohr
atom = AtomicDFT(element,
                 xc=opt.functional,
                 confinement=PowerConfinement(r0=r0, s=2),
                 configuration='[He] 2s2 2p2',
                 valence=['2s', '2p'],
                 timing=True,
                 )
atom.run()
atom.plot_Rnl(only_valence=False)
atom.plot_density()

# Compute Slater-Koster integrals:
rmin, dr, N = 0.5, 0.05, 250
sk = SlaterKosterTable(atom, atom, timing=True)
sk.run(rmin, dr, N, superposition=opt.superposition,
       xc=opt.functional, stride=opt.stride)
sk.write('%s-%s_no_repulsion.par' % (element, element))
sk.write('%s-%s_no_repulsion.skf' % (element, element))
sk.plot()
U = atom.get_hubbard_value('2p', scheme='central', maxstep=1.)
hubbardvalues = {'s': U}

# -------------------------------
# Compute Slater-Koster integrals
# -------------------------------

r_cov = covalent_radii[atomic_numbers[element]] / Bohr
r_wfc = 2 * r_cov
r_rho = 3 * r_cov
atom = AtomicDFT(
    element,
    xc=xc,
    confinement=PowerConfinement(r0=r_wfc, s=2),
    wf_confinement=PowerConfinement(r0=r_rho, s=2),
    configuration=configuration,
    valence=valence,
    scalarrel=False,
)
atom.run()

# Compute Slater-Koster integrals:
rmin, dr, N = 0.5, 0.05, 250
sk = SlaterKosterTable(atom, atom)
sk.run(rmin, dr, N, superposition='density', xc=xc)
sk.write('%s-%s_no_repulsion.skf' % (element, element),
         eigenvalues=eigenvalues,
         spe=0.,
         hubbardvalues=hubbardvalues,
         occupations=occupations)
Beispiel #4
0
        scalarrel=True,
        maxiter=50000,
        mix=0.005,
        txt='-',
    )
    atom.run()
    atoms[el] = atom

# -------------------------------
# Compute Slater-Koster integrals
# -------------------------------

for i in range(len(elements)):
    el_a = elements[i]
    rNum = rNum2 / 2.0 if el == element2 else rNum1 / 2.0
    for j in range(i + 1):
        rNum = rNum + rNum2 / 2.0 if el == element2 else rNum + rNum1 / 2.0
        el_b = elements[j]
        rmin, dr, N = 0.4, 0.02, int(rNum)
        sk = SlaterKosterTable(atoms[el_a], atoms[el_b], txt='-')
        sk.run(rmin, dr, N, superposition='density', xc=xc, stride=2)
        if el_a == el_b:
            sk.write('%s-%s_no_repulsion.skf' % (el_a, el_a),
                     eigenvalues=eigenvalues[el_a],
                     spe=0.,
                     hubbardvalues=hubbardvalues[el_a],
                     occupations=occupations[el_a])
        else:
            for pair in [(el_a, el_b), (el_b, el_a)]:
                sk.write('%s-%s_no_repulsion.skf' % pair, pair=pair)
Beispiel #5
0
conf = PowerConfinement(r0=9.41, s=2)
wf_conf = {
    '5d': PowerConfinement(r0=6.50, s=2),
    '6s': PowerConfinement(r0=6.50, s=2),
    '6p': PowerConfinement(r0=4.51, s=2),
}
atom = AtomicDFT(
    element,
    xc=xc,
    confinement=conf,
    wf_confinement=wf_conf,
    configuration='[Xe] 4f14 5d10 6s1 6p0',
    valence=['5d', '6s', '6p'],
    scalarrel=True,
    timing=True,
    nodegpts=150,
    mix=0.2,
    txt='-',
)
atom.run()
atom.plot_Rnl()
atom.plot_density()

# Compute Slater-Koster integrals:
rmin, dr, N = 0.4, 0.02, 900
sk = SlaterKosterTable(atom, atom, timing=True)
sk.run(rmin, dr, N, superposition='density', xc=xc)
sk.write('Au-Au_no_repulsion.par')
sk.write('Au-Au_no_repulsion.skf')
sk.plot()
Beispiel #6
0
atom2 = AtomicDFT(
    'H',
    xc='LDA',
    confinement=PowerConfinement(r0=1.1, s=2),
    configuration='1s1',
    valence=['1s'],
    txt=None,
)
atom2.run()
ener = atom2.get_energy()
print('H -- Etot  | %s' % check(ener, 0.58885808402033557, eps_etot))
e_1s = atom2.get_epsilon('1s')
print('H -- E_1s  | %s' % check(e_1s, 1.00949638195278960, eps))

# Check B-H Slater-Koster integrals
sk = SlaterKosterTable(atom1, atom2, txt=None)

R, nt, nr = 2.0, 150, 50
sk.wf_range = sk.get_range(1e-7)
grid, areas = sk.make_grid(R, nt=nt, nr=nr)

S, H, H2 = sk.calculate_mels([('sss', '2s', '1s')], atom1, atom2, R, grid,
                             areas)

print('B-H sps S  | %s' % check_abs(S[9], -0.34627316, eps))
print('B-H sps H  | %s' % check_abs(H[9], 0.29069894, eps))
print('B-H sps H2 | %s' % check_abs(H2[9], 0.29077536, eps))

S, H, H2 = sk.calculate_mels([('sps', '1s', '2p')], atom2, atom1, R, grid,
                             areas)