-
Notifications
You must be signed in to change notification settings - Fork 18
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
[WIP] Prototypes for Energy, Forces, Virials #85
Conversation
@tjjarvinen -- can you please add a draft documentation page that explains the interface. I think we are more or less on the same page. |
I would actually add here that maybe the default should also include: function forces!(f, data, calc; kwargs...)
f .= forces(data, cal; kwargs...)
return f
end
function energy_forces_virial(data, calc; kwargs...)
e = energydata, calc; kwargs...)
f = forces(data, calc; kwargs...)
v = forces(data, calc; kwargs...)
return (; :energy=>e, :forces=>f, :virial=>v)
end etc. Also, I would say that |
Yes, something like that should be added, I forgot to add this to the list at the top. The reason I didn't yet add it to the code, is I'm not sure which should the default be? Don't we want the codes to implement forces(sys, calc) = forces!(alloc(...), sys, calc) |
regarding E, F, _ = energy_forces_virial but I dont have a strong view on this. What about Somehow I'd prefer to focus on a minimal set and the two potential_energy
energy_forces_virial! seems to be the two natural ones to implement. |
No. Not all methods can calculate virial and you want those to throw error. This is the case e.g. in isolated molecules, where virial is meaningless. |
One can equally argue that the virial is simply zero in that case since the energy doesn't change when you change cell shape. |
If you do constant volume simulation, you don't want to spend time to calculate virials. So, calling a method that calculates virials is a waste. For me |
It has essentially zero extra cost if you already compute the forces. But ok, let's assume this. then why And why should |
I meant for the combinations only
For our ACE code it is not essentially free. It takes a considerable amount of time to gather the final value. |
I don’t think you are right - let’s benchmark this and stop arguing here. |
I think this debate had become unproductive. I’m closing the PR and will open a new one with a more succinct proposal. |
This PR goes with #84 - For the time being I propose to do no more than
For now I am leaving out the general
calculate
prototype and will add it only if there is at least partial agreement on that.