2021-02-02 13:57:53 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2021-01-03 18:45:58 +01:00
|
|
|
import numpy as np
|
|
|
|
from hydrogen import e_loc, psi
|
|
|
|
|
|
|
|
interval = np.linspace(-5,5,num=50)
|
2021-04-25 20:02:47 +02:00
|
|
|
print(interval
|
|
|
|
)
|
2021-01-29 13:23:00 +01:00
|
|
|
|
2021-01-03 18:45:58 +01:00
|
|
|
delta = (interval[1]-interval[0])**3
|
|
|
|
|
|
|
|
r = np.array([0.,0.,0.])
|
|
|
|
|
|
|
|
for a in [0.1, 0.2, 0.5, 0.9, 1., 1.5, 2.]:
|
2021-01-29 13:23:00 +01:00
|
|
|
E = 0.
|
|
|
|
E2 = 0.
|
2021-01-03 18:45:58 +01:00
|
|
|
norm = 0.
|
2021-01-29 13:23:00 +01:00
|
|
|
|
2021-01-03 18:45:58 +01:00
|
|
|
for x in interval:
|
|
|
|
r[0] = x
|
2021-01-29 13:23:00 +01:00
|
|
|
|
2021-01-03 18:45:58 +01:00
|
|
|
for y in interval:
|
|
|
|
r[1] = y
|
2021-01-29 13:23:00 +01:00
|
|
|
|
2021-01-03 18:45:58 +01:00
|
|
|
for z in interval:
|
|
|
|
r[2] = z
|
2021-01-29 13:23:00 +01:00
|
|
|
|
|
|
|
w = psi(a,r)
|
2021-01-03 18:45:58 +01:00
|
|
|
w = w * w * delta
|
2021-01-29 13:23:00 +01:00
|
|
|
|
|
|
|
e_tmp = e_loc(a,r)
|
|
|
|
E += w * e_tmp
|
|
|
|
E2 += w * e_tmp * e_tmp
|
2021-01-03 18:45:58 +01:00
|
|
|
norm += w
|
2021-01-29 13:23:00 +01:00
|
|
|
|
|
|
|
E = E / norm
|
2021-01-20 18:31:49 +01:00
|
|
|
E2 = E2 / norm
|
2021-01-29 13:23:00 +01:00
|
|
|
|
2021-04-25 20:02:47 +02:00
|
|
|
s2 = E2 #- E**2
|
2021-01-29 13:23:00 +01:00
|
|
|
print(f"a = {a} \t E = {E:10.8f} \t \sigma^2 = {s2:10.8f}")
|