Author Topic: Configurations from MomentTensorPotentialTraining object  (Read 3592 times)

0 Members and 1 Guest are viewing this topic.

Offline jmarmol

  • New QuantumATK user
  • *
  • Posts: 2
  • Country: us
  • Reputation: 0
    • View Profile
I trained some MTP potentials following the examples in https://docs.quantumatk.com/manual/Types/MomentTensorPotentialTraining/MomentTensorPotentialTraining.html and would like to export the configurations that were used for the training, which were generated with the ''RandomDisplacementsParameters' function. When reading the resulting 'mtp_study.hdf5' file in the GUI, I can see each configuration and related energy/force/stress information in the form of a movie, but I haven't been able to extract the coordinates of all the frames into some text file. I could send one frame at a time to the Builder or Editor tool, but this becomes unfeasible when having hundreds of configurations. I also tried reading the  'mtp_study.hdf5' file in the terminal and the trainingSets() function to get the configurations, but I can only get the original reference configuration:
Code
conf=nlread('mtp_study.hdf5', MomentTensorPotentialTraining)[0]
sets=conf.trainingSets()
nlprint(sets[0].referenceConfigurations()[0])
Thanks for your help.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Configurations from MomentTensorPotentialTraining object
« Reply #1 on: June 2, 2022, 01:36 »
sets[0].configurations() should do it (returns a Trajectory)

Please check the documentation of classes in the reference manual, usually you can find the answer there quicker than asking on the Forum :-)
https://docs.quantumatk.com/manual/Types/TrainingSet/TrainingSet.html

Offline jmarmol

  • New QuantumATK user
  • *
  • Posts: 2
  • Country: us
  • Reputation: 0
    • View Profile
Re: Configurations from MomentTensorPotentialTraining object
« Reply #2 on: June 2, 2022, 17:28 »
Thanks Anders. I had already tried that, but the issue is that the object is not a Trajectory, but a RandomDisplacementsParameters object, so I just get:
Code
$ sets[0].configurations()

AttributeError: 'RandomDisplacementsParameters' object has no attribute 'configurations'
I also looked in the reference manual (https://docs.quantumatk.com/manual/Types/RandomDisplacementsParameters/RandomDisplacementsParameters.html), but I can only access the original configuration with the referenceConfigurations() function, not the whole trajectory with repetitions, strain and so on. I'm attaching the HDF5 file in case you can take a look. I can see all the configurations in the GUI with the Trajectory Analyzer tool, but I would like to be able to extract these with a script since there are about 200 configurations. Thanks for your help.