Batista_AIMD_Solutions

# Batista_AIMD_Solutions - 2006 Summer School on...

This preview shows pages 1–5. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2006 Summer School on Computational Materials Science Lecture Notes: Ab Initio Molecular Dynamics Simulation Methods in Chemistry Victor S. Batista * Yale University, Department of Chemistry, P.O.Box 208107, New Haven, Connecticut 06520-8107, U.S.A. I Solutions to Problems Problem 1: In order to visualize the output of this program, cut the source code attached below, save it in a file named Problem1.f, compile it by typing f77 Problem1.f -o Problem1 run it by typing ./Problem1 Visualize the output as follows: type gnuplot then type plot ‘‘arch.0000’’ That will show the representation of the Gaussian state, introduced in Eq. (6) in terms of an array of numbers associated with a grid in coordinate space. To exit, type quit * E-mail: [email protected] 1 PROGRAM Problem_1 call Initialize() CALL SAVEWF(0) END cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc SUBROUTINE Initialize() c c Wave Packet Initialization: Gaussian centered at xk, with momentum pk c IMPLICIT NONE INTEGER nptx,npts,kk COMPLEX chi,EYE REAL omega,xmin,xmax,dx,pi,mass,xk,pk,x,alpha PARAMETER(npts=10,nptx=2 ** npts) COMMON / wfunc/ chi(nptx) common /xy/ xmin,xmax common /packet/mass,xk,pk xmin=-20. xmax=20. EYE=(0.0,1.0) pi= acos(-1.0) omega=1. dx=(xmax-xmin)/real(nptx) pk=0.0 xk=0.0 mass=1.0 alpha=mass * omega do kk=1,nptx x=xmin+kk * dx chi(kk)=((alpha/pi) ** 0.25) 1 * exp(-alpha/2. * (x-xk) ** 2+EYE * pk * (x-xk)) end do RETURN END cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc SUBROUTINE SAVEWF(j) c c Save Wave-packet in coordinate space c IMPLICIT NONE INTEGER nptx,npts,kk,j COMPLEX chi,EYE REAL RV,omega,xmin,xmax,dx,pi,mass,xk,pk,x,alpha,Vpot,RKE character * 9 B PARAMETER(npts=10,nptx=2 ** npts) COMMON / wfunc/ chi(nptx) common /xy/ xmin,xmax common /packet/mass,xk,pk write(B, ’(A,i4.4)’) ’arch.’, j OPEN(1,FILE=B) dx=(xmax-xmin)/real(nptx) do kk=1,nptx x=xmin+kk * dx WRITE(1,22) x,chi(kk) end do CLOSE(1) 22 FORMAT(6(e13.6,2x)) RETURN END cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 2 Problem 2: In order to visualize the output of this program, cut the source code attached below, save it in a file named Problem2.f, compile it by typing f77 Problem2.f -o Problem2 run it by typing ./Problem2 Visualize the output as follows: type gnuplot then type plot ‘‘nume.0000’’ That will show the representation of the amplitude of the Fourier transform of the Gaussian state, introduced in Eq. (6), in terms of an array of numbers associated with a grid in momentum space. In order to visualize the analytic results on top of the numerical values type replot ‘‘anal.0000’’ In order to visualize the numerically computed phases as a function of p type plot ‘‘nume.0000 u 1:3’’ and to visualize the analytic results on top of the numerical values type replot ‘‘anal.0000’’ To exit, type quit 3 PROGRAM Problem2 call Initialize() CALL SAVEFT() END cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc...
View Full Document

## This note was uploaded on 12/07/2011 for the course CHEM 350 taught by Professor Duanejohnson during the Summer '06 term at University of Illinois, Urbana Champaign.

### Page1 / 82

Batista_AIMD_Solutions - 2006 Summer School on...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online