Esempio n. 1
0
def compute_charges(charge_method, charge_type, molecule):
    """
    Compute charges for nbody fragments
    """
    from psi4.driver.driver import energy
    from psi4.driver.p4util.util import oeprop

    charges = {}
    molecule = molecule.clone()
    for i in range(1, molecule.nfragments() + 1):
        molecule.set_name('charges%i' %i)
        e, wfn = energy(charge_method, molecule=molecule.extract_subsets([i]), return_wfn=True)
        oeprop(wfn, charge_type)
        charges[i] = wfn.atomic_point_charges().np

    return charges
Esempio n. 2
0
def compute_charges(charge_method, charge_type, molecule):
    """
    Compute charges for nbody fragments
    """
    from psi4.driver.driver import energy
    from psi4.driver.p4util.util import oeprop

    charges = {}
    molecule = molecule.clone()
    for i in range(1, molecule.nfragments() + 1):
        molecule.set_name('charges%i' % i)
        e, wfn = energy(charge_method, molecule=molecule.extract_subsets([i]), return_wfn=True)
        oeprop(wfn, charge_type)
        charges[i] = wfn.atomic_point_charges().np

    return charges