Ejemplo n.º 1
0
 def dia(self, mol=None, dm0=None, gauge_orig=None, shielding_nuc=None):
     if mol is None: mol = self.mol
     if dm0 is None: dm0 = self._scf.make_rdm1()
     if not (isinstance(dm0, numpy.ndarray) and dm0.ndim == 2):
         # spin-traced 1pdm
         dm0 = dm0[0] + dm0[1]
     return rhf_nmr.dia(mol, dm0, gauge_orig, shielding_nuc)
Ejemplo n.º 2
0
Archivo: rhf.py Proyecto: MSwenne/BEP
def dia(nsrobj, gauge_orig=None, shielding_nuc=None, dm0=None):
    '''Diamagnetic part of NSR tensors.
    '''
    if shielding_nuc is None: shielding_nuc = nsrobj.shielding_nuc
    if dm0 is None: dm0 = nsrobj._scf.make_rdm1()

    mol = nsrobj.mol
    im, mass_center = inertia_tensor(mol)
    if gauge_orig is None:
        ao_coords = rhf_mag._get_ao_coords(mol)
        # Eq. (34) of JCP, 105, 2804
        nsr_dia = rhf_nmr.dia(nsrobj, gauge_orig, shielding_nuc, dm0)
        for n, atm_id in enumerate(shielding_nuc):
            coord = mol.atom_coord(atm_id)
            with mol.with_common_origin(coord):
                with mol.with_rinv_origin(coord):
                    # a11part = (B dot) -1/2 frac{\vec{r}_N}{r_N^3} r_N (dot mu)
                    h11 = mol.intor('int1e_cg_a11part', comp=9)
            e11 = numpy.einsum('xpq,qp->x', h11, dm0).reshape(3, 3)
            nsr_dia[n] -= e11 - numpy.eye(3) * e11.trace()
            nsr_dia[n] *= 2
    else:
        nsr_dia = []
        for n, atm_id in enumerate(shielding_nuc):
            coord = mol.atom_coord(atm_id)
            with mol.with_rinv_origin(coord):
                with mol.with_common_origin(gauge_orig):
                    # a11part = (B dot) -1/2 frac{\vec{r}_N}{r_N^3} (r-R_c) (dot mu)
                    h11 = mol.intor('int1e_cg_a11part', comp=9)
                e11 = numpy.einsum('xpq,qp->x', h11, dm0).reshape(3, 3)
                with mol.with_common_origin(coord):
                    # a11part = (B dot) -1/2 frac{\vec{r}_N}{r_N^3} r_N (dot mu)
                    h11 = mol.intor('int1e_cg_a11part', comp=9)
                # e11 ~ (B dot) -1/2 frac{\vec{r}_N}{r_N^3} (R_N-R_c) (dot mu)
                e11 -= numpy.einsum('xpq,qp->x', h11, dm0).reshape(3, 3)
            e11 = e11 - numpy.eye(3) * e11.trace()
            nsr_dia.append(e11)

    nsr_dia = _safe_solve(im, numpy.asarray(nsr_dia))
    unit = _atom_gyro_list(mol)[shielding_nuc] * nist.ALPHA**2
    return numpy.einsum('ixy,i->ixy', nsr_dia, unit)
Ejemplo n.º 3
0
def dia(nmrobj, gauge_orig=None, shielding_nuc=None, dm0=None):
    if dm0 is None: dm0 = nmrobj._scf.make_rdm1()
    if not (isinstance(dm0, numpy.ndarray) and dm0.ndim == 2):
        dm0 = dm0[0] + dm0[1]
    return rhf_nmr.dia(nmrobj, gauge_orig, shielding_nuc, dm0)
Ejemplo n.º 4
0
def dia(mol, dm0, gauge_orig=None, shielding_nuc=None):
    if not (isinstance(dm0, numpy.ndarray) and dm0.ndim == 2):
        dm0 = dm0[0] + dm0[1]
    return rhf_nmr.dia(mol, dm0, gauge_orig, shielding_nuc)
Ejemplo n.º 5
0
def dia(nmrobj, gauge_orig=None, shielding_nuc=None, dm0=None):
    if dm0 is None: dm0 = nmrobj._scf.make_rdm1()
    if not (isinstance(dm0, numpy.ndarray) and dm0.ndim == 2):
        dm0 = dm0[0] + dm0[1]
    return rhf_nmr.dia(nmrobj, gauge_orig, shielding_nuc, dm0)