Author Topic: export MD trajectories to extended XYZ  (Read 2858 times)

0 Members and 1 Guest are viewing this topic.

Offline msingh96

  • Regular QuantumATK user
  • **
  • Posts: 9
  • Country: us
  • Reputation: 0
    • View Profile
export MD trajectories to extended XYZ
« on: August 27, 2024, 17:58 »
There's a decently old topic about exporting an MD trajectory to the xyz format. however it would also be helpful to export using the ASE package bundled with atk python. but I'm kind of lost on how to use ASE with QuantumATK. how do I load the MD trajectory, I want all of the data mind you, into atoms objects to export the data to external formats? exporting to trainingsets, then table is probably not what I want to do.

Mayur

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5573
  • Country: dk
  • Reputation: 95
    • View Profile
    • QuantumATK at Synopsys
Re: export MD trajectories to extended XYZ
« Reply #1 on: August 31, 2024, 00:35 »
If it's just exporting to text format, it's probably easiest to just write the exporter in Python yourself, would at most be a few lines of code.

But there is a "secret" conversion function to an ase.Atoms object:
from NL.CommonConcepts.Configurations.Utilities import configurationToAseAtoms
atoms_object = configurationToAseAtoms(configuration)

You now can use this object as you would otherwise in ASE.

For a trajectory I guess you need to loop over the configurations in it, as I am not aware of ASE having a special class for trajectory objects in memory (only files).

Offline msingh96

  • Regular QuantumATK user
  • **
  • Posts: 9
  • Country: us
  • Reputation: 0
    • View Profile
Re: export MD trajectories to extended XYZ
« Reply #2 on: September 3, 2024, 07:40 »
Woah that's convenient!  8)  I came up with a pretty blunt way to extract the values in the end but will probably switch to this!