Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3-vector for coordinates? #55

Open
timholy opened this issue Aug 19, 2024 · 1 comment
Open

3-vector for coordinates? #55

timholy opened this issue Aug 19, 2024 · 1 comment

Comments

@timholy
Copy link
Contributor

timholy commented Aug 19, 2024

Most of the structs in this package are now quite efficient, but I see one more potential opportunity: Atom's coords field is a Vector{Float64}. Assuming this will always be a 3-vector, one option would be to create a Coordinates type. MIToS does this already, although their array type is immutable. Is this kind of change something worth considering? Would it need to be mutable? I'm thinking of methods like applytransform!.

@jgreener64
Copy link
Member

Yes we should think about doing something like this. Coordinates will always be a 3-vector.

We would want to be able to change the coordinates of an atom but could make Atom itself mutable and keep the coordinates immutable, assigning new coordinates via coords!/x!/y!/z!. In that case SVector{3, Float64} might be sufficient. If making Atom mutable gives slowdowns we could try MVector too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants