コード例 #1
0
def agts(queue):
    si = queue.add('submit.agts.py', ncpus=4, walltime=60)
    bs = queue.add('bs.py', deps=si, ncpus=4, walltime=60)
    queue.add('bs_plot.py', deps=bs, creates='bs-PBE.png')

    w = queue.add('wannier.py', deps=si, ncpus=1, walltime=60)
    bs = queue.add('bs_pbe0.py', deps=w, ncpus=1, walltime=10 * 60)
    queue.add('bs_plot2.py', deps=bs, creates='bs-PBE0.png')

    deps = []
    for k in range(3, 8):
        deps.append(queue.add('eos.py %d' % k, ncpus=4, walltime=10 * 60))
    for k in range(8, 13):
        deps.append(queue.add('eos.py %d' % k, ncpus=16, walltime=10 * 60))
    queue.add('results.py', deps=deps, creates=['a.png', 'B.png'])


if __name__ == '__main__':
    from si_pbe import groundstate
    si = groundstate(5.43, 8)
    si.calc.write('Si-PBE.gpw', mode='all')
コード例 #2
0
ファイル: eos.py プロジェクト: Xu-Kai/lotsofcoresbook2code
import sys
import pickle
import numpy as np
from gpaw.xc.hybridk import HybridXC
from gpaw import GPAW
from si_pbe import groundstate
a0 = 5.43
A = np.linspace(a0 - 0.06, a0 + 0.06, 5)
k = int(sys.argv[1])
eos = np.zeros((3, 5))
for i, a in enumerate(A):
    si = groundstate(a, k)
    epbe = si.get_potential_energy()
    elda = epbe + si.calc.get_xc_difference('LDA')
    pbe0 = HybridXC('PBE0', alpha=5.0)
    epbe0 = epbe + si.calc.get_xc_difference(pbe0)
    eos[:, i] = epbe, elda, epbe0
pickle.dump((A, eos), open('eos-%d.pckl' % k, 'w'))