def get_geom(): init_logging("./") geom = geom_from_library("h2.xyz") kwargs = { "keywords": "BP86 def2-SV(P)", "charge": 0, "mult": 1, "blocks": "%tddft nroots 2 iroot 1 end", "track": True, } orca = ORCA(**kwargs) geom.set_calculator(orca) return geom
def water(): geom = geom_loader("lib:h2o.xyz") init_logging() calc_kwargs = { "xc": "pbe0", "method": "tddft", "basis": "sto3g", "nstates": 2, "root": 1, # OverlapCalculator specific "track": True, "cdds": "calc", "ovlp_type": "tden", } calc = PySCF(**calc_kwargs) geom.set_calculator(calc) return geom
def test_orca_stable(): init_logging() geom = geom_from_library("ozone.xyz") orca_kwargs = { "keywords": "UHF def2-SVP", "pal": 1, "mult": 1, "charge": 0, } calc = ORCA(**orca_kwargs) geom.set_calculator(calc) unstable_energy = calc.get_energy(geom.atoms, geom.coords)["energy"] assert unstable_energy == pytest.approx(-224.0547837492) calc.do_stable = True stable_energy = calc.get_energy(geom.atoms, geom.coords)["energy"] assert stable_energy == pytest.approx(-224.1476205193)
def run_distributed(scheduler=None): init_logging(THIS_DIR, scheduler) atoms = ("H", "H") geoms = list() for i in range(7): bond_length = 0.8 + i * 0.2 print(f"{i}: {bond_length:.02f}") coords = np.array((0., 0., 0., 0., 0., bond_length)) geom = Geometry(atoms, coords) # def2-TZVP / TDDFT td_kwargs = { "keywords": "BP86 def2-TZVP", "charge": 0, "mult": 1, "calc_number": i, "blocks": "%tddft nroots 2 iroot 1 end", #"track": True, "out_dir": THIS_DIR, } # def2-SV(P) / Ground state kwargs = { "keywords": "BP86 def2-SV(P)", "charge": 0, "mult": 1, "calc_number": i, "out_dir": THIS_DIR, } orca = ORCA(**td_kwargs) geom.set_calculator(orca) geoms.append(geom) neb_kwargs = { "dask_cluster": scheduler, } neb = NEB(geoms, **neb_kwargs) forces = neb.forces for f in forces.reshape(-1, 6): print(f, f"{np.linalg.norm(f):.2f}") for geom in neb.images: print(geom.calculator.wfow)
import numpy as np import pytest from pysisyphus.calculators.AnaPot import AnaPot from pysisyphus.calculators.Dimer import Dimer from pysisyphus.calculators.PySCF import PySCF from pysisyphus.Geometry import Geometry from pysisyphus.helpers import geom_from_library from pysisyphus.init_logging import init_logging from pysisyphus.optimizers.PreconLBFGS import PreconLBFGS from pysisyphus.testing import using init_logging() @pytest.mark.parametrize("rotation_method, ref_cycle", [ ("direct", 9), ("fourier", 9), ]) def test_dimer(rotation_method, ref_cycle): coords = (-0.2, 1.1, 0) geom = Geometry(("X", ), coords) N_raw = np.array((0.83, 0.27, 0.)) # New implementation dimer_kwargs = { "rotation_method": rotation_method, "calculator": AnaPot(), "N_raw": N_raw, "rotation_remove_trans": False, }