Exemplo n.º 1
0
def ip(symbol, fd, setup):
    xc = 'LDA'
    aea = AllElectronAtom(symbol, log=fd)
    aea.initialize()
    aea.run()
    aea.refine()
    aea.scalar_relativistic = True
    aea.refine()
    energy = aea.ekin + aea.eH + aea.eZ + aea.exc
    eigs = []
    for l, channel in enumerate(aea.channels):
        n = l + 1
        for e, f in zip(channel.e_n, channel.f_n):
            if f == 0:
                break
            eigs.append((e, n, l))
            n += 1
    e0, n0, l0 = max(eigs)
    aea = AllElectronAtom(symbol, log=fd)
    aea.add(n0, l0, -1)
    aea.initialize()
    aea.run()
    aea.refine()
    aea.scalar_relativistic = True
    aea.refine()
    IP = aea.ekin + aea.eH + aea.eZ + aea.exc - energy
    IP *= Ha

    s = create_setup(symbol, type=setup, xc=xc)
    f_ln = defaultdict(list)
    for l, f in zip(s.l_j, s.f_j):
        if f:
            f_ln[l].append(f)

    f_sln = [[f_ln[l] for l in range(1 + max(f_ln))]]
    calc = AtomPAW(symbol, f_sln, xc=xc, txt=fd, setups=setup)
    energy = calc.results['energy']
    # eps_n = calc.wfs.kpt_u[0].eps_n

    f_sln[0][l0][-1] -= 1
    calc = AtomPAW(symbol, f_sln, xc=xc, charge=1, txt=fd, setups=setup)
    IP2 = calc.results['energy'] - energy
    return IP, IP2
Exemplo n.º 2
0
from gpaw.atom.aeatom import AllElectronAtom, c
from gpaw.test import equal

Z = 79  # gold atom
kwargs = dict(alpha2=150 * Z**2, ngauss=100)

# Test Schroedinger equation:
aea = AllElectronAtom(Z, log=None)
aea.initialize(**kwargs)

errors = []
for channel in aea.channels:
    channel.solve(-Z)
    for n in range(7):
        e = channel.e_n[n]
        e0 = -0.5 * Z**2 / (n + channel.l + 1)**2
        errors.append(abs(e / e0 - 1))
equal(max(errors), 0, 2.0e-5)

# Test Dirac equation:
aea = AllElectronAtom(Z, dirac=True, log=None)
aea.initialize(**kwargs)

errors = []
for channel in aea.channels:
    channel.solve(-Z)
    for n in range(7):
        e = channel.e_n[n]
        if channel.k > 0:
            n += 1
        e0 = (1 +
Exemplo n.º 3
0
from __future__ import print_function
from gpaw.atom.aeatom import AllElectronAtom, c
from gpaw.test import equal

Z = 79  # gold atom
kwargs = dict(ngpts=5000, alpha2=1000 * Z**2, ngauss=200)

# Test Schroedinger equation:
aea = AllElectronAtom(Z, log=None)
aea.initialize(**kwargs)

errors = []
for channel in aea.channels:
    channel.solve(-Z)
    for n in range(7):
        e = channel.e_n[n]
        e0 = -0.5 * Z**2 / (n + channel.l + 1)**2
        errors.append(abs(e / e0 - 1))
print(max(errors))
equal(max(errors), 0, 2.0e-5)

# Test Dirac equation:
aea = AllElectronAtom(Z, dirac=True, log=None)
aea.initialize(**kwargs)

errors = []
for channel in aea.channels:
    channel.solve(-Z)
    for n in range(7):
        e = channel.e_n[n]
        if channel.k > 0: