Source code for pynao.m_dipole_ni


from __future__ import division, print_function
import numpy as np

#
#
#
[docs]def dipole_ni(me, sp1, R1, sp2, R2, **kvargs): """ Computes overlap for an atom pair. The atom pair is given by a pair of species indices and the coordinates of the atoms. Args: sp1,sp2 : specie indices, and R1,R2 : respective coordinates in Bohr, atomic units Result: matrix of orbital overlaps The procedure uses the numerical integration in coordinate space. """ from pynao.m_ao_matelem import build_3dgrid from pynao.m_ao_eval_libnao import ao_eval_libnao as ao_eval grids = build_3dgrid(me, sp1, R1, sp2, R2, **kvargs) ao1 = ao_eval(me.ao1, R1, sp1, grids.coords) ao1 = ao1 * grids.weights ko1 = np.einsum('ik,oi->koi', grids.coords, ao1) ao2 = ao_eval(me.ao1, R2, sp2, grids.coords) koo2dip = np.einsum("koi,pi->kop", ko1, ao2) return koo2dip