예제 #1
0
        "corr_first_energy": True,
        "corr_bisec_size": 0.0025,
        "corr_bisec_energy": True,
    }

    irc = IMKMod(geom, **irc_kwargs)
    irc.run()

    # plot_irc(irc, irc.__class__.__name__)
    assert_anapot_irc(irc)


@pytest.mark.parametrize("calc_cls, kwargs_", [
    pytest.param(PySCF, {
        "basis": "321g",
    }, marks=using("pyscf")),
    pytest.param(Gaussian16, {"route": "HF/3-21G"}, marks=using("gaussian16")),
    pytest.param(Turbomole, {
        "control_path": "./hf_abstr_control_path",
        "pal": 1
    },
                 marks=using("turbomole")),
])
def test_hf_abstraction_dvv(calc_cls, kwargs_, this_dir):
    geom = geom_loader("lib:hfabstraction_hf321g_displ_forward.xyz")

    calc_kwargs = {
        "pal": 2,
    }
    calc_kwargs.update(kwargs_)
예제 #2
0
# # "thresh": "gau_loose",
# "max_cycles": 23,
# }
# opt = SteepestDescent(cos, **opt_kwargs)
# # import pdb; pdb.set_trace()
# opt.run()

# run_tsopt_from_cos(cos, tsopt_key, tsopt_kwargs)


@pytest.mark.skip
@pytest.mark.parametrize(
    "tsopt_key, tsopt_kwargs",
    [
        # ("dimer", ),
        pytest.param("rsprfo", {}, marks=using("orca")),
    ])
def test_run_tsopt_from_cos(tsopt_key, tsopt_kwargs):
    geoms = geom_from_library("ala_dipeptide_iso_b3lyp_631gd_10_images.trj")

    orca_kwargs = {
        "keywords": "b3lyp 6-31G* rijcosx",
        "pal": 2,
        "mem": 2000,
        "charge": 0,
        "mult": 1,
    }

    calc_number = 0

    def calc_getter():
예제 #3
0
from pysisyphus.optimizers.PreconLBFGS import PreconLBFGS
from pysisyphus.testing import using

init_logging()


@pytest.fixture
def this_dir(request):
    return Path(request.module.__file__).parents[0]


