-
Notifications
You must be signed in to change notification settings - Fork 20
Chemical Element #49
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
Comments
I agree. The original reason for separating out some of these fields was to allow for a single particle to not necessarily represent an atom, but instead be more general to be e.g. a molecule or some other coarse-grained object. I think that's still possible, and one would then just not make use of the We may still want to hold onto the |
Maybe this now goes back to the #43 discussion. Personally, I would really prefer something like this |
I would want the species to be ultra-light-weight for speed. So yes it represents the same thing but it is an entirely different implementation. In fact it could be used to index into the list of elements. |
btw, the point about wrapping an integer is simply to distinguish the atomic number from an integer. There is no arithmetic on atomic numbers, one may want to dispatch on indexing, etc. I did this in JuLIP because my codes started getting confused when an integer was an index and when was it an atomic number. |
I think this also comes back to the question of "Does everyone need to use the same atom type?" Some people might prioritize it being lightweight over everything else, while others might favor ease of accessing associated data. At one point, we were addressing this by having an Maybe there's some clever intermediate solution on the backend where the same type can be a minimalist lightweight thing but also be "lazily" instantiated to store additional stuff? |
I don't think there has to be a compromise. If people are happy with the following idea, I can transfer this in from struct ChemicalSymbol # or ChemicalElement or .... I don't care about the name.
z::Int
end
ChemicalElement(:Si)
# ChemicalElement(14)
# but display as
# <Si> It would just need a list of symbols, and a dictionary for reverse lookup. We really shouldn't be using integers for this, nor symbols, having a separate type gives us dispatch. Integers can be confused with indices (e.g. iteration) and you definitely don't want to do arithmetic on Chemical Elements. |
I like this...but I see I also liked it a year ago, so would be good for one or two other people to chime in, too... @mfherbst or @jgreener64, any opinions? |
Personally I don't care how we represent element types. I agree a separate struct would be nice for dispatch and as long it is light weight and flexible it really does not matter how it stores things. Regarding the old question of the atoms: The issue is that some file formats do allow you to use different symbols (e.g. to identify deuterium versus hydrogen) or change the atomic mass, which was originally the motivation for having these separated entries instead of a lookup in the default (feature-rich and slow) atom implementation. I think it makes a lot of sense to have a slimmer version, that essentially ties all identification of the atom to the atomic number and that's it. |
My point is that it does matter. If you store them as symbols then anything wrapping that will not be The point about different symbols outside the standard list is important. This would also become relevant, e.g. for coarse-grained models where you don't have the standard chemical symbols. |
Yes sure, I understand that. But then you could just make your atom type that just stores the number and only implements the functions that return |
Yes that’s essentially what I’m proposing. EDIT : above was a quick response - slightly longer : I suppose we can debate whether there is a point in having |
How many people use isotopes right now with AtomsBase? |
At the moment, the
Atom
type is defined as follows:I notice two things: why do we need atomic symbol AND atomic number? Doesn't it define the same thing? Secondly,
Symbol
is not anisbbits
type (which really tripped me up a little while ago).I therefore propose to implement a (could be named something else of course)
which is now
isbits
, and could be displayed as the symbol for readability.The text was updated successfully, but these errors were encountered: