Replies: 3 comments 2 replies
-
Hi @fxcoudert, your confusion is warranted. Essentially, there was parallel development of quite similar functionality in pymatgen by two different groups. They are not directly equivalent, and you can use or try either the chemenv module or the local_env module, and both have different algorithms for determining chemical environments. The In an ideal world the API would be a little cleaner, but sometimes there is a historical path dependence, and overall I think it’s healthy to explore different approaches to solve a problem so I don’t think there’s much harm in it. |
Beta Was this translation helpful? Give feedback.
-
For reference, after some more reading, this is the code I currently have to convert from
It has restrictions that make it unsuitable for a PR at this stage: it requires a single well-defined environment to be present. I'm going to test it across the MP database. The scientific context is: I am trying to compare the bond determination from ChemEnv to CrystalNN and others. I don't think it has been benchmarked before. |
Beta Was this translation helpful? Give feedback.
-
@fxcoudert Regarding your code: it should be possible to generalize it for all strategies (simple, multiweight), if you always use the first environment set. I am tagging @kaueltzen from my group as she nowadays works mostly on ChemEnv and might want to comment. |
Beta Was this translation helpful? Give feedback.
-
When one wants to analyse a materials' structure in terms of a molecular graph / connectivity matrix / list of bonded atoms, one approach is to use the classes in
analysis.local_env
, likeCrystallNN
orIsayevNN
. You can then get the bonding information throughget_bonded_structure()
as a niceStructureGraph
object, which internally uses a networkx graph.On the other hand, there is the approach of
analysis.chemenv
, which is a different technique but has a related aim. I am puzzled however about the objects that it returns. I think the closest analogue to get the structure graph isget_structure_connectivity()
: that returns aStructureConnectivity
, which internally uses a networkx graph. But it appears to be different fromStructureGraph
, although they must store pretty much the same information.I have two questions:
StructureConnectivity
andStructureGraph
? or why can't I? am I missing something?StructureConnectivity
object? Ask it to return a list of bonds, for example? (Something like theget_connected_sites()
function ofStructureGraph
.) I don't find a lot of doc or examples, and the only function I have found is aprint_links()
function to display stuff. Again, I am probably missing something, but I don't know what.kind poke to @JaGeo because I think she wrote that code
Beta Was this translation helpful? Give feedback.
All reactions