reset # define energy resolution eps = 0.1 #e-01 # define poisson distribution p(n, l) = exp(-l) * (l**n) / gamma(n+1) # define gaussian to model delta function with finite energy resolution eps g(n, w, w_qho) = exp(-0.5 * (w - n*w_qho)**2 / (eps**2)) / sqrt(2*pi*eps**2) # define dos for different orders of perturbation theory dos0(n, w, w_qho) = g(n, w, w_qho) dos1(n, w, w_qho) = 0.5 * (g(n+1, w, w_qho) + g(n-1, w, w_qho)) # we want a sum which we define recursively until n_max, dos is a function evaluating the density of states as function of frequency sum0(n, l, w, w_qho) = (n