Git Product home page Git Product logo

Comments (2)

simonbatzner avatar simonbatzner commented on July 23, 2024

Hi @pdobbelaere, I loaded your structures and ran the ASE neighborlist calculation that we use internally. I can confirm that I see the same behavior:

A: PBC + cell are set, the neighborlist is aware of periodic images but since the cell is large never sees them, all is fine
B: PBC is false, cell is set, much slower.
C: PBC is false, cell is not there, this is equivalent to A since the cutoff is small enough in A that it's the same as if it was just in vacuum

This is the neighborlist we use. Note that the docs say:

Atoms outside periodic boundaries are mapped into the box. Atoms
outside nonperiodic boundaries are included in the neighbor list
but complexity of neighbor list search for those can become n^2.

Looking at your structure your atoms lie right on the border, hence you're seeing the N^2 scaling of ASE. When I shift them to the middle of the cell, the behavior goes away.

import time
import numpy as np

from ase.io import read
from ase.neighborlist import neighbor_list

b = read('./clusters_b.xyz')

s = time.time()
ib, jb = neighbor_list('ij', b, cutoff=5., self_interaction=False)
e = time.time()
print(e-s)

# simple cubic cell
cell = b.get_cell()
center = cell[0][0]/ 2.

# shift to middle of box
p = b.get_positions()
p += np.array([center, center, center])
b.set_positions(p)
b.wrap()

s = time.time()
ib, jb = neighbor_list('ij', b, cutoff=5., self_interaction=False)
e = time.time()
print(e-s)

Gives:

9.93855881690979
0.07891488075256348

from nequip.

pdobbelaere avatar pdobbelaere commented on July 23, 2024

Thanks very much for the speedy reply. That is good to know.

from nequip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.