12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

thermodynamic simulations & feynman quantum path integration 423trapezoid integration. As can be seen, the agreement between the analytic resultand the path integration is satisfactory.✞/ / QMCbouncer . java : quantum bouncer wavefunction via path integration/ / Author : Oscar Restrepo , Universidad de Antioquiaimport java . io .∗ ;import java . util .∗ ;public class QMCbouncer {static int max = 300000, N = 100; // Trajectories , arraystatic double dt = 0.05 , g = 2.0; / / Time step , gravitypublic static void main ( String [] argv ) throws IOException , FileNotFoundException {PrintWriter q = new PrintWriter (new FileOutputStream ("bouncer . dat") , true );double change , newE, oldE , norm , h , firstlast , maxx , path [] = new double [101];int prop [ ] = new int [201] , i , j , element , ele , maxel ; // Probabilitiesh=0.00;for ( j = 0; j 0.) { // No negative pathspath [ element ] += change ;newE = energy ( path ) ;// New trajectory Eif (newE>oldE && Math . exp(−newE+oldE ) = maxel ) maxel=ele ; // Scale change 0 to Nif ( element !=0 ) prop [ ele ]++;oldE = newE ; // For next cicle} } }maxx =0.0;for ( i = 1; i < N; i++ ) if ( path [ i ] >= maxx ) maxx=path [ i ] ; / / Normnorm = 0 . ;h = maxx/maxel ;firstlast = h∗0.5∗ ( prop [0] + prop [ maxel ] ) ;for ( i =1; i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!