You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is a Python 2->3 bug.
I changed line 309 in Periodic.py:
m = np.array(map(lambda x: ATOMICMASSES[x-1], self.mol0.atoms))*1000.0
to:
m = np.array(list(map(lambda x: ATOMICMASSES[x-1], self.mol0.atoms)))*1000.0
and it seems to be working
I'm trying to run an MD simulation in PBC, using ChemSpider-trained network:
def EnAndForce(z_, x_, nreal_, DoForce = True):
mtmp = Mol(z_,x_)
en,f = manager.EvalBPDirectEEUpdateSinglePeriodic(mtmp, PARAMS["AN1_r_Rc"],
PARAMS["AN1_a_Rc"], PARAMS["EECutoffOff"], nreal_,True)
return en[0], f[0]
lat=Lattice(np.eye(3)*70) # 70 angstrom box
m.properties["Lattice"]=lat
PARAMS["MDThermostat"] = "Nose"
PARAMS["MDTemp"] = 300
PARAMS["MDdt"] = 0.1 # fs
PARAMS["RemoveInvariant"]=True
PARAMS["MDV0"] = "Random"
PARAMS["MDMaxStep"] = 10000
PF = PeriodicForce(m,np.eye(3)*70) #m.properties["Lattice"])
PF.BindForce(EnAndForce, 70.0)
PARAMS["MDTemp"] = 300.0
PARAMS["MDdt"] = 0.05 # In fs.
traj = PeriodicVelocityVerlet(PF,"sim_300K")
traj.Prop()
Traceback (most recent call last):
File "runmd.py", line 79, in
traj.Prop()
File "/mainfs/scratch/mk1a18/TensorMol/TensorMol/Simulations/PeriodicMD.py", line 144, in Prop
LOGGER.info("Step: %i time: %.1f(fs) (kJ/mol): %.5f <|a|>(m/s2): %.5f (Eh): %.5f (kJ/mol): %.5f Rho(g/cm**3): %.5f Teff(K): %.5f", step, self.t, self.KE/1000.0, np.linalg.norm(self.a) , self.EPot, self.KE/1000.0+self.EPot*KJPERHARTREE,self.Density(), Teff)
File "/mainfs/scratch/mk1a18/TensorMol/TensorMol/Simulations/PeriodicMD.py", line 106, in Density
return self.PForce.Density()
File "/mainfs/scratch/mk1a18/TensorMol/TensorMol/ForceModifiers/Periodic.py", line 309, in Density
m = np.array(map(lambda x: ATOMICMASSES[x-1], self.mol0.atoms))*1000.0
TypeError: unsupported operand type(s) for *: 'map' and 'float'
The text was updated successfully, but these errors were encountered: