[ase-users] neighborlist: two atoms with distance larger than cutoff identified as neighbors

Ask Hjorth Larsen asklarsen at gmail.com
Sat Dec 12 16:22:10 CET 2020


Am Sa., 12. Dez. 2020 um 15:19 Uhr schrieb Tristan Maxson via ase-users <
ase-users at listserv.fysik.dtu.dk>:

> There is an additional "skin" parameter which is a flat extra amount that
> is counted.  I am unsure what the logic of having it exactly is, but it is
> likely the source of your problem.
>
> Thank you,
> Tristan Maxson
>

Indeed it's the skin parameter which ensures that the "neighbour" is found
(this is documented behaviour).

The purpose of the skin variable is to avoid rebuilding the neighbor list
when atoms move only a little bit -- we tabulate more neighbours than
necessary for later performance in typical use cases where atoms move
around a bit.

Maybe we should think of adding a more user-friendly interface which does
not produce the "fake" neighbours by default.

Best regards
Ask






>
>
> On Sat, Dec 12, 2020 at 3:50 AM Chunguang Tang via ase-users <
> ase-users at listserv.fysik.dtu.dk> wrote:
>
>> Dear ASE developers,
>>
>> The below code identifies two atoms with distance of 2.5 angstroms as
>> neighbors although I set the cutoff (radius) as 1 angstrom. I thought they
>> are neighbors only when their distance =< 2 angstroms. Could you help? Many
>> thanks.
>>
>> Chunguang
>>
>> ------------------------------------------------
>>
>> from ase import Atoms, neighborlist
>> lcell=10
>>
>> p=[[0, 0, 0],[2.5, 0, 0]]
>>
>> natom=len(p)
>> symbol=['H' for i in range(natom)]
>> atoms=Atoms(symbols=symbol,positions=p,cell=[lcell,lcell,lcell],pbc=True)
>> # two atoms with radius r1 and r2 are defined as neighbors if they
>> overlap. That is, if their distance<r1+r2
>>
>> cutoff=[1. for i in range(natom)] #here we assume two points with
>> distance<2 angstrom are connected or neighbors
>> nl=neighborlist.NeighborList(cutoff,self_interaction=False,bothways=True)
>> nl.update(atoms)
>>
>> for i in range(natom):
>>     indices, offsets = nl.get_neighbors(i) # according ASE, offsets seems
>> to be the vector from atom i to its neighbor atom, but its output is zero.
>>     print(indices)
>>
>>
>> _______________________________________________
>> ase-users mailing list
>> ase-users at listserv.fysik.dtu.dk
>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20201212/b6fa3891/attachment.html>


More information about the ase-users mailing list