 -- Example with the 1D harmonic oscillator code --

 * This gives an example of a Hydrogen atom in a 1D harmonic potential well.
   This uses the Lin Lin end-to-end distribution estimator to calculate the
   momentum distribution of a harmonic oscillator.

   The input file is set up so that t = hbar*beta*omega = 2, where omega is the
   vibrational frequency of the harmonic oscillator, if the spring constant
   of the harmonic oscillator is set to k = 1.

   If we call the end-to-end distribution n(u), where u is the path opening
   vector, and the free particle part n0(u), then the analytical result is:

   n(u) = n0(u)*n1(u)
   where n0(u) = exp(-m*u**2/(2*beta*hbar**2))
   and n1(u) = exp(-0.5*beta*k*u**2*(t*coth(t/2)-2)/(2*t**2))

 * For demonstration purposes, two values of u have been chosen such that 
   n(u1) = 0.8 and n(u2) = 0.4 using the formula above

 * To run, first compile the driver code in drivers/. This should be as 
   simple as: 

$ make

 * Next, source the env.sh file in the i-pi root.

$ source i-pi-root/env.sh

** Run the examples automatically:
 
 * A Makefile is provided to run this example. To run simply use:

$ make harmonic

 * To clean up output files:

$ make clean


** Run the examples manually:

 * Go to the i-pi root directory and from there

$ source env.sh

 * Go back to the example directory and run

$ i-pi input.xml
 
   the wrapper will start and sit waiting on the UDS /tmp/ipi
 
 * Open a separate terminal and run the harmonic oscillator driver code 
 
$ i-pi-driver -u -h harmonic -m harm -o 1

   You can run multiple instances of the code; it is so fast that parallel 
   scaling won't be appreciable.

 * If your system does not support Unix domain sockets, just set in input.xml
   <socket mode="inet"> <port> port_no </port>

  then run the driver as:

$ i-pi-driver -h harmonic -m harm -o 1 -p port_no

 * You can also compare the Fortran and Python drivers, running the same i-PI input but using respectively

$ i-pi-driver -u -h harmonic -m harm3d -o 1

or

$ driver.py -u -a harmonic -m harmonic
