Amp doesn't reset calculator results when parameters changed

Issue #96 resolved
andrew_peterson repo owner created an issue

If a user manually (or through some outside script) changes Amp's parameters while it holds a calculation result, then re-calls a method like get_potential_energy(), no new calculation is performed. E.g.,

calc = Amp.load(...)
atoms.set_calculator(calc)
e1 = atoms.get_potential_energy()
calc.parameters = ...  # Some line to change parameters internally
e2 = atoms.get_potential_energy()

Here, e1 and e2 will be the same, when in general they should not be. I think Amp needs to call

self.reset()

to clear the ase.calculators.calculator.Calculator's memory when it notices its internal state has changed, because ASE doesn't notice any change.

Comments (3)

  1. andrew_peterson reporter

    The user should be doing calc.set(parameter3=45) or similar, not accessing the parameters dictionary directly. I will close this for now as calc.set works correctly.

  2. Log in to comment