Closed bernstei closed 10 months ago
Although, I'm a bit confused, because it should fail when it tries to rerun with the non-True pbc.
[edited] Apparently something entirely inexplicable is happening. In the calculates that are automatically triggered the atoms object ends up with pbc True, despite the fact that the one that's getting passed in has pbc False. It just changes value for no apparent reason. I can print atoms.pbc
in BaseCalculators.get_property
and it's [False] * 3
, but as far as I can tell it calls Vasp.calculate
, and it gets atoms.pbc
of [True] * 3
, despite the fact that as far as I can tell there's nothing in between except entering the function.
[edited more] I can't do a simple reproduction. I wonder if it has something to do with the fact that these modifications of pbc are happening inside of the derived class Vasp.calculate
, and so the changes are happening in weird places relative to where the testing for changed atomic configurations is done.
I've worked around this, for now at least, by using Calculator.results
in save_results()
if available. Works for VASP, won't work for CASTEP, but the issue is, so far as I can tell, only happening if the pbc manipulation is being done. That manipulation is required for ase.calculators.vasp.Vasp
, so our wrapper does it, while the ASE Castep apparently just overwrites it or something, so that'll have to be handled differently.
I think I found a cleaner solution. PR coming soon.
The wfl Vasp calculator wrapper changes all the pbcs to
True
before actually running VASP since the ASE Vasp calculator complains otherwise, and then changes back once the calculation is done. However, the saving of the properties triggers additional VASP runs, basically because the ASE system detects the change in pbc values as a change to the system and invalidates the cache whensave_results()
calls things likeget_potential_energy()
.For VASP it'd be easy enough to make
save_results()
try to grab the values fromatoms.calc.results
, which won't trigger another evaluation. I'm not sure how that'd behave with CASTEP, which doesn't have aCalculator.results
dict.