From 40680558f1567e003f32061ea6d1ed02375ca99e Mon Sep 17 00:00:00 2001 From: kylebystrom Date: Fri, 16 Feb 2024 17:12:29 -0500 Subject: [PATCH] draft ability to call new_scf --- orchard/pyscf_caller.py | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/orchard/pyscf_caller.py b/orchard/pyscf_caller.py index 1be98f0..bc118f8 100644 --- a/orchard/pyscf_caller.py +++ b/orchard/pyscf_caller.py @@ -106,16 +106,30 @@ def setup_calc(atoms, settings): ) elif is_cider and (not is_jax): - # TODO grid level settings - from ciderpress.dft.ri_cider import setup_cider_calc - import joblib - mlfunc_filename = settings['cider'].pop('mlfunc_filename') - calc = setup_cider_calc( - mol, - joblib.load(mlfunc_filename), - spinpol=settings['control']['spinpol'], - **(settings['cider']), - ) + if 'use_new_scf' in settings['cider']: + use_new = settings['cider'].pop('use_new_scf') + else: + use_new = False + if use_new: + from ciderpress.pyscf.dft import make_cider_calc + calc = dft.UKS(mol) if settings['control']['spinpol'] else dft.RKS(mol) + mlfunc_filename = settings['cider'].pop('mlfunc_filename') + calc = make_cider_calc( + calc, + mlfunc_filename, + **(settings['cider']) + ) + else: + # TODO grid level settings + from ciderpress.dft.ri_cider import setup_cider_calc + import joblib + mlfunc_filename = settings['cider'].pop('mlfunc_filename') + calc = setup_cider_calc( + mol, + joblib.load(mlfunc_filename), + spinpol=settings['control']['spinpol'], + **(settings['cider']), + ) elif (not is_cider) and is_jax: from ciderpress.dft.jax_ks import setup_jax_exx_calc calc = setup_jax_exx_calc(