def dv12(self,x): return -2 * x * self.c * self.d * exp(-self.d*x*x) #pot = Test_Pot_Tully() #x = np.linspace(-10,10,100) #p_ary = np.array([ pot.get_nacme([[i]]) for i in x]) / 50 #plt.plot(x,p_ary[:]) #p_ary = np.array([ pot.v12(i) for i in x]) #plt.plot(x,p_ary[:]) #p_ary = np.array([ pot.get_pot([[i]]) for i in x]) #plt.plot(x,p_ary[:,0]) #plt.plot(x,p_ary[:,1]) #plt.show() #sys.exit() # x = Molecule(["X"]) x.set_masses([2000]) x.set_positions([[-5.0,0,0]]) x.set_velocities([[0.0180,0,0]]) #print x.get_masses() #print x.get_kinetic_energy() print x.get_momentum() #sys.exit() func = Test_Pot_Tully() pot = Potential_TEST(x,func,0,2) #md = VelocityVerlet(x,pot,dt=0.2*fs2tau,nstep=5000) md = TullySurfaceHopping(x,pot,dt=0.2*fs2tau,nstep=1500) md.run()
import pyximport pyximport.install() cProfile.runctx("do()", globals(), locals(), "Profile.prof") s = pstats.Stats("Profile.prof") s.strip_dirs().sort_stats("time").print_stats() sys.exit() for i in xrange(500): x = 1.0 + 0.1 * i mol_mm.set_positions([[0.,0.,0.],[0.,0.,x*ang2bohr]]) pot_mm.calc() #print x, pot_mm.get_potential_energy(), pot_mm.get_forces()[0][2] print x, pot_mm.get_forces() #print pot_mm.get_forces() sys.exit() n = 256 mol_mm = Molecule(["Ar"]*n) SetLattice(mol_mm,1.77).set_positions() SetMaxwellVelocities(mol_mm,30).set_velocities() pot_mm = Potential_MM(mol_mm) vel = VelocityVerlet(mol_mm, pot_mm, nstep=2000, dt=0.5*fs2tau) vel.run() sys.exit() mol, inp = molpro_input_parser("template.com") read_coord(mol,"coord1") read_velocity(mol,"velocity1") pot = Potential_TSH_CASSCF(mol, inp, now_state=1, nrange=2) tsh = TullySurfaceHopping(mol,pot,dt=0.5*fs2tau,\ nstep=500,tsh_times=5) tsh.run()