示例#1
0
        def get_e_psi1(pcmobj):
            pcmobj.grids.build()
            mol = pcmobj.mol
            natm = mol.natm
            lmax = pcmobj.lmax

            r_vdw = ddcosmo.get_atomic_radii(pcmobj)
            coords_1sph, weights_1sph = ddcosmo.make_grids_one_sphere(
                pcmobj.lebedev_order)
            ylm_1sph = numpy.vstack(sph.real_sph_vec(coords_1sph, lmax, True))

            fi = ddcosmo.make_fi(pcmobj, r_vdw)
            ui = 1 - fi
            ui[ui < 0] = 0
            nexposed = numpy.count_nonzero(ui == 1)
            nbury = numpy.count_nonzero(ui == 0)
            on_shell = numpy.count_nonzero(ui > 0) - nexposed

            nlm = (lmax + 1)**2
            Lmat = ddcosmo.make_L(pcmobj, r_vdw, ylm_1sph, fi)
            Lmat = Lmat.reshape(natm * nlm, -1)

            cached_pol = ddcosmo.cache_fake_multipoles(pcmobj.grids, r_vdw,
                                                       lmax)

            phi = ddcosmo.make_phi(pcmobj, dm, r_vdw, ui, ylm_1sph)
            L_X = numpy.linalg.solve(Lmat, phi.ravel()).reshape(natm, -1)
            psi, vmat, L_S = \
                    ddcosmo.make_psi_vmat(pcmobj, dm, r_vdw, ui, ylm_1sph,
                                          cached_pol, L_X, Lmat)
            psi1 = ddcosmo_grad.make_e_psi1(pcmobj, dm, r_vdw, ui, ylm_1sph,
                                            cached_pol, L_X, Lmat)
            return L_X, psi, psi1
示例#2
0
        def get_e_psi1(pcmobj):
            pcmobj.grids.build()
            mol = pcmobj.mol
            natm = mol.natm
            lmax = pcmobj.lmax

            r_vdw = ddcosmo.get_atomic_radii(pcmobj)
            coords_1sph, weights_1sph = ddcosmo.make_grids_one_sphere(pcmobj.lebedev_order)
            ylm_1sph = numpy.vstack(sph.real_sph_vec(coords_1sph, lmax, True))

            fi = ddcosmo.make_fi(pcmobj, r_vdw)
            ui = 1 - fi
            ui[ui<0] = 0
            nexposed = numpy.count_nonzero(ui==1)
            nbury = numpy.count_nonzero(ui==0)
            on_shell = numpy.count_nonzero(ui>0) - nexposed

            nlm = (lmax+1)**2
            Lmat = ddcosmo.make_L(pcmobj, r_vdw, ylm_1sph, fi)
            Lmat = Lmat.reshape(natm*nlm,-1)

            cached_pol = ddcosmo.cache_fake_multipoles(pcmobj.grids, r_vdw, lmax)

            phi = ddcosmo.make_phi(pcmobj, dm, r_vdw, ui)
            L_X = numpy.linalg.solve(Lmat, phi.ravel()).reshape(natm,-1)
            psi, vmat, L_S = \
                    ddcosmo.make_psi_vmat(pcmobj, dm, r_vdw, ui, pcmobj.grids, ylm_1sph,
                                          cached_pol, L_X, Lmat)
            psi1 = ddcosmo_grad.make_e_psi1(pcmobj, dm, r_vdw, ui, pcmobj.grids, ylm_1sph,
                                            cached_pol, L_X, Lmat)
            return L_X, psi, psi1