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

How to represent isotopes? #393

Closed
rowlesmr opened this issue May 14, 2023 · 4 comments · Fixed by #400
Closed

How to represent isotopes? #393

rowlesmr opened this issue May 14, 2023 · 4 comments · Fixed by #400

Comments

@rowlesmr
Copy link
Collaborator

Kind of raised in #390

I don't think there is currently a way to denote isotopes using the current _atom_type.symbol definition*, and core seems very X-ray biased, so I don't think it would be an easy fix (but I think worthy to do).

*
    The identity of the atom specie(s) representing this atom type.
    Normally this code is the element symbol followed by the charge
    if there is one. The symbol may be composed of any character except
    an underline or a blank, with the proviso that digits designate an
    oxidation state and must be followed by a + or - character.
@jamesrhester
Copy link
Contributor

Agree that this is important. It should be separate from the atom type symbol, e.g. _atom_type.isotope. The scattering length table could be indexed by both element and isotope number, or perhaps atomic number and isotope number. As the scattering length table is not yet used we have some flexibility in how we rework it.

@rowlesmr
Copy link
Collaborator Author

rowlesmr commented May 17, 2023

Idea. We already have _atom_type.atomic_number. Let's create _atom_type.mass_number.

Scattering lengths are then keyed on both atomic and mass number. Mass number has a default value of zero, which indicates to use the "natural" element abundance value for the scattering length, rather than a specific isotope.

.
Although, I can't see how to do a nested loop, a la, _atom_type.atomic_number-style to make a value depends on two keys with a loop_ _enumeration_default.index _enumeration_default.value construct.

@jamesrhester
Copy link
Contributor

Although, I can't see how to do a nested loop, a la, atom_type.atomic_number-style to make a value depends on two keys with a loop _enumeration_default.index _enumeration_default.value construct.

Yes indeed, that is a problem. The hacky solution is to define a data name that is a list of [_atomic_number, _atomic_mass] with which to index the enumeration list. The more elegant solution would be to replace _enumeration.def_index_id with a loopable data name, e.g. _enumeration_index.id where the data names to use to index the default list could be provided.

As much as I hate touching DDLm, the latter is really the right way to do it. I'll raise an issue for separate discussion.

@rowlesmr
Copy link
Collaborator Author

From #397 (comment), I think it is better to loop on _atom_type.element_symbol and _atom_type.mass_number. This allows for an explicit use of D for deuterium, which is in the element listing.

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

Successfully merging a pull request may close this issue.

2 participants