Пример #1
0
    calc.write('h2o.gpw')
else:
    calc = GPAW('h2o.gpw')
    calc.initialize_positions()

from gpaw.xas import RecursionMethod

if 1:
    r = RecursionMethod(calc)
    r.run(400)
    r.write('h2o.pckl')
else:
    r = RecursionMethod(filename='h2o.pckl')

if 0:
    from pylab import *

    x = -30 + 40 * np.arange(300) / 300.0

    for n in range(50, 401, 50):
        y = r.get_spectra(x, imax=n)
        plot(x, y[0], label=str(n))
    legend()
    show()

print e, niter
energy_tolerance = 0.0002
niter_tolerance = 0
equal(e, -17.5407, energy_tolerance)
assert 18 <= niter <= 19, niter
Пример #2
0
if mpi.size == 1:
    xas = XAS(calc)
    x, y = xas.get_spectra()
else:
    x = np.linspace(0, 10, 50)

k = 2
calc.set(kpts=(k, k, k))
calc.initialize()
calc.set_positions(si)
assert calc.wfs.dtype == complex

r = RecursionMethod(calc)
r.run(40)
if mpi.size == 1:
    z = r.get_spectra(x)

if 0:
    import pylab as p
    p.plot(x, y[0])
    p.plot(x, sum(y))
    p.plot(x, z[0])
    p.show()

# 2p corehole
gen('Si', name='hch2p', corehole=(2, 1, 0.5), gpernode=30)
calc = GPAW(nbands=None,
            h=0.25,
            occupations=FermiDirac(width=0.05),
            setups={0: 'hch2p'})
si.set_calculator(calc)
Пример #3
0
if mpi.size == 1:
    xas = XAS(calc)
    x, y = xas.get_spectra()
else:
    x = np.linspace(0, 10, 50)

k = 2
calc.set(kpts=(k, k, k))
calc.initialize()
calc.set_positions(si)
assert calc.wfs.dtype == complex

r = RecursionMethod(calc)
r.run(40)
if mpi.size == 1:
    z = r.get_spectra(x)

if 0:
    import pylab as p
    p.plot(x, y[0])
    p.plot(x, sum(y))
    p.plot(x, z[0])
    p.show()

# 2p corehole
gen('Si', name='hch2p', corehole=(2, 1, 0.5))
calc = GPAW(nbands=None,
            h=0.25,
            occupations=FermiDirac(width=0.05),
            setups={0: 'hch2p'})
si.set_calculator(calc)
    niter = calc.get_number_of_iterations()
    calc.write('h2o.gpw')
else:
    calc = GPAW('h2o.gpw')
    calc.initialize_positions()

from gpaw.xas import RecursionMethod

if 1:
    r = RecursionMethod(calc)
    r.run(400)
    r.write('h2o.pckl')
else:
    r = RecursionMethod(filename='h2o.pckl')

if 0:
    from pylab import *

    x = -30 + 40 * np.arange(300) / 300.0

    for n in range(50, 401, 50):
        y = r.get_spectra(x, imax=n)
        plot(x, y[0], label=str(n))
    legend()
    show()

print(e, niter)
energy_tolerance = 0.0002
niter_tolerance = 0
equal(e, -17.9621, energy_tolerance)