Git Product home page Git Product logo

Comments (5)

jameskermode avatar jameskermode commented on July 30, 2024

Perhaps generating all rings and then filtering based on type afterwards would be a simpler approach?

from matscipy.

yunai2384 avatar yunai2384 commented on July 30, 2024

Perhaps generating all rings and then filtering based on type afterwards would be a simpler approach?

Thanks for reply, i think the shortest path of A-A-A... rings and A-B-A-B... rings should be different, and a little modification of the shortest path algorithm forA-B-A-B rings should be better?

from matscipy.

jameskermode avatar jameskermode commented on July 30, 2024

Thinking about this a little more, I think you could actually do it with no modifications to the shortest path algorithm, just by passing a custom cutoff dictionary to neighbour_list. If you leave out A-A and B-B from the dictionary they will never considered to be neighbours.

from matscipy.

pastewka avatar pastewka commented on July 30, 2024

You can also explicitly remove A-A and B-B- neighbors from the neighbor list. Try the following (untested):

import _matscipy
from matscipy.neighbours import neighbour_list

i, j, r = neighbour_list('ijD', a, cutoff)
n = a.numbers
mask = a[i] != a[j]  # True for differing elements
i = i[mask]
j = j[mask]
r = r[mask]
d = _matscipy.distances_on_graph(i, j)
ring =_matscipy.find_sp_rings(i, j, r, d, maxlength)

from matscipy.

yunai2384 avatar yunai2384 commented on July 30, 2024

Thanks a lot, i checked the rings in my 816 atoms in AB2, and the rings i get are all A-B-A-B, it helps me a lot.
Best regards and keep healthy!

from matscipy.

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.