Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working save trajectory code with energies also being saved for test mace. #123

Merged
merged 4 commits into from
Aug 11, 2024

Conversation

CompRhys
Copy link
Collaborator

@CompRhys CompRhys commented Aug 8, 2024

coords, lattices = (locals().get(key, []) for key in ("coords", "lattices")) was problem line which seemed to always return empty lists, as such it never went into the if statement even with the flag set to true and the other issues didn't cause errors.

mace_traj = Trajectory(
species=relaxed_struct[mat_id].species,
species=atoms.get_chemical_symbols(),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should have been relaxed_struct.species

Copy link
Collaborator Author

@CompRhys CompRhys Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather be sure of the order being the same by taking it from atoms because previously the code was looking at the filtered atoms where there were a large number of extra coords from the filter constraints. n.b. even the original working implementation (a549532) suffered from this flaw which slipped through as the pmg Trajectory class doesn't check lengths at init.

@@ -129,35 +130,39 @@
}[ase_filter]
optim_cls: Callable[..., Optimizer] = {"FIRE": FIRE, "LBFGS": LBFGS}[ase_optimizer]

for atoms in tqdm(atoms_list, desc="Relaxing"):
for atoms in tqdm(deepcopy(atoms_list), desc="Relaxing"):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this deliberate or left over from BatchOptimizer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deliberate in order to be able to repeatedly run the optimization in order to debug as if not the original list is mutated in place. It could be excluded from this PR if wanted but I think the isolation is fairly helpful

Copy link
Owner

@janosh janosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for these fixes @CompRhys! 👍

@janosh janosh merged commit eb6ff66 into main Aug 11, 2024
9 of 10 checks passed
@janosh janosh deleted the fix-save-mace-traj branch August 11, 2024 20:57
@janosh janosh added the mlff Concerning machine learning force fields label Aug 22, 2024
@janosh janosh added the fix Bug fix label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix mlff Concerning machine learning force fields
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants