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

Pymatgen parser - displacements Nan issue #88

Open
Harry-Rich opened this issue Jan 8, 2025 · 1 comment
Open

Pymatgen parser - displacements Nan issue #88

Harry-Rich opened this issue Jan 8, 2025 · 1 comment

Comments

@Harry-Rich
Copy link
Contributor

When parsing Xdatcar files, displacements are not working properly i.e.

x = Xdatcar("XDATCAR_reduced_50_wrapped.vasp")
time_step = 1.0 * sc.Unit('fs')
step_skip = 50 * sc.Unit('dimensionless')
kin = parser.PymatgenParser(x.structures, time_step = time_step, step_skip = step_skip, specie = ['Li','N', 'H'])

This calls the parser and calculates coords, indices, drift_indices etc.
It should also calculate displacements, but

kin.displacements

returns the right dimensions and shape scipp vairable, but everything is nan.

However,

structure, coords, latt = kin.get_structure_coords_latt(x.structures)
kin.calculate_displacements(coords = coords, lattice= latt)

does work and correctly calculates displacements, so it is not the calculation that is broken, so I believe it must be something in here (Parser) :

        disp = self.calculate_displacements(coords, lattice)
        drift_corrected = self.correct_drift(disp)

        self._slice = DIMENSIONALITY[dimension.lower()]
        drift_corrected = drift_corrected['dimension', self._slice]
        self.dimensionality = drift_corrected.sizes['dimension'] * sc.units.dimensionless

        self.displacements = drift_corrected['atom', indices]

I will look into it, be good if someone else could verify with a different xdatcar file as well

@arm61
Copy link
Collaborator

arm61 commented Jan 8, 2025

Can you try with the XDATCAR that is located in the docs (https://github.com/bjmorgan/kinisi/blob/master/docs/source/example_XDATCAR.gz)?

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

No branches or pull requests

2 participants