#file_h2o = os.path.join ("./", 'H2O.xyz')
#file_nh3 = os.path.join ("./", 'NH3.xyz')

m_dummy = pyadf.molecule('NH3.xyz')
m_dummy.set_symmetry('NOSYM')
#m_nh3 = pyadf.molecule(file_nh3)
#m_nh3.set_symmetry('NOSYM')

#m_tot = m_h2o + m_nh3
#m_tot.set_symmetry('NOSYM')

h2o = Molecule('H2O.xyz')
nh3 = Molecule('NH3.xyz')

tot = Molecule('H2O.xyz')
tot.append(nh3.geometry + 'symmetry c1' + '\n' + 'no_com' + '\n' +
           'no_reorient' + '\n')
#check
tot.display_xyz()

psi4.set_num_threads(16)
psi4.core.set_output_file('output.dat', False)
### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
# Grid generation step
#
# getting a grid from psi4 for the total system

if parse_version(psi4.__version__) >= parse_version('1.3a1'):
    build_superfunctional = psi4.driver.dft.build_superfunctional
else:
    build_superfunctional = psi4.driver.dft_funcs.build_superfunctional
Exemple #2
0
import sys
import os
sys.path.append("/usr/local/xcfun_py3/lib64/python")
#sys.path.append("/usr/local/PyADF-myfork/src/")
import numpy as np
import psi4
from pkg_resources import parse_version
from molecule import Molecule

#psi4.set_num_threads(16)
h2o=Molecule('H2O.xyz')
h2o.append('symmetry c1' +'\n' + 'no_com' + '\n' + 'no_reorient' + '\n')
psi4.set_options({'basis': 'aug-cc-pvdz', # can be defined later maybe?
                  'puream': 'True',
                  'DF_SCF_GUESS': 'False',
                  'scf_type': 'direct',
                  'dft_radial_scheme' : 'becke',
                  'dft_radial_points': 50,
                  'dft_spherical_points' : 194,
                  'e_convergence': 1e-8,
                  'd_convergence': 1e-8})
h2o_mol=psi4.geometry(h2o.geometry)
ene, h2o_wfn = psi4.energy('blyp', return_wfn=True)
C_h2o=np.array(h2o_wfn.Ca_subset("AO","OCC"))
D_h2o=np.array(h2o_wfn.Da())

# 2.1 map A and B density on grid points
from grid import GridFactoryDensity 
#we use the total system grid
Vpot = h2o_wfn.V_potential()
x, y, z, w = Vpot.get_np_xyzw()
      #
      # getting a grid from adf. Alternative options:  
      #                                               i) use the total sys (env+act)  grid
      #                                               ii) use the active sys grid
      print("Setting psi4 Vpot object ...")
      if os.path.isfile(logfname):
        print("  Removing "+ logfname )
        os.remove(logfname)


      f = io.StringIO()
      with redirect_stdout(f):
        enviro=Molecule(geomB)

        tot=Molecule(geomA)
        tot.append(enviro.geometry+'symmetry c1' +'\n' + 'no_com' + '\n' + 'no_reorient' + '\n')
        #check
        tot.display_xyz()
        #set the computation parameters explicitly here
        #psi4.set_num_threads(16)
        if parse_version(psi4.__version__) >= parse_version('1.3a1'):      
            build_superfunctional = psi4.driver.dft.build_superfunctional
        else:
            build_superfunctional = psi4.driver.dft_funcs.build_superfunctional  
        
        tot_mol=psi4.geometry(tot.geometry)
        #set options for the grid
        #'homogeneous' grid quality through the code is desiderable
        psi4.set_options({'dft_radial_scheme' : 'becke',
                          'dft_radial_points': 50,
                          'dft_spherical_points' : 110})