1#! /usr/bin/env python3
2
3import sys
4import os
5from pyscf import gto, scf, tools
6import numpy
7
8mol = gto.Mole(atom=[['Ne', (0,0,0)]],
9            basis='cc-pvdz',
10            unit='Angstrom',
11            verbose=4)
12mol.build()
13mf = scf.RHF(mol)
14mf.chkfile = 'neon.chk.h5'
15mf.kernel()
16hcore = mf.get_hcore()
17fock = mf.get_veff()
18# ascii fcidump is converted using fcidump_to_qmcpack.py.
19tools.fcidump.from_scf(mf, 'FCIDUMP')
20nmo = mf.mo_coeff.shape[-1]
21
22wfn_header = """&FCI
23UHF = 0
24CMajor
25NCI = 1
26TYPE = matrix
27/"""
28orbmat = numpy.identity(nmo,dtype=numpy.complex128)
29with open("wfn_rhf.dat", 'w') as f:
30    f.write(wfn_header+'\n')
31    f.write('Coefficients: 1.0\n')
32    f.write('Determinant: 1\n')
33    for i in range(0,mol.nelec[0]):
34        occ = '0.0 '*i + '1.0' + ' 0.0'*(nmo-i-1) + '\n'
35        f.write(occ)
36    # Alternatively add FullMO to the header above and replace for loop above
37    # with double loop below.
38    # for i in range(0,nmo):
39        # for j in range(0,nmo):
40            # val = orbmat[i,j]
41            # f.write('(%.10e,%.10e) '%(val.real, val.imag))
42        # f.write('\n')
43