Open ghutchis opened 6 years ago
Hi
Each element has an id
which is intended for cases like these.
typedef struct _msym_element {
void *id; // custom identifier
double m; // Mass
double v[3]; // Position
int n; // Nuclear charge
char name[4]; // Name
} msym_element_t;
Or is this not what you meant?
I did see the id
field, but not an example on how it's used. Am I supposed to supply those when handing off the molecule? I worry because in equivalence_set.c
, there's this:
https://github.com/mcodev31/libmsym/blob/c99470376270db4ec4c925b952fa722e011377d6/src/equivalence_set.c#L87
At the outset, it seems like the id
fields are cleared.
Yes, you supply it in each element when doingmsymSetElements
.
That code only runs from msymGenerateElements
in which case we want to remove the id for newly generated elements.
I.e. if you want to generate a new molecule from an atom and a group the new elements will not have an id (but the original will).
Not been doing much chemistry lately, but just downloaded Avogadro 2 from Flathub. It looks great! I can see that atom selection is working. I like the subgroup selection and rendering as well. Perhaps we should look at rendering some orbitals at some point. Would probably be a good educational feature to be able to quickly view (example) SALCs for some n.
That could be interesting (e.g., going from s
or p
orbitals on a particular atom to the SALC).
Shouldn't be too difficult assuming one could add an orbital to an atom (or equivalence set). You could also show the symmetry species of all orbitals in e.g. a fchk, and/or vibrational modes.
I made a (very quick and ugly) hack to the Avogadro symmetry code to see if I could extract the symmetry species of the orbitals in an fchk file for CH2 (C2v) and basis C=1s2s2p, H=1s. It spits out this:
0.992799 A1
0.876721 A1
0.815339 B1
1.00216 A1
1 B2
1.8554 A1
1.701 B1
Which matches 4A1 + 0A2 + 2B1 + 1B2
expected by libmsym using that basis (code above does not print species with coefficient < epsilon (double)
)
So one could imagine adding a tab listing all orbitals and their symmetry species and perhaps another with the character table.
SALC generation should just reasonably similar, just in reverse.
Perhaps we should continue this conversation by mail.
This would be great, particularly since many calculations run in low symmetry.
I'd be happy to talk over email.
I've sent you a couple of patches (hopefully to the right email).
I implemented display of equivalent sets of atoms in Avogadro v2:
In the process, I realized that once you get the sets, there's no way to relate the atoms in the group back to the original molecule, except by element and coordinates.
Right now, I'm doing that, but it would be great to have an atom id (index) that travels through the context. Is there an easy way to do that?
In other words, what I'd really like to do is: