GEMDAT-repos / GEMDAT

Python toolkit for molecular dynamics analysis
https://gemdat.readthedocs.io
Apache License 2.0
21 stars 3 forks source link

Implement Haven ratio #283

Closed stefsmeets closed 3 months ago

stefsmeets commented 3 months ago

This PR implements Haven's ratio as described here: https://github.com/GEMDAT-repos/GEMDAT/issues/269#issuecomment-1991636949

You call it it via SimulationMetrics.haven_ratio()

Closes #269

stefsmeets commented 3 months ago

Hi @v9lgraf , I have no idea if these numbers make sense. Could you have a look and let me know what you think?

>>> from gemdat import Trajectory, SimulationMetrics
>>> 
>>> trajectory = Trajectory.from_vasprun('vasprun.xml')
>>> diff_trajectory = trajectory.filter('Li')
>>> 
>>> metrics = SimulationMetrics(diff_trajectory)
>>> metrics.tracer_diffusivity(dimensions=3)
1.8267357889731602e-09
>>> metrics.ionic_conductivity(dimensions=3)
7.601127262740172e-11
>>> metrics.haven_ratio(dimensions=3)
24.032432635717115
stefsmeets commented 3 months ago

I'm going to merge this now @v9lgraf, please let me know if you have a chance to test this and run into issues.

v9lgraf commented 3 months ago

Hi Stef, I saw this and will have a look!