1#! /usr/bin/env python3
2
3import numpy
4from pyscf.pbc import gto, scf
5from pyscf.pbc import tools as pbctools
6import h5py
7from pyscftools.integrals_from_chkfile import eri_to_h5
8from pyscftools.integrals_from_chkfile_kpfftdf import (
9        eri_to_h5, getOrthoAORotation
10)
11
12
13alat0 = 3.6
14
15cell = gto.Cell()
16cell.a = numpy.eye(3)*alat0
17cell.atom = [('He',0,0,0)]
18cell.basis = 'gth-dzv'
19cell.pseudo = 'gth-pade'
20cell.mesh = [71]*3
21cell.verbose = 5
22cell.build()
23
24nk = [2,2,2]
25kpts = cell.make_kpts(nk)
26
27mf = scf.KRHF(cell,kpts=kpts)
28mf.chkfile = 'scf.dump'
29ehf = mf.kernel()
30
31hcore = mf.get_hcore()
32fock = (hcore + mf.get_veff())
33X,nmo_per_kpt = getOrthoAORotation(cell,kpts,1e-8)
34with h5py.File(mf.chkfile) as fh5:
35  fh5['scf/hcore'] = hcore
36  fh5['scf/fock'] = fock
37  fh5['scf/orthoAORot'] = X
38  fh5['scf/nmo_per_kpt'] = nmo_per_kpt
39
40eri_to_h5("ham_chol_uc", "./scf.dump", orthoAO=True, gtol=1e-5)
41