From dd2367feb49c21425d6d6327133964342b7bf823 Mon Sep 17 00:00:00 2001 From: "Grace@Work" Date: Thu, 15 Aug 2024 12:42:32 -0700 Subject: [PATCH] enable SMD option in opt_driver (#196) * enable thermo calculation and save to h5 * revise format * correct mistake * save * update h.kernel() to one time usage * enable SMD and add e_solvent into results * set thermo to False * enable SMD in geo-opt driver --------- Co-authored-by: xiaojie.wu --- gpu4pyscf/drivers/opt_driver.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gpu4pyscf/drivers/opt_driver.py b/gpu4pyscf/drivers/opt_driver.py index a75044be..9551e48c 100644 --- a/gpu4pyscf/drivers/opt_driver.py +++ b/gpu4pyscf/drivers/opt_driver.py @@ -84,11 +84,18 @@ def opt_mol(mol_name, config, constraints, charge=None, spin=0): mf = mf.to_gpu() mf.chkfile = None - if with_solvent: + + if with_solvent and config['solvent']['method'].endswith(('PCM', 'pcm')): mf = mf.PCM() mf.with_solvent.lebedev_order = 29 mf.with_solvent.method = config['solvent']['method'].replace('PCM','-PCM') mf.with_solvent.eps = config['solvent']['eps'] + + if with_solvent and config['solvent']['method'].endswith(('smd', 'SMD')): + mf = mf.SMD() + mf.with_solvent.lebedev_order = 29 + mf.with_solvent.method = 'SMD' + mf.with_solvent.solvent = config['solvent']['solvent'] mf.direct_scf_tol = 1e-14 mf.chkfile = None