/* Path Integral Monte Carlo code developed by A. Balaz 
   (antun@ipb.ac.rs) for papers:
         
   "Systematic Speedup in the Convergence of Path Integrals"
   by A. Bogojevic, A. Balaz, and A. Belic
   Phys. Rev. Lett. 94 (2005) 180403

   "Fast Converging Path Integrals for Time-Dependent Potentials"
   by A. Balaz, I. Vidanovic, A. Bogojevic, A, Pelster
   arXiv:0912.2743

   Address: Institute of Physics, Belgrade, Serbia
   Scientific Computing Laboratory, http://www.scl.rs/speedup/

   Public use and modification of this code is allowed providing 
   the above paper is properly acknowledged. The author would be 
   grateful for all information and/or comments regarding the use   
   of the code.  
*/

This serial code gives a Monte Carlo simulation that calculates imaginary time amplitudes 
for the transition from a at the moment ta to b in the moment tb for generic thery.
The Planck constant hbar=1.  Trajectories are generated using the bisection method.
The variable s determines the level of bisection, i.e. time discretization N takes the
values 2^0, 2^1, ..., 2^s.

The user configurable section is in file p.c. In it users need to define the level
parameter p (1 <= p <= 8) and to supply the potential V and its derivatives. 

COMPILING:

1) Supply the appropriate level p (by adjusting #define statement) and function V0() in file p.c.
2) A typical serial compiling line (e.g. for level p=2) looks like:             

   cc -O5 -o speedup-p4 main.c p.c nr.c -lm -lsprng -I.

   Note that you need to have installed SPRNG libraries, http://sprng.cs.fsu.edu/  
   (The above example [-lsprng] is for the case of system wide installation of SPRNG. 
   In the case of a custom installation this needs to be changed appropriatel.)

USAGE: 

./speedup-p4 ta a tb b s Nmc seed par[0] ...

speedup-p4 is the compile name of the simulation working at level p=2.

ta is the initial time
a is the position at time t=ta
tb is the final time.
b is the position at time t=tb
s is the bisection level.
Nmc is the number of Monte Carlo samples used.
seed is seed value used by the SPRNG (random number generator).
par[0], ... are additional parameters defining the potential 
(initialize as many as needed and use them in the same order
in the user supplied function V0 in file p.c).
