Trajectory file with varying number of atoms
Issue #162
resolved
Hello, We are three prospective AMP users and we were wondering if there was a way to load as trajectory files, snapshots composed of varying number of atoms, as it seems from ASE that this can be only done with a database module.
Thanks, G & A & R
Comments (3)
-
repo owner -
I don't think that ASE trajectory files have to have a constant number of atoms. Each of the "Atoms" objects in the trajectory is independent. My Amp script does the following (quite similar to what Andrew wrote above):
# Make training set trajectory traj_train = Trajectory('training.traj', mode='w') training_set_1 = read('input_1.xyz', index=(':'), format='xyz') for atoms in training_set_1: traj_train.write(atoms) training_set_2 = read('input_2.xyz', index=(':'), format='xyz') for atoms in training_set_2: traj_train.write(atoms) calc.train(images='training.traj')
I think the issue can be closed.
-
repo owner - changed status to resolved
Yes, this was fixed upstream in ASE. The trajectory format now can take variable numbers of atoms.
- Log in to comment
Yes, that's a bit of a limitation of the ASE trajectory format. The database is a good way to proceed. If you want to avoid that format, you can just feed Amp a list of images that you assemble in your script. E.g., something like
(then pass
images
to Amp.train). Does that work?If you have suggestions for a better way, please let us know! We are trying to avoid creating yet another file format for atoms.