Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dpdata/formats/psi4/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}}
set basis {basis:s}
set gradient_write on
G, wfn = gradient("WB97M-D3BJ", return_wfn=True)
G, wfn = gradient("{method:s}", return_wfn=True)
wfn.energy()
wfn.gradient().print_out()
"""
Expand Down
9 changes: 9 additions & 0 deletions tests/test_psi4.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,12 @@ def test_psi4_input(self):
"""
),
)

def test_psi4_input_uses_requested_method(self):
system = dpdata.LabeledSystem("psi4/psi4.out", fmt="psi4/out")
with tempfile.NamedTemporaryFile("r") as f:
system.to_psi4_inp(f.name, method="hf", basis="sto-3g")
content = f.read()

self.assertIn('G, wfn = gradient("hf", return_wfn=True)', content)
self.assertNotIn('G, wfn = gradient("WB97M-D3BJ", return_wfn=True)', content)
Loading