In [1]:

from sympy import *
init_printing() # For Sympy
from IPython.display import display



## Simple Pade form for the Jastrow factor.

The value of $A$ is fixed by the cusp condition at $r=0$.



In [2]:

A, B, r = symbols('A B r')
u = A*r/(1.0 + B*r) - A/B
sym_u = Symbol('u')
display(Eq(sym_u,u))




$$u = \frac{A r}{B r + 1.0} - \frac{A}{B}$$




In [3]:

# Symbolic derivatives
du = diff(u, r)
du = simplify(du)
sym_du = Symbol('du')/Symbol('dr')
display(Eq(sym_du, du))
ddu = simplify(diff(u, r, 2))
sym_ddu = Symbol('d^2')*Symbol('u')/Symbol('dr^2')
display(Eq(sym_ddu, ddu))




$$\frac{du}{dr} = \frac{1.0 A}{\left(B r + 1.0\right)^{2}}$$

$$\frac{d^{2} u}{dr^{2}} = - \frac{2.0 A B}{\left(B r + 1.0\right)^{3}}$$




In [4]:

# Substitute concrete values to evaluate
vals = {A:-0.25, B: 0.1, r:1.0}
display(Eq(sym_u, u.subs(vals)))
display(Eq(sym_du, du.subs(vals)))
display(Eq(sym_ddu, ddu.subs(vals)))




$$u = 2.27272727272727$$

$$\frac{du}{dr} = -0.206611570247934$$

$$\frac{d^{2} u}{dr^{2}} = 0.0375657400450789$$




In [ ]: