2021-02-02 13:57:53 +01:00
|
|
|
#!/usr/bin/env python3
|
2021-01-03 18:45:58 +01:00
|
|
|
import numpy as np
|
|
|
|
|
|
|
|
def potential(r):
|
2021-01-26 00:22:37 +01:00
|
|
|
distance = np.sqrt(np.dot(r,r))
|
|
|
|
assert (distance > 0)
|
|
|
|
return -1. / distance
|
2021-01-03 18:45:58 +01:00
|
|
|
|
|
|
|
def psi(a, r):
|
|
|
|
return np.exp(-a*np.sqrt(np.dot(r,r)))
|
|
|
|
|
|
|
|
def kinetic(a,r):
|
2021-01-26 00:22:37 +01:00
|
|
|
distance = np.sqrt(np.dot(r,r))
|
|
|
|
assert (distance > 0.)
|
2021-01-29 13:23:00 +01:00
|
|
|
|
|
|
|
return a * (1./distance - 0.5 * a)
|
2021-01-03 18:45:58 +01:00
|
|
|
|
|
|
|
def e_loc(a,r):
|
|
|
|
return kinetic(a,r) + potential(r)
|
2021-01-12 01:01:52 +01:00
|
|
|
|
|
|
|
def drift(a,r):
|
2021-01-26 13:11:57 +01:00
|
|
|
ar_inv = -a/np.sqrt(np.dot(r,r))
|
|
|
|
return r * ar_inv
|