[CSC 335] Psi Function
Andrew J. Pounds
pounds_aj at mercer.edu
Thu Oct 21 11:05:50 EDT 2021
Some of you have told me that you are struggling with my problem on
HW4. Here is some python code that does 3 point Gauss-Laguerre
integration for that problem. Pay attention to how I scaled things in
the problem...
import math
def fofx(x):
r = x*0.529e-10
Z = 1.0
a0 = 0.529e-10
a = 1.0 / (4.0 * math.sqrt(2.0*math.pi))*math.pow(Z/a0,3.0/2.0)
b = 2.0 - Z/a0*r
c = math.exp(-(Z/a0*r)/2.0)
psi = a*b*c
return psi*psi*math.pow(r,3)
X = [4.15774556783479E-01,
2.29428036027904E+00,
6.28994508293748E+00]
W = [7.11093009929173E-01,
2.78517733569241E-01,
1.03892565015861E-02]
sum = 0.0;
for i in range(0,3):
sum += W[i] * fofx(X[i]) * math.exp(X[i])
print "Value of integral is " + str(sum)
print "Value of expectation value is " + str( sum * 4 * math.pi)
--
*/Andrew J. Pounds, Ph.D./* (pounds_aj at mercer.edu)
<mailto:pounds_aj at mercer.edu>
/Professor of Chemistry and Computer Science/
/Director of the Computational Science Program/
/Mercer University, Macon, GA 31207/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc335/attachments/20211021/da8ae6ce/attachment.html>
More information about the csc335
mailing list