コード例 #1
0
    def setUp(self):
        tasks = [
            NwTask.dft_task(mol,
                            operation="optimize",
                            xc="b3lyp",
                            basis_set="6-31++G*"),
            NwTask.dft_task(mol,
                            operation="freq",
                            xc="b3lyp",
                            basis_set="6-31++G*"),
            NwTask.dft_task(mol,
                            operation="energy",
                            xc="b3lyp",
                            basis_set="6-311++G**"),
            NwTask.dft_task(mol,
                            charge=mol.charge + 1,
                            operation="energy",
                            xc="b3lyp",
                            basis_set="6-311++G**"),
            NwTask.dft_task(mol,
                            charge=mol.charge - 1,
                            operation="energy",
                            xc="b3lyp",
                            basis_set="6-311++G**")
        ]

        self.nwi = NwInput(mol,
                           tasks,
                           geometry_options=["units", "angstroms", "noautoz"],
                           memory_options="total 1000 mb")
        self.nwi_symm = NwInput(
            mol,
            tasks,
            geometry_options=["units", "angstroms", "noautoz"],
            symmetry_options=["c1"])
コード例 #2
0
    def get_nwinput(self, mol):
        functional = "b3lyp"
        geom_opt_bset = {}
        scf_bset = {}
        for el in mol.composition.elements:
            geom_opt_bset[el.symbol] = "6-31+g*"
            scf_bset[el.symbol] = "6-31++g**" if el.Z <= 18 else "6-31+g*"

        if len(mol) > 1:
            # Insert opt and freq job for molecules with more than one atom.
            tasks = [
                NwTask.dft_task(mol, operation="optimize", xc=functional,
                                basis_set=geom_opt_bset),
                NwTask.dft_task(mol, operation="freq", xc=functional,
                                basis_set=geom_opt_bset)
            ]
        else:
            tasks = []

        tasks.extend([
            NwTask.dft_task(mol, operation="energy", xc=functional,
                            basis_set=scf_bset),
            NwTask.dft_task(mol, charge=mol.charge + 1, operation="energy",
                            xc=functional, basis_set=scf_bset),
            NwTask.dft_task(mol, charge=mol.charge - 1, operation="energy",
                            xc=functional, basis_set=scf_bset)
        ])

        return NwInput(mol, tasks)
コード例 #3
0
#!/usr/bin/env python
# coding: utf-8

from __future__ import division, print_function, unicode_literals, \
    absolute_import

from pymatgen import Molecule
from pymatgen.io.nwchem import NwInput, NwTask

coords = [[0.000000, 0.000000, 0.000000], [0.000000, 0.000000, 1.089000],
          [1.026719, 0.000000, -0.363000], [-0.513360, -0.889165, -0.363000],
          [-0.513360, 0.889165, -0.363000]]
mol = Molecule(["C", "H", "H", "H", "H"], coords)

tasks = [
    NwTask.dft_task(mol,
                    operation="optimize",
                    xc="b3lyp",
                    basis_set="6-31++G*"),
    NwTask.dft_task(mol, operation="freq", xc="b3lyp", basis_set="6-31++G*")
]
nwi = NwInput(mol, tasks)

print(nwi)