I am interested to plot lattice parameters vs temperature after Molecular Dynamics calculation in NPT ensemble to detect structural phase transition of my system, Ex- enter image description here So, I am looking for python script for performing this plot extracting data from VASP output (Ex- XDATCAR, OSZICAR). Thank you in advance.

  • $\begingroup$ pymatgen may be useful pymatgen.org/… $\endgroup$
    – CW Tan
    Commented May 3 at 15:07
  • $\begingroup$ solid to solid phase transition (symmetry change) is difficult to find due to rate at which we do heat the system in MD. Best way to compare free energy of two different system crystal across different temperature to know phase transition occurred or not $\endgroup$ Commented Jun 3 at 13:02

1 Answer 1


If you can't find a script, it would be easy enough to program yourself.

Read the lattice vectors from the files and time average over each NPT trajectory. I assume ASE or other programs (I don't really use them) can read the trajectories easily. Presumably you're using a supercell, so divide by the multiplicity to get the lattice vectors. The norm of the lattice vectors give you the lattice parameters above.

For phase transitions where the new underlying supercell is bigger than primitive cell, it's hard to know what the multiplicity is. You can probably make progress with phonopy, which can tell you some detailed info about your crystal. Time average both the (supercell) positions and (supercell) lattice vectors and write a new averaged POSCAR file. Run phonopy with the --symmetry flag to find the primitive cell and space group for your structure.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .