Esempio n. 1
0
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() 
Esempio n. 2
0
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()
Esempio n. 3
0
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()