zerothi / sisl

Electronic structure Python package for post analysis and large scale tight-binding DFT/NEGF calculations
https://zerothi.github.io/sisl
Mozilla Public License 2.0
182 stars 58 forks source link

Ufuncs could support external classes #747

Open pfebrer opened 5 months ago

pfebrer commented 5 months ago

E.g. in the case of Geometry there are implementations to convert from/to ASE atoms. So with a simple wrapper it should be easy to support:

import ase

import sisl

# Define a structure as an ase atoms object
geometry = ase.Atoms(...)

# Get the rotated ase atoms object
rotated_geometry = sisl.rotate(geometry, 30, [0,0,1])

I think it would be quite cool. It would be similar to how numpy can apply operations on many objects, although the implementation would be different in the sense that is based on sisl implementing the converters.

zerothi commented 5 months ago

This could be cool, but I think it has very low priority. There are soo many issues open that I think we should try to finish some of them ;)

I also can't really see who will use it? Much of the functional methods are also done in other codes, with slightly different API's, so my bet is that if somebody is using ase, then they would stick with that. :)

pfebrer commented 5 months ago

I would see this being useful if some function is not implemented in ASE, or it has an API that is more complicated to acheive a certain goal. If someone asks how to acheive that thing in Matter Modelling, then you can answer: "use this function in sisl". And you will have introduced sisl to them with minimal friction :)

zerothi commented 5 months ago

I don't really mind if it is a small pr, but I don't think you should spend tons of time on this, I would still prefer some help on thinking about the categories, and how we can solve that issue ;)

pfebrer commented 5 months ago

I will leave the issue here, I don't want to work on it for now, it was just an idea.