-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mod: root argument for OverlapCalculator
- all classes deriving from OverlapCalculator now support the 'root' keyword - ORCA sets appropriate iroot, even when keyword is not present in the input - Turbomole and Gaussian are not yet implemented
- Loading branch information
Johannes Steinmetzer
committed
Sep 26, 2023
1 parent
d755903
commit 5c25557
Showing
8 changed files
with
115 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import pytest | ||
|
||
from pysisyphus.calculators.PySCF import PySCF | ||
from pysisyphus.calculators import DFTBp, ORCA | ||
from pysisyphus.testing import using | ||
|
||
|
||
_ROOT_REF_ENERGIES = { | ||
(ORCA, None): -74.4893, | ||
(ORCA, 2): -74.3984, | ||
(PySCF, None): -74.4893, | ||
(PySCF, 2): -74.3714, | ||
(DFTBp, None): -4.077751, | ||
(DFTBp, 2): -3.33313, | ||
} | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"calc_cls, calc_kwargs", | ||
( | ||
pytest.param( | ||
ORCA, | ||
{ | ||
"keywords": f"hf sto-3g", | ||
"blocks": "%tddft tda false nroots 3 end", | ||
}, | ||
marks=(using("orca")), | ||
), | ||
pytest.param( | ||
PySCF, | ||
{ | ||
"basis": "sto3g", | ||
"method": "tddft", | ||
"nroots": 3, | ||
}, | ||
marks=(using("pyscf")), | ||
), | ||
pytest.param( | ||
DFTBp, | ||
{ | ||
"parameter": "mio-ext", | ||
"nroots": 4, | ||
}, | ||
marks=(using("dftbp")), | ||
), | ||
), | ||
) | ||
@pytest.mark.parametrize("root", (None, 2)) | ||
def test_root(calc_cls, calc_kwargs, root): | ||
ref_energy = _ROOT_REF_ENERGIES[(calc_cls, root)] | ||
calc_kwargs.update( | ||
{ | ||
"root": root, | ||
"base_name": f"root_{root}", | ||
"track": True, | ||
} | ||
) | ||
geom = calc_cls.geom_from_fn("lib:h2o.xyz", **calc_kwargs) | ||
energy = geom.energy | ||
assert energy == pytest.approx(ref_energy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters