Open yuuhaixia opened 6 months ago
You have to take the Pytorch file and convert the data using the Crystal class in the code which you can then feed into packages like ASE, nglview, or some other software.
class Crystal(object):
def __init__(self, crys_array_dict):
self.frac_coords = crys_array_dict['frac_coords']
self.atom_types = crys_array_dict['atom_types']
self.lengths = crys_array_dict['lengths']
self.angles = crys_array_dict['angles']
self.dict = crys_array_dict
...........
Hello, are you referring to this Crystal class below in the compute_metrics.py file? Do I need to run through this evaluation file to visualize my generated results?
If I just run python cdvae/run.py data=perov expname=perov
and
python scripts/evaluate.py --model_path MODEL_PATH --tasks recon gen
Is it possible to get the results of the generated crystals, as well as visualize them?
@JianZhou711
Our workflow included importing the crystal class and using it to convert the PT file then converting the info from that into a poscar before visualizing it with Vesta (example in the attached image). I have experimented with running it on ASE and NGLview without converting poscar and have worked, but I do not have those files atm. There might be a way to do it without the class, but we just determined that was the easiest method.
Thank you very much for your reply, can you please share the code to convert PT to POSCAR, I keep having problems! @JianZhou711
The output of the PT in the generated material does not tell the type of atom, such as whether it is Bi or O, etc., so how should one determine what component the generated material is?
This should answer both questions. I'll leave it up for a few days before deleting it.
Thank you really, but I don't understand why I'm getting this error AttributeError: 'Crystal' object has no attribute 'structure'
@JianZhou711
That's weird, we never ran into that error when doing test runs with mp-20. Try doing a try-except run instead of a list comprehension and skip all of the ones that ran into an error.
Is it something to do with the number of times it was trained, because I only trained 500 epochs, and the output 'atom_types' are all negative. Below is the result of my PT printout, is there any anomaly? Thanks again! @JianZhou711
Potentially? I didn't see those issues when I ran, but I did mainly use the mp_20 dataset for trains. I could ask others, but I'm on break for a few weeks. I would recommend just running try excepts and ignoring them before doing another model run to test.
If I skip the exception then I will get null value. Can you provide me with a PT file that you have trained and generated, I want to make sure that there is something wrong with my generated data that is causing the visualization not to work. Really thank you very much for replying me multiple times~
@JianZhou711
same dropbox
Many thanks to the authors for their contribution and sharing. However, when I am using the PT file you shared for visualization, (I am using VESTA), one of the crystal diagrams I get is as follows: there is no chemical bond link between atoms. May I ask why this is so? Or is there something wrong with @JianZhou711
I am actually not sure. You would probably have to consult with material scientists or the paper. I'd assume some of the elements are just not feasible, but that is just my assumption. We did filter out a vast majority of the PT file to a small list of elements that we feel are realistic and potentially relevant.
Thank you again, you really helped me a lot! I wish you all the happiness in the world every day!
You mean the crystals that are generated, some are not chemically linked and some are chemically linked are they? @JianZhou711
Yes, that's what I think is happening. I recommend reaching out to someone with a better grasp of material science instead though. I am not confident since I am on the computational side of things.
have to consult with material scientists or the paper. I'd assume some of the elements are just not feasible, but that is just my assumption. We did filter out a vast majority of the PT file to a small list of elements that we feel are realistic and potentially relevant.
Could you please share the code for visualization of pt files? @yuuhaixia
Thank you very much for your work, after training the generation task, may I ask how to visualize the generated results?