from ase.lattice import bulk
import pyscfdump.scf as scf
from pyscfdump.helpers import build_cell
from pyscfdump.pbcfcidump import fcidump

A2B = 1.889725989       #angstrom to bohr conversion

a=3.567         #lattice parameter
ke=500          #kinetic energy cutoff in units of rydberg
basis='gth-dzvp'        #basis set choice
nmps=[[1,1,1],[2,1,1],[2,2,1],[2,2,2]]     #number of k-points in each dimension

def name(nmp):
    s = ''
    for n in nmp:
        s = s + str(n)
    return s

#prepare the cell object
ase_atom = bulk('C', 'diamond', a=a*A2B)
print ase_atom
cell = build_cell(ase_atom, ke=ke, basis=basis, pseudo='gth-pade')

for nmp in nmps:
    #run the HF calculation
    kmf,scaled_kpts = scf.run_kdft(cell, nmp=nmp,  gamma=True, df='df')
    #dump the integrals
    fcidump('k'+name(nmp)+'/fcidumpfile',kmf,nmp,scaled_kpts,False)
