Adds a test for DFT-D3 + Dataset
@@ -159,6 +159,35 @@ def test_dataset_compute_response(fractal_compute_server):
assert len(response.ids) == 2
+def test_dataset_d3(fractal_compute_server):
+ testing.check_has_module("psi4")
+ testing.check_has_module("dftd3")
+
+ client = ptl.FractalClient(fractal_compute_server)
+ ds_name = "He_DFTD3"
+ ds = ptl.collections.Dataset(ds_name, client)
+
+ # Add two helium dimers to the DB at 4 and 8 bohr
+ HeDimer = ptl.Molecule.from_data([[2, 0.343, 0, -4.123], [2, 0, 0, 4.123]], dtype="numpy", units="bohr", frags=[1])
+ ds.add_entry("HeDimer", HeDimer)
+ ds.set_default_program("psi4")
+ ds.add_keywords("scf_default", "psi4", ptl.models.KeywordSet(values={}), default=True)
+
+ ds.save()
+
+ ds.compute("B3LYP", "6-31g")
+ ds.compute("B3LYP-D3", "6-31g")
+
+ fractal_compute_server.await_results()
+
+ assert len(ds.list_history()) == 2
+
+ d3 = ds.get_values(method="b3lyp-d3")
+ assert d3.shape == (1, 1)
+ b3lyp = ds.get_values(method="b3lyp")
+ assert d3.iloc[0, 0] != b3lyp.iloc[0, 0]
+
+
def test_reactiondataset_check_state(fractal_compute_server):
client = ptl.FractalClient(fractal_compute_server)
ds = ptl.collections.ReactionDataset("check_state", client, ds_type="ie", default_program="rdkit")
