Assertion for "force_consistent=True"

Issue #104 new
Georg Kastlunger created an issue

We should add an assertion or exception if the user loads trained amp files, where the force_consistent=True keyword has been used, but does not explicitly give the keyword when restarting and viceversa.

This could be done in two ways:

  • Add an assertion somewhere in AMP
  • Change the call from ase.results so it creates an error when the keyword is given (or not) and the respective energy is not available.

Comments (5)

  1. andrew_peterson repo owner

    Or more specifically, the error would be raised at the point when the user calls calc.get_potential_energy(force_consistent=False).

  2. andrew_peterson repo owner

    It's been a while since we discussed this, but I think the idea is that users could choose to train with force-consistent or 0-Kelvin energy. That is, we might add a force_consistent keyword to Amp.train. Then we need to have the force_consistent keyword in energy and force call methods, and raise an error if it doesn't match what was chosen during training. Does that make sense?

  3. Alireza Khorshidi

    The first part seems simple, we just add a force_consistent keyword to Amp.train and propagate it to the model/__init__.py and add it to image.get_potential_energy.

    However, what I am confused about is the second part where we need to access force_consistent keyword fed by the user when calling

    calc = Amp(...)
    image.set_calculator(calc)
    image.get_potential_energy(force_consistent=True)
    

    (and then compare it with the value saved in calc.amp). Let's discuss it more in person, if what I said is not clear.

  4. andrew_peterson repo owner

    The force consistent keyword is already there through the ASE calculator. See this link.

    So we just need to work within this framework, I would think.

    Note I have a patch in progress for ASE that will make that force_consistent keyword work better. Perhaps we just want to put this issue on hold until after v0.5 since we're not using it at the moment.

  5. Log in to comment