There are several ways to plot Morse potential (see this question) and other smart solutions to plot the quantum harmonic oscillator wave functions on a parabola (see this other question).
So far I copied the solution for the Morse potential as it looked very nice (I prefer when the machine execute loop instead of me coping 100 wave functions by hand):
% ... %
\usepackage{tikz}
\usetikzlibrary{intersections}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
% ... %
\begin{tikzpicture}
%%%%%%% Define Potential Function %%%%%%%
\pgfmathsetmacro{\De}{6}
\pgfmathsetmacro{\Ro}{1}
\pgfmathsetmacro{\alpha}{1}
\pgfmathdeclarefunction{V}{1}{%
\pgfmathparse{%
\De*((1-exp(-\alpha*(#1-\Ro)))^2-1)%
}%
}%
%%%%%%% Energy Levels %%%%%%%
\pgfmathdeclarefunction{energy}{1}{%
\pgfmathparse{%
-\De+(#1+.5) - (#1+.5)^2/(4*\De)
}%
}%
\begin{axis}[
axis lines=none,
smooth,
no markers,
domain=0:8,
ymax=6,
scale=1.5
]
\addplot [red, samples=50, name path global=MorseCurve] {V(x)};
\pgfplotsinvokeforeach{0,1,2,3,4,5,6, 7, 8, 9, 10, 11, 12}{
\path [name path global=HelperLine-#1] (axis cs: 0,{energy(#1)}) -- (axis cs: 10, {energy(#1)});
\draw[name intersections={of=MorseCurve and HelperLine-#1}] (intersection-1) -- (intersection-2);
}
\end{axis}
\end{tikzpicture}
% ... %
Since I would like to represent the Franck-Condon principle, what I'm looking for is a way to merge the two things, the quantum harmonic oscillator anche the morse potential, so that I could achieve something like
I really would like to keep everything in a for loop-like structure, but I understand that it's impossible to compute Hermite polynomials with LaTeX (isn't it?) so maybe a labelling with the numbers of \pgfplotsinvokeforeach
would even be a great step forward.
Any idea?
EDIT 1
The first 4 functions are (as requested)
H_1(x) = exp(-x^2/2)
H_2(x) = 2*x * exp(-x^2/2)
H_3(x) = (4*x^2-2) * exp(-x^2/2)
H_4(x) = (-12*x+8*x^3) * exp(-x^2/2)
...
The polynomial part are the Hermite polynomials, while the exponential part it just remains the same. Here I computed them with Mathematica up to 10:
V
function, right? Please also provide this value or directly shift the x values in the data table.