Molecule in uniform electric field

Hi,
I am trying to run a simple scf calculation of h2o molecule in an external uniform electric field along z-direction E=(0,0,Ez)
Perhaps I am using incorrect instructions:
psi4.set_options({‘basis’: ‘cc-pvtz’,
‘scf_type’: ‘direct’,
‘e_convergence’: 1e-8,
‘d_convergence’: 1e-8,
‘PERTURB_H’: True,
‘PERTURB_WITH’:‘DIPOLE’,
‘PERTURB_DIPOLE’:[0.,0.,0.01]})
since I cannot get the same result in the case I explicitly build the core hamiltonian
dipole=mints.so_dipole()

Build H_core

V = mints.ao_potential()
T = mints.ao_kinetic()
dipole=mints.so_dipole()
dipole[2].scale(0.0001)
H = T.clone()
H.add(V)
H.add(dipole[2])

Thanks in advance

Have you seen this question? It looks similar to yours.

Also, please enclose example script in a preformatted block (backticks). I think the forum’s own formatting is interfering with your input file, so I can’t read it clearly.

import time
import numpy as np
np.set_printoptions(precision=5, linewidth=200, suppress=True)
import psi4

# Memory for Psi4 in GB
psi4.set_memory('2 GB')
psi4.core.set_output_file("test.dat", False)

# Memory for numpy in GB
numpy_memory = 2

mol = psi4.geometry("""
O  0.0000   0.0000   -0.075791843589   
H  0.0000 -0.866811828967   0.601435779270   
H  0.00     0.866811828967   0.601435779270 
symmetry c1
no_reorient 
no_com
""")

psi4.set_options({'basis': 'cc-pvtz',
                  'scf_type': 'direct',
                  'guess': 'core',
                  'e_convergence': 1e-8,
                  'd_convergence': 1e-8,
                  'PERTURB_H': True,
                  'PERTURB_WITH':'DIPOLE',
                  'PERTURB_DIPOLE':[0.,0.,0.0001]})
scf_e, scf_wfn = psi4.energy('scf', return_wfn=True)

I am using the above example as reference. Then I tried to run RHF_libJK.py example from psi4numpy project with few lines added and setting up the same options and molecule geometry

# Build H_core
V = mints.ao_potential()
T = mints.ao_kinetic()
H = T.clone()
H.add(V)
#add dipole field
dipole=mints.ao_dipole()
tmp=np.asarray(dipole[2])
tmp[:]*=0.0001
field=psi4.core.Matrix.from_array(tmp)
H.add(field)

Regarding the post you cited, it was my intial starting point, althoug my task is slighltly different. Further, is it possible that the reference example and the modified RHF_libJK example diverge at some point?