
from ase.lattice import bulk
import pyscfdump.scf as scf
from pyscfdump.helpers import build_cell
from pyscf.pbc import cc as pbccc

def run_kccsd(mf):
    cc = pbccc.KCCSD(mf)
    cc.verbose = 7
    cc.ccsd()
    return cc

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
nmp=[2,2,2]     #number of k-points in each dimension

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

#run the HF calculation
kmf,scaled_kpts = scf.run_khf(cell, nmp=nmp, exxdiv = None, gamma=True, df='df')

#run CC
cc = run_kccsd(kmf)
print cc.ecc

