In [1]:

from __future__ import print_function, division
from sympy import symbols
from sympy.core import S, pi, Rational
from sympy.functions import sqrt, exp, factorial, gamma, tanh
from sympy.functions import assoc_laguerre as L
from sympy.functions import assoc_legendre as P
from sympy.physics.quantum.constants import hbar

from sympy import init_printing
init_printing()



## Morse potential

The Morse potential is given by

$$V(x) = D_e [1 - e^{-a(r-r_e)}])$$


In [2]:

x, lam = symbols("x lambda")
n = symbols("n", integer=True)




In [3]:

def morse_psi_n(n, x, lam, xe):
Nn = sqrt((factorial(n)*(2*lam - 2*n - 10))/gamma(2*lam - n))
z = 2*lam*exp(-(x - xe))
psi = Nn*z**(lam - n -S(1)/2) * exp(-S(1)/2*z) * L(n, 2*lam - 2*n - 1, z)
return psi




In [4]:

def morse_E_n(n, lam):
return 1 - 1/lam**2*(lam - n - S(1)/2)**2




In [5]:

morse_E_n(0, lam)




Out[5]:

$$1 - \frac{1}{\lambda^{2}} \left(\lambda - \frac{1}{2}\right)^{2}$$




In [6]:

from sympy.functions import cosh



## Pöschl-Teller potential

The Pösch-Teller potential is given by

$$V(x) = -\frac{\lambda(\lambda + 1)}{2} \operatorname{sech}^2(x)$$


In [7]:

def posch_teller_psi_n(n, x, lam):
psi = P(lam, n, tanh(x))
return psi




In [8]:

posch_teller_psi_n(n, x, lam)




Out[8]:

$$P_{\lambda}^{\left(n\right)}\left(\tanh{\left (x \right )}\right)$$




In [9]:

def morse_E_n(n, lam):
if n <= lam:
return -n**2/ 2
else:
raise ValueError("Lambda should not be greater than n.")




In [10]:

morse_E_n(5, 6)




Out[10]:

$$-12.5$$



### References

• Pöschl, G.; Teller, E. (1933). "Bemerkungen zur Quantenmechanik des anharmonischen Oszillators". Zeitschrift für Physik 83 (3–4): 143–151. doi:10.1007/BF01331132.

• Siegfried Flügge Practical Quantum Mechanics (Springer, 1998) Lekner, John (2007). "Reflectionless eigenstates of the sech2 potential". American Journal of Physics 875 (12): 1151–1157. doi:10.1119/1.2787015.



In [ ]:




In [11]:

from IPython.core.display import HTML
def css_styling():
styles = open('./styles/custom_barba.css', 'r').read()
return HTML(styles)
css_styling()




Out[11]:

/* Based on Lorena Barba template available at: https://github.com/barbagroup/AeroPython/blob/master/styles/custom.css*/
@font-face {
font-family: "Computer Modern";
src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');
}
div.cell{
width:800px;
margin-left:16% !important;
margin-right:auto;
}
h1 {
font-family: 'Alegreya Sans', sans-serif;
}
h2 {
font-family: 'Fenix', serif;
}
h3{
font-family: 'Fenix', serif;
margin-top:12px;
margin-bottom: 3px;
}
h4{
font-family: 'Fenix', serif;
}
h5 {
font-family: 'Alegreya Sans', sans-serif;
}
div.text_cell_render{
font-family: 'Alegreya Sans',Computer Modern, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
line-height: 135%;
font-size: 120%;
width:600px;
margin-left:auto;
margin-right:auto;
}
.CodeMirror{
font-family: "Source Code Pro";
font-size: 90%;
}
/* .prompt{
display: None;
}*/
.text_cell_render h1 {
font-weight: 200;
font-size: 50pt;
line-height: 100%;
color:#CD2305;
margin-bottom: 0.5em;
margin-top: 0.5em;
display: block;
}
.text_cell_render h5 {
font-weight: 300;
font-size: 16pt;
color: #CD2305;
font-style: italic;
margin-bottom: .5em;
margin-top: 0.5em;
display: block;
}
.warning{
color: rgb( 240, 20, 20 )
}

MathJax.Hub.Config({
TeX: {
extensions: ["AMSmath.js"]
},
tex2jax: {
inlineMath: [ ['$','$'], ["\$","\$"] ],
displayMath: [ ['$$','$$'], ["\$","\$"] ]
},
displayAlign: 'center', // Change this to 'center' to center equations.
"HTML-CSS": {
styles: {'.MathJax_Display': {"margin": 4}}
}
});