@pytest.mark.parametrize("calc_cls, calc_kwargs, chk_exts", [
    pytest.param(ORCA, {
        "keywords": "HF def2-SVP",
    }, ("gbw", ),
                 marks=using("orca")),
    pytest.param(Gaussian16, {
        "route": "HF/def2SVP",
    }, ("fchk", ),
                 marks=using("gaussian16")),
    pytest.param(PySCF, {
        "method": "scf",
        "basis": "def2svp"
    }, ("chkfile", ),
                 marks=using("pyscf")),
    pytest.param(Turbomole, {"control_path": "benzene_control_path"},
                 ("mos", ),
                 marks=using("turbomole")),
    pytest.param(Turbomole, {"control_path": "benzene_control_path_uhf"},
                 ("alpha", "beta"),
                 marks=using("turbomole")),
예제 #4
0
from pysisyphus.calculators import Gaussian16, Turbomole, ORCA
from pysisyphus.calculators.PySCF import PySCF
from pysisyphus.helpers import geom_from_library
from pysisyphus.testing import using


@pytest.mark.parametrize(
    "calc_cls, calc_kwargs, ref_energy, ref_force_norm",
    [
        pytest.param(
            ORCA,
            {"keywords": "BP86 def2-SVP"},
            -40.473648820542,
            0.0539577447,
            marks=using("orca"),
        ),
        pytest.param(
            ORCA,
            # DoEq includes interaction between point charges and nuclear
            # charges of the actual atoms.
            {
                "keywords": "BP86 def2-SVP",
                "blocks": "%method doEQ true end"
            },
            -40.448455709343,
            0.0539577447,
            marks=using("orca"),
        ),
        pytest.param(
            Turbomole,
예제 #5
0

init_logging()


@pytest.fixture
def this_dir(request):
    return Path(request.module.__file__).parents[0]


@pytest.mark.parametrize(
    "calc_cls, calc_kwargs_",
    [
        pytest.param(Gaussian16,
            {"route": "HF/STO-3G"},
            marks=using("gaussian16")),
        pytest.param(ORCA,
            {"keywords": "HF STO-3G tightscf"},
            marks=using("orca")),
        # pytest.param(Psi4,
            # {"method": "scf", "basis": "sto-3g", "to_set": {"scf_type": "pk"}},
            # marks=using("psi4"),
        # ),
        pytest.param(PySCF,
            {"basis": "sto-3g"},
            marks=(using("pyscf"), pytest.mark.pyscf)),
        pytest.param(Turbomole,
            {"control_path": "./control_path_hf_sto3g_gs"},
            marks=using("turbomole")),
])
def test_cytosin_gs_opt(calc_cls, calc_kwargs_, this_dir):
예제 #6
0
import numpy as np


@using("pyscf")
@pytest.mark.parametrize(
    "hessian_init, ref_cycle",
    [
        ("calc", 11),
        # Converges to wrong minimum
        # ("unit", 9),
        ("fischer", 15),
        ("lindh", 21),
        ("simple", 22),
        ("swart", 15),
        pytest.param("xtb", 21, marks=[using("pyscf"),
                                       using("xtb")]),
        pytest.param("xtb1", 15, marks=[using("pyscf"),
                                        using("xtb")]),
    ])
def test_guess_hessians(hessian_init, ref_cycle):
    geom = geom_loader("lib:h2o2_hf_321g_opt.xyz", coord_type="redund")
    geom.set_calculator(PySCF(basis="def2svp", pal=2))

    print("@\tguess_hessian:", hessian_init)
    opt_kwargs = {
        "hessian_init": hessian_init,
        "thresh": "gau_tight",
    }
    opt = RFOptimizer(geom, **opt_kwargs)
    opt.run()
예제 #7
0
import pytest

from pysisyphus.calculators.PySCF import PySCF
from pysisyphus.cos.NEB import NEB
from pysisyphus.helpers import geom_from_library
from pysisyphus.optimizers.QuickMin import QuickMin
from pysisyphus.optimizers.LBFGS import LBFGS
from pysisyphus.testing import using


@pytest.mark.skip
@pytest.mark.parametrize("opt_cls", [
    pytest.param(QuickMin, marks=using("pyscf")),
    pytest.param(LBFGS, marks=using("pyscf")),
])
def test_diels_alder_neb(opt_cls):
    geoms = geom_from_library("diels_alder_interpolated.trj")
    for i, geom in enumerate(geoms):
        calc_kwargs = {
            "basis": "sto3g",
            "pal": 2,
            "calc_number": i,
        }
        calc = PySCF(**calc_kwargs)
        geom.set_calculator(calc)
    neb = NEB(geoms)

    opt_kwargs = {
        "dump": True,
        "align": True,
        "max_cycles": 15,
예제 #8
0
@pytest.mark.parametrize("precon", [
    True,
    False,
])
@pytest.mark.parametrize(
    "calc_cls, calc_kwargs, ref_nu_pre, ref_cyc_pre, ref_nu, ref_cyc",
    [
        pytest.param(
            # 1791.60 cm⁻¹ from ORCA itself
            ORCA,
            {"keywords": "BP86 def2-SVP"},
            1793.274093,
            3,
            1793.293512,
            7,
            marks=using("orca")),
        pytest.param(
            # 1691.888 cm⁻¹ from XTB itself
            XTB,
            {},
            1691.052689,
            3,
            1691.005160,
            7,
            marks=using("xtb")),
        # pytest.param(
        # PySCF, {"basis": "321g",},
        # 1889.2027727, 16, 1888.9849030442317, 16, marks=using("pyscf")),
        pytest.param(PySCF, {
            "basis": "def2svp",
            "xc": "bp86"
예제 #9
0
        -0.20069873   -0.69255477    1.27610279
    """.strip().split(),
        dtype=float,
    ) * ANG2BOHR)
    return Geometry(atoms, coords)


@pytest.mark.parametrize(
    "calc_cls, calc_kwargs",
    [
        pytest.param(
            Gaussian09,
            {
                "route": "hf sto-3g",
            },
            marks=using("gaussian09"),
        ),
        pytest.param(
            Gaussian16,
            {
                "route": "hf sto-3g",
            },
            marks=using("gaussian16"),
        ),
        pytest.param(
            ORCA,
            {
                "keywords": "hf sto-3g",
            },
            marks=using("orca"),
        ),
예제 #10
0

@pytest.mark.parametrize(
    "calc_cls, calc_kwargs, ref_cycle, ccl_dist, oc_dist",
    [
        pytest.param(
            PySCF,
            {
                "basis": "6-31g*",
                "xc": "b3lyp",
                "pal": 2
            },
            29,
            4.79584,
            2.67745,
            marks=using("pyscf"),
        ),
        pytest.param(XTB, {}, 27, 5.26346, 2.62731, marks=using("xtb")),
    ],
)
def test_ohch3f_anion(calc_cls, calc_kwargs, ref_cycle, ccl_dist, oc_dist):
    """Example (R1) from
        https://aip.scitation.org/doi/pdf/10.1063/1.3457903?class=pdf

    See Fig. 2 and Fig. 4
    """

    geom = geom_loader("lib:ohch3f_anion_cs.xyz")
    # OH group is a fragment
    fragment_indices = [
        (5, 6),