尝试使用ase运行aMD模拟,不断收到此错误 - ValueError:shapes(0,)和(3,3)未对齐:0(dim 0)!= 3(dim 0)

时间:2016-09-08 17:45:54

标签: python numpy simulation atomic

这是我的python代码。我必须为我的集群使用嵌入式原子潜力。我进口的结构是1013个原子的双金属纳米团簇。我需要在3000 K的固定温度下运行MD。模拟从0开始并跳转到53573K然后到50656K,然后给出错误消息。

from ase.md.langevin import Langevin

from ase.io.trajectory import Trajectory

from ase import units

import numpy as np

from ase import Atoms

from ase.calculators.eam import EAM

from ase.io import write, read

# Kelvin (Set up the temperature)

T = 3000 

#Import the global minimum structure 

fName= 'globalminstr.xyz'

#Interatomic Potential

atoms = read(fName)
calc= EAM(potential='Zope-Ti-Al-2003.eam.alloy')
atoms.set_calculator(calc)

#Langevin dynamics

dyn = Langevin(atoms, 5 * units.fs, T * units.kB, 0.002)

def printenergy(a=atoms):  # store a reference to atoms in the definition.
"""Function to print the potential, kinetic and total energy."""
epot = a.get_potential_energy() / len(a)
ekin = a.get_kinetic_energy() / len(a)
print('Energy per atom: Epot = %.3feV  Ekin = %.3feV (T=%3.0fK)  '
'Etot = %.3feV' % (epot, ekin, ekin / (1.5 * units.kB), epot +   ekin))

dyn.attach(printenergy, interval=50)

# Saving the positions of all atoms after every 100th time step.
traj = Trajectory('moldyn.traj', 'w', atoms)
dyn.attach(traj.write, interval=50)

# Running dynamics
printenergy()
dyn.run(5000)

0 个答案:

没有答案