-
Notifications
You must be signed in to change notification settings - Fork 3
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
Site shape analysis #166
Site shape analysis #166
Conversation
I conducted AIMD simulations using a forced symmetry structure, and I have uploaded the simulation files to the "shape_analysis" subfolder within the surfdrive directory. I've tried to apply rotational symmetry to this data, and I would appreciate if you could review my approach. I have used files created by MATLAB, which are also available on surfdrive. However, when attempting to integrate them with gemdat, I encountered an issue with the order of symmetric operations. Since I manually recorded these operations, it is difficult to integrate. I was thinking that it should be possible to extract the symmetry operations from the sites CIF file and apply them to each lithium atom at each time step. And then plot the positions of the lithium atoms around one of the specified sites within a cutoff distance.
Thanks! I will play around with it a bit. So, the goal for this code is to eventually extract the shape analysis bit and give it a place in gemdat. |
Hi @AstyLavrinenko , I'm getting:
Because |
Wow, I didn't have this error. Okay, can we try to replace lines 17-19 with lines below?
|
That works, I think you are using a deprecated numpy feature that caused this: https://numpy.org/doc/stable/release/1.19.0-notes.html#deprecate-automatic-dtype-object-for-ragged-input Now I run into this:
|
Well maybe, but I didn't change anything manually and I have quite new version of numpy same as for gemdat. Anyway, what if you try:
instead of |
I have studied the code today and here is what I came up with. The goal is to have a generalized algorithm that for all symmetrically equivalent cluster centers, find nearest atoms from trajectory, and transforms them back to the asymmetric unit. This helps the statistics for performing shape analysis and making plots. As input:
Algorithm:
@AstyLavrinenko Let me know what you think about this. |
@stefsmeets Yes, I think this should work. Although for step 4 there are two possible ways. The first one you described. Second:
I'm not sure which one is easier to implement. Using the code I provided, I tried to follow the second option. |
I think I found a nice way to do this with pymatgen, still WIP. Just trying things out in a notebook for now. |
TODO
from pathlib import Path
from gemdat import Trajectory
from gemdat.io import read_cif
workdir = Path('/home/stef/md-analysis-matlab-example-short/shape_analysis')
trajectory = Trajectory.from_vasprun(workdir / 'vasprun.xml')
diff_trajectory = trajectory.filter('Li')
structure = read_cif(workdir / 'argyrodite_48h48h16e.cif')
from gemdat.shape import ShapeAnalyzer
thresh = 1.0 # Å
supercell = (2, 1, 1)
sa = ShapeAnalyzer.from_structure(structure)
shapes = sa.analyze_trajectory(trajectory=diff_trajectory,
supercell=supercell,
threshold=thresh)
import matplotlib.pyplot as plt
from gemdat import plots
bins = np.linspace(-thresh, thresh, 50)
for shape in shapes:
plots.shape(shape, bins=bins)
plt.show() |
Hi @AstyLavrinenko, I'm pretty happy with the way this works now. Could you have a look whether you find this intuitive to work with, and if it helps with your analysis? Todo
|
Hi @stefsmeets, the example looks impressive! I really like the idea of using a heatmap for visualization. I've started experimenting with code using some different data. I'm planning to dig deeper and play around a bit more. I'll let you know how it goes by the end of the week |
Hi @AstyLavrinenko Thanks! Since there was no response I'm going to assume everything is working as intended. I will merge this now, let me know or open new issue with any comments or issues you may find. |
Hi @stefsmeets I have a couple of things I'd like to discuss, and I think it would be more effective to do so in person. If I'm not mistaken, you will be at the reactor tomorrow. If that's the case, we could go over these |
I conducted AIMD simulations using a forced symmetry structure, and I have uploaded the simulation files to the "shape_analysis" subfolder within the surfdrive directory. I've tried to apply rotational symmetry to this data, and I would appreciate if you could review my approach. I have used files created by MATLAB, which are also available on surfdrive. However, when attempting to integrate them with gemdat, I encountered an issue with the order of symmetric operations. Since I manually recorded these operations, it is difficult to integrate. I was thinking that it should be possible to extract the symmetry operations from the sites CIF file and apply them to each lithium atom at each time step. And then plot the positions of the lithium atoms around one of the specified sites within a cutoff distance.