1#!/usr/bin/env python3
2
3import numpy
4import pyscf.pbc.gto as gto
5from pyscf.pbc import scf, dft
6import h5py
7import sys
8
9cell = gto.Cell()
10cell.verbose = 5
11alat0 = 3.6
12cell.a = (numpy.ones((3,3))-numpy.eye(3))*alat0 / 2.0
13cell.atom = (('C',0,0,0),('C',numpy.array([0.25,0.25,0.25])*alat0))
14cell.basis = 'gth-szv'
15cell.pseudo = 'gth-pade'
16cell.mesh = [25,25,25]
17cell.build()
18nk = [2,2,2]
19kpts = cell.make_kpts(nk)
20
21mf = scf.KRHF(cell, kpts=kpts)
22mf.chkfile = 'scf.chk'
23mf.kernel()
24
25from afqmctools.utils.linalg import get_ortho_ao
26hcore = mf.get_hcore()
27fock = (hcore + mf.get_veff())
28X, nmo_per_kpt = get_ortho_ao(cell,kpts,1e-14)
29with h5py.File(mf.chkfile, 'r+') as fh5:
30  fh5['scf/hcore'] = hcore
31  fh5['scf/fock'] = fock
32  fh5['scf/orthoAORot'] = X
33  fh5['scf/nmo_per_kpt'] = nmo_per_kpt
34