pyiron / FAQs

General question board for pyiron users
3 stars 0 forks source link

How to upload and animate trajectories from xyz file #44

Open ahmedabdelkawy opened 5 months ago

ahmedabdelkawy commented 5 months ago

using the ase.io.read and then ase_to_pyiron did not work (get_chemical_species error), do we have another function to do so directly?

ahmedabdelkawy commented 5 months ago

@pmrv @jyang2009

jan-janssen commented 5 months ago

The xyz file format is not clearly specified - so there are different versions how the chemical elements are stored in those file. Can you upload an example?

pmrv commented 5 months ago

It's a bit manual still, but what you can try is use this class. Once you have populated positions and cells, you can call .animate_structures() to get the 3D view. Alternatively use StructureStorage and .add_structure() each structure separately before calling .anime_structures(). In both cases you will still need to load the structures using ase.io. Be aware also that nglview doesn't understand changes to the cell along the trajectory, so it will use the first cell.

pmrv commented 5 months ago

Ah and with ase.io.read you may have to specify format='extxyz', otherwise it will try to read in numeric element ids instead of chemical symbols.