From 426bd3752918dfe16f6eedbd2e9165aaf9f28d36 Mon Sep 17 00:00:00 2001 From: gelzinyte Date: Mon, 22 Jul 2024 14:43:57 +0000 Subject: [PATCH 01/24] bug fix --- .github/workflows/docs.yml | 2 +- wfl/calculators/castep.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 58e1f636..f9a03e5f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -110,7 +110,7 @@ jobs: # dependency from https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow deploy-docs: - if: github.event.action == 'push' + if: github.event.pull_request.merged == true needs: build-docs runs-on: ubuntu-latest diff --git a/wfl/calculators/castep.py b/wfl/calculators/castep.py index 514381ad..4770da53 100644 --- a/wfl/calculators/castep.py +++ b/wfl/calculators/castep.py @@ -105,7 +105,7 @@ def calculate(self, atoms=None, properties=_default_properties, system_changes=a self.clean_rundir(_default_keep_files, calculation_succeeded) # reset pbc because Castep overwrites it to True - self.atoms.pbc = orig_pbc(False) + self.atoms.pbc = orig_pbc def setup_calc_params(self, properties): From 3f409190a17bb3305c23f4ebec879d04da50957b Mon Sep 17 00:00:00 2001 From: gelzinyte Date: Mon, 22 Jul 2024 16:30:58 +0000 Subject: [PATCH 02/24] some initial changes --- tests/calculators/test_orca.py | 18 +++++------ tests/local_scripts/gelzinyte.workstation.sh | 3 +- wfl/calculators/orca/__init__.py | 32 +++----------------- 3 files changed, 15 insertions(+), 38 deletions(-) diff --git a/tests/calculators/test_orca.py b/tests/calculators/test_orca.py index 561fa46a..bcba0bb0 100644 --- a/tests/calculators/test_orca.py +++ b/tests/calculators/test_orca.py @@ -23,9 +23,6 @@ from wfl.configset import ConfigSet, OutputSpec from wfl.autoparallelize import AutoparaInfo -pytestmark = pytest.mark.xfail(reason="calculator needs to be updated to work with latest gitlab version of ase") - - ref_parameters = dict(charge=0, mult=1, orca_command="dummy_no_orca_exec", @@ -72,7 +69,7 @@ def test_orca_is_converged(): assert orca.is_converged() is None -@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") +#@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") def test_full_orca(tmp_path): atoms = Atoms("H2", positions=[(0, 0, 0), (0, 0, 0.9)]) @@ -107,9 +104,9 @@ def test_full_orca(tmp_path): atoms.get_potential_energy() -@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") +#@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") def test_orca_with_generic(tmp_path): - + home_dir = tmp_path / "home_dir" atoms = Atoms("H2", positions=[(0, 0, 0), (0, 0, 0.9)]) @@ -127,9 +124,10 @@ def test_orca_with_generic(tmp_path): for at in outputs.to_ConfigSet(): assert "orca_energy" in at.info or "orca_calculation_failed" in at.info -@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") + +#@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") def test_orca_geometry_optimisation(tmp_path): - + home_dir = tmp_path / "home_dir" atoms = Atoms("H2", positions=[(0, 0, 0), (0, 0, 0.9)]) @@ -152,7 +150,7 @@ def test_orca_geometry_optimisation(tmp_path): @pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") def test_post_processing(tmp_path): - + home_dir = tmp_path / "home_dir" atoms = Atoms("H2", positions=[(0, 0, 0), (0, 0, 0.9)]) @@ -173,7 +171,7 @@ def test_parse_npa_output(): assert np.all([v1==v2 for v1, v2 in zip(elements, ["O", "H", "H"])]) assert np.all([pytest.approx(v1)==v2 for v1, v2 in zip(populations, ref_populations)]) assert np.all([pytest.approx(v1)==v2 for v1, v2 in zip(charges,ref_charges)]) - + def simplest_orca_post(orca_calc): diff --git a/tests/local_scripts/gelzinyte.workstation.sh b/tests/local_scripts/gelzinyte.workstation.sh index 44ece984..65ef46f0 100755 --- a/tests/local_scripts/gelzinyte.workstation.sh +++ b/tests/local_scripts/gelzinyte.workstation.sh @@ -3,5 +3,6 @@ export ASE_CONFIG_PATH=${HOME}/.config/ase/pytest.config.ini # Aims -pytest -v -s -rxXs ../calculators/test_aims.py +#pytest -v -s -rxXs ../calculators/test_aims.py +pytest ../calculators/test_orca.py diff --git a/wfl/calculators/orca/__init__.py b/wfl/calculators/orca/__init__.py index 5d01a36a..e9835282 100644 --- a/wfl/calculators/orca/__init__.py +++ b/wfl/calculators/orca/__init__.py @@ -44,16 +44,13 @@ class ORCA(WFLFileIOCalculator, ASE_ORCA): scratchdir: str / Path, default None temporary directory to execute calculations in and delete or copy back results (set by "keep_files") if needed. For example, directory on a local disk with fast file I/O. - calculator_exec: str, default "orca" - command for ORCA, without any prefix or redirection set. - for example: "/path/to/orca" - mutually exclusive with "command" post_process: function that takes the current instance of the calculator and is to be executed after reading back results from file, but before all the files are deleted. For example, a localisation scheme that uses the wavefunction files and saves local charges to `ORCA.extra_results`. - **kwargs: arguments for ase.calculators.espresso.Espresso + **kwargs: arguments for ase.calculators.orca.ORCA + see https://wiki.fysik.dtu.dk/ase/ase/calculators/orca.html#module-ase.calculators.orca """ implemented_properties = ["energy", "forces", "dipole"] @@ -73,18 +70,6 @@ def __init__(self, keep_files="default", rundir_prefix="ORCA_", scratchdir=None, workdir=None, calculator_exec=None, post_process=None, **kwargs): - if calculator_exec is not None: - if "command" in kwargs: - raise ValueError("Cannot specify both calculator_exec and command") - if " PREFIX " in calculator_exec: - raise ValueError("calculator_exec should not include orca command line arguments such as ' PREFIX.inp > PREFIX.out'") - self.command = f'{calculator_exec} PREFIX.inp > ' \ - f'PREFIX.out' - elif calculator_exec is None and "command" not in kwargs: - self.command = os.environ.get("ASE_ORCA_COMMAND", "orca PREFIX.inp > PREFIX.out") - else: - self.command = kwargs["command"] - super().__init__(keep_files=keep_files, rundir_prefix=rundir_prefix, workdir=workdir, scratchdir=scratchdir, **kwargs) @@ -112,7 +97,10 @@ def calculate(self, atoms=None, properties=["energy", "forces"], system_changes= if self.post_process is not None: self.post_process(self) calculation_succeeded = True + if 'DFT_FAILED_ORCA' in atoms.info: + del atoms.info["DFT_FAILED_ORCA"] except Exception as e: + atoms.info["DFT_FAILED_ORCA"] = TRUE calculation_succeeded = False raise e finally: @@ -123,16 +111,6 @@ def calculate(self, atoms=None, properties=["energy", "forces"], system_changes= - def cleanup(self): - """Clean all (empty) directories that could not have been removed - immediately after the calculation, for example, because other parallel - process might be using them.""" - if any(self.workdir_root.iterdir()): - print(f'{self.workdir_root.name} is not empty, not removing') - else: - self.workdir_root.rmdir() - - def write_input(self, atoms, properties=None, system_changes=None): """Writes orca.inp, based on the wfl ORCA calculator parameters""" From d4d06e01a65f278d7974ff11d10cd4740cb9beee Mon Sep 17 00:00:00 2001 From: Elena Date: Tue, 30 Jul 2024 15:04:48 +0200 Subject: [PATCH 03/24] undo docs deployment rule --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0de47b1e..31a5e1da 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -108,7 +108,7 @@ jobs: # dependency from https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow deploy-docs: - if: github.event.pull_request.merged == true + if: github.event.action == 'push' needs: build-docs runs-on: ubuntu-latest From a625f46c10071ff825ee7b183fc194659c27ef61 Mon Sep 17 00:00:00 2001 From: Elena Date: Tue, 30 Jul 2024 17:05:39 +0200 Subject: [PATCH 04/24] recursion fix for ase 3.23 --- wfl/calculators/castep.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wfl/calculators/castep.py b/wfl/calculators/castep.py index 4770da53..0eb8cbc8 100644 --- a/wfl/calculators/castep.py +++ b/wfl/calculators/castep.py @@ -61,6 +61,8 @@ def __init__(self, keep_files="default", rundir_prefix="run_CASTEP_", # make sure we are looking for pspot if path given kwargs["find_pspots"] = True + #import pdb; pdb.set_trace() + # WFLFileIOCalculator is a mixin, will call remaining superclass constructors for us super().__init__(keep_files=keep_files, rundir_prefix=rundir_prefix, workdir=workdir, scratchdir=scratchdir, **kwargs) @@ -83,7 +85,7 @@ def calculate(self, atoms=None, properties=_default_properties, system_changes=a orig_pbc = self.atoms.pbc.copy() try: - super().calculate(atoms=atoms) + super().calculate(atoms=atoms, properties=properties, system_changes=system_changes) calculation_succeeded = True if 'DFT_FAILED_CASTEP' in atoms.info: del atoms.info['DFT_FAILED_CASTEP'] @@ -95,8 +97,8 @@ def calculate(self, atoms=None, properties=_default_properties, system_changes=a # ASE castep calculator does not ever raise an exception when # it fails. Instead, you get things like stress being None, # which lead to TypeError when save_calc_results calls get_stress(). - for property in properties: - result = self.get_property(property) + for prop in properties: + result = self.get_property(prop, allow_calculation=False) if result is None: calculation_succeeded = False atoms.info["DFT_FAILED_CASTEP"] = True From 04233db3ddf95eb5c0dc935223349f17d0e9352f Mon Sep 17 00:00:00 2001 From: Elena Date: Tue, 30 Jul 2024 18:22:15 +0200 Subject: [PATCH 05/24] break from a superfluous loop --- wfl/calculators/castep.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wfl/calculators/castep.py b/wfl/calculators/castep.py index 0eb8cbc8..7da03d93 100644 --- a/wfl/calculators/castep.py +++ b/wfl/calculators/castep.py @@ -61,13 +61,13 @@ def __init__(self, keep_files="default", rundir_prefix="run_CASTEP_", # make sure we are looking for pspot if path given kwargs["find_pspots"] = True - #import pdb; pdb.set_trace() # WFLFileIOCalculator is a mixin, will call remaining superclass constructors for us super().__init__(keep_files=keep_files, rundir_prefix=rundir_prefix, workdir=workdir, scratchdir=scratchdir, **kwargs) + def calculate(self, atoms=None, properties=_default_properties, system_changes=all_changes): """Do the calculation. Handles the working directories in addition to regular ASE calculation operations (writing input, executing, reading_results) @@ -102,6 +102,7 @@ def calculate(self, atoms=None, properties=_default_properties, system_changes=a if result is None: calculation_succeeded = False atoms.info["DFT_FAILED_CASTEP"] = True + break # from WFLFileIOCalculator self.clean_rundir(_default_keep_files, calculation_succeeded) From 98decdbb5f88138e5763fbc250d26c44a8af6849 Mon Sep 17 00:00:00 2001 From: Elena Date: Mon, 5 Aug 2024 10:41:34 +0200 Subject: [PATCH 06/24] loosen castep test tolerances when running a different castep version on a different machine --- tests/calculators/test_castep.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/calculators/test_castep.py b/tests/calculators/test_castep.py index 16f95b92..cc8cef6c 100644 --- a/tests/calculators/test_castep.py +++ b/tests/calculators/test_castep.py @@ -30,9 +30,9 @@ def test_castep_calculation(tmp_path): ) atoms.calc = calc - assert atoms.get_potential_energy() == approx(-217.2263559019) - assert atoms.get_forces() == approx(np.array([[-0., -0., 0.], [ 0., 0., -0.]])) - assert atoms.get_stress() == approx(np.array([ 0.06361731, 0.06361731, 0.06361731,-0., 0., 0.])) + assert atoms.get_potential_energy() == approx(-217.2263559019, 2e-3) + assert atoms.get_forces() == approx(np.array([[-0., -0., 0.], [ 0., 0., -0.]]), abs=1e-4) + assert atoms.get_stress() == approx(np.array([ 0.06361731, 0.06361731, 0.06361731,-0., 0., 0.]), abs=1e-5) def test_castep_calc_via_generic(tmp_path): From 7c910d7643d71b128ff46ba3967da5eb3528d3ea Mon Sep 17 00:00:00 2001 From: Elena Date: Mon, 5 Aug 2024 10:47:13 +0200 Subject: [PATCH 07/24] remove extra empty lines --- wfl/calculators/castep.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/wfl/calculators/castep.py b/wfl/calculators/castep.py index 7da03d93..2bdba0f9 100644 --- a/wfl/calculators/castep.py +++ b/wfl/calculators/castep.py @@ -61,13 +61,11 @@ def __init__(self, keep_files="default", rundir_prefix="run_CASTEP_", # make sure we are looking for pspot if path given kwargs["find_pspots"] = True - # WFLFileIOCalculator is a mixin, will call remaining superclass constructors for us super().__init__(keep_files=keep_files, rundir_prefix=rundir_prefix, workdir=workdir, scratchdir=scratchdir, **kwargs) - def calculate(self, atoms=None, properties=_default_properties, system_changes=all_changes): """Do the calculation. Handles the working directories in addition to regular ASE calculation operations (writing input, executing, reading_results) From e9086dfc8a4d96259a8917badc0b8c7e5caf50ab Mon Sep 17 00:00:00 2001 From: Elena Date: Mon, 5 Aug 2024 10:59:07 +0200 Subject: [PATCH 08/24] enforce ase v3.23 with castep calculator --- wfl/calculators/castep.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wfl/calculators/castep.py b/wfl/calculators/castep.py index 2bdba0f9..6751c350 100644 --- a/wfl/calculators/castep.py +++ b/wfl/calculators/castep.py @@ -4,6 +4,9 @@ from copy import deepcopy +from packaging.version import Version + +import ase from ase.calculators.calculator import all_changes from ase.calculators.castep import Castep as ASE_Castep @@ -51,6 +54,10 @@ def __init__(self, keep_files="default", rundir_prefix="run_CASTEP_", workdir=None, scratchdir=None, calculator_exec=None, **kwargs): + if Version(ase.__version__) < Version("3.23"): + raise ImportError(f"The wfl CASTEP calculator is only compatible with ASE v3.23 and higher, " + f"but your ASE version is v{ase.__version__}. Please upgrade") + kwargs = deepcopy(kwargs) if calculator_exec is not None: if "castep_command" in kwargs: From 0c984f1f79c0874bdc543d6b82702875194e9b2b Mon Sep 17 00:00:00 2001 From: JPDarby Date: Thu, 8 Aug 2024 15:38:17 +0100 Subject: [PATCH 09/24] Noams test for ase fileio caching with VASP example --- tests/calculators/test_ase_fileio_caching.py | 55 ++++++++++++++++++++ tests/calculators/test_vasp.py | 9 ++-- 2 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 tests/calculators/test_ase_fileio_caching.py diff --git a/tests/calculators/test_ase_fileio_caching.py b/tests/calculators/test_ase_fileio_caching.py new file mode 100644 index 00000000..f890e997 --- /dev/null +++ b/tests/calculators/test_ase_fileio_caching.py @@ -0,0 +1,55 @@ +import os + +import pytest + +from ase.atoms import Atoms + + +######################## +# test Vasp calculator + +from tests.calculators.test_vasp import test_vasp_mark +@pytest.mark.skipif(test_vasp_mark, reason='Vasp testing env vars missing') +def test_vasp_cache_timing(tmp_path, monkeypatch): + from ase.calculators.vasp import Vasp as Vasp_ase + from wfl.calculators.vasp import Vasp as Vasp_wrap + + config = Atoms('Si', positions=[[0, 0, 9]], cell=[2, 2, 2], pbc=[True, True, True]) + kwargs_ase = {'encut': 200, 'pp': os.environ['PYTEST_VASP_POTCAR_DIR']} + kwargs_wrapper = {'workdir': tmp_path} + # make sure 'pp' is relative to correct dir (see wfl.calculators.vasp) + if os.environ['PYTEST_VASP_POTCAR_DIR'].startswith('/'): + monkeypatch.setenv("VASP_PP_PATH", "/.") + else: + monkeypatch.setenv("VASP_PP_PATH", ".") + cache_timing(config, Vasp_ase, kwargs_ase, Vasp_wrap, kwargs_wrapper, tmp_path, monkeypatch) + + +######################## +# generic code used by all calculators + +import time + +from wfl.configset import ConfigSet, OutputSpec +from wfl.calculators import generic + +def cache_timing(config, calc_ase, kwargs_ase, calc_wfl, kwargs_wrapper, rundir, monkeypatch): + (rundir / "run_calc_ase").mkdir() + + calc = calc_ase(**kwargs_ase) + config.calc = calc + + monkeypatch.chdir(rundir / "run_calc_ase") + t0 = time.time() + E = config.get_potential_energy() + ase_time = time.time() - t0 + + monkeypatch.chdir(rundir) + t0 = time.time() + _ = generic.calculate(inputs=ConfigSet(config), outputs=OutputSpec(), + calculator=calc_wfl(**kwargs_wrapper, **kwargs_ase)) + wfl_time = time.time() - t0 + + print("ASE", ase_time, "WFL", wfl_time) + + assert wfl_time < ase_time * 1.25 diff --git a/tests/calculators/test_vasp.py b/tests/calculators/test_vasp.py index 3be3485e..6d323880 100644 --- a/tests/calculators/test_vasp.py +++ b/tests/calculators/test_vasp.py @@ -13,10 +13,11 @@ from wfl.calculators import generic from wfl.configset import ConfigSet, OutputSpec -pytestmark = pytest.mark.skipif('ASE_VASP_COMMAND' not in os.environ or - 'ASE_VASP_COMMAND_GAMMA' not in os.environ or - 'PYTEST_VASP_POTCAR_DIR' not in os.environ, - reason='missing env var ASE_VASP_COMMAND or ASE_VASP_COMMAND_GAMMA or PYTEST_VASP_POTCAR_DIR') +test_vasp_mark = ('ASE_VASP_COMMAND' not in os.environ or + 'ASE_VASP_COMMAND_GAMMA' not in os.environ or + 'PYTEST_VASP_POTCAR_DIR' not in os.environ) +pytestmark = pytest.mark.skipif(test_vasp_mark, reason='missing env var ASE_VASP_COMMAND or ASE_VASP_COMMAND_GAMMA ' + 'or PYTEST_VASP_POTCAR_DIR') def test_vasp_gamma(tmp_path, monkeypatch): From c7e3c5b5b26e35de24a676a5eb09c8ad8892f7ec Mon Sep 17 00:00:00 2001 From: gelzinyte Date: Sun, 11 Aug 2024 19:54:41 +0200 Subject: [PATCH 10/24] initial update --- tests/calculators/test_orca.py | 48 +++++++-- tests/local_scripts/gelzinyte.workstation.sh | 2 +- wfl/calculators/orca/__init__.py | 103 ++++++++++++++----- 3 files changed, 114 insertions(+), 39 deletions(-) diff --git a/tests/calculators/test_orca.py b/tests/calculators/test_orca.py index bcba0bb0..a5338dd6 100644 --- a/tests/calculators/test_orca.py +++ b/tests/calculators/test_orca.py @@ -7,10 +7,14 @@ import os import shutil from functools import partial +import subprocess + +from packaging.version import Version import pytest import numpy as np +import ase from ase.build import molecule from pytest import approx from pathlib import Path @@ -23,6 +27,20 @@ from wfl.configset import ConfigSet, OutputSpec from wfl.autoparallelize import AutoparaInfo +if Version(ase.__version__) < Version("3.23"): + aims_prerequisites = pytest.mark.skip(reason="ORCA tests are only supported for ASE v3.23, please update.") + +else: + + from ase.config import cfg as ase_cfg + + aims_prerequisites = pytest.mark.skipif( + condition = 'orca' not in ase_cfg.parser , + reason='Missing "orca" in ase\'s configuration file.' + ) + + + ref_parameters = dict(charge=0, mult=1, orca_command="dummy_no_orca_exec", @@ -69,7 +87,6 @@ def test_orca_is_converged(): assert orca.is_converged() is None -#@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") def test_full_orca(tmp_path): atoms = Atoms("H2", positions=[(0, 0, 0), (0, 0, 0.9)]) @@ -79,21 +96,23 @@ def test_full_orca(tmp_path): # this should raise error and copy over default files calc = ORCA(workdir=home_dir, - scratchdir=scratchdir, - keep_files = False, - mult=2) - + scratchdir=scratchdir, + keep_files = False, + mult=2) + atoms.calc = calc try: atoms.get_potential_energy() - except CalculationFailed: + except subprocess.CalledProcessError: pass assert list(scratchdir.iterdir()) == [] assert home_dir.exists() calc_dir = [d for d in home_dir.iterdir()][0] - for ext in [".ase", ".inp", ".out"]: - assert (calc_dir / ("orca" + ext)).exists() - + for ext in [".inp", ".out"]: + fn = calc_dir / ("orca" + ext) + print(fn) + assert fn.exists() + # just check this executes without error calc = ORCA(workdir=home_dir, scratchdir=scratchdir, @@ -101,7 +120,16 @@ def test_full_orca(tmp_path): mult=1) atoms.calc = calc - atoms.get_potential_energy() + + energy = atoms.get_potential_energy() + forces = atoms.get_forces() + + ref_energy = -31.595527990679514 + ref_forces = np.array([[ 4.11376537e-10, 4.11376537e-10, 3.55578429e+00], + [-2.57110335e-10, -4.11376537e-10, -3.55578431e+00]]) + + assert energy == approx(ref_energy) + assert forces == approx(ref_forces) #@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") diff --git a/tests/local_scripts/gelzinyte.workstation.sh b/tests/local_scripts/gelzinyte.workstation.sh index 5dc06031..f86d91a4 100755 --- a/tests/local_scripts/gelzinyte.workstation.sh +++ b/tests/local_scripts/gelzinyte.workstation.sh @@ -7,5 +7,5 @@ export ASE_MOPAC_COMMAND="${HOME}/programs/mopac-22.1.1-linux/bin/mopac PREFIX.m # Aims #pytest -v -s -rxXs ../calculators/test_aims.py -pytest ../calculators/test_orca.py +pytest -v -s -rxXs --basetemp tmpdir ../calculators/test_orca.py::test_full_orca diff --git a/wfl/calculators/orca/__init__.py b/wfl/calculators/orca/__init__.py index e9835282..e1f8064a 100644 --- a/wfl/calculators/orca/__init__.py +++ b/wfl/calculators/orca/__init__.py @@ -14,9 +14,13 @@ from ..wfl_fileio_calculator import WFLFileIOCalculator from wfl.utils.misc import chunks +# To Do +## - insert engrad if it's not there +## add default parameters as in write input -_default_keep_files = ["*.inp", "*.out", "*.ase", "*.engrad", "*.xyz", +_default_keep_files = ["*.inp", "*.out", "*.engrad", "*.xyz", "*_trj.xyz"] +_default_properties = ["energy", "forces"] class ORCA(WFLFileIOCalculator, ASE_ORCA): @@ -59,48 +63,80 @@ class ORCA(WFLFileIOCalculator, ASE_ORCA): # to override that function's built-in default of 10 wfl_generic_default_autopara_info = {"num_inputs_per_python_subprocess": 1} - # same as parent class, only multiplicity changed to trigger default - default_parameters = dict( - charge=0, mult=None, - task='engrad', - orcasimpleinput='tightscf PBE def2-SVP', - orcablocks='%scf maxiter 200 end') + # EG where should it be? + default_params = dict(charge=0, orcasimpleinput='engrad B3LYP def2-TZVP', + orcablocks='%pal nprocs 1 end') + def __init__(self, keep_files="default", rundir_prefix="ORCA_", scratchdir=None, - workdir=None, calculator_exec=None, post_process=None, - **kwargs): + workdir=None, post_process=None, **kwargs): super().__init__(keep_files=keep_files, rundir_prefix=rundir_prefix, workdir=workdir, scratchdir=scratchdir, **kwargs) - self.extra_results = dict() # to make use of wfl.utils.save_calc_results.save_calc_results() + self.extra_results = dict() self.extra_results["atoms"] = {} self.extra_results["config"] = {} self.post_process = post_process - def calculate(self, atoms=None, properties=["energy", "forces"], system_changes=all_changes): +# def calculate(self, atoms=None, properties=["energy", "forces"], system_changes=all_changes): +# """Does the calculation. Handles the working directories in addition to regular +# ASE calculation operations (writing input, executing, reading_results) """ +# +# Calculator.calculate(self, atoms, properties, system_changes) +# +# # from WFLFileIOCalculator +# self.setup_rundir() +# +# try: +# self.write_input(self.atoms, properties, system_changes) +# self.execute() +# self.read_results() +# if self.post_process is not None: +# self.post_process(self) +# calculation_succeeded = True +# if 'DFT_FAILED_ORCA' in atoms.info: +# del atoms.info["DFT_FAILED_ORCA"] +# except Exception as e: +# atoms.info["DFT_FAILED_ORCA"] = TRUE +# calculation_succeeded = False +# raiseke e +# finally: +# # when exception is raised, `calculation_succeeded` is set to False, +# # the following code is executed and exception is re-raised. +# # from WFLFileIOCalculator +# self.clean_rundir(_default_keep_files, calculation_succeeded) + + + + def calculate(self, atoms=None, properties=_default_properties, system_changes=all_changes): """Does the calculation. Handles the working directories in addition to regular ASE calculation operations (writing input, executing, reading_results) """ - Calculator.calculate(self, atoms, properties, system_changes) - # from WFLFileIOCalculator self.setup_rundir() + # how should default parameters be treated? + # currently + # - ase.ORCA.calculate() -> + # - ase.genericfileio.GenericFileIOCalculator.calculate() -> + # - ase.genericfileio.GenericFileIOCalculator.write_inputfiles() -> + # - calls ase.calculators.orca.OrcaTemplate.write_input and + # gives it self.parameters which update the hard-coded defaults + + self.fill_in_default_params() + self.enforce_force_calculation() + try: - self.write_input(self.atoms, properties, system_changes) - self.execute() - self.read_results() - if self.post_process is not None: - self.post_process(self) + super().calculate(atoms=atoms, properties=properties, system_changes=system_changes) calculation_succeeded = True if 'DFT_FAILED_ORCA' in atoms.info: del atoms.info["DFT_FAILED_ORCA"] except Exception as e: - atoms.info["DFT_FAILED_ORCA"] = TRUE + atoms.info["DFT_FAILED_ORCA"] = True calculation_succeeded = False raise e finally: @@ -109,7 +145,12 @@ def calculate(self, atoms=None, properties=["energy", "forces"], system_changes= # from WFLFileIOCalculator self.clean_rundir(_default_keep_files, calculation_succeeded) + def fill_in_default_params(self): + parameters = self.default_params + parameters.update(self.parameters) + self.parameters = parameters + def write_input(self, atoms, properties=None, system_changes=None): """Writes orca.inp, based on the wfl ORCA calculator parameters""" @@ -150,15 +191,21 @@ def write_input(self, atoms, properties=None, system_changes=None): str(atom.position[2]) + '\n') f.write('*\n') - def pick_task(self): - # energy and force calculation is enforced - task = self.parameters["task"] - if task is None: - task = "engrad" - elif "engrad" not in task and "opt" not in task and "copt" not in task: - task += " engrad" - return task - + def enforce_force_calculation(self): + + orcasimpleinput = self.parameters["orcasimpleinput"] + if "engrad" not in orcasimpleinput and "opt" not in orcasimpleinput: + self.parameters["orcasimpleinput"] = "engrad " + orcasimpleinput + +# def pick_task(self): +# # energy and force calculation is enforced +# task = self.parameters["task"] +# if task is None: +# task = "engrad" +# elif "engrad" not in task and "opt" not in task and "copt" not in task: +# task += " engrad" +# return task + def is_converged(self): """checks for warnings about SCF/wavefunction not converging. From 4151b3b39354b469594852a818a8e8a604485b39 Mon Sep 17 00:00:00 2001 From: JPDarby Date: Tue, 13 Aug 2024 16:17:25 +0100 Subject: [PATCH 11/24] added test for qe file caching --- tests/calculators/test_ase_fileio_caching.py | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/calculators/test_ase_fileio_caching.py b/tests/calculators/test_ase_fileio_caching.py index f890e997..00883e03 100644 --- a/tests/calculators/test_ase_fileio_caching.py +++ b/tests/calculators/test_ase_fileio_caching.py @@ -24,6 +24,29 @@ def test_vasp_cache_timing(tmp_path, monkeypatch): monkeypatch.setenv("VASP_PP_PATH", ".") cache_timing(config, Vasp_ase, kwargs_ase, Vasp_wrap, kwargs_wrapper, tmp_path, monkeypatch) +######################## +# test quantum espresso calculator +from tests.calculators.test_qe import espresso_avail, qe_pseudo +@pytest.mark.skipif(not espresso_avail, reason='qe testing env vars missing') +def test_qe_cache_timing(tmp_path, monkeypatch, qe_pseudo): + from ase.calculators.espresso import Espresso as Espresso_ASE + from wfl.calculators.espresso import Espresso as Espresso_wrap + + config = Atoms('Si', positions=[[0, 0, 9]], cell=[2, 2, 2], pbc=[True, True, True]) + + pspot = qe_pseudo + kwargs_ase = dict( + pseudopotentials=dict(Si=pspot.name), + pseudo_dir=pspot.parent, + input_data={"SYSTEM": {"ecutwfc": 40, "input_dft": "LDA",}}, + kpts=(2, 3, 4), + conv_thr=0.0001, + workdir=tmp_path + ) + + kwargs_wrapper = {} + cache_timing(config, Espresso_ASE, kwargs_ase, Espresso_wrap, kwargs_wrapper, tmp_path, monkeypatch) + ######################## # generic code used by all calculators From 7ec56d2a045c3e5607a2c903606963a1c90b196b Mon Sep 17 00:00:00 2001 From: JPDarby Date: Tue, 13 Aug 2024 17:50:41 +0100 Subject: [PATCH 12/24] patch for CI search --- .github/workflows/pytests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index 11550bb1..c4679bc1 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -108,12 +108,15 @@ jobs: # search for available torch version with +cpu support for torch_version_test in $( python3 -m pip install torch== 2>&1 | fgrep 'from versions' | sed -e 's/.*from versions: //' -e 's/)//' -e 's/,[ ]*/\n/g' | tac ); do + echo "check torch_version_test $torch_version_test" set +e python3 -m pip install --dry-run torch==${torch_version_test}+cpu \ - -f https://download.pytorch.org/whl/torch_stable.html > /dev/null 2>&1 + -f https://download.pytorch.org/whl/torch_stable.html 2>&1 search_stat=$? + echo "got search_stat $search_stat" set -e if [ $search_stat == 0 ]; then + echo "got valid +cpu version, exiting" torch_version=${torch_version_test} break fi From d2a9cc279acd8ed6866aac879142980be89538a8 Mon Sep 17 00:00:00 2001 From: JPDarby Date: Tue, 13 Aug 2024 18:00:25 +0100 Subject: [PATCH 13/24] further CI debugging --- .github/workflows/pytests.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index c4679bc1..47ac77ae 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -46,7 +46,7 @@ jobs: - name: Install latest ASE from pypi run: | echo PIP_CONSTRAINT $PIP_CONSTRAINT - python3 -m pip install ase + python3 -m pip install ase echo -n "ASE VERSION " python3 -c "import ase; print(ase.__file__, ase.__version__)" @@ -105,8 +105,15 @@ jobs: run: | echo "search for torch version" set +o pipefail + + echo "torch versions" + python3 -m pip install torch== + echo "torch versions to search" + python3 -m pip install torch== 2>&1 | fgrep 'from versions' | + sed -e 's/.*from versions: //' -e 's/)//' -e 's/,[ ]*/\n/g' | tac + # search for available torch version with +cpu support - for torch_version_test in $( python3 -m pip install torch== 2>&1 | fgrep 'from versions' | + for torch_version_test in $( python3 -m pip install torch== 2>&1 | fgrep 'from versions' | sed -e 's/.*from versions: //' -e 's/)//' -e 's/,[ ]*/\n/g' | tac ); do echo "check torch_version_test $torch_version_test" set +e From 228f87a9c596bf3abe923ad72e39048bcaacc1c9 Mon Sep 17 00:00:00 2001 From: JPDarby Date: Tue, 13 Aug 2024 18:34:59 +0100 Subject: [PATCH 14/24] added test for RuntimeWarning if using bare calculators --- tests/calculators/test_wrapped_calculator.py | 30 ++++++++++++++++++++ wfl/calculators/generic.py | 14 +++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/calculators/test_wrapped_calculator.py diff --git a/tests/calculators/test_wrapped_calculator.py b/tests/calculators/test_wrapped_calculator.py new file mode 100644 index 00000000..4fe2b3e9 --- /dev/null +++ b/tests/calculators/test_wrapped_calculator.py @@ -0,0 +1,30 @@ +import pytest +from ase.atoms import Atoms +from wfl.configset import ConfigSet, OutputSpec +from wfl.calculators import generic + +######################## +# test a RuntimeWarning is raised when using the Espresso Calculator directly from ase +from tests.calculators.test_qe import espresso_avail, qe_pseudo +@pytest.mark.skipif(not espresso_avail, reason='qe testing env vars missing') +def test_wrapped_qe(tmp_path, qe_pseudo): + from ase.calculators.espresso import Espresso as Espresso_ASE + from wfl.calculators.espresso import Espresso as Espresso_wrap + + config = Atoms('Si', positions=[[0, 0, 9]], cell=[2, 2, 2], pbc=[True, True, True]) + + pspot = qe_pseudo + kwargs = dict( + pseudopotentials=dict(Si=pspot.name), + pseudo_dir=pspot.parent, + input_data={"SYSTEM": {"ecutwfc": 40, "input_dft": "LDA",}}, + kpts=(2, 3, 4), + conv_thr=0.0001, + workdir=tmp_path, + tstress=True, + tprnfor=True + ) + + direct_calc = (Espresso_ASE, [], kwargs) + kwargs_generic = dict(inputs=ConfigSet(config), outputs=OutputSpec(), calculator=direct_calc) + pytest.warns(RuntimeWarning, generic.calculate, **kwargs_generic) \ No newline at end of file diff --git a/wfl/calculators/generic.py b/wfl/calculators/generic.py index 50c4b350..544b8103 100644 --- a/wfl/calculators/generic.py +++ b/wfl/calculators/generic.py @@ -150,6 +150,20 @@ def calculate(*args, **kwargs): if calculator is None: calculator = args[2] + #check if calculator should be wrapped + if type(calculator) == tuple: + from ase.calculators.espresso import Espresso as ASE_Espresso + from ase.calculators.vasp.vasp import Vasp as ASE_Vasp + from ase.calculators.aims import Aims as ASE_Aims + from ase.calculators.castep import Castep as ASE_Castep + from ase.calculators.mopac import MOPAC as ASE_MOPAC + from ase.calculators.orca import ORCA as ASE_ORCA + wrapped_types = [ASE_Espresso, ASE_Vasp, ASE_Aims, ASE_Castep, ASE_MOPAC, ASE_ORCA] + + calc = calculator[0] + if calc in wrapped_types: + warnings.warn(f"{calc} should be imported from wfl.calculators rather than ase. Using {calc} directly can lead to duplicated singlepoints", RuntimeWarning) + default_autopara_info = getattr(calculator, "wfl_generic_default_autopara_info", {"num_inputs_per_python_subprocess": 10}) return autoparallelize(_run_autopara_wrappable, *args, default_autopara_info=default_autopara_info, **kwargs) From 87e2a18cd3c7681cc72ea6bccec2b2c93f4ffbf9 Mon Sep 17 00:00:00 2001 From: JPDarby Date: Wed, 14 Aug 2024 09:33:06 +0100 Subject: [PATCH 15/24] patch for pip CI --- .github/workflows/pytests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index 47ac77ae..400a12e8 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -113,8 +113,10 @@ jobs: sed -e 's/.*from versions: //' -e 's/)//' -e 's/,[ ]*/\n/g' | tac # search for available torch version with +cpu support - for torch_version_test in $( python3 -m pip install torch== 2>&1 | fgrep 'from versions' | - sed -e 's/.*from versions: //' -e 's/)//' -e 's/,[ ]*/\n/g' | tac ); do + # for torch_version_test in $( python3 -m pip install torch== 2>&1 | fgrep 'from versions' | + # sed -e 's/.*from versions: //' -e 's/)//' -e 's/,[ ]*/\n/g' | tac ); do + wget https://pypi.org/pypi/torch/json -O torch_versions + for torch_version_test in $( python3 -c "import json; print(' '.join(json.load(open('torch_versions'))['releases'].keys()))" | sed 's/ /\n/g' | tac ); do echo "check torch_version_test $torch_version_test" set +e python3 -m pip install --dry-run torch==${torch_version_test}+cpu \ From 59dc01c03a141d2eb7a813670ccc12baa62b3624 Mon Sep 17 00:00:00 2001 From: JPDarby Date: Wed, 14 Aug 2024 09:48:26 +0100 Subject: [PATCH 16/24] commented out previous search for torch versions --- .github/workflows/pytests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index 400a12e8..783e6aed 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -106,11 +106,11 @@ jobs: echo "search for torch version" set +o pipefail - echo "torch versions" - python3 -m pip install torch== - echo "torch versions to search" - python3 -m pip install torch== 2>&1 | fgrep 'from versions' | - sed -e 's/.*from versions: //' -e 's/)//' -e 's/,[ ]*/\n/g' | tac + # echo "torch versions" + # python3 -m pip install torch== + # echo "torch versions to search" + # python3 -m pip install torch== 2>&1 | fgrep 'from versions' | + # sed -e 's/.*from versions: //' -e 's/)//' -e 's/,[ ]*/\n/g' | tac # search for available torch version with +cpu support # for torch_version_test in $( python3 -m pip install torch== 2>&1 | fgrep 'from versions' | From f0e76ec6184286343807d90629510cbaa7eecbf2 Mon Sep 17 00:00:00 2001 From: gelzinyte Date: Fri, 16 Aug 2024 01:15:21 +0200 Subject: [PATCH 17/24] update orca calculator --- tests/assets/orca.ase | 6 - tests/assets/orca.engrad | 22 - tests/assets/orca.inp | 21 - tests/assets/orca.out | 960 ----------------- tests/assets/orca/orca.out | 989 ++++++++++++++++++ .../assets/{ => orca}/orca_scf_converged.out | 0 .../{ => orca}/orca_scf_unconverged.out | 0 .../assets/{ => orca}/orca_scf_unfinished.out | 0 tests/assets/orca_freq_dummy.out | 87 -- tests/calculators/test_orca.py | 122 ++- tests/local_scripts/gelzinyte.workstation.sh | 4 +- wfl/calculators/orca/__init__.py | 218 ++-- 12 files changed, 1127 insertions(+), 1302 deletions(-) delete mode 100644 tests/assets/orca.ase delete mode 100644 tests/assets/orca.engrad delete mode 100644 tests/assets/orca.inp delete mode 100644 tests/assets/orca.out create mode 100644 tests/assets/orca/orca.out rename tests/assets/{ => orca}/orca_scf_converged.out (100%) rename tests/assets/{ => orca}/orca_scf_unconverged.out (100%) rename tests/assets/{ => orca}/orca_scf_unfinished.out (100%) delete mode 100644 tests/assets/orca_freq_dummy.out diff --git a/tests/assets/orca.ase b/tests/assets/orca.ase deleted file mode 100644 index da6b2ed6..00000000 --- a/tests/assets/orca.ase +++ /dev/null @@ -1,6 +0,0 @@ -dict(charge=0, - mult=1, - orca_command='dummy_no_orca_exec', - orcablocks='%scf Convergence Tight \nSmearTemp 5000.0 \nmaxiter 500 \n Rotate \n { 1, 7, 28.37, 0, 0} \n { 6, 9, 54.55, 0, 0} \n { 2, 10, 27.42, 0, 0} \n { 0, 14, 8.014, 1, 1} \n { 3, 15, 35.3, 1, 1} \n { 5, 13, 51.31, 1, 1} \n { 2, 10, 17.84, 1, 1} \n { 1, 11, 59.83, 1, 1} \nend \n \nend \n', - orcasimpleinput='UHF revPBE def2-TZVP def2/J D3BJ slowconv', - task='gradient') diff --git a/tests/assets/orca.engrad b/tests/assets/orca.engrad deleted file mode 100644 index fe711275..00000000 --- a/tests/assets/orca.engrad +++ /dev/null @@ -1,22 +0,0 @@ -# -# Number of atoms -# - 2 -# -# The current total energy in Eh -# - -107.788924101776 -# -# The current gradient in Eh/bohr -# - 19.528379995282 - 0.000000006652 - -0.000000200001 - -19.528379995281 - -0.000000006652 - 0.000000200001 -# -# The atomic numbers and current coordinates in Bohr -# - 6 0.0000000 0.0000000 0.0000000 - 8 0.9448631 0.0000000 0.0000000 diff --git a/tests/assets/orca.inp b/tests/assets/orca.inp deleted file mode 100644 index 86318d32..00000000 --- a/tests/assets/orca.inp +++ /dev/null @@ -1,21 +0,0 @@ -! engrad UHF revPBE def2-TZVP def2/J D3BJ slowconv -%scf Convergence Tight -SmearTemp 5000.0 -maxiter 500 - Rotate - { 1, 7, 28.37, 0, 0} - { 6, 9, 54.55, 0, 0} - { 2, 10, 27.42, 0, 0} - { 0, 14, 8.014, 1, 1} - { 3, 15, 35.3, 1, 1} - { 5, 13, 51.31, 1, 1} - { 2, 10, 17.84, 1, 1} - { 1, 11, 59.83, 1, 1} -end - -end - -*xyz 0 1 -C 0.0 0.0 0.0 -O 0.5 0.0 0.0 -* diff --git a/tests/assets/orca.out b/tests/assets/orca.out deleted file mode 100644 index 85080e04..00000000 --- a/tests/assets/orca.out +++ /dev/null @@ -1,960 +0,0 @@ - - ***************** - * O R C A * - ***************** - - --- An Ab Initio, DFT and Semiempirical electronic structure package --- - - ####################################################### - # -***- # - # Department of theory and spectroscopy # - # Directorship: Frank Neese # - # Max Planck Institute fuer Kohlenforschung # - # Kaiser Wilhelm Platz 1 # - # D-45470 Muelheim/Ruhr # - # Germany # - # # - # All rights reserved # - # -***- # - ####################################################### - - - Program Version 4.2.1 - RELEASE - - - - With contributions from (in alphabetic order): - Daniel Aravena : Magnetic Suceptibility - Michael Atanasov : Ab Initio Ligand Field Theory (pilot matlab implementation) - Alexander A. Auer : GIAO ZORA, VPT2 - Ute Becker : Parallelization - Giovanni Bistoni : ED, misc. LED, open-shell LED, HFLD - Martin Brehm : Molecular dynamics - Dmytro Bykov : SCF Hessian - Vijay G. Chilkuri : MRCI spin determinant printing, contributions to CSF-ICE - Dipayan Datta : RHF DLPNO-CCSD density - Achintya Kumar Dutta : EOM-CC, STEOM-CC - Dmitry Ganyushin : Spin-Orbit,Spin-Spin,Magnetic field MRCI - Miquel Garcia : C-PCM Hessian, Gaussian charge scheme - Yang Guo : DLPNO-NEVPT2, CIM, IAO-localization - Andreas Hansen : Spin unrestricted coupled pair/coupled cluster methods - Benjamin Helmich-Paris : CASSCF linear response (MC-RPA) - Lee Huntington : MR-EOM, pCC - Robert Izsak : Overlap fitted RIJCOSX, COSX-SCS-MP3, EOM - Christian Kollmar : KDIIS, OOCD, Brueckner-CCSD(T), CCSD density - Simone Kossmann : Meta GGA functionals, TD-DFT gradient, OOMP2, MP2 Hessian - Martin Krupicka : AUTO-CI - Lucas Lang : DCDCAS - Dagmar Lenk : GEPOL surface, SMD - Dimitrios Liakos : Extrapolation schemes; Compound Job, initial MDCI parallelization - Dimitrios Manganas : Further ROCIS development; embedding schemes - Dimitrios Pantazis : SARC Basis sets - Taras Petrenko : DFT Hessian,TD-DFT gradient, ASA, ECA, R-Raman, ABS, FL, XAS/XES, NRVS - Peter Pinski : DLPNO-MP2, DLPNO-MP2 Gradient - Christoph Reimann : Effective Core Potentials - Marius Retegan : Local ZFS, SOC - Christoph Riplinger : Optimizer, TS searches, QM/MM, DLPNO-CCSD(T), (RO)-DLPNO pert. Triples - Tobias Risthaus : Range-separated hybrids, TD-DFT gradient, RPA, STAB - Michael Roemelt : Original ROCIS implementation - Masaaki Saitow : Open-shell DLPNO-CCSD energy and density - Barbara Sandhoefer : DKH picture change effects - Avijit Sen : IP-ROCIS - Kantharuban Sivalingam : CASSCF convergence, NEVPT2, FIC-MRCI - Bernardo de Souza : ESD, SOC TD-DFT - Georgi Stoychev : AutoAux, RI-MP2 NMR - Willem Van den Heuvel : Paramagnetic NMR - Boris Wezisla : Elementary symmetry handling - Frank Wennmohs : Technical directorship - - - We gratefully acknowledge several colleagues who have allowed us to - interface, adapt or use parts of their codes: - Stefan Grimme, W. Hujo, H. Kruse, : VdW corrections, initial TS optimization, - C. Bannwarth DFT functionals, gCP, sTDA/sTD-DF - Ed Valeev, F. Pavosevic, A. Kumar : LibInt (2-el integral package), F12 methods - Garnet Chan, S. Sharma, J. Yang, R. Olivares : DMRG - Ulf Ekstrom : XCFun DFT Library - Mihaly Kallay : mrcc (arbitrary order and MRCC methods) - Andreas Klamt, Michael Diedenhofen : otool_cosmo (COSMO solvation model) - Jiri Pittner, Ondrej Demel : Mk-CCSD - Frank Weinhold : gennbo (NPA and NBO analysis) - Christopher J. Cramer and Donald G. Truhlar : smd solvation model - Lars Goerigk : TD-DFT with DH, B97 family of functionals - V. Asgeirsson, H. Jonsson : NEB implementation - FAccTs GmbH : IRC, NEB, NEB-TS, Multilevel, MM, QM/MM, CI optimization - S Lehtola, MJT Oliveira, MAL Marques : LibXC Library - - - Your calculation uses the libint2 library for the computation of 2-el integrals - For citations please refer to: http://libint.valeyev.net - - Your ORCA version has been built with support for libXC version: 4.2.3 - For citations please refer to: https://tddft.org/programs/libxc/ - - This ORCA versions uses: - CBLAS interface : Fast vector & matrix operations - LAPACKE interface : Fast linear algebra routines - SCALAPACK package : Parallel linear algebra routines - - -Your calculation utilizes the atom-pairwise dispersion correction -with the Becke-Johnson damping scheme (D3BJ) -Cite in your paper: -S.Grimme, S.Ehrlich, L.Goerigk, J Comput Chem, (2011), 32, 1456–1465 -S.Grimme, J.Antony, S.Ehrlich and H.Krieg, J.Chem.Phys., 132, (2010), 154104 - - ------ Orbital basis set information ----- -Your calculation utilizes the basis: def2-TZVP - F. Weigend and R. Ahlrichs, Phys. Chem. Chem. Phys. 7, 3297 (2005). - ------ AuxJ basis set information ----- -Your calculation utilizes the auxiliary basis: def2/J - F. Weigend, Phys. Chem. Chem. Phys. 8, 1057 (2006). - -================================================================================ - WARNINGS - Please study these warnings very carefully! -================================================================================ - - -INFO : the flag for use of LIBINT has been found! - -================================================================================ - INPUT FILE -================================================================================ -NAME = orca.inp -| 1> ! engrad UHF revPBE def2-TZVP def2/J D3BJ slowconv -| 2> %scf Convergence Tight -| 3> SmearTemp 5000.0 -| 4> maxiter 500 -| 5> Rotate -| 6> { 1, 7, 28.37, 0, 0} -| 7> { 6, 9, 54.55, 0, 0} -| 8> { 2, 10, 27.42, 0, 0} -| 9> { 0, 14, 8.014, 1, 1} -| 10> { 3, 15, 35.3, 1, 1} -| 11> { 5, 13, 51.31, 1, 1} -| 12> { 2, 10, 17.84, 1, 1} -| 13> { 1, 11, 59.83, 1, 1} -| 14> end -| 15> -| 16> end -| 17> -| 18> *xyz 0 1 -| 19> C 0.0 0.0 0.0 -| 20> O 0.5 0.0 0.0 -| 21> * -| 22> -| 23> ****END OF INPUT**** -================================================================================ - - ******************************* - * Energy+Gradient Calculation * - ******************************* - ---------------------------------- -CARTESIAN COORDINATES (ANGSTROEM) ---------------------------------- - C 0.000000 0.000000 0.000000 - O 0.500000 0.000000 0.000000 - ----------------------------- -CARTESIAN COORDINATES (A.U.) ----------------------------- - NO LB ZA FRAG MASS X Y Z - 0 C 6.0000 0 12.011 0.000000 0.000000 0.000000 - 1 O 8.0000 0 15.999 0.944863 0.000000 0.000000 - --------------------------------- -INTERNAL COORDINATES (ANGSTROEM) --------------------------------- - C 0 0 0 0.000000000000 0.00000000 0.00000000 - O 1 0 0 0.500000000000 0.00000000 0.00000000 - ---------------------------- -INTERNAL COORDINATES (A.U.) ---------------------------- - C 0 0 0 0.000000000000 0.00000000 0.00000000 - O 1 0 0 0.944863066961 0.00000000 0.00000000 - ---------------------- -BASIS SET INFORMATION ---------------------- -There are 2 groups of distinct atoms - - Group 1 Type C : 11s6p2d1f contracted to 5s3p2d1f pattern {62111/411/11/1} - Group 2 Type O : 11s6p2d1f contracted to 5s3p2d1f pattern {62111/411/11/1} - -Atom 0C basis set group => 1 -Atom 1O basis set group => 2 ---------------------------------- -AUXILIARY/J BASIS SET INFORMATION ---------------------------------- -There are 2 groups of distinct atoms - - Group 1 Type C : 12s5p4d2f1g contracted to 6s4p3d1f1g pattern {711111/2111/211/2/1} - Group 2 Type O : 12s5p4d2f1g contracted to 6s4p3d1f1g pattern {711111/2111/211/2/1} - -Atom 0C basis set group => 1 -Atom 1O basis set group => 2 - -Checking for AutoStart: -The File: orca.gbw exists -Trying to determine its content: - ... Fine, the file contains calculation information - ... Fine, the calculation information was read - ... Fine, the file contains a basis set - ... Fine, the basis set was read - ... Fine, the file contains a geometry - ... Fine, the geometry was read - ... Fine, the file contains a set of orbitals - ... Fine, the orbitals can be read - => possible old guess file was deleted - => GBW file was renamed to GES file - => GES file is set as startup file - => Guess is set to MORead - ... now leaving AutoStart - ------------------------------------------------------------------------------- - ORCA GTO INTEGRAL CALCULATION - -- RI-GTO INTEGRALS CHOSEN -- ------------------------------------------------------------------------------- - - BASIS SET STATISTICS AND STARTUP INFO - -Gaussian basis set: - # of primitive gaussian shells ... 40 - # of primitive gaussian functions ... 92 - # of contracted shells ... 22 - # of contracted basis functions ... 62 - Highest angular momentum ... 3 - Maximum contraction depth ... 6 -Auxiliary gaussian basis set: - # of primitive gaussian shells ... 48 - # of primitive gaussian functions ... 140 - # of contracted shells ... 30 - # of contracted aux-basis functions ... 98 - Highest angular momentum ... 4 - Maximum contraction depth ... 7 -Ratio of auxiliary to basis functions ... 1.58 -Integral package used ... LIBINT - One Electron integrals ... done - Ordering auxiliary basis shells ... done - Integral threshhold Thresh ... 2.500e-11 - Primitive cut-off TCut ... 2.500e-12 - Pre-screening matrix ... done - Shell pair data ... - Ordering of the shell pairs ... done ( 0.000 sec) 253 of 253 pairs - Determination of significant pairs ... done ( 0.000 sec) - Creation of shell pair data ... done ( 0.000 sec) - Storage of shell pair data ... done ( 0.000 sec) - Shell pair data done in ( 0.000 sec) - Computing two index integrals ... done - Cholesky decomposition of the V-matrix ... done - - -Timings: - Total evaluation time ... 0.105 sec ( 0.002 min) - One electron matrix time ... 0.004 sec ( 0.000 min) = 3.9% - Schwartz matrix evaluation time ... 0.078 sec ( 0.001 min) = 74.4% - Two index repulsion integral time ... 0.000 sec ( 0.000 min) = 0.3% - Cholesky decomposition of V ... 0.000 sec ( 0.000 min) = 0.3% - Three index repulsion integral time ... 0.000 sec ( 0.000 min) = 0.0% - -------------------------------------------------------------------------------- - ORCA SCF -------------------------------------------------------------------------------- - ------------- -SCF SETTINGS ------------- -Hamiltonian: - Density Functional Method .... DFT(GTOs) - Exchange Functional Exchange .... PBE - PBE kappa parameter XKappa .... 1.245000 - PBE mue parameter XMuePBE .... 0.219520 - Correlation Functional Correlation .... PBE - PBE beta parameter CBetaPBE .... 0.066725 - LDA part of GGA corr. LDAOpt .... PW91-LDA - Gradients option PostSCFGGA .... off - Density functional embedding theory .... OFF - NL short-range parameter .... 3.700000 - RI-approximation to the Coulomb term is turned on - Number of auxiliary basis functions .... 98 - - -General Settings: - Integral files IntName .... orca - Hartree-Fock type HFTyp .... UHF - Total Charge Charge .... 0 - Multiplicity Mult .... 1 - Number of Electrons NEL .... 14 - Basis Dimension Dim .... 62 - Nuclear Repulsion ENuc .... 50.8010119968 Eh - -Convergence Acceleration: - DIIS CNVDIIS .... on - Start iteration DIISMaxIt .... 0 - Startup error DIISStart .... 0.200000 - # of expansion vecs DIISMaxEq .... 5 - Bias factor DIISBfac .... 1.050 - Max. coefficient DIISMaxC .... 10.000 - Newton-Raphson CNVNR .... off - SOSCF CNVSOSCF .... off - Level Shifting CNVShift .... on - Level shift para. LevelShift .... 0.2500 - Turn off err/grad. ShiftErr .... 0.0000 - Zerner damping CNVZerner .... off - Static damping CNVDamp .... on - Fraction old density DampFac .... 0.8500 - Max. Damping (<1) DampMax .... 0.9800 - Min. Damping (>=0) DampMin .... 0.0000 - Turn off err/grad. DampErr .... 0.0300 - Fernandez-Rico CNVRico .... off - -SCF Procedure: - Maximum # iterations MaxIter .... 500 - SCF integral mode SCFMode .... Direct - Integral package .... LIBINT - Reset frequency DirectResetFreq .... 20 - Integral Threshold Thresh .... 2.500e-11 Eh - Primitive CutOff TCut .... 2.500e-12 Eh - -Convergence Tolerance: - Convergence Check Mode ConvCheckMode .... Total+1el-Energy - Convergence forced ConvForced .... 0 - Energy Change TolE .... 1.000e-08 Eh - 1-El. energy change .... 1.000e-05 Eh - DIIS Error TolErr .... 5.000e-07 - - -Diagonalization of the overlap matrix: -Smallest eigenvalue ... 8.936e-05 -Time for diagonalization ... 0.001 sec -Threshold for overlap eigenvalues ... 1.000e-08 -Number of eigenvalues below threshold ... 0 -Time for construction of square roots ... 0.000 sec -Total time needed ... 0.001 sec - ---------------------- -INITIAL GUESS: MOREAD ---------------------- -Guess MOs are being read from file: orca.ges -Input Geometry matches current geometry (good) -Input basis set matches current basis set (good) -MOs were renormalized -MOs were reorthogonalized (Cholesky) ------------------ -ORBITAL ROTATIONS ------------------ - Rotation 1(0) 7(0) cos(t)= 0.879897 sin(t)= 0.475164 - Rotation 6(0) 9(0) cos(t)= 0.579992 sin(t)= 0.814622 - Rotation 2(0) 10(0) cos(t)= 0.887655 sin(t)= 0.460510 - Rotation 0(1) 14(1) cos(t)= 0.990234 sin(t)= 0.139415 - Rotation 3(1) 15(1) cos(t)= 0.816138 sin(t)= 0.577858 - Rotation 5(1) 13(1) cos(t)= 0.625106 sin(t)= 0.780540 - Rotation 2(1) 10(1) cos(t)= 0.951916 sin(t)= 0.306360 - Rotation 1(1) 11(1) cos(t)= 0.502567 sin(t)= 0.864538 - ------------------ - INITIAL GUESS DONE ( 0.0 sec) - ------------------ -------------------- -DFT GRID GENERATION -------------------- - -General Integration Accuracy IntAcc ... 4.340 -Radial Grid Type RadialGrid ... Gauss-Chebyshev -Angular Grid (max. acc.) AngularGrid ... Lebedev-110 -Angular grid pruning method GridPruning ... 3 (G Style) -Weight generation scheme WeightScheme... Becke -Basis function cutoff BFCut ... 1.0000e-11 -Integration weight cutoff WCut ... 1.0000e-14 -Grids for H and He will be reduced by one unit - -# of grid points (after initial pruning) ... 3372 ( 0.0 sec) -# of grid points (after weights+screening) ... 3337 ( 0.0 sec) -nearest neighbour list constructed ... 0.0 sec -Grid point re-assignment to atoms done ... 0.0 sec -Grid point division into batches done ... 0.0 sec -Reduced shell lists constructed in 0.0 sec - -Total number of grid points ... 3337 -Total number of batches ... 53 -Average number of points per batch ... 62 -Average number of grid points per atom ... 1668 -Average number of shells per batch ... 18.80 (85.44%) -Average number of basis functions per batch ... 54.98 (88.68%) -Average number of large shells per batch ... 17.81 (94.78%) -Average number of large basis fcns per batch ... 52.22 (94.98%) -Maximum spatial batch extension ... 19.11, 25.60, 31.36 au -Average spatial batch extension ... 5.48, 6.97, 7.12 au - -Time for grid setup = 0.013 sec - --------------- -SCF ITERATIONS --------------- -ITER Energy Delta-E Max-DP RMS-DP [F,P] Damp - *** Starting incremental Fock matrix formation *** - 0 -93.1506429324 0.00000000000015.72502858 0.30251853 4.0233047 0.8500 - 1 -95.8231039022 -2.67246096977213.34474224 0.25700369 3.2714866 0.8500 - ***Turning on DIIS*** - 2 -97.8997190733 -2.07661517113211.38536957 0.21919368 2.6669792 0.8500 - 3 -99.5418385074 -1.642119434055 9.77224807 0.18819083 2.1907141 0.8500 - 4 -100.8666530538 -1.324814546449 8.39579262 0.16206797 1.8225822 0.8500 - 5 -101.9429392155 -1.076286161693 7.17645940 0.13878000 1.5296582 0.8500 - 6 -102.8402473933 -0.897308177841 6.10552667 0.11814689 1.2878912 0.8500 - 7 -103.5983865256 -0.758139132250 5.17779526 0.10015504 1.0854893 0.8500 - 8 -104.2425137276 -0.644127202031 4.39352013 0.08495886 0.9148987 0.8500 - 9 -104.7863240923 -0.543810364650 3.73594784 0.07226556 0.7718779 0.8500 - 10 -105.2446114067 -0.458287314473 3.17913278 0.06153255 0.6521532 0.8500 - 11 -105.6315458387 -0.386934431978 2.70362195 0.05235520 0.5516496 0.8500 - 12 -105.9589928780 -0.327447039272 2.29717413 0.04449498 0.4670049 0.8500 - 13 -106.2364771469 -0.277484268947 1.95133475 0.03780102 0.3955636 0.8500 - 14 -106.4716910275 -0.235213880546 1.65805734 0.03212535 0.3352133 0.8500 - 15 -106.6710960991 -0.199405071621 1.40926819 0.02731155 0.2842034 0.8500 - 16 -106.8402001663 -0.169104067234 1.19781633 0.02321893 0.2410558 0.8500 - 17 -106.9836708827 -0.143470716313 1.01793455 0.01973523 0.2045283 0.8500 - 18 -107.1054388321 -0.121767949419 0.86500045 0.01677197 0.1735832 0.8500 - 19 -107.2088121821 -0.103373350035 0.73509301 0.01425429 0.1473536 0.8500 - *** Restarting incremental Fock matrix formation *** - *** Resetting DIIS *** - 20 -107.2965847968 -0.087772614694 0.61959143 0.01196808 0.1251121 0.8500 - 21 -107.3712109253 -0.074626128468 0.52831553 0.01021190 0.1061579 0.8500 - 22 -107.4345212887 -0.063310363399 0.45253414 0.00877338 0.0901353 0.8500 - 23 -107.4882486057 -0.053727317040 0.38590866 0.00749739 0.0765734 0.8500 - 24 -107.5338939006 -0.045645294884 0.32788239 0.00637454 0.0650628 0.8500 - 25 -107.5726897261 -0.038795825462 0.27776754 0.00539629 0.0552843 0.8500 - 26 -107.6056681745 -0.032978448432 0.23567310 0.00457637 0.0469739 0.8500 - 27 -107.6336932710 -0.028025096511 0.20043414 0.00389281 0.0399143 0.8500 - 28 -107.6575074458 -0.023814174751 0.17054756 0.00331355 0.0339181 0.8500 - 29 -107.6777451562 -0.020237710488 0.96664757 0.01878324 0.0288242 0.0000 - 30 -107.7923762762 -0.114631119971 0.00177169 0.00006754 0.0006094 0.0000 - 31 -107.7923763283 -0.000000052074 0.00019619 0.00000622 0.0001011 0.0000 - 32 -107.7923763398 -0.000000011555 0.00007526 0.00000294 0.0000354 0.0000 - 33 -107.7923763417 -0.000000001895 0.00003214 0.00000132 0.0000040 0.0000 - **** Energy Check signals convergence **** - - Fermi smearing (ALPHA): E(HOMO(Eh)) = -0.240032 MUE = 0.036814 gap= 15.149 eV - Fermi smearing (BETA): E(HOMO(Eh)) = -0.240033 MUE = 0.036813 gap= 15.149 eV - -N_FOD(alpha) = 0.000000 - N_FOD(beta) = 0.000000 - N_FOD = 0.000000 - - ***************************************************** - * SUCCESS * - * SCF CONVERGED AFTER 34 CYCLES * - ***************************************************** - -Setting up the final grid: - -General Integration Accuracy IntAcc ... 4.670 -Radial Grid Type RadialGrid ... Gauss-Chebyshev -Angular Grid (max. acc.) AngularGrid ... Lebedev-302 -Angular grid pruning method GridPruning ... 3 (G Style) -Weight generation scheme WeightScheme... Becke -Basis function cutoff BFCut ... 1.0000e-11 -Integration weight cutoff WCut ... 1.0000e-14 -Grids for H and He will be reduced by one unit - -# of grid points (after initial pruning) ... 12424 ( 0.0 sec) -# of grid points (after weights+screening) ... 12367 ( 0.0 sec) -nearest neighbour list constructed ... 0.0 sec -Grid point re-assignment to atoms done ... 0.0 sec -Grid point division into batches done ... 0.1 sec -Reduced shell lists constructed in 0.1 sec - -Total number of grid points ... 12367 -Total number of batches ... 194 -Average number of points per batch ... 63 -Average number of grid points per atom ... 6184 -Average number of shells per batch ... 17.09 (77.67%) -Average number of basis functions per batch ... 49.84 (80.38%) -Average number of large shells per batch ... 15.87 (92.89%) -Average number of large basis fcns per batch ... 46.58 (93.47%) -Maximum spatial batch extension ... 20.23, 24.37, 22.15 au -Average spatial batch extension ... 3.67, 4.19, 4.15 au - -Final grid set up in 0.1 sec -Final integration ... done ( 0.1 sec) -Change in XC energy ... 0.004586878 -Integrated number of electrons ... 13.999973314 -Previous integrated no of electrons ... 14.003631565 - ----------------- -TOTAL SCF ENERGY ----------------- - -Total Energy : -107.78778946 Eh -2933.05486 eV - -Components: -Nuclear Repulsion : 50.80101200 Eh 1382.36581 eV -Electronic Energy : -158.58880146 Eh -4315.42068 eV -One Electron Energy: -240.50394088 Eh -6544.44494 eV -Two Electron Energy: 81.91513942 Eh 2229.02427 eV - -Virial components: -Potential Energy : -233.08569628 Eh -6342.58425 eV -Kinetic Energy : 125.29790682 Eh 3409.52938 eV -Virial Ratio : 1.86025212 - - -DFT components: -N(Alpha) : 6.999986656949 electrons -N(Beta) : 6.999986656939 electrons -N(Total) : 13.999973313888 electrons -E(X) : -14.798525253678 Eh -E(C) : -0.483714232527 Eh -E(XC) : -15.282239486205 Eh -DFET-embed. en. : 0.000000000000 Eh - ---------------- -SCF CONVERGENCE ---------------- - - Last Energy change ... -2.8692e-10 Tolerance : 1.0000e-08 - Last MAX-Density change ... 1.6174e-05 Tolerance : 1.0000e-07 - Last RMS-Density change ... 5.6387e-07 Tolerance : 5.0000e-09 - Last DIIS Error ... 6.2615e-07 Tolerance : 5.0000e-07 - - **** THE GBW FILE WAS UPDATED (orca.gbw) **** - **** DENSITY FILE WAS UPDATED (orca.scfp) **** - **** ENERGY FILE WAS UPDATED (orca.en.tmp) **** - **** THE GBW FILE WAS UPDATED (orca.gbw) **** - **** DENSITY FILE WAS UPDATED (orca.scfp) **** ----------------- -ORBITAL ENERGIES ----------------- - SPIN UP ORBITALS - NO OCC E(Eh) E(eV) - 0 1.0000 -19.163103 -521.4545 - 1 1.0000 -10.401853 -283.0488 - 2 1.0000 -0.989289 -26.9199 - 3 1.0000 -0.897626 -24.4256 - 4 1.0000 -0.897626 -24.4256 - 5 1.0000 -0.273297 -7.4368 - 6 1.0000 -0.240032 -6.5316 - 7 0.0000 0.066695 1.8149 - 8 0.0000 0.093886 2.5548 - 9 0.0000 0.093886 2.5548 - 10 0.0000 0.193447 5.2640 - 11 0.0000 0.308969 8.4075 - 12 0.0000 0.308969 8.4075 - 13 0.0000 0.381453 10.3799 - 14 0.0000 0.552346 15.0301 - 15 0.0000 0.552346 15.0301 - 16 0.0000 0.593585 16.1523 - 17 0.0000 0.593647 16.1539 - 18 0.0000 0.593673 16.1547 - 19 0.0000 0.918519 24.9942 - 20 0.0000 1.060679 28.8625 - 21 0.0000 1.060679 28.8626 - 22 0.0000 1.235686 33.6247 - 23 0.0000 1.242358 33.8063 - 24 0.0000 1.242358 33.8063 - 25 0.0000 1.432603 38.9831 - 26 0.0000 1.622935 44.1623 - 27 0.0000 1.624532 44.2058 - 28 0.0000 2.104075 57.2548 - 29 0.0000 2.208471 60.0956 - 30 0.0000 2.208471 60.0956 - 31 0.0000 2.534964 68.9799 - 32 0.0000 2.545235 69.2594 - 33 0.0000 2.545235 69.2594 - 34 0.0000 2.722153 74.0736 - 35 0.0000 2.722168 74.0740 - 36 0.0000 2.987474 81.2933 - 37 0.0000 2.987474 81.2933 - 38 0.0000 3.160287 85.9958 - 39 0.0000 3.338359 90.8414 - 40 0.0000 3.338359 90.8414 - 41 0.0000 3.402460 92.5856 - 42 0.0000 3.402655 92.5909 - 43 0.0000 3.614960 98.3681 - 44 0.0000 4.566891 124.2714 - 45 0.0000 4.805827 130.7732 - 46 0.0000 4.805827 130.7732 - 47 0.0000 5.421979 147.5396 - 48 0.0000 5.421979 147.5396 - 49 0.0000 5.887048 160.1947 - 50 0.0000 5.900625 160.5642 - 51 0.0000 6.299976 171.4310 - 52 0.0000 6.818869 185.5509 - 53 0.0000 6.818869 185.5509 - 54 0.0000 7.199696 195.9137 - 55 0.0000 7.308269 198.8681 - 56 0.0000 7.316697 199.0974 - 57 0.0000 8.629440 234.8190 - 58 0.0000 8.629440 234.8190 - 59 0.0000 9.829283 267.4684 - 60 0.0000 28.677484 780.3540 - 61 0.0000 44.180122 1202.2022 - - SPIN DOWN ORBITALS - NO OCC E(Eh) E(eV) - 0 1.0000 -19.163102 -521.4545 - 1 1.0000 -10.401853 -283.0488 - 2 1.0000 -0.989289 -26.9199 - 3 1.0000 -0.897626 -24.4256 - 4 1.0000 -0.897626 -24.4256 - 5 1.0000 -0.273295 -7.4367 - 6 1.0000 -0.240033 -6.5316 - 7 0.0000 0.066694 1.8148 - 8 0.0000 0.093887 2.5548 - 9 0.0000 0.093887 2.5548 - 10 0.0000 0.193447 5.2640 - 11 0.0000 0.308969 8.4075 - 12 0.0000 0.308969 8.4075 - 13 0.0000 0.381452 10.3798 - 14 0.0000 0.552346 15.0301 - 15 0.0000 0.552346 15.0301 - 16 0.0000 0.593586 16.1523 - 17 0.0000 0.593647 16.1540 - 18 0.0000 0.593673 16.1547 - 19 0.0000 0.918519 24.9942 - 20 0.0000 1.060679 28.8625 - 21 0.0000 1.060679 28.8626 - 22 0.0000 1.235687 33.6247 - 23 0.0000 1.242358 33.8063 - 24 0.0000 1.242358 33.8063 - 25 0.0000 1.432602 38.9831 - 26 0.0000 1.622935 44.1623 - 27 0.0000 1.624532 44.2058 - 28 0.0000 2.104075 57.2548 - 29 0.0000 2.208470 60.0955 - 30 0.0000 2.208470 60.0955 - 31 0.0000 2.534963 68.9799 - 32 0.0000 2.545235 69.2594 - 33 0.0000 2.545235 69.2594 - 34 0.0000 2.722152 74.0735 - 35 0.0000 2.722167 74.0739 - 36 0.0000 2.987473 81.2933 - 37 0.0000 2.987473 81.2933 - 38 0.0000 3.160286 85.9958 - 39 0.0000 3.338358 90.8413 - 40 0.0000 3.338358 90.8413 - 41 0.0000 3.402460 92.5856 - 42 0.0000 3.402654 92.5909 - 43 0.0000 3.614961 98.3681 - 44 0.0000 4.566889 124.2714 - 45 0.0000 4.805828 130.7732 - 46 0.0000 4.805828 130.7732 - 47 0.0000 5.421979 147.5396 - 48 0.0000 5.421979 147.5396 - 49 0.0000 5.887049 160.1948 - 50 0.0000 5.900626 160.5642 - 51 0.0000 6.299976 171.4311 - 52 0.0000 6.818870 185.5509 - 53 0.0000 6.818870 185.5509 - 54 0.0000 7.199697 195.9137 - 55 0.0000 7.308269 198.8681 - 56 0.0000 7.316697 199.0974 - 57 0.0000 8.629440 234.8190 - 58 0.0000 8.629440 234.8190 - 59 0.0000 9.829283 267.4684 - 60 0.0000 28.677484 780.3540 - 61 0.0000 44.180123 1202.2023 - - ******************************** - * MULLIKEN POPULATION ANALYSIS * - ******************************** - ------------------------------------------- -FOD BASED MULLIKEN REDUCED ORBITAL CHARGES ------------------------------------------- - 0 C s : 0.000000 s : 0.000000 - pz : 0.000000 p : 0.000000 - px : 0.000000 - py : 0.000000 - dz2 : -0.000000 d : -0.000000 - dxz : 0.000000 - dyz : 0.000000 - dx2y2 : -0.000000 - dxy : 0.000000 - f0 : 0.000000 f : -0.000000 - f+1 : -0.000000 - f-1 : 0.000000 - f+2 : 0.000000 - f-2 : -0.000000 - f+3 : -0.000000 - f-3 : 0.000000 - 1 O s : -0.000000 s : -0.000000 - pz : -0.000000 p : 0.000000 - px : 0.000000 - py : -0.000000 - dz2 : 0.000000 d : 0.000000 - dxz : 0.000000 - dyz : -0.000000 - dx2y2 : 0.000000 - dxy : 0.000000 - f0 : 0.000000 f : -0.000000 - f+1 : -0.000000 - f-1 : -0.000000 - f+2 : -0.000000 - f-2 : -0.000000 - f+3 : -0.000000 - f-3 : -0.000000 - - - ******************************* - * LOEWDIN POPULATION ANALYSIS * - ******************************* - -------------------------------------------- -LOEWDIN ATOMIC CHARGES AND SPIN POPULATIONS -------------------------------------------- - 0 C : -0.402458 0.000001 - 1 O : 0.402458 -0.000001 - ----------------------------------------------------- -LOEWDIN REDUCED ORBITAL CHARGES AND SPIN POPULATIONS ----------------------------------------------------- -CHARGE - 0 C s : 2.947509 s : 2.947509 - pz : 0.689266 p : 2.858510 - px : 1.479978 - py : 0.689266 - dz2 : 0.056824 d : 0.483820 - dxz : 0.128262 - dyz : 0.000000 - dx2y2 : 0.170472 - dxy : 0.128262 - f0 : 0.012305 f : 0.112619 - f+1 : 0.017619 - f-1 : 0.002052 - f+2 : 0.020512 - f-2 : 0.000000 - f+3 : 0.029365 - f-3 : 0.030765 - 1 O s : 3.181039 s : 3.181039 - pz : 1.061405 p : 3.845211 - px : 1.722400 - py : 1.061405 - dz2 : 0.069434 d : 0.413237 - dxz : 0.067751 - dyz : 0.000000 - dx2y2 : 0.208302 - dxy : 0.067751 - f0 : 0.007743 f : 0.158055 - f+1 : 0.043896 - f-1 : 0.001253 - f+2 : 0.012755 - f-2 : 0.000000 - f+3 : 0.073160 - f-3 : 0.019246 - -SPIN - 0 C s : 0.000005 s : 0.000005 - pz : -0.000000 p : -0.000004 - px : -0.000003 - py : -0.000000 - dz2 : 0.000000 d : 0.000000 - dxz : 0.000000 - dyz : 0.000000 - dx2y2 : 0.000000 - dxy : 0.000000 - f0 : -0.000000 f : 0.000000 - f+1 : 0.000000 - f-1 : -0.000000 - f+2 : -0.000000 - f-2 : -0.000000 - f+3 : 0.000000 - f-3 : 0.000000 - 1 O s : 0.000000 s : 0.000000 - pz : 0.000000 p : -0.000001 - px : -0.000001 - py : 0.000000 - dz2 : -0.000000 d : -0.000001 - dxz : -0.000000 - dyz : 0.000000 - dx2y2 : -0.000000 - dxy : -0.000000 - f0 : 0.000000 f : 0.000000 - f+1 : 0.000000 - f-1 : -0.000000 - f+2 : 0.000000 - f-2 : 0.000000 - f+3 : 0.000000 - f-3 : -0.000000 - - - ***************************** - * MAYER POPULATION ANALYSIS * - ***************************** - - NA - Mulliken gross atomic population - ZA - Total nuclear charge - QA - Mulliken gross atomic charge - VA - Mayer's total valence - BVA - Mayer's bonded valence - FA - Mayer's free valence - - ATOM NA ZA QA VA BVA FA - 0 C 7.4294 6.0000 -1.4294 3.5567 3.5567 0.0000 - 1 O 6.5706 8.0000 1.4294 3.5567 3.5567 -0.0000 - - Mayer bond orders larger than 0.100000 -B( 0-C , 1-O ) : 3.5567 - -------- -TIMINGS -------- - -Total SCF time: 0 days 0 hours 0 min 4 sec - -Total time .... 4.906 sec -Sum of individual times .... 4.786 sec ( 97.6%) - -Fock matrix formation .... 4.607 sec ( 93.9%) - Split-RI-J .... 3.342 sec ( 72.5% of F) - XC integration .... 1.145 sec ( 24.9% of F) - Basis function eval. .... 0.286 sec ( 24.9% of XC) - Density eval. .... 0.232 sec ( 20.3% of XC) - XC-Functional eval. .... 0.145 sec ( 12.6% of XC) - XC-Potential eval. .... 0.438 sec ( 38.2% of XC) -Diagonalization .... 0.039 sec ( 0.8%) -Density matrix formation .... 0.015 sec ( 0.3%) -Population analysis .... 0.001 sec ( 0.0%) -Initial guess .... 0.002 sec ( 0.0%) -Orbital Transformation .... 0.000 sec ( 0.0%) -Orbital Orthonormalization .... 0.001 sec ( 0.0%) -DIIS solution .... 0.012 sec ( 0.3%) -Grid generation .... 0.110 sec ( 2.2%) - - -------------------------------------------------------------------------------- - DFT DISPERSION CORRECTION - - DFTD3 V3.1 Rev 1 - USING Becke-Johnson damping -------------------------------------------------------------------------------- -The revPBE functional is recognized -Active option DFTDOPT ... 4 - -molecular C6(AA) [au] = 100.821596 - - - DFT-D V3 - parameters - s6 scaling factor : 1.0000 - a1 scaling factor : 0.5238 - s8 scaling factor : 2.3550 - a2 scaling factor : 3.5016 - ad hoc parameters k1-k3 : 16.0000 1.3333 -4.0000 - - Edisp/kcal,au: -0.711996130502 -0.001134637936 - E6 /kcal : -0.280198044 - E8 /kcal : -0.431798087 - % E8 : 60.646128302 - -------------------------- ---------------- -Dispersion correction -0.001134638 -------------------------- ---------------- - - -------------------------- -------------------- -FINAL SINGLE POINT ENERGY -107.788924101776 -------------------------- -------------------- - ------------------------------------------------------------------------------- - ORCA SCF GRADIENT CALCULATION ------------------------------------------------------------------------------- - -Gradient of the Kohn-Sham DFT energy: -Kohn-Sham wavefunction type ... UKS -Hartree-Fock exchange scaling ... 0.000 -Number of operators ... 2 -Number of atoms ... 2 -Basis set dimensions ... 62 -Integral neglect threshold ... 2.5e-11 -Integral primitive cutoff ... 2.5e-12 - -Nuclear repulsion gradient ... done -One Electron Gradient ... done -Pre-screening matrix ... done -RI-J gradient ... done -Exchange-correlation gradient ... done -Dispersion correction ... done - ------------------- -CARTESIAN GRADIENT ------------------- - - 1 C : 19.528379995 0.000000007 -0.000000200 - 2 O : -19.528379995 -0.000000007 0.000000200 - -Difference to translation invariance: - : 0.0000000000 -0.0000000000 -0.0000000000 - -Norm of the cartesian gradient ... 27.6172998405 -RMS gradient ... 11.2747154471 -MAX gradient ... 19.5283799953 - -------- -TIMINGS -------- - -Total SCF gradient time ... 0.663 sec - -One electron gradient .... 0.007 sec ( 1.0%) -Prescreening matrices .... 0.105 sec ( 15.8%) -RI-J Coulomb gradient .... 0.096 sec ( 14.5%) -XC gradient .... 0.278 sec ( 41.9%) - - *************************************** - * ORCA property calculations * - *************************************** - - --------------------- - Active property flags - --------------------- - (+) Dipole Moment - - ------------------------------------------------------------------------------- - ORCA ELECTRIC PROPERTIES CALCULATION ------------------------------------------------------------------------------- - -Dipole Moment Calculation ... on -Quadrupole Moment Calculation ... off -Polarizability Calculation ... off -GBWName ... orca.gbw -Electron density file ... orca.scfp -The origin for moment calculation is the CENTER OF MASS = ( 0.539695, 0.000000 0.000000) - -------------- -DIPOLE MOMENT -------------- - X Y Z -Electronic contribution: 0.56364 -0.00000 -0.00000 -Nuclear contribution : 0.00317 0.00000 0.00000 - ----------------------------------------- -Total Dipole Moment : 0.56681 -0.00000 -0.00000 - ----------------------------------------- -Magnitude (a.u.) : 0.56681 -Magnitude (Debye) : 1.44071 - - - --------------------- -Rotational spectrum --------------------- - -Rotational constants in cm-1: 0.000000 9.828743 9.828743 -Rotational constants in MHz : 0.000000 294658.313449 294658.313449 - - Dipole components along the rotational axes: -x,y,z [a.u.] : 0.566807 -0.000000 -0.000000 -x,y,z [Debye]: 1.440708 -0.000000 -0.000001 - - - -Timings for individual modules: - -Sum of individual times ... 5.727 sec (= 0.095 min) -GTO integral calculation ... 0.125 sec (= 0.002 min) 2.2 % -SCF iterations ... 4.923 sec (= 0.082 min) 86.0 % -SCF Gradient evaluation ... 0.679 sec (= 0.011 min) 11.8 % - ****ORCA TERMINATED NORMALLY**** -TOTAL RUN TIME: 0 days 0 hours 0 minutes 5 seconds 919 msec diff --git a/tests/assets/orca/orca.out b/tests/assets/orca/orca.out new file mode 100644 index 00000000..b5ca99f7 --- /dev/null +++ b/tests/assets/orca/orca.out @@ -0,0 +1,989 @@ + + ***************** + * O R C A * + ***************** + + #, + ### + #### + ##### + ###### + ########, + ,,################,,,,, + ,,#################################,, + ,,##########################################,, + ,#########################################, ''#####, + ,#############################################,, '####, + ,##################################################,,,,####, + ,###########'''' ''''############################### + ,#####'' ,,,,##########,,,, '''####''' '#### + ,##' ,,,,###########################,,, '## + ' ,,###'''' '''############,,, + ,,##'' '''############,,,, ,,,,,,###'' + ,#'' '''#######################''' + ' ''''####'''' + ,#######, #######, ,#######, ## + ,#' '#, ## ## ,#' '#, #''# ###### ,####, + ## ## ## ,#' ## #' '# # #' '# + ## ## ####### ## ,######, #####, # # + '#, ,#' ## ## '#, ,#' ,# #, ## #, ,# + '#######' ## ## '#######' #' '# #####' # '####' + + + + ####################################################### + # -***- # + # Department of theory and spectroscopy # + # Directorship and core code : Frank Neese # + # Max Planck Institute fuer Kohlenforschung # + # Kaiser Wilhelm Platz 1 # + # D-45470 Muelheim/Ruhr # + # Germany # + # # + # All rights reserved # + # -***- # + ####################################################### + + + Program Version 5.0.4 - RELEASE - + + + With contributions from (in alphabetic order): + Daniel Aravena : Magnetic Suceptibility + Michael Atanasov : Ab Initio Ligand Field Theory (pilot matlab implementation) + Alexander A. Auer : GIAO ZORA, VPT2 properties, NMR spectrum + Ute Becker : Parallelization + Giovanni Bistoni : ED, misc. LED, open-shell LED, HFLD + Martin Brehm : Molecular dynamics + Dmytro Bykov : SCF Hessian + Vijay G. Chilkuri : MRCI spin determinant printing, contributions to CSF-ICE + Dipayan Datta : RHF DLPNO-CCSD density + Achintya Kumar Dutta : EOM-CC, STEOM-CC + Dmitry Ganyushin : Spin-Orbit,Spin-Spin,Magnetic field MRCI + Miquel Garcia : C-PCM and meta-GGA Hessian, CC/C-PCM, Gaussian charge scheme + Yang Guo : DLPNO-NEVPT2, F12-NEVPT2, CIM, IAO-localization + Andreas Hansen : Spin unrestricted coupled pair/coupled cluster methods + Benjamin Helmich-Paris : MC-RPA, TRAH-SCF, COSX integrals + Lee Huntington : MR-EOM, pCC + Robert Izsak : Overlap fitted RIJCOSX, COSX-SCS-MP3, EOM + Marcus Kettner : VPT2 + Christian Kollmar : KDIIS, OOCD, Brueckner-CCSD(T), CCSD density, CASPT2, CASPT2-K + Simone Kossmann : Meta GGA functionals, TD-DFT gradient, OOMP2, MP2 Hessian + Martin Krupicka : Initial AUTO-CI + Lucas Lang : DCDCAS + Marvin Lechner : AUTO-CI (C++ implementation), FIC-MRCC + Dagmar Lenk : GEPOL surface, SMD + Dimitrios Liakos : Extrapolation schemes; Compound Job, initial MDCI parallelization + Dimitrios Manganas : Further ROCIS development; embedding schemes + Dimitrios Pantazis : SARC Basis sets + Anastasios Papadopoulos: AUTO-CI, single reference methods and gradients + Taras Petrenko : DFT Hessian,TD-DFT gradient, ASA, ECA, R-Raman, ABS, FL, XAS/XES, NRVS + Peter Pinski : DLPNO-MP2, DLPNO-MP2 Gradient + Christoph Reimann : Effective Core Potentials + Marius Retegan : Local ZFS, SOC + Christoph Riplinger : Optimizer, TS searches, QM/MM, DLPNO-CCSD(T), (RO)-DLPNO pert. Triples + Tobias Risthaus : Range-separated hybrids, TD-DFT gradient, RPA, STAB + Michael Roemelt : Original ROCIS implementation + Masaaki Saitow : Open-shell DLPNO-CCSD energy and density + Barbara Sandhoefer : DKH picture change effects + Avijit Sen : IP-ROCIS + Kantharuban Sivalingam : CASSCF convergence, NEVPT2, FIC-MRCI + Bernardo de Souza : ESD, SOC TD-DFT + Georgi Stoychev : AutoAux, RI-MP2 NMR, DLPNO-MP2 response + Willem Van den Heuvel : Paramagnetic NMR + Boris Wezisla : Elementary symmetry handling + Frank Wennmohs : Technical directorship + + + We gratefully acknowledge several colleagues who have allowed us to + interface, adapt or use parts of their codes: + Stefan Grimme, W. Hujo, H. Kruse, P. Pracht, : VdW corrections, initial TS optimization, + C. Bannwarth, S. Ehlert DFT functionals, gCP, sTDA/sTD-DF + Ed Valeev, F. Pavosevic, A. Kumar : LibInt (2-el integral package), F12 methods + Garnet Chan, S. Sharma, J. Yang, R. Olivares : DMRG + Ulf Ekstrom : XCFun DFT Library + Mihaly Kallay : mrcc (arbitrary order and MRCC methods) + Jiri Pittner, Ondrej Demel : Mk-CCSD + Frank Weinhold : gennbo (NPA and NBO analysis) + Christopher J. Cramer and Donald G. Truhlar : smd solvation model + Lars Goerigk : TD-DFT with DH, B97 family of functionals + V. Asgeirsson, H. Jonsson : NEB implementation + FAccTs GmbH : IRC, NEB, NEB-TS, DLPNO-Multilevel, CI-OPT + MM, QMMM, 2- and 3-layer-ONIOM, Crystal-QMMM, + LR-CPCM, SF, NACMEs, symmetry and pop. for TD-DFT, + nearIR, NL-DFT gradient (VV10), updates on ESD, + ML-optimized integration grids + S Lehtola, MJT Oliveira, MAL Marques : LibXC Library + Liviu Ungur et al : ANISO software + + + Your calculation uses the libint2 library for the computation of 2-el integrals + For citations please refer to: http://libint.valeyev.net + + Your ORCA version has been built with support for libXC version: 5.1.0 + For citations please refer to: https://tddft.org/programs/libxc/ + + This ORCA versions uses: + CBLAS interface : Fast vector & matrix operations + LAPACKE interface : Fast linear algebra routines + SCALAPACK package : Parallel linear algebra routines + Shared memory : Shared parallel matrices + BLAS/LAPACK : OpenBLAS 0.3.15 USE64BITINT DYNAMIC_ARCH NO_AFFINITY Prescott SINGLE_THREADED + Core in use : Prescott + Copyright (c) 2011-2014, The OpenBLAS Project + + +Your calculation utilizes the atom-pairwise dispersion correction +with the Becke-Johnson damping scheme (D3BJ) +Cite in your paper: +S.Grimme, S.Ehrlich, L.Goerigk, J Comput Chem, (2011), 32, 1456–1465 +S.Grimme, J.Antony, S.Ehrlich and H.Krieg, J.Chem.Phys., 132, (2010), 154104 + + +================================================================================ + +----- Orbital basis set information ----- +Your calculation utilizes the basis: def2-TZVP + F. Weigend and R. Ahlrichs, Phys. Chem. Chem. Phys. 7, 3297 (2005). + +----- AuxJ basis set information ----- +Your calculation utilizes the auxiliary basis: def2/J + F. Weigend, Phys. Chem. Chem. Phys. 8, 1057 (2006). + +================================================================================ + WARNINGS + Please study these warnings very carefully! +================================================================================ + + +INFO : the flag for use of the SHARK integral package has been found! + + +WARNING: TRAH does not support fractional occupations! + ===> : Turning TRAH off +================================================================================ + INPUT FILE +================================================================================ +NAME = orca.inp +| 1> ! engrad UHF revPBE def2-TZVP def2/J D3BJ slowconv +| 2> %scf Convergence Tight +| 3> SmearTemp 5000.0 +| 4> maxiter 500 +| 5> Rotate +| 6> { 1, 7, 28.37, 0, 0} +| 7> { 6, 9, 54.55, 0, 0} +| 8> { 2, 10, 27.42, 0, 0} +| 9> { 0, 14, 8.014, 1, 1} +| 10> { 3, 15, 35.3, 1, 1} +| 11> { 5, 13, 51.31, 1, 1} +| 12> { 2, 10, 17.84, 1, 1} +| 13> { 1, 11, 59.83, 1, 1} +| 14> end +| 15> +| 16> end +| 17> +| 18> *xyz 0 1 +| 19> C 0.0 0.0 0.0 +| 20> O 0.5 0.0 0.0 +| 21> * +| 22> +| 23> +| 24> ****END OF INPUT**** +================================================================================ + + ******************************* + * Energy+Gradient Calculation * + ******************************* + +--------------------------------- +CARTESIAN COORDINATES (ANGSTROEM) +--------------------------------- + C 0.000000 0.000000 0.000000 + O 0.500000 0.000000 0.000000 + +---------------------------- +CARTESIAN COORDINATES (A.U.) +---------------------------- + NO LB ZA FRAG MASS X Y Z + 0 C 6.0000 0 12.011 0.000000 0.000000 0.000000 + 1 O 8.0000 0 15.999 0.944863 0.000000 0.000000 + +-------------------------------- +INTERNAL COORDINATES (ANGSTROEM) +-------------------------------- + C 0 0 0 0.000000000000 0.00000000 0.00000000 + O 1 0 0 0.500000000000 0.00000000 0.00000000 + +--------------------------- +INTERNAL COORDINATES (A.U.) +--------------------------- + C 0 0 0 0.000000000000 0.00000000 0.00000000 + O 1 0 0 0.944863066961 0.00000000 0.00000000 + +--------------------- +BASIS SET INFORMATION +--------------------- +There are 2 groups of distinct atoms + + Group 1 Type C : 11s6p2d1f contracted to 5s3p2d1f pattern {62111/411/11/1} + Group 2 Type O : 11s6p2d1f contracted to 5s3p2d1f pattern {62111/411/11/1} + +Atom 0C basis set group => 1 +Atom 1O basis set group => 2 +--------------------------------- +AUXILIARY/J BASIS SET INFORMATION +--------------------------------- +There are 2 groups of distinct atoms + + Group 1 Type C : 12s5p4d2f1g contracted to 6s4p3d1f1g pattern {711111/2111/211/2/1} + Group 2 Type O : 12s5p4d2f1g contracted to 6s4p3d1f1g pattern {711111/2111/211/2/1} + +Atom 0C basis set group => 1 +Atom 1O basis set group => 2 +------------------------------------------------------------------------------ + ORCA GTO INTEGRAL CALCULATION + -- RI-GTO INTEGRALS CHOSEN -- +------------------------------------------------------------------------------ +------------------------------------------------------------------------------ + ___ + / \ - P O W E R E D B Y - + / \ + | | | _ _ __ _____ __ __ + | | | | | | | / \ | _ \ | | / | + \ \/ | | | | / \ | | | | | | / / + / \ \ | |__| | / /\ \ | |_| | | |/ / + | | | | __ | / /__\ \ | / | \ + | | | | | | | | __ | | \ | |\ \ + \ / | | | | | | | | | |\ \ | | \ \ + \___/ |_| |_| |__| |__| |_| \__\ |__| \__/ + + - O R C A' S B I G F R I E N D - + & + - I N T E G R A L F E E D E R - + + v1 FN, 2020, v2 2021 +------------------------------------------------------------------------------ + + +Reading SHARK input file orca.SHARKINP.tmp ... ok +---------------------- +SHARK INTEGRAL PACKAGE +---------------------- + +Number of atoms ... 2 +Number of basis functions ... 62 +Number of shells ... 22 +Maximum angular momentum ... 3 +Integral batch strategy ... SHARK/LIBINT Hybrid +RI-J (if used) integral strategy ... SPLIT-RIJ (Revised 2003 algorithm where possible) +Printlevel ... 1 +Contraction scheme used ... SEGMENTED contraction +Coulomb Range Separation ... NOT USED +Exchange Range Separation ... NOT USED +Finite Nucleus Model ... NOT USED +Auxiliary Coulomb fitting basis ... AVAILABLE + # of basis functions in Aux-J ... 98 + # of shells in Aux-J ... 30 + Maximum angular momentum in Aux-J ... 4 +Auxiliary J/K fitting basis ... NOT available +Auxiliary Correlation fitting basis ... NOT available +Auxiliary 'external' fitting basis ... NOT available +Integral threshold ... 2.500000e-11 +Primitive cut-off ... 2.500000e-12 +Primitive pair pre-selection threshold ... 2.500000e-12 + +Calculating pre-screening integrals ... done ( 0.0 sec) Dimension = 22 +Organizing shell pair data ... done ( 0.0 sec) +Shell pair information +Total number of shell pairs ... 253 +Shell pairs after pre-screening ... 253 +Total number of primitive shell pairs ... 864 +Primitive shell pairs kept ... 834 + la=0 lb=0: 55 shell pairs + la=1 lb=0: 60 shell pairs + la=1 lb=1: 21 shell pairs + la=2 lb=0: 40 shell pairs + la=2 lb=1: 24 shell pairs + la=2 lb=2: 10 shell pairs + la=3 lb=0: 20 shell pairs + la=3 lb=1: 12 shell pairs + la=3 lb=2: 8 shell pairs + la=3 lb=3: 3 shell pairs + +Calculating one electron integrals ... done ( 0.0 sec) +Calculating RI/J V-Matrix + Cholesky decomp.... done ( 0.0 sec) +Calculating Nuclear repulsion ... done ( 0.0 sec) ENN= 50.801011996800 Eh + +SHARK setup successfully completed in 0.2 seconds + +Maximum memory used throughout the entire GTOINT-calculation: 13.9 MB +------------------------------------------------------------------------------- + ORCA SCF +------------------------------------------------------------------------------- + +------------ +SCF SETTINGS +------------ +Hamiltonian: + Density Functional Method .... DFT(GTOs) + Exchange Functional Exchange .... PBE + PBE kappa parameter XKappa .... 1.245000 + PBE mue parameter XMuePBE .... 0.219520 + Correlation Functional Correlation .... PBE + PBE beta parameter CBetaPBE .... 0.066725 + LDA part of GGA corr. LDAOpt .... PW91-LDA + Gradients option PostSCFGGA .... off + Density functional embedding theory .... OFF + NL short-range parameter .... 3.700000 + RI-approximation to the Coulomb term is turned on + Number of AuxJ basis functions .... 98 + + +General Settings: + Integral files IntName .... orca + Hartree-Fock type HFTyp .... UHF + Total Charge Charge .... 0 + Multiplicity Mult .... 1 + Number of Electrons NEL .... 14 + Basis Dimension Dim .... 62 + Nuclear Repulsion ENuc .... 50.8010119968 Eh + +Convergence Acceleration: + DIIS CNVDIIS .... on + Start iteration DIISMaxIt .... 0 + Startup error DIISStart .... 0.200000 + # of expansion vecs DIISMaxEq .... 5 + Bias factor DIISBfac .... 1.050 + Max. coefficient DIISMaxC .... 10.000 + Trust-Rad. Augm. Hess. CNVTRAH .... off + SOSCF CNVSOSCF .... off + Level Shifting CNVShift .... on + Level shift para. LevelShift .... 0.2500 + Turn off err/grad. ShiftErr .... 0.0000 + Zerner damping CNVZerner .... off + Static damping CNVDamp .... on + Fraction old density DampFac .... 0.8500 + Max. Damping (<1) DampMax .... 0.9800 + Min. Damping (>=0) DampMin .... 0.0000 + Turn off err/grad. DampErr .... 0.0300 + Fernandez-Rico CNVRico .... off + +SCF Procedure: + Maximum # iterations MaxIter .... 500 + SCF integral mode SCFMode .... Direct + Integral package .... SHARK and LIBINT hybrid scheme + Reset frequency DirectResetFreq .... 20 + Integral Threshold Thresh .... 2.500e-11 Eh + Primitive CutOff TCut .... 2.500e-12 Eh + +Convergence Tolerance: + Convergence Check Mode ConvCheckMode .... Total+1el-Energy + Convergence forced ConvForced .... 0 + Energy Change TolE .... 1.000e-08 Eh + 1-El. energy change .... 1.000e-05 Eh + DIIS Error TolErr .... 5.000e-07 + + +Diagonalization of the overlap matrix: +Smallest eigenvalue ... 8.936e-05 +Time for diagonalization ... 0.002 sec +Threshold for overlap eigenvalues ... 1.000e-08 +Number of eigenvalues below threshold ... 0 +Time for construction of square roots ... 0.001 sec +Total time needed ... 0.003 sec + +Time for model grid setup = 0.024 sec + +------------------------------ +INITIAL GUESS: MODEL POTENTIAL +------------------------------ +Loading Hartree-Fock densities ... done +Calculating cut-offs ... done +Initializing the effective Hamiltonian ... done +Setting up the integral package (SHARK) ... done +Starting the Coulomb interaction ... done ( 0.0 sec) +Reading the grid ... done +Mapping shells ... done +Starting the XC term evaluation ... done ( 0.0 sec) + promolecular density results + # of electrons = 14.000001299 + EX = -13.808593820 + EC = -0.471319999 + EX+EC = -14.279913819 +Transforming the Hamiltonian ... done ( 0.0 sec) +Diagonalizing the Hamiltonian ... done ( 0.0 sec) +Back transforming the eigenvectors ... done ( 0.0 sec) +Now organizing SCF variables ... ----------------- +ORBITAL ROTATIONS +----------------- + Rotation 1(0) 7(0) cos(t)= 0.879897 sin(t)= 0.475164 + Rotation 6(0) 9(0) cos(t)= 0.579992 sin(t)= 0.814622 + Rotation 2(0) 10(0) cos(t)= 0.887655 sin(t)= 0.460510 + Rotation 0(1) 14(1) cos(t)= 0.990234 sin(t)= 0.139415 + Rotation 3(1) 15(1) cos(t)= 0.816138 sin(t)= 0.577858 + Rotation 5(1) 13(1) cos(t)= 0.625106 sin(t)= 0.780540 + Rotation 2(1) 10(1) cos(t)= 0.951916 sin(t)= 0.306360 + Rotation 1(1) 11(1) cos(t)= 0.502567 sin(t)= 0.864538 +done + ------------------ + INITIAL GUESS DONE ( 0.0 sec) + ------------------ +------------------- +DFT GRID GENERATION +------------------- + +General Integration Accuracy IntAcc ... 4.388 +Radial Grid Type RadialGrid ... OptM3 with GC (2021) +Angular Grid (max. ang.) AngularGrid ... 4 (Lebedev-302) +Angular grid pruning method GridPruning ... 4 (adaptive) +Weight generation scheme WeightScheme... Becke +Basis function cutoff BFCut ... 1.0000e-11 +Integration weight cutoff WCut ... 1.0000e-14 +Angular grids for H and He will be reduced by one unit +Partially contracted basis set ... off +Rotationally invariant grid construction ... off + +Total number of grid points ... 12226 +Total number of batches ... 192 +Average number of points per batch ... 63 +Average number of grid points per atom ... 6113 +Time for grid setup = 0.089 sec + +-------------- +SCF ITERATIONS +-------------- +ITER Energy Delta-E Max-DP RMS-DP [F,P] Damp + *** Starting incremental Fock matrix formation *** + 0 -94.0949665100 0.00000000000014.34379724 0.27569148 3.6360220 0.8500 + 1 -96.3714280389 -2.27646152884512.71652002 0.24466255 3.0045046 0.8500 + ***Turning on DIIS*** + 2 -98.2154818064 -1.84405376748110.89401357 0.20977483 2.4869696 0.8500 + 3 -99.7253003925 -1.509818586096 9.33676280 0.18023494 2.0695810 0.8500 + 4 -100.9761920126 -1.250891620172 8.01219253 0.15526181 1.7369836 0.8500 + 5 -102.0160351696 -1.039843156977 6.83011042 0.13257845 1.4657083 0.8500 + 6 -102.8931956965 -0.877160526889 5.80411122 0.11268342 1.2385285 0.8500 + 7 -103.6367280886 -0.743532392101 4.92086621 0.09542754 1.0470278 0.8500 + 8 -104.2680124100 -0.631284321420 4.17640763 0.08095098 0.8851102 0.8500 + 9 -104.8022489524 -0.534236542398 3.55129340 0.06886851 0.7487913 0.8500 + 10 -105.2541988959 -0.451949943499 3.02093533 0.05862795 0.6340786 0.8500 + 11 -105.6370027083 -0.382803812347 2.56822012 0.04986524 0.5373278 0.8500 + 12 -105.9616178990 -0.324615190745 2.18197551 0.04236950 0.4555507 0.8500 + 13 -106.2370471102 -0.275429211165 1.85384318 0.03599824 0.3863458 0.8500 + 14 -106.4707645217 -0.233717411523 1.57565539 0.03060038 0.3277561 0.8500 + 15 -106.6691072183 -0.198342696608 1.33951702 0.02601959 0.2781365 0.8500 + 16 -106.8374685735 -0.168361355209 1.13870344 0.02212187 0.2360916 0.8500 + 17 -106.9804180626 -0.142949489124 0.96784622 0.01880296 0.2004453 0.8500 + 18 -107.1018159431 -0.121397880439 0.82258224 0.01598008 0.1702102 0.8500 + 19 -107.2049252840 -0.103109340904 0.69916177 0.01358174 0.1445566 0.8500 + *** Restarting incremental Fock matrix formation *** + *** Resetting DIIS *** + 20 -107.2925103386 -0.087585054671 0.59139904 0.01144991 0.1227849 0.8500 + 21 -107.3669535297 -0.074443191073 0.50360516 0.00975792 0.1042317 0.8500 + 22 -107.4301699671 -0.063216437341 0.43013971 0.00835711 0.0885250 0.8500 + 23 -107.4838604296 -0.053690462557 0.36629947 0.00712665 0.0752187 0.8500 + 24 -107.5294835087 -0.045623079048 0.31120665 0.00605555 0.0639206 0.8500 + 25 -107.5682581555 -0.038774646799 0.26391242 0.00512977 0.0543208 0.8500 + 26 -107.6012145234 -0.032956367948 0.22406017 0.00435256 0.0461605 0.8500 + 27 -107.6292228915 -0.028008368053 0.19051949 0.00370158 0.0392265 0.8500 + 28 -107.6530259418 -0.023803050313 0.16203572 0.00314911 0.0333358 0.8500 + 29 -107.6732559820 -0.020230040250 0.91819604 0.01784525 0.0283309 0.0000 + 30 -107.7878585469 -0.114602564902 0.00117960 0.00005178 0.0003548 0.0000 + 31 -107.7878586037 -0.000000056732 0.00012760 0.00000533 0.0000394 0.0000 + 32 -107.7878586097 -0.000000006061 0.00009847 0.00000389 0.0000215 0.0000 + **** Energy Check signals convergence **** + + Fermi smearing (ALPHA): E(HOMO(Eh)) = -0.240236 MUE = 0.036739 gap= 15.155 eV + Fermi smearing (BETA): E(HOMO(Eh)) = -0.240240 MUE = 0.036737 gap= 15.155 eV + +N_FOD(alpha) = 0.000000 + N_FOD(beta) = 0.000000 + N_FOD = 0.000000 + + ***************************************************** + * SUCCESS * + * SCF CONVERGED AFTER 33 CYCLES * + ***************************************************** + + +---------------- +TOTAL SCF ENERGY +---------------- + +Total Energy : -107.78785861 Eh -2933.05675 eV + +Components: +Nuclear Repulsion : 50.80101200 Eh 1382.36581 eV +Electronic Energy : -158.58887061 Eh -4315.42256 eV +One Electron Energy: -240.50201045 Eh -6544.39241 eV +Two Electron Energy: 81.91313984 Eh 2228.96985 eV + +Virial components: +Potential Energy : -233.09085570 Eh -6342.72464 eV +Kinetic Energy : 125.30299709 Eh 3409.66790 eV +Virial Ratio : 1.86021772 + + +DFT components: +N(Alpha) : 6.999998045846 electrons +N(Beta) : 6.999998044369 electrons +N(Total) : 13.999996090214 electrons +E(X) : -14.798466221369 Eh +E(C) : -0.483714087775 Eh +E(XC) : -15.282180309145 Eh +DFET-embed. en. : 0.000000000000 Eh + +--------------- +SCF CONVERGENCE +--------------- + + Last Energy change ... -2.0826e-09 Tolerance : 1.0000e-08 + Last MAX-Density change ... 4.4657e-05 Tolerance : 1.0000e-07 + Last RMS-Density change ... 1.5491e-06 Tolerance : 5.0000e-09 + Last DIIS Error ... 2.9398e-06 Tolerance : 5.0000e-07 + + **** THE GBW FILE WAS UPDATED (orca.gbw) **** + **** DENSITY orca.scfp WAS UPDATED **** + **** ENERGY FILE WAS UPDATED (orca.en.tmp) **** + **** THE GBW FILE WAS UPDATED (orca.gbw) **** + **** DENSITY orca.scfp WAS UPDATED **** +---------------- +ORBITAL ENERGIES +---------------- + SPIN UP ORBITALS + NO OCC E(Eh) E(eV) + 0 1.0000 -19.161848 -521.4204 + 1 1.0000 -10.402131 -283.0564 + 2 1.0000 -0.988986 -26.9117 + 3 1.0000 -0.897184 -24.4136 + 4 1.0000 -0.897184 -24.4136 + 5 1.0000 -0.273246 -7.4354 + 6 1.0000 -0.240236 -6.5372 + 7 0.0000 0.066711 1.8153 + 8 0.0000 0.093937 2.5562 + 9 0.0000 0.093937 2.5562 + 10 0.0000 0.193431 5.2635 + 11 0.0000 0.309022 8.4089 + 12 0.0000 0.309022 8.4089 + 13 0.0000 0.381426 10.3791 + 14 0.0000 0.552340 15.0299 + 15 0.0000 0.552340 15.0299 + 16 0.0000 0.593612 16.1530 + 17 0.0000 0.593612 16.1530 + 18 0.0000 0.593859 16.1597 + 19 0.0000 0.918454 24.9924 + 20 0.0000 1.060796 28.8657 + 21 0.0000 1.060796 28.8657 + 22 0.0000 1.235626 33.6231 + 23 0.0000 1.242265 33.8037 + 24 0.0000 1.242265 33.8038 + 25 0.0000 1.432701 38.9858 + 26 0.0000 1.623560 44.1793 + 27 0.0000 1.623560 44.1793 + 28 0.0000 2.104084 57.2550 + 29 0.0000 2.208222 60.0888 + 30 0.0000 2.208222 60.0888 + 31 0.0000 2.534408 68.9647 + 32 0.0000 2.545206 69.2586 + 33 0.0000 2.545206 69.2586 + 34 0.0000 2.722106 74.0723 + 35 0.0000 2.722106 74.0723 + 36 0.0000 2.987384 81.2909 + 37 0.0000 2.987384 81.2909 + 38 0.0000 3.160366 85.9979 + 39 0.0000 3.338474 90.8445 + 40 0.0000 3.338474 90.8445 + 41 0.0000 3.402372 92.5832 + 42 0.0000 3.402372 92.5833 + 43 0.0000 3.614118 98.3452 + 44 0.0000 4.566561 124.2624 + 45 0.0000 4.805137 130.7544 + 46 0.0000 4.805137 130.7544 + 47 0.0000 5.421195 147.5182 + 48 0.0000 5.421195 147.5182 + 49 0.0000 5.895412 160.4223 + 50 0.0000 5.895413 160.4223 + 51 0.0000 6.299717 171.4240 + 52 0.0000 6.818276 185.5347 + 53 0.0000 6.818276 185.5347 + 54 0.0000 7.198266 195.8748 + 55 0.0000 7.314022 199.0246 + 56 0.0000 7.314028 199.0248 + 57 0.0000 8.631430 234.8731 + 58 0.0000 8.631430 234.8732 + 59 0.0000 9.833066 267.5713 + 60 0.0000 28.681462 780.4623 + 61 0.0000 44.186046 1202.3634 + + SPIN DOWN ORBITALS + NO OCC E(Eh) E(eV) + 0 1.0000 -19.161845 -521.4203 + 1 1.0000 -10.402132 -283.0564 + 2 1.0000 -0.988985 -26.9116 + 3 1.0000 -0.897183 -24.4136 + 4 1.0000 -0.897183 -24.4136 + 5 1.0000 -0.273244 -7.4353 + 6 1.0000 -0.240240 -6.5373 + 7 0.0000 0.066710 1.8153 + 8 0.0000 0.093939 2.5562 + 9 0.0000 0.093939 2.5562 + 10 0.0000 0.193432 5.2636 + 11 0.0000 0.309020 8.4089 + 12 0.0000 0.309020 8.4089 + 13 0.0000 0.381424 10.3791 + 14 0.0000 0.552340 15.0299 + 15 0.0000 0.552341 15.0300 + 16 0.0000 0.593612 16.1530 + 17 0.0000 0.593612 16.1530 + 18 0.0000 0.593858 16.1597 + 19 0.0000 0.918457 24.9925 + 20 0.0000 1.060795 28.8657 + 21 0.0000 1.060795 28.8657 + 22 0.0000 1.235626 33.6231 + 23 0.0000 1.242266 33.8038 + 24 0.0000 1.242267 33.8038 + 25 0.0000 1.432699 38.9857 + 26 0.0000 1.623560 44.1793 + 27 0.0000 1.623560 44.1793 + 28 0.0000 2.104083 57.2550 + 29 0.0000 2.208220 60.0887 + 30 0.0000 2.208220 60.0887 + 31 0.0000 2.534405 68.9647 + 32 0.0000 2.545204 69.2585 + 33 0.0000 2.545204 69.2585 + 34 0.0000 2.722101 74.0721 + 35 0.0000 2.722101 74.0721 + 36 0.0000 2.987381 81.2908 + 37 0.0000 2.987381 81.2908 + 38 0.0000 3.160363 85.9979 + 39 0.0000 3.338471 90.8444 + 40 0.0000 3.338471 90.8444 + 41 0.0000 3.402370 92.5832 + 42 0.0000 3.402370 92.5832 + 43 0.0000 3.614121 98.3452 + 44 0.0000 4.566558 124.2624 + 45 0.0000 4.805138 130.7545 + 46 0.0000 4.805139 130.7545 + 47 0.0000 5.421196 147.5182 + 48 0.0000 5.421196 147.5182 + 49 0.0000 5.895417 160.4224 + 50 0.0000 5.895417 160.4225 + 51 0.0000 6.299718 171.4241 + 52 0.0000 6.818279 185.5348 + 53 0.0000 6.818279 185.5348 + 54 0.0000 7.198268 195.8748 + 55 0.0000 7.314022 199.0247 + 56 0.0000 7.314028 199.0248 + 57 0.0000 8.631431 234.8732 + 58 0.0000 8.631431 234.8732 + 59 0.0000 9.833067 267.5713 + 60 0.0000 28.681462 780.4623 + 61 0.0000 44.186049 1202.3635 + + ******************************** + * MULLIKEN POPULATION ANALYSIS * + ******************************** + +------------------------------------------ +FOD BASED MULLIKEN REDUCED ORBITAL CHARGES +------------------------------------------ + 0 C s : 0.000000 s : 0.000000 + pz : 0.000000 p : 0.000000 + px : 0.000000 + py : 0.000000 + dz2 : -0.000000 d : -0.000000 + dxz : 0.000000 + dyz : 0.000000 + dx2y2 : -0.000000 + dxy : 0.000000 + f0 : 0.000000 f : -0.000000 + f+1 : -0.000000 + f-1 : 0.000000 + f+2 : 0.000000 + f-2 : -0.000000 + f+3 : -0.000000 + f-3 : 0.000000 + 1 O s : -0.000000 s : -0.000000 + pz : -0.000000 p : 0.000000 + px : 0.000000 + py : -0.000000 + dz2 : 0.000000 d : 0.000000 + dxz : 0.000000 + dyz : -0.000000 + dx2y2 : 0.000000 + dxy : 0.000000 + f0 : -0.000000 f : -0.000000 + f+1 : -0.000000 + f-1 : -0.000000 + f+2 : -0.000000 + f-2 : -0.000000 + f+3 : -0.000000 + f-3 : -0.000000 + + + ******************************* + * LOEWDIN POPULATION ANALYSIS * + ******************************* + +------------------------------------------- +LOEWDIN ATOMIC CHARGES AND SPIN POPULATIONS +------------------------------------------- + 0 C : -0.401845 0.000001 + 1 O : 0.401845 -0.000001 + +---------------------------------------------------- +LOEWDIN REDUCED ORBITAL CHARGES AND SPIN POPULATIONS +---------------------------------------------------- +CHARGE + 0 C s : 2.946994 s : 2.946994 + pz : 0.689330 p : 2.858777 + px : 1.480118 + py : 0.689330 + dz2 : 0.056787 d : 0.483572 + dxz : 0.128211 + dyz : 0.000000 + dx2y2 : 0.170362 + dxy : 0.128211 + f0 : 0.012292 f : 0.112502 + f+1 : 0.017605 + f-1 : 0.002049 + f+2 : 0.020486 + f-2 : 0.000000 + f+3 : 0.029341 + f-3 : 0.030730 + 1 O s : 3.181082 s : 3.181082 + pz : 1.061598 p : 3.846058 + px : 1.722862 + py : 1.061598 + dz2 : 0.069451 d : 0.413052 + dxz : 0.067625 + dyz : 0.000000 + dx2y2 : 0.208352 + dxy : 0.067625 + f0 : 0.007672 f : 0.157963 + f+1 : 0.043893 + f-1 : 0.001279 + f+2 : 0.012786 + f-2 : 0.000000 + f+3 : 0.073154 + f-3 : 0.019179 + +SPIN + 0 C s : 0.000008 s : 0.000008 + pz : -0.000001 p : -0.000009 + px : -0.000006 + py : -0.000002 + dz2 : 0.000000 d : 0.000002 + dxz : 0.000001 + dyz : -0.000000 + dx2y2 : 0.000000 + dxy : 0.000001 + f0 : 0.000000 f : 0.000001 + f+1 : 0.000000 + f-1 : 0.000000 + f+2 : 0.000000 + f-2 : 0.000000 + f+3 : 0.000000 + f-3 : 0.000000 + 1 O s : 0.000000 s : 0.000000 + pz : 0.000001 p : 0.000000 + px : -0.000002 + py : 0.000001 + dz2 : -0.000000 d : -0.000002 + dxz : -0.000000 + dyz : -0.000000 + dx2y2 : -0.000001 + dxy : -0.000000 + f0 : -0.000000 f : -0.000000 + f+1 : 0.000000 + f-1 : -0.000000 + f+2 : -0.000000 + f-2 : -0.000000 + f+3 : 0.000000 + f-3 : -0.000000 + + + ***************************** + * MAYER POPULATION ANALYSIS * + ***************************** + + NA - Mulliken gross atomic population + ZA - Total nuclear charge + QA - Mulliken gross atomic charge + VA - Mayer's total valence + BVA - Mayer's bonded valence + FA - Mayer's free valence + + ATOM NA ZA QA VA BVA FA + 0 C 7.4213 6.0000 -1.4213 3.5661 3.5661 0.0000 + 1 O 6.5787 8.0000 1.4213 3.5661 3.5661 -0.0000 + + Mayer bond orders larger than 0.100000 +B( 0-C , 1-O ) : 3.5661 + +------- +TIMINGS +------- + +Total SCF time: 0 days 0 hours 0 min 4 sec + +Total time .... 4.094 sec +Sum of individual times .... 3.967 sec ( 96.9%) + +Fock matrix formation .... 3.756 sec ( 91.7%) + Split-RI-J .... 0.365 sec ( 9.7% of F) + XC integration .... 3.371 sec ( 89.8% of F) + Basis function eval. .... 0.660 sec ( 19.6% of XC) + Density eval. .... 1.044 sec ( 31.0% of XC) + XC-Functional eval. .... 0.464 sec ( 13.8% of XC) + XC-Potential eval. .... 1.126 sec ( 33.4% of XC) +Diagonalization .... 0.049 sec ( 1.2%) +Density matrix formation .... 0.008 sec ( 0.2%) +Population analysis .... 0.002 sec ( 0.0%) +Initial guess .... 0.024 sec ( 0.6%) +Orbital Transformation .... 0.000 sec ( 0.0%) +Orbital Orthonormalization .... 0.000 sec ( 0.0%) +DIIS solution .... 0.015 sec ( 0.4%) +Grid generation .... 0.114 sec ( 2.8%) + +Maximum memory used throughout the entire SCF-calculation: 13.1 MB + + +------------------------------------------------------------------------------- + DFT DISPERSION CORRECTION + + DFTD3 V3.1 Rev 1 + USING Becke-Johnson damping +------------------------------------------------------------------------------- +The revPBE functional is recognized +Active option DFTDOPT ... 4 + +molecular C6(AA) [au] = 100.821596 + + + DFT-D V3 + parameters + s6 scaling factor : 1.0000 + a1 scaling factor : 0.5238 + s8 scaling factor : 2.3550 + a2 scaling factor : 3.5016 + ad hoc parameters k1-k3 : 16.0000 1.3333 -4.0000 + + Edisp/kcal,au: -0.711996130502 -0.001134637936 + E6 /kcal : -0.280198044 + E8 /kcal : -0.431798087 + % E8 : 60.646128302 + +------------------------- ---------------- +Dispersion correction -0.001134638 +------------------------- ---------------- + + +------------------------- -------------------- +FINAL SINGLE POINT ENERGY -107.788993249745 +------------------------- -------------------- + +------------------------------------------------------------------------------ + ORCA SCF GRADIENT CALCULATION +------------------------------------------------------------------------------ + +Gradient of the Kohn-Sham DFT energy: +Kohn-Sham wavefunction type ... UKS +Hartree-Fock exchange scaling ... 0.000 +Number of operators ... 2 +Number of atoms ... 2 +Basis set dimensions ... 62 +Integral neglect threshold ... 2.5e-11 +Integral primitive cutoff ... 2.5e-12 +SHARK Integral package ... ON + +Nuc. rep. gradient (SHARK) ... done ( 0.0 sec) +HCore & Overlap gradient (SHARK) ... done ( 0.0 sec) +RI-J gradient (SHARK) ... done ( 0.1 sec) +Exchange-correlation gradient ... done +Dispersion correction ... done + +------------------ +CARTESIAN GRADIENT +------------------ + + 1 C : 19.533143589 0.000000000 0.000000322 + 2 O : -19.533143589 -0.000000000 -0.000000322 + +Difference to translation invariance: + : 0.0000000000 -0.0000000000 0.0000000000 + +Difference to rotation invariance: + : 0.0000000000 0.0000003043 -0.0000000000 + +Norm of the cartesian gradient ... 27.6240365800 +RMS gradient ... 11.2774657095 +MAX gradient ... 19.5331435895 + +------- +TIMINGS +------- + +Total SCF gradient time ... 0.805 sec + +One electron gradient .... 0.009 sec ( 1.1%) +RI-J Coulomb gradient .... 0.135 sec ( 16.8%) +XC gradient .... 0.531 sec ( 66.0%) + +Maximum memory used throughout the entire SCFGRAD-calculation: 31.0 MB + + *************************************** + * ORCA property calculations * + *************************************** + + --------------------- + Active property flags + --------------------- + (+) Dipole Moment + + +------------------------------------------------------------------------------ + ORCA ELECTRIC PROPERTIES CALCULATION +------------------------------------------------------------------------------ + +Dipole Moment Calculation ... on +Quadrupole Moment Calculation ... off +Polarizability Calculation ... off +GBWName ... orca.gbw +Electron density ... orca.scfp +The origin for moment calculation is the CENTER OF MASS = ( 0.539695, 0.000000 0.000000) + +------------- +DIPOLE MOMENT +------------- + X Y Z +Electronic contribution: 0.56272 0.00000 -0.00000 +Nuclear contribution : 0.00317 0.00000 0.00000 + ----------------------------------------- +Total Dipole Moment : 0.56589 0.00000 -0.00000 + ----------------------------------------- +Magnitude (a.u.) : 0.56589 +Magnitude (Debye) : 1.43837 + + + +-------------------- +Rotational spectrum +-------------------- + +Rotational constants in cm-1: 0.000000 9.828743 9.828743 +Rotational constants in MHz : 0.000000 294658.313449 294658.313449 + + Dipole components along the rotational axes: +x,y,z [a.u.] : 0.565886 0.000000 -0.000003 +x,y,z [Debye]: 1.438369 0.000000 -0.000008 + + + +Timings for individual modules: + +Sum of individual times ... 5.160 sec (= 0.086 min) +GTO integral calculation ... 0.225 sec (= 0.004 min) 4.4 % +SCF iterations ... 4.112 sec (= 0.069 min) 79.7 % +SCF Gradient evaluation ... 0.824 sec (= 0.014 min) 16.0 % + ****ORCA TERMINATED NORMALLY**** +TOTAL RUN TIME: 0 days 0 hours 0 minutes 5 seconds 386 msec diff --git a/tests/assets/orca_scf_converged.out b/tests/assets/orca/orca_scf_converged.out similarity index 100% rename from tests/assets/orca_scf_converged.out rename to tests/assets/orca/orca_scf_converged.out diff --git a/tests/assets/orca_scf_unconverged.out b/tests/assets/orca/orca_scf_unconverged.out similarity index 100% rename from tests/assets/orca_scf_unconverged.out rename to tests/assets/orca/orca_scf_unconverged.out diff --git a/tests/assets/orca_scf_unfinished.out b/tests/assets/orca/orca_scf_unfinished.out similarity index 100% rename from tests/assets/orca_scf_unfinished.out rename to tests/assets/orca/orca_scf_unfinished.out diff --git a/tests/assets/orca_freq_dummy.out b/tests/assets/orca_freq_dummy.out deleted file mode 100644 index e2c9035a..00000000 --- a/tests/assets/orca_freq_dummy.out +++ /dev/null @@ -1,87 +0,0 @@ -snippet from orca output, for reading of frequencies - ------------------------ -VIBRATIONAL FREQUENCIES ------------------------ - -Scaling factor for frequencies = 1.000000000 (already applied!) - - 0: 0.00 cm**-1 - 1: 0.00 cm**-1 - 2: 0.00 cm**-1 - 3: 0.00 cm**-1 - 4: 0.00 cm**-1 - 5: 0.00 cm**-1 - 6: -4845.14 cm**-1 ***imaginary mode*** - 7: -819.13 cm**-1 ***imaginary mode*** - 8: -584.08 cm**-1 ***imaginary mode*** - 9: -583.86 cm**-1 ***imaginary mode*** - 10: 1198.30 cm**-1 - 11: 2953.17 cm**-1 - 12: 2988.80 cm**-1 - 13: 3309.58 cm**-1 - 14: 3309.63 cm**-1 - - ------------- -NORMAL MODES ------------- - -These modes are the Cartesian displacements weighted by the diagonal matrix -M(i,i)=1/sqrt(m[i]) where m[i] is the mass of the displaced atom -Thus, these vectors are normalized but *not* orthogonal - - 0 1 2 3 4 5 - 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 4 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 5 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 6 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 7 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 8 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 9 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 10 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 11 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 12 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 13 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 14 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 - 6 7 8 9 10 11 - 0 -0.000000 0.000000 -0.056775 -0.089134 0.000008 0.000394 - 1 0.000000 0.000000 -0.089130 0.056782 -0.000519 -0.000039 - 2 0.000000 -0.165530 -0.000000 -0.000000 0.000000 0.000000 - 3 0.000000 -0.000000 0.378384 0.588492 -0.500018 -0.000671 - 4 -0.000000 0.000000 -0.059655 0.036680 0.000117 -0.499775 - 5 0.499976 0.493139 0.000000 -0.000000 0.000000 -0.000000 - 6 0.000000 -0.000000 0.375511 0.590352 0.499974 -0.002279 - 7 0.000000 0.000000 -0.057136 0.040626 0.001725 0.500214 - 8 0.500019 0.493060 0.000000 -0.000000 0.000000 -0.000000 - 9 0.000000 -0.000000 -0.038706 -0.058479 0.000789 -0.500876 - 10 -0.000000 -0.000000 0.590964 -0.377962 -0.497828 -0.000801 - 11 -0.501584 0.491408 0.000000 0.000000 -0.000000 0.000000 - 12 0.000000 0.000000 -0.038670 -0.058273 -0.000844 0.499126 - 13 -0.000000 -0.000000 0.587873 -0.375934 0.502166 0.000830 - 14 -0.498416 0.494797 0.000000 0.000000 -0.000000 0.000000 - 12 13 14 - 0 -0.000083 0.067702 0.089971 - 1 -0.000038 -0.089966 0.067707 - 2 -0.000000 0.000000 0.000000 - 3 -0.000692 0.019421 0.024281 - 4 -0.499738 0.561489 -0.421873 - 5 -0.000000 0.000000 0.000000 - 6 -0.002271 0.016087 0.026780 - 7 0.500261 0.561639 -0.420349 - 8 -0.000000 0.000000 0.000000 - 9 0.501967 -0.419742 -0.559691 - 10 0.000796 -0.025718 0.017900 - 11 0.000000 -0.000000 -0.000000 - 12 -0.498019 -0.422479 -0.563437 - 13 -0.000867 -0.025406 0.017550 - 14 0.000000 -0.000000 -0.000000 - - ------------ -IR SPECTRUM ------------ - and there is more at the bottom of this file as well, not needed really \ No newline at end of file diff --git a/tests/calculators/test_orca.py b/tests/calculators/test_orca.py index a5338dd6..2a6422da 100644 --- a/tests/calculators/test_orca.py +++ b/tests/calculators/test_orca.py @@ -11,16 +11,17 @@ from packaging.version import Version -import pytest - import numpy as np -import ase -from ase.build import molecule +import pytest from pytest import approx from pathlib import Path + +import ase +from ase.build import molecule from ase import Atoms from ase.calculators.calculator import CalculationFailed +from ase.io import orca as orca_io from wfl.calculators.orca import ORCA, parse_npa_output, natural_population_analysis from wfl.calculators import generic @@ -43,10 +44,11 @@ ref_parameters = dict(charge=0, mult=1, - orca_command="dummy_no_orca_exec", + #orca_command="dummy_no_orca_exec", orcablocks='%scf Convergence Tight \nSmearTemp 5000.0 \nmaxiter 500 \n Rotate \n { 1, 7, 28.37, 0, 0} \n { 6, 9, 54.55, 0, 0} \n { 2, 10, 27.42, 0, 0} \n { 0, 14, 8.014, 1, 1} \n { 3, 15, 35.3, 1, 1} \n { 5, 13, 51.31, 1, 1} \n { 2, 10, 17.84, 1, 1} \n { 1, 11, 59.83, 1, 1} \nend \n \nend \n', orcasimpleinput='UHF revPBE def2-TZVP def2/J D3BJ slowconv', - task='gradient') + #task='gradient') + ) ref_output = dict(energy=-2933.086022884649, forces=np.array([[-1.00418967e+03, -3.42059590e-07, 1.02844648e-05], @@ -55,36 +57,32 @@ ) -def test_orca_calculator(): - orca = ORCA() - orca.read(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'assets', 'orca')) - - # parameter reading - for key, val in orca.parameters.items(): - assert ref_parameters[key] == val +def test_orca_is_converged(tmp_path): + """function to check convergence from orca's output.""" - # results reading - for key, val in orca.results.items(): - # the dipole can bave a little floating point issue - # because it is written up to 5 digits only - assert ref_output[key] == approx(val, rel=(1e-4 if key == "dipole" else 1e-7)) + ref_path = Path(__file__).parent.resolve() / "../assets/orca/" + orca = ORCA() + output_fn = ref_path / "orca_scf_converged.out" + assert orca.is_converged(output_fn) is True -def test_orca_is_converged(): - """function to check convergence from orca's output.""" + output_fn = ref_path / "orca_scf_unconverged.out" + assert orca.is_converged(output_fn) is False - ref_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'assets') - orca = ORCA() + output_fn = ref_path / "orca_scf_unfinished.out" + assert orca.is_converged(output_fn) is None - orca.label = os.path.join(ref_path, 'orca_scf_converged') - assert orca.is_converged() is True + orcablocks = "%scf maxiter 2 end" + orca = ORCA(orcablocks=orcablocks, workdir=tmp_path) - orca.label = os.path.join(ref_path, 'orca_scf_unconverged') - assert orca.is_converged() is False + at = molecule("CH4") + at.set_distance(0, 1, 4.0, fix=0) + at.calc = orca - orca.label = os.path.join(ref_path, 'orca_scf_unfinished') - assert orca.is_converged() is None + # todo - make this run in tmpdir + with pytest.raises(CalculationFailed): + at.get_potential_energy() def test_full_orca(tmp_path): @@ -101,38 +99,44 @@ def test_full_orca(tmp_path): mult=2) atoms.calc = calc - try: + + with pytest.raises(subprocess.CalledProcessError): atoms.get_potential_energy() - except subprocess.CalledProcessError: - pass + assert list(scratchdir.iterdir()) == [] assert home_dir.exists() + calc_dir = [d for d in home_dir.iterdir()][0] for ext in [".inp", ".out"]: fn = calc_dir / ("orca" + ext) print(fn) assert fn.exists() - # just check this executes without error + # check correct execution calc = ORCA(workdir=home_dir, scratchdir=scratchdir, keep_files = "default", mult=1) + + atoms = molecule("H2O") atoms.calc = calc energy = atoms.get_potential_energy() - forces = atoms.get_forces() + assert energy == approx(-2079.6566902318705) - ref_energy = -31.595527990679514 - ref_forces = np.array([[ 4.11376537e-10, 4.11376537e-10, 3.55578429e+00], - [-2.57110335e-10, -4.11376537e-10, -3.55578431e+00]]) - assert energy == approx(ref_energy) + forces = atoms.get_forces() + ref_forces = np.array([[ 5.71864808e-07, 1.47992709e-07, -4.34436341e-01], + [-4.11376537e-10, -1.46326633e-01, 2.13230073e-01], + [-3.70238883e-09, 1.46325557e-01, 2.13230269e-01]]) assert forces == approx(ref_forces) + dipole = atoms.get_dipole_moment() + ref_dipole = np.array([ 0., 0., -0.43402056]) + assert dipole == approx(ref_dipole) + -#@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") def test_orca_with_generic(tmp_path): home_dir = tmp_path / "home_dir" @@ -153,7 +157,6 @@ def test_orca_with_generic(tmp_path): assert "orca_energy" in at.info or "orca_calculation_failed" in at.info -#@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") def test_orca_geometry_optimisation(tmp_path): home_dir = tmp_path / "home_dir" @@ -165,7 +168,8 @@ def test_orca_geometry_optimisation(tmp_path): calc = ORCA(workdir=home_dir, keep_files = "default", mult=1, - task="opt") + orcasimpleinput='opt B3LYP def2-TZVP', + ) generic_result = generic.calculate(inputs=inputs, outputs=outputs, calculator=calc, properties=["energy", "forces"], output_prefix="orca_") @@ -173,10 +177,9 @@ def test_orca_geometry_optimisation(tmp_path): out = list(generic_result)[0] - assert pytest.approx(out.get_distance(0, 1)) == 0.76812058465248 + assert pytest.approx(out.get_distance(0, 1), abs=0.03) == 0.76812058465248 -@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ, reason="no ORCA executable in path") def test_post_processing(tmp_path): home_dir = tmp_path / "home_dir" @@ -188,7 +191,10 @@ def test_post_processing(tmp_path): atoms.calc = calc atoms.get_potential_energy() - assert Path(atoms.calc.label + '.post').exists() + + output_fn = atoms.calc.directory / atoms.calc.template.outputname.replace(".out", ".post") + + assert output_fn.exists() def test_parse_npa_output(): @@ -203,13 +209,15 @@ def test_parse_npa_output(): def simplest_orca_post(orca_calc): - label = orca_calc.label - if Path(label + '.out').exists(): - with open(label + ".post", "w") as f: + output_fn = orca_calc.directory / orca_calc.template.outputname + post_fn = str(output_fn).replace(".out", ".post") + + if Path(output_fn).exists(): + with open(post_fn, "w") as f: f.write("Dummy file generated after ORCA execution\n") -@pytest.mark.skipif("ASE_ORCA_COMMAND" not in os.environ or "JANPA_HOME_DIR" not in os.environ, reason="no ORCA or JANPA executable in path") +@pytest.mark.skipif("JANPA_HOME_DIR" not in os.environ, reason="JANPA_HOME_DIR is not set") def test_run_npa(tmp_path): janpa_home_dir = os.environ["JANPA_HOME_DIR"] @@ -218,15 +226,25 @@ def test_run_npa(tmp_path): home_dir = tmp_path / "home_dir" atoms = Atoms("H2", positions=[(0, 0, 0), (0, 0, 0.9)]) - calc = ORCA(workdir=home_dir, - keep_files = ["*.inp", "*.out", "*.janpa"], - post_process=post_func, - ) + orca_params = dict(workdir=home_dir, + keep_files = ["*.inp", "*.out", "*.janpa"], + post_process=post_func, + ) + + calc_init = (ORCA, [], orca_params) + calc = ORCA(**orca_params) + + # test regular calculation + at = atoms.copy() + at.calc = calc + at.get_potential_energy() + + # test parallelised calculation inputs = ConfigSet(atoms) outputs = OutputSpec() - generic_results = generic.calculate(inputs=inputs, outputs=outputs, calculator=calc, properties=["energy", "forces"], output_prefix="orca_", raise_calc_exceptions=True) + generic_results = generic.calculate(inputs=inputs, outputs=outputs, calculator=calc_init, properties=["energy", "forces"], output_prefix="orca_", raise_calc_exceptions=True) atoms = list(generic_results)[0] diff --git a/tests/local_scripts/gelzinyte.workstation.sh b/tests/local_scripts/gelzinyte.workstation.sh index f86d91a4..f83aa716 100755 --- a/tests/local_scripts/gelzinyte.workstation.sh +++ b/tests/local_scripts/gelzinyte.workstation.sh @@ -5,7 +5,9 @@ export ASE_CONFIG_PATH=${HOME}/.config/ase/pytest.config.ini # MOPAC isn't updated with the profile export ASE_MOPAC_COMMAND="${HOME}/programs/mopac-22.1.1-linux/bin/mopac PREFIX.mop 2> /dev/null" +export JANPA_HOME_DIR="${HOME}/programs/janpa" + # Aims #pytest -v -s -rxXs ../calculators/test_aims.py -pytest -v -s -rxXs --basetemp tmpdir ../calculators/test_orca.py::test_full_orca +pytest -v -s -rxXs --basetemp tmpdir ../calculators/test_orca.py diff --git a/wfl/calculators/orca/__init__.py b/wfl/calculators/orca/__init__.py index e1f8064a..025966a9 100644 --- a/wfl/calculators/orca/__init__.py +++ b/wfl/calculators/orca/__init__.py @@ -3,6 +3,8 @@ from pathlib import Path import subprocess +from typing import Optional + import ase.io from ase.io.orca import read_geom_orcainp import numpy as np @@ -14,9 +16,6 @@ from ..wfl_fileio_calculator import WFLFileIOCalculator from wfl.utils.misc import chunks -# To Do -## - insert engrad if it's not there -## add default parameters as in write input _default_keep_files = ["*.inp", "*.out", "*.engrad", "*.xyz", "*_trj.xyz"] @@ -63,7 +62,7 @@ class ORCA(WFLFileIOCalculator, ASE_ORCA): # to override that function's built-in default of 10 wfl_generic_default_autopara_info = {"num_inputs_per_python_subprocess": 1} - # EG where should it be? + # EG where should this be? default_params = dict(charge=0, orcasimpleinput='engrad B3LYP def2-TZVP', orcablocks='%pal nprocs 1 end') @@ -82,56 +81,30 @@ def __init__(self, keep_files="default", rundir_prefix="ORCA_", scratchdir=None, self.post_process = post_process -# def calculate(self, atoms=None, properties=["energy", "forces"], system_changes=all_changes): -# """Does the calculation. Handles the working directories in addition to regular -# ASE calculation operations (writing input, executing, reading_results) """ -# -# Calculator.calculate(self, atoms, properties, system_changes) -# -# # from WFLFileIOCalculator -# self.setup_rundir() -# -# try: -# self.write_input(self.atoms, properties, system_changes) -# self.execute() -# self.read_results() -# if self.post_process is not None: -# self.post_process(self) -# calculation_succeeded = True -# if 'DFT_FAILED_ORCA' in atoms.info: -# del atoms.info["DFT_FAILED_ORCA"] -# except Exception as e: -# atoms.info["DFT_FAILED_ORCA"] = TRUE -# calculation_succeeded = False -# raiseke e -# finally: -# # when exception is raised, `calculation_succeeded` is set to False, -# # the following code is executed and exception is re-raised. -# # from WFLFileIOCalculator -# self.clean_rundir(_default_keep_files, calculation_succeeded) - - - def calculate(self, atoms=None, properties=_default_properties, system_changes=all_changes): """Does the calculation. Handles the working directories in addition to regular ASE calculation operations (writing input, executing, reading_results) """ + # should be fixed by ASE's PR #3442 + if self.atoms is None: + self.atoms = atoms + # from WFLFileIOCalculator self.setup_rundir() - # how should default parameters be treated? - # currently - # - ase.ORCA.calculate() -> - # - ase.genericfileio.GenericFileIOCalculator.calculate() -> - # - ase.genericfileio.GenericFileIOCalculator.write_inputfiles() -> - # - calls ase.calculators.orca.OrcaTemplate.write_input and - # gives it self.parameters which update the hard-coded defaults - self.fill_in_default_params() + self.enforce_force_calculation() + if self.parameters.get("mult", None) is None: + charge = self.parameters.get("charge", 0) + self.parameters["mult"] = self.get_default_multiplicity(atoms, charge) + try: super().calculate(atoms=atoms, properties=properties, system_changes=system_changes) + + self.wfl_calc_post_process() + calculation_succeeded = True if 'DFT_FAILED_ORCA' in atoms.info: del atoms.info["DFT_FAILED_ORCA"] @@ -140,73 +113,56 @@ def calculate(self, atoms=None, properties=_default_properties, system_changes=a calculation_succeeded = False raise e finally: - # when exception is raised, `calculation_succeeded` is set to False, - # the following code is executed and exception is re-raised. - # from WFLFileIOCalculator self.clean_rundir(_default_keep_files, calculation_succeeded) + def wfl_calc_post_process(self): + """ + Extends ASE's calculator's reading capabilities. + - Checks the calculation has converged and raises an exception if not + - energy, force and dipole are read by ASE + - reads optimised aptoms and optimisation trjectory, if appropriate. + - (to be updated) reads frequencies, and eigenmodes, if appropriate. + - performs post-procesing with any external functions + """ + + output_file_path = self.directory / self.template.outputname + + if not self.is_converged(output_file_path): + raise CalculationFailed("Wavefunction not fully converged") + + orcasimpleinput = self.parameters["orcasimpleinput"] + + if 'opt' in orcasimpleinput or "copt" in orcasimpleinput: + self.read_opt_atoms(str(output_file_path).replace(".out", ".xyz")) + self.read_trajectory(str(output_file_path).replace(".out", "_trj.xyz")) + + # to be updated + #if 'freq' in orcasimpleinput: + # self.read_frequencies() + + if self.post_process is not None: + self.post_process(self) + def fill_in_default_params(self): - parameters = self.default_params + parameters = self.default_params.copy() parameters.update(self.parameters) self.parameters = parameters - - def write_input(self, atoms, properties=None, system_changes=None): - """Writes orca.inp, based on the wfl ORCA calculator parameters""" - - if self.parameters.get("mult", None) is None: - self.set(mult=self.get_default_multiplicity(atoms, - self.parameters.get( - "charge", 0))) - - # copy of ASE's method, just using the patched write_orca() from here - FileIOCalculator.write_input(self, atoms, properties, system_changes) - self.parameters.write(self.label + '.ase') - - # this is modified in place here - orcablocks = self.parameters['orcablocks'] - - if self.pcpot: - pcstring = f'% pointcharges \"{self.label}.pc\"\n\n' - orcablocks += pcstring - self.pcpot.write_mmcharges(self.label) - - with open(self.label + '.inp', 'w') as f: - - f.write(f"! {self.pick_task()} {self.parameters['orcasimpleinput']} \n") - f.write(f"{orcablocks} \n") - - f.write('*xyz') - f.write(f" {self.parameters['charge']:d}") - f.write(f" {self.parameters['mult']:d} \n") - for atom in atoms: - if atom.tag == 71: # 71 is ascii G (Ghost) - symbol = atom.symbol + ' : ' - else: - symbol = atom.symbol + ' ' - f.write(symbol + - str(atom.position[0]) + ' ' + - str(atom.position[1]) + ' ' + - str(atom.position[2]) + '\n') - f.write('*\n') def enforce_force_calculation(self): orcasimpleinput = self.parameters["orcasimpleinput"] - if "engrad" not in orcasimpleinput and "opt" not in orcasimpleinput: + + # does "freq" produce engrad too? + force_producing_keys = ["engrad", "opt", "copt"] + expect_engrad = np.sum([key in orcasimpleinput for key in force_producing_keys]) + + if not expect_engrad: self.parameters["orcasimpleinput"] = "engrad " + orcasimpleinput -# def pick_task(self): -# # energy and force calculation is enforced -# task = self.parameters["task"] -# if task is None: -# task = "engrad" -# elif "engrad" not in task and "opt" not in task and "copt" not in task: -# task += " engrad" -# return task - - def is_converged(self): + + def is_converged(self, output_file_path): """checks for warnings about SCF/wavefunction not converging. Returns @@ -217,7 +173,8 @@ def is_converged(self): Based on ase.calculators.orca.read_energy(). """ - with open(self.label + '.out', mode='r', encoding='utf-8') as fd: + + with open(output_file_path, mode='r', encoding='utf-8') as fd: text = fd.read() re_energy = re.compile(r"FINAL SINGLE POINT ENERGY.*\n") @@ -229,30 +186,14 @@ def is_converged(self): return not re_not_converged.search(found_line.group(0)) - def read_results(self): - """Reads all results""" - - if not self.is_converged(): - raise CalculationFailed("Wavefunction not fully converged") - - self.read_energy() - self.read_forces() - - self.read_dipole() - if 'opt' in self.parameters.task or "copt" in self.parameters.task: - self.read_opt_atoms() - self.read_trajectory() - - if 'freq' in self.parameters.task: - self.read_frequencies() - - def read_opt_atoms(self): + def read_opt_atoms(self, out_xyz_fn): """Reads the result of the geometry optimisation""" - opt_atoms = ase.io.read(f'{self.label}.xyz') + opt_atoms = ase.io.read(out_xyz_fn) self.extra_results["relaxed_positions"] = opt_atoms.positions.copy() - def read_trajectory(self): + + def read_trajectory(self, traj_fn): """Reads the trajectory of the geometry optimisation Notes @@ -261,7 +202,7 @@ def read_trajectory(self): E -154.812399026326"; # TODO parse out forces as well """ - opt_trj = ase.io.read(f'{self.label}_trj.xyz', ':') + opt_trj = ase.io.read(traj_fn, ":") for at in opt_trj: energy = None for key in at.info.keys(): @@ -276,6 +217,7 @@ def read_trajectory(self): self.extra_results["opt_trajectory"] = opt_trj + # EG: The eigenvector reading is implemented incorrectly def read_frequencies(self): """Reads frequencies (dynamical matrix eigenvalues) and normal modes (eigenvectors) from output. @@ -352,37 +294,6 @@ def read_frequencies(self): "Frequency calculation has failed in ORCA: eigenvectors not " "found") - def read_dipole(self): - """ - Note - ---- - - Dipole is calculated by default, though only written up to 0.00001 - so the rest of the digits are not meaningful in the output. - """ - with open(self.label + '.out', mode='r', encoding='utf-8') as fd: - text = fd.read() - - # recognise the whole block and pick up the three numbers we need - pattern_dipole_block = re.compile( - r"(?:DIPOLE MOMENT\n" - r"[-]+\n" - r"[\sXYZ]*\n" - r"Electronic contribution:[\s\.0-9-]*\n" - r"Nuclear contribution :[\s\.0-9-]*\n" - r"[-\s]+\n" - r"Total Dipole Moment :\s+([-0-9\.]*)\s+([-0-9\.]*)\s+([-0-9\.]*))" - # this reads the X, Y, Z parts - ) - - # three numbers, total dipole in a.u. - match = pattern_dipole_block.search(text) - - if match: - dipole = np.array( - [float(x) for x in match.groups()]) / units.Debye * units.Bohr - self.results["dipole"] = dipole - @staticmethod def get_default_multiplicity(atoms, charge=0): """ Gets the multiplicity of the atoms object. @@ -407,19 +318,20 @@ def natural_population_analysis(janpa_home_dir, orca_calc): janpa_home_dir = Path(janpa_home_dir) - label = orca_calc.label + orca_input_fn = orca_calc.directory / orca_calc.template.inputname + label = orca_input_fn.parent / orca_input_fn.stem # just to get the elements if orca_calc.atoms is not None: ref_elements = list(orca_calc.atoms.symbols) else: - atoms = read_geom_orcainp(label + '.inp') + atoms = read_geom_orcainp(orca_input_fn) ref_elements = list(atoms.symbols) # 1. Convert from orca output to incomplete molden - calculator_exec = orca_calc.command.split(' ')[0] - command = f"{calculator_exec}_2mkl {label} -molden > {label}.orca_2mkl.out" + orca_command = orca_calc.profile.command + command = f"{orca_command}_2mkl {label} -molden > {label}.orca_2mkl.out" subprocess.run(command, shell=True) # think about how to handle errors, etc # 2. Clean up molden format From d360c85adea3505429965a39d8a9718a3ce4d882 Mon Sep 17 00:00:00 2001 From: gelzinyte Date: Fri, 16 Aug 2024 01:24:26 +0200 Subject: [PATCH 18/24] more clean up --- tests/calculators/test_orca.py | 31 ++++---------------- tests/local_scripts/gelzinyte.workstation.sh | 4 +-- wfl/calculators/orca/__init__.py | 6 +--- 3 files changed, 8 insertions(+), 33 deletions(-) diff --git a/tests/calculators/test_orca.py b/tests/calculators/test_orca.py index 2a6422da..3be0fc84 100644 --- a/tests/calculators/test_orca.py +++ b/tests/calculators/test_orca.py @@ -28,33 +28,12 @@ from wfl.configset import ConfigSet, OutputSpec from wfl.autoparallelize import AutoparaInfo -if Version(ase.__version__) < Version("3.23"): - aims_prerequisites = pytest.mark.skip(reason="ORCA tests are only supported for ASE v3.23, please update.") +from ase.config import cfg as ase_cfg -else: - - from ase.config import cfg as ase_cfg - - aims_prerequisites = pytest.mark.skipif( - condition = 'orca' not in ase_cfg.parser , - reason='Missing "orca" in ase\'s configuration file.' - ) - - - -ref_parameters = dict(charge=0, - mult=1, - #orca_command="dummy_no_orca_exec", - orcablocks='%scf Convergence Tight \nSmearTemp 5000.0 \nmaxiter 500 \n Rotate \n { 1, 7, 28.37, 0, 0} \n { 6, 9, 54.55, 0, 0} \n { 2, 10, 27.42, 0, 0} \n { 0, 14, 8.014, 1, 1} \n { 3, 15, 35.3, 1, 1} \n { 5, 13, 51.31, 1, 1} \n { 2, 10, 17.84, 1, 1} \n { 1, 11, 59.83, 1, 1} \nend \n \nend \n', - orcasimpleinput='UHF revPBE def2-TZVP def2/J D3BJ slowconv', - #task='gradient') - ) - -ref_output = dict(energy=-2933.086022884649, - forces=np.array([[-1.00418967e+03, -3.42059590e-07, 1.02844648e-05], - [1.00418967e+03, 3.42059590e-07, -1.02844648e-05]]), - dipole=np.array([1.44071, -0.0, -0.0]) - ) +aims_prerequisites = pytest.mark.skipif( + condition = 'orca' not in ase_cfg.parser , + reason='Missing "orca" in ase\'s configuration file.' +) def test_orca_is_converged(tmp_path): diff --git a/tests/local_scripts/gelzinyte.workstation.sh b/tests/local_scripts/gelzinyte.workstation.sh index f83aa716..70929c1c 100755 --- a/tests/local_scripts/gelzinyte.workstation.sh +++ b/tests/local_scripts/gelzinyte.workstation.sh @@ -8,6 +8,6 @@ export ASE_MOPAC_COMMAND="${HOME}/programs/mopac-22.1.1-linux/bin/mopac PREFIX.m export JANPA_HOME_DIR="${HOME}/programs/janpa" # Aims -#pytest -v -s -rxXs ../calculators/test_aims.py -pytest -v -s -rxXs --basetemp tmpdir ../calculators/test_orca.py +pytest -v -s -rxXs ../calculators/test_aims.py +pytest -v -s -rxXs ../calculators/test_orca.py diff --git a/wfl/calculators/orca/__init__.py b/wfl/calculators/orca/__init__.py index 025966a9..ceaa2c22 100644 --- a/wfl/calculators/orca/__init__.py +++ b/wfl/calculators/orca/__init__.py @@ -1,16 +1,12 @@ -import os import re from pathlib import Path import subprocess -from typing import Optional - import ase.io from ase.io.orca import read_geom_orcainp import numpy as np from ase import units -from ase.calculators.calculator import CalculationFailed, Calculator, \ - FileIOCalculator, all_changes +from ase.calculators.calculator import CalculationFailed, all_changes from ase.calculators.orca import ORCA as ASE_ORCA from ..wfl_fileio_calculator import WFLFileIOCalculator From 25c215bfd3a9aabc322203c3140eb018c90a3149 Mon Sep 17 00:00:00 2001 From: gelzinyte Date: Fri, 16 Aug 2024 01:59:47 +0200 Subject: [PATCH 19/24] minor fixes --- tests/calculators/test_orca.py | 13 ++++++++----- wfl/calculators/orca/__init__.py | 1 - 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/calculators/test_orca.py b/tests/calculators/test_orca.py index 3be0fc84..91190258 100644 --- a/tests/calculators/test_orca.py +++ b/tests/calculators/test_orca.py @@ -30,12 +30,12 @@ from ase.config import cfg as ase_cfg -aims_prerequisites = pytest.mark.skipif( +orca_prerequisites = pytest.mark.skipif( condition = 'orca' not in ase_cfg.parser , reason='Missing "orca" in ase\'s configuration file.' ) - +@orca_prerequisites def test_orca_is_converged(tmp_path): """function to check convergence from orca's output.""" @@ -63,7 +63,7 @@ def test_orca_is_converged(tmp_path): with pytest.raises(CalculationFailed): at.get_potential_energy() - +@orca_prerequisites def test_full_orca(tmp_path): atoms = Atoms("H2", positions=[(0, 0, 0), (0, 0, 0.9)]) @@ -115,7 +115,7 @@ def test_full_orca(tmp_path): ref_dipole = np.array([ 0., 0., -0.43402056]) assert dipole == approx(ref_dipole) - +@orca_prerequisites def test_orca_with_generic(tmp_path): home_dir = tmp_path / "home_dir" @@ -136,6 +136,7 @@ def test_orca_with_generic(tmp_path): assert "orca_energy" in at.info or "orca_calculation_failed" in at.info +@orca_prerequisites def test_orca_geometry_optimisation(tmp_path): home_dir = tmp_path / "home_dir" @@ -159,6 +160,7 @@ def test_orca_geometry_optimisation(tmp_path): assert pytest.approx(out.get_distance(0, 1), abs=0.03) == 0.76812058465248 +@orca_prerequisites def test_post_processing(tmp_path): home_dir = tmp_path / "home_dir" @@ -195,7 +197,7 @@ def simplest_orca_post(orca_calc): with open(post_fn, "w") as f: f.write("Dummy file generated after ORCA execution\n") - +@orca_prerequisites @pytest.mark.skipif("JANPA_HOME_DIR" not in os.environ, reason="JANPA_HOME_DIR is not set") def test_run_npa(tmp_path): @@ -263,6 +265,7 @@ def test_run_npa(tmp_path): [-5.59691e-01, 1.79000e-02, -0.0], [-5.63437e-01, 1.75500e-02, -0.0]]])} +@orca_prerequisites @pytest.mark.skip(reason="Normal mode (eigenvector) reading implemented incorrectly.") def test_read_frequencies(): mol = molecule("CH4") diff --git a/wfl/calculators/orca/__init__.py b/wfl/calculators/orca/__init__.py index ceaa2c22..c8075348 100644 --- a/wfl/calculators/orca/__init__.py +++ b/wfl/calculators/orca/__init__.py @@ -58,7 +58,6 @@ class ORCA(WFLFileIOCalculator, ASE_ORCA): # to override that function's built-in default of 10 wfl_generic_default_autopara_info = {"num_inputs_per_python_subprocess": 1} - # EG where should this be? default_params = dict(charge=0, orcasimpleinput='engrad B3LYP def2-TZVP', orcablocks='%pal nprocs 1 end') From 522b416778254bb6fd02aef25af20c171264d125 Mon Sep 17 00:00:00 2001 From: gelzinyte Date: Fri, 16 Aug 2024 14:46:29 +0200 Subject: [PATCH 20/24] remove ase 3.22 dependencies --- tests/calculators/test_castep.py | 1 - wfl/calculators/castep.py | 47 ++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/tests/calculators/test_castep.py b/tests/calculators/test_castep.py index cc8cef6c..d2b39832 100644 --- a/tests/calculators/test_castep.py +++ b/tests/calculators/test_castep.py @@ -12,7 +12,6 @@ pytestmark = pytest.mark.skipif("CASTEP_COMMAND" not in os.environ, reason="'CASTEP_COMMAND' not given.") - def test_castep_calculation(tmp_path): atoms = bulk("Al", "bcc", a=4.05, cubic=True) diff --git a/wfl/calculators/castep.py b/wfl/calculators/castep.py index 6751c350..4f61bf53 100644 --- a/wfl/calculators/castep.py +++ b/wfl/calculators/castep.py @@ -4,9 +4,6 @@ from copy import deepcopy -from packaging.version import Version - -import ase from ase.calculators.calculator import all_changes from ase.calculators.castep import Castep as ASE_Castep @@ -44,19 +41,22 @@ class Castep(WFLFileIOCalculator, ASE_Castep): **kwargs: arguments for ase.calculators.Castep.Castep """ + implemented_properties = ["energy", "forces", "stress"] # new default value of num_inputs_per_python_subprocess for calculators.generic, # to override that function's built-in default of 10 wfl_generic_default_autopara_info = {"num_inputs_per_python_subprocess": 1} - def __init__(self, keep_files="default", rundir_prefix="run_CASTEP_", - workdir=None, scratchdir=None, - calculator_exec=None, **kwargs): - - if Version(ase.__version__) < Version("3.23"): - raise ImportError(f"The wfl CASTEP calculator is only compatible with ASE v3.23 and higher, " - f"but your ASE version is v{ase.__version__}. Please upgrade") + def __init__( + self, + keep_files="default", + rundir_prefix="run_CASTEP_", + workdir=None, + scratchdir=None, + calculator_exec=None, + **kwargs, + ): kwargs = deepcopy(kwargs) if calculator_exec is not None: @@ -69,11 +69,17 @@ def __init__(self, keep_files="default", rundir_prefix="run_CASTEP_", kwargs["find_pspots"] = True # WFLFileIOCalculator is a mixin, will call remaining superclass constructors for us - super().__init__(keep_files=keep_files, rundir_prefix=rundir_prefix, - workdir=workdir, scratchdir=scratchdir, **kwargs) - - - def calculate(self, atoms=None, properties=_default_properties, system_changes=all_changes): + super().__init__( + keep_files=keep_files, + rundir_prefix=rundir_prefix, + workdir=workdir, + scratchdir=scratchdir, + **kwargs, + ) + + def calculate( + self, atoms=None, properties=_default_properties, system_changes=all_changes + ): """Do the calculation. Handles the working directories in addition to regular ASE calculation operations (writing input, executing, reading_results) Reimplements & extends GenericFileIOCalculator.calculate() for the development version of ASE @@ -90,12 +96,14 @@ def calculate(self, atoms=None, properties=_default_properties, system_changes=a orig_pbc = self.atoms.pbc.copy() try: - super().calculate(atoms=atoms, properties=properties, system_changes=system_changes) + super().calculate( + atoms=atoms, properties=properties, system_changes=system_changes + ) calculation_succeeded = True - if 'DFT_FAILED_CASTEP' in atoms.info: - del atoms.info['DFT_FAILED_CASTEP'] + if "DFT_FAILED_CASTEP" in atoms.info: + del atoms.info["DFT_FAILED_CASTEP"] except Exception as exc: - atoms.info['DFT_FAILED_CASTEP'] = True + atoms.info["DFT_FAILED_CASTEP"] = True calculation_succeeded = False raise exc finally: @@ -115,7 +123,6 @@ def calculate(self, atoms=None, properties=_default_properties, system_changes=a # reset pbc because Castep overwrites it to True self.atoms.pbc = orig_pbc - def setup_calc_params(self, properties): # calculate stress if requested self.param.calculate_stress = "stress" in properties From 605d4ec9ccf87c0f70a71cc818bc583dfc0e25d3 Mon Sep 17 00:00:00 2001 From: Noam Bernstein Date: Tue, 20 Aug 2024 15:37:45 -0400 Subject: [PATCH 21/24] Try to fix sign of scalar diffs and parity quantities in error analysis --- wfl/fit/error.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/wfl/fit/error.py b/wfl/fit/error.py index daeaf50b..a8b43f4d 100755 --- a/wfl/fit/error.py +++ b/wfl/fit/error.py @@ -41,7 +41,8 @@ def calc(inputs, calc_property_prefix, ref_property_prefix, Returns ------- errors: dict of RMSE and MAE for each category and property - diffs: dict with list of differences for each category and property + diffs: dict with list of differences for each category and property (signed for scalar + properties, norms for vectors) parity: dict with "ref" and "calc" keys, each containing list of property values for each category and property, for parity plots """ @@ -188,13 +189,13 @@ def _reshape_normalize(quant, prop, atoms, per_atom): if len(diff.shape) != 2: raise RuntimeError(f"Should never have diff.shape={diff.shape} with dim != 2 (prop {prop + atom_split_index_label})") - # compute norm along vector components - diff = np.linalg.norm(diff, axis=1) - if not per_component: + if diff.shape[1] > 1: + # compute norm along vector components + diff = np.linalg.norm(diff, axis=1) + if not per_component and selected_ref_quant.shape[1] > 1: selected_ref_quant = np.linalg.norm(selected_ref_quant, axis=1) selected_calc_quant = np.linalg.norm(selected_calc_quant, axis=1) - _dict_add([all_diffs, all_weights, all_parity["ref"], all_parity["calc"]], [diff, _promote(weight, diff), selected_ref_quant, selected_calc_quant], at_category, prop + atom_split_index_label) From 26508fc74bad9fbca5b894cf6c72765adbc77558 Mon Sep 17 00:00:00 2001 From: Noam Bernstein Date: Thu, 22 Aug 2024 12:45:27 -0400 Subject: [PATCH 22/24] Add support for stress in wfl.fit.error --- wfl/fit/error.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wfl/fit/error.py b/wfl/fit/error.py index a8b43f4d..e3a29a33 100755 --- a/wfl/fit/error.py +++ b/wfl/fit/error.py @@ -381,16 +381,15 @@ def select_units(prop, plt_type, units_dict=None): "energy/atom": {"parity": ("eV/at", 1.0), "error": ("meV/at", 1.0e3)}, "forces": {"parity": ("eV/Å", 1.0), "error": ("meV/Å", 1.0e3)}, "virial": {"parity": ("eV", 1.0), "error": ("meV", 1.0e3)}, - "virial/atom": {"parity": ("eV/at", 1.0), "error": ("meV/at", 1.0e3)} + "virial/atom": {"parity": ("eV/at", 1.0), "error": ("meV/at", 1.0e3)}, + "stress": {"parity": ("GPa", 1.0), "error": ("MPa", 1.0e3)}, } if units_dict is None: units_dict = {} use_units_dict.update(units_dict) - if "virial" in prop: - prop = re.sub(r"/comp\b", "", prop) + prop = re.sub(r"/comp\b", "", prop) if "forces" in prop: - prop = re.sub(r"/comp\b", "", prop) prop = re.sub(r"/Z_\d+\b", "", prop) if "energy" in prop: From e565988bde316ff8220c23ab1f1b8c833a0b33fd Mon Sep 17 00:00:00 2001 From: JPDarby Date: Tue, 27 Aug 2024 10:00:34 +0100 Subject: [PATCH 23/24] test_calc_generic small changes --- tests/calculators/test_calc_generic.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/calculators/test_calc_generic.py b/tests/calculators/test_calc_generic.py index 5e828a9a..d08c12bb 100644 --- a/tests/calculators/test_calc_generic.py +++ b/tests/calculators/test_calc_generic.py @@ -139,7 +139,6 @@ def test_generic_autopara_defaults(): sys.stderr = sys.__stderr__ assert "num_inputs_per_python_subprocess=3" in l_stderr.getvalue() -@pytest.mark.xfail(reason="Waiting for update to work with ASE3.23") def test_generic_DFT_autopara_defaults(tmp_path, monkeypatch): ats = [Atoms('Al2', positions=[[0,0,0], [1,1,1]], cell=[10]*3, pbc=[True]*3) for _ in range(50)] @@ -151,6 +150,6 @@ def test_generic_DFT_autopara_defaults(tmp_path, monkeypatch): # try with a calculator that overrides an autopara default, namely a DFT calculator # that sets num_inputs_per_python_subprocess=1 sys.stderr = l_stderr - at_proc = generic.calculate(ci, os, Espresso(calculator_exec="_DUMMY_EXEC_", pseudo_dir="_DUMMY_DIR_", workdir=tmp_path)) + at_proc = generic.calculate(ci, os, Espresso(workdir=tmp_path)) sys.stderr = sys.__stderr__ assert "num_inputs_per_python_subprocess=1" in l_stderr.getvalue() From 9defcb23d45933ff582ec4a49748d64222a9ac57 Mon Sep 17 00:00:00 2001 From: JPDarby Date: Wed, 28 Aug 2024 10:18:45 +0100 Subject: [PATCH 24/24] fixed rdkit version to match reference values --- .github/workflows/pytests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index 783e6aed..ceec692d 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -41,7 +41,7 @@ jobs: - name: Install dependencies from pip run: | echo "numpy<2" >> $PIP_CONSTRAINT - python3 -m pip install wheel setuptools numpy scipy click matplotlib pyyaml spglib rdkit flake8 pytest pytest-cov requests + python3 -m pip install wheel setuptools numpy scipy click matplotlib pyyaml spglib rdkit==2024.3.3 flake8 pytest pytest-cov requests - name: Install latest ASE from pypi run: |