def do(): n = 50 mol_mm = SetLattice("Ar",n,1.77).set_molecule() SetMaxwell(mol_mm,30).set_velocities() pot_mm = Potential_MM(mol_mm) vel = VelocityVerlet(mol_mm, pot_mm, nstep=200, dt=0.5*fs2tau) vel.run()
from MakeInitial import SetLattice from Potential import Potential_MM from MonteCarlo import MonteCarlo_Ex # Set the initial coordinate # lattice structure of 500 Ar atoms n = 50 lattice = SetLattice("Ar", n, 1.77) vlength = lattice.get_lattice_length() # define the potential pot = Potential_MM(mol, check_pbc=True, vlength=vlength) # make the instance delta = [0.2] * (len(mol)) mc = MonteCarlo_Ex(mol, pot, delta, 100000, 30.0, restart=False) # adjust the frequency of the output reloading mc.access_writeoutput().set_freq_xyz(10000) mc.access_writeoutput().set_freq_trajectory(10000) mc.access_writeoutput().set_freq_energy(10000) # run montecarlo mc.run()
from IO_MOLPRO import molpro_input_parser from Potential import Potential_TSH_CASSCF, Potential_MM, Potential_QMMM from TullySurfaceHopping import TullySurfaceHopping_QMMM from Constants import fs2tau, bohr2ang import sys from IO_MOLPRO import OutputMOLPRO from MakeInitial import SetLattice, SetMaxwell, superpositioned_atoms_delete mol_qm, inp = molpro_input_parser("template.com") mol_qm.read_coord_from_file("coord1") mol_qm.read_velocity_from_file("velocity1") pot_qm = Potential_TSH_CASSCF(mol_qm, inp, now_state=2, nrange=4) n = 500 lattice = SetLattice("Ar",n,1.77) vlength = lattice.get_lattice_length() mol_mm = lattice.set_molecule() SetMaxwell(mol_mm, 300).set_velocities() mol_mm = superpositioned_atoms_delete(mol_mm, mol_qm) pot_mm = Potential_MM(mol_mm, rlimit = vlength / 2) pot_qmmm = Potential_QMMM(mol_qm, mol_mm, rlimit = vlength / 2) tsh = TullySurfaceHopping_QMMM(mol_qm, mol_mm, pot_qm, pot_mm,\ pot_qmmm, dt=0.5*fs2tau, nstep=5000,tsh_times=5) tsh.run()
from MakeInitial import SetLattice from Potential import Potential_MM from MonteCarlo import MonteCarlo_Ex # Set the initial coordinate # lattice structure of 500 Ar atoms n = 50 lattice = SetLattice("Ar",n,1.77) vlength = lattice.get_lattice_length() # define the potential pot = Potential_MM(mol, check_pbc=True, vlength=vlength) # make the instance delta = [0.2] * (len(mol)) mc = MonteCarlo_Ex(mol, pot, delta, 100000, 30.0, restart=False) # adjust the frequency of the output reloading mc.access_writeoutput().set_freq_xyz(10000) mc.access_writeoutput().set_freq_trajectory(10000) mc.access_writeoutput().set_freq_energy(10000) # run montecarlo mc.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()
from IO_MOLPRO import molpro_input_parser from Potential import Potential_TSH_CASSCF, Potential_MM, Potential_QMMM from TullySurfaceHopping import TullySurfaceHopping_QMMM from Constants import fs2tau, bohr2ang import sys from IO_MOLPRO import OutputMOLPRO from MakeInitial import SetLattice, SetMaxwell, superpositioned_atoms_delete mol_qm, inp = molpro_input_parser("template.com") mol_qm.read_coord_from_file("coord1") mol_qm.read_velocity_from_file("velocity1") pot_qm = Potential_TSH_CASSCF(mol_qm, inp, now_state=2, nrange=4) n = 500 lattice = SetLattice("Ar", n, 1.77) vlength = lattice.get_lattice_length() mol_mm = lattice.set_molecule() SetMaxwell(mol_mm, 300).set_velocities() mol_mm = superpositioned_atoms_delete(mol_mm, mol_qm) pot_mm = Potential_MM(mol_mm, rlimit=vlength / 2) pot_qmmm = Potential_QMMM(mol_qm, mol_mm, rlimit=vlength / 2) tsh = TullySurfaceHopping_QMMM(mol_qm, mol_mm, pot_qm, pot_mm,\ pot_qmmm, dt=0.5*fs2tau, nstep=5000,tsh_times=5) tsh.run()