(*

This code is written by Antun Balaz (antun@ipb.ac.rs) and Ivana Vidanovic (ivanavi@ipb.ac.rs) from the Scientific Computing Laboratory of the Institute of Physics Belgrade, http://www.scl.rs/

The code calculates single-particle one-dimensional effective potential W[x, xbar; eps] to level eps^(p-1) for time independent potential V[x]. he use of level p effective potential for calculation of short-time amplitudes leads to substantially reduces errors, proportional to eps^(p+1-Pd/2), where P is the number of particles, and d is spatial dimensionality. For the case P=d=1 considered in this file, the errors are proportional to eps^(p+1/2). In Path-Integral Monte Carlo calculations of transition amplitudes, the error is proportional to 1/N^p, where N is the number of time steps used in the discretization. The effective potential is defined as

W[x, xbar, eps] = Sum[c[m,k] eps^(m-k) xbar^(2k), {m, 0, p-1}, {k, 0, m}] ,

and the coefficients c[m, k] are calculated by iterating the recursion given in Eq. (14) from the paper "Recursive Schroedinger Equation Approach to Faster Converging Path Integrals" by A. Balaz, A. Bogojevic, I. Vidanovic, and A. Pelster, Phys. Rev. E 79, 036701 (2009), available from http://arxiv.org/abs/0806.4774

The effective actions up to the level p=35 are available in the file EffectiveAction-1d-p35.m from http://www.scl.rs/speedup/

*)

p = 35;
CurrentTime = FromDate[Date[]];
StartTime = CurrentTime;
c[i_, j_]=0;
For[m = 0, m < p, m++, c[m, m]=D[V[x], {x, 2 m}] / (2 m+1)!; For[k = m-1, k ≥ 0, k--, c[m, k]=Expand[((2 k+2) (2 k+1) c[m, k+1] + D[c[m-1, k],{x, 2}] - 
Sum[ D[c[l, r], {x, 1}] D[ c[m-l-2, k-r], {x, 1}], {l, 0, m-2}, {r, Max[0, k-m+l+2], Min[k, l]}] - 
Sum[2 r (2 k - 2 r + 2)  c[l, r] c[m-l-1, k-r+1], {l, 1, m-2}, {r, Max[0, k-m+l+2], Min[k, l]}]) / (8 (m+k+1))]];
Print["p = ",m+1," contribution calculated."]; CalculationEndTime=FromDate[Date[]]; CalculationTime=CalculationEndTime-StartTime; Print["Calculation time = ",CalculationTime," seconds."]; Print["Memory used: ",N[MaxMemoryUsed[]/1024/1024]," MB"]; Print[]]

(* To save the output of p=35 calculation to a file, the following command was used: *)
Definition[c] >>> "EffectiveAction-1d-p35.m";

(* Level p effective potential. *)
W[p, x_, xbar_, eps_] = Sum[c[m,k] eps^(m-k) xbar^(2k),{m,0,p-1},{k,0,m}]