Skip to content

Commit 966d929

Browse files
committed
Updated orbital to support cardinal
2 parents 33c21a1 + f6f5f9f commit 966d929

7 files changed

Lines changed: 534 additions & 271 deletions

File tree

exatomic/algorithms/basis.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ def normalize(alpha, l, m, n):
179179
fac2(2 * n - 1)) ** (0.5)
180180
return prefac * numer / denom
181181

182+
def sloppy_normalize(alpha, L):
183+
prefac = (2 / np.pi) ** (0.75)
184+
numer = 2 ** (L) * alpha ** ((L + 1.5) / 2)
185+
denom = (fac2(2 * L - 1)) ** (0.5)
186+
return prefac * numer / denom
187+
182188
def _vec_fac(n):
183189
return fac(n)
184190

@@ -193,9 +199,16 @@ def _vec_normalize(alpha, l, m, n):
193199
_vec_fac2(2 * n - 1)) ** (0.5)
194200
return prefac * numer / denom
195201

202+
def _vec_sloppy_normalize(alpha, L):
203+
prefac = (2 / np.pi) ** (0.75)
204+
numer = 2 ** (L) * alpha ** ((L + 1.5) / 2)
205+
denom = (_vec_fac2(2 * L - 1)) ** (0.5)
206+
return prefac * numer / denom
207+
196208
def _overlap(x1, x2, y1, y2, z1, z2, l1, l2, m1, m2, n1, n2, N1, N2, alpha1, alpha2):
197209
'''
198-
Pardon my Fortran.
210+
Pardon the Fortran style that follows. This was translated from the snafu
211+
electronic structure software package.
199212
'''
200213
s12 = 0.
201214
tol = 1e-8
@@ -343,9 +356,11 @@ def _wrap_overlap(x, y, z, l, m, n, N, alpha):
343356
fac = jit(nopython=True)(fac)
344357
fac2 = jit(nopython=True)(fac2)
345358
normalize = jit(nopython=True)(normalize)
359+
sloppy_normalize = jit(nopython=True)(sloppy_normalize)
346360
_vec_fac = vectorize(['int64(int64)'])(_vec_fac)
347361
_vec_fac2 = vectorize(['int64(int64)'])(_vec_fac2)
348362
_vec_normalize = vectorize(['float64(float64,int64,int64,int64)'])(_vec_normalize)
363+
_vec_sloppy_normalize = vectorize(['float64(float64,int64)'])(_vec_sloppy_normalize)
349364
_overlap = vectorize(['float64(float64,float64,float64,float64,float64,float64,int64, \
350365
int64,int64,int64,int64,int64,float64,float64,float64,float64)'])(_overlap)
351366
_wrap_overlap = jit()(_wrap_overlap)

exatomic/algorithms/delocalization.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def compute_deloc(cat, neut, an, tag='', debug=False, jtype=None):
8585
cat (exatomic.Universe): N-1 electron system
8686
neut (exatomic.Universe): N electron system
8787
an (exatomic.Universe): N+1 electron system
88+
debug (bool): verbose printing
89+
jtype (str): 'IP' or 'EA' if not both
8890
8991
Returns
9092
ret (pd.DataFrame): The energy as a function of N

0 commit comments

Comments
 (0)