1
0
mirror of https://github.com/TREX-CoE/qmc-lttc.git synced 2024-10-05 15:56:17 +02:00
qmc-lttc/energy_hydrogen.py

30 lines
575 B
Python
Raw Normal View History

#!/usr/bin/env python3
2021-01-03 18:45:58 +01:00
import numpy as np
from hydrogen import e_loc, psi
2021-01-12 01:01:52 +01:00
interval = np.linspace(-5,5,num=50)
delta = (interval[1]-interval[0])**3
2021-01-03 18:45:58 +01:00
2021-01-12 01:01:52 +01:00
r = np.array([0.,0.,0.])
2021-01-03 18:45:58 +01:00
2021-01-12 01:01:52 +01:00
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.
2021-01-12 01:01:52 +01:00
norm = 0.
2021-01-29 13:23:00 +01:00
2021-01-25 23:52:53 +01:00
for x in interval:
r[0] = x
for y in interval:
r[1] = y
for z in interval:
r[2] = z
2021-01-29 13:23:00 +01:00
2021-01-25 23:52:53 +01:00
w = psi(a,r)
w = w * w * delta
2021-01-29 13:23:00 +01:00
2021-01-25 23:52:53 +01:00
E += w * e_loc(a,r)
norm += w
2021-01-29 13:23:00 +01:00
2021-01-12 01:01:52 +01:00
E = E / norm
print(f"a = {a} \t E = {E}")