Skip to content

Commit

Permalink
TODO: ORCA auto ABS
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Aug 27, 2024
1 parent fb63491 commit 0e16554
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pyscf/df/addons.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Author: Qiming Sun <[email protected]>
#


import sys
import numpy
from pyscf.lib import logger
Expand Down Expand Up @@ -119,8 +120,8 @@ def aug_etb_for_dfbasis(mol, dfbasis=DFBASIS, beta=ETB_BETA,
emax_by_l = [emax[liljsum==ll].max() for ll in range(l_max1*2-1)]
emin_by_l = [emin[liljsum==ll].min() for ll in range(l_max1*2-1)]
# Tune emin and emax
emin_by_l = numpy.array(emin_by_l) * 2 # *2 for alpha+alpha on same center
emax_by_l = numpy.array(emax_by_l) * 2 #/ (numpy.arange(l_max1*2-1)*.5+1)
emin_by_l = numpy.array(emin_by_l) * 2
emax_by_l = numpy.array(emax_by_l) * 2

ns = numpy.log((emax_by_l+emin_by_l)/emin_by_l) / numpy.log(beta)
etb = []
Expand Down Expand Up @@ -187,6 +188,7 @@ def make_auxbasis(mol, mp2fit=False):
logger.debug(mol, ' ETB auxbasis for %s %s', k, auxbasis[k])
return auxbasis

# TODO: add auxbasis keyword etb and auto
def make_auxmol(mol, auxbasis=None):
'''Generate a fake Mole object which uses the density fitting auxbasis as
the basis sets. If auxbasis is not specified, the optimized auxiliary fitting
Expand All @@ -197,7 +199,6 @@ def make_auxmol(mol, auxbasis=None):
even-tempered Gaussian basis set will be generated.
See also the paper JCTC, 13, 554 about generating auxiliary fitting basis.
JCP, 127, 074102
Kwargs:
auxbasis : str, list, tuple
Expand Down
25 changes: 25 additions & 0 deletions pyscf/df/auto_basis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'''
JCTC, 13, 554
'''

f = [20, 4.0, 4.0, 3.5, 2.5, 2.0, 2.0]
beta_big = [1.8, 2.0, 2.2, 2.2, 2.2, 2.3, 3.0, 3.0]
beta_small = 1.8

def auto_basis(mol, l_inc=1):
l_val = highest_l_in_occupied_shell
l_max = max(mol._bas[:,0])
l_max_aux = max(l_val*2, l_max+l_inc)

a_min_aux = a_min[:,None] + a_min
a_max_aux = a_min[:,None] + a_min
r_exp = _gaussian_int(a, l)
a_max_eff = 2 * k(l)**2 / (np.pi * r_exp)
a_max_eff_aux = a_max_eff[:,None] + a_max_eff
a_max_aux = ([max(f[l] * a_max_eff_aux, a_max_aux) for l in range(2*l_val+1)] +
a_max_aux[2*l_val+1:])

beta = list(beta_big)
beta[:2*l_val] = beta_small

ns = np.log(a_max_aux/a_min_aux) / beta

0 comments on commit 0e16554

Please sign in to comment.