[ase-users] vasp6 and neighbor list ...

Chaitanya Krishna icymist at gmail.com
Sun Sep 21 12:36:14 CEST 2008


Hi all,

I want to find out the nearest neighbors of my atoms using the
neighborlist in ase/calculators. This is the code I have.

chaitanya at vaayu:~/tmp/asetest/ag01> cat read_force.py
from ase import *
from ase.calculators.vasp6 import Vasp
from ase.calculators.neighborlist import NeighborList

calc = Vasp(restart=True)
atoms = read('CONTCAR', format='vasp')
calc.get_atoms()

nl = NeighborList(5.0)

indices, offsets = nl.get_neighbors(8)
print indices, offsets

The error that I get is,

chaitanya at vaayu:~/tmp/asetest/ag01> python read_force.py
Traceback (most recent call last):
  File "read_force.py", line 11, in <module>
    indices, offsets = nl.get_neighbors(8)
  File "/Library/Frameworks/Python.framework/Versions/2.5.2001/lib/python2.5/site-packages/ase/calculators/neighborlist.py",
line 103, in get_neighbors
    return self.neighbors[a], self.displacements[a]
AttributeError: NeighborList instance has no attribute 'neighbors'

I guess I still do not have enough knowledge in Python to understand the error.

Can someone help me finding what I am doing wrong.

Regards,
Chaitanya.



More information about the ase-users mailing list