-
Notifications
You must be signed in to change notification settings - Fork 1
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
Basic implementation of geometry optimization interface. #1
Conversation
Thanks, Cedric! @tjjarvinen please do a first-round review and I'll then look at it also as soon as I can manage, probably within the next 2-3 days. |
We can add a Stillinger-Weber and a Lennard-Jones test either to the examples or to the tests even. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main issue is the use of system.particles
. AtomsBase has an iterator over particles, so you can mostly just use system
instead.
The second point is that AbstractSystem
is an abstract type and both FlexibleSystem
and FastSystem
are it's subtypes. But only FlexibleSystem
would work with the code.
Thaks @tjjarvinen for the helpful review. Fixes are now implemented. |
Why is there a type restriction |
Probably not, but I think at least for optimize_geometry is useful to catch sanely programming errors where a user accidentally swaps the argument order, don't you think? |
My perspective is that abstract types are not supposed to be used to document, only to organize dispatch. I understand that's not how it is always used (even in Base). This resulted in my having to copy-paste entire functions from Base into my own code and remove the type annotation to be able to use it. Until there is multiple inheritance I prefer to not restrict type signatures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I right that the big missing gap is the optimization of the cell shape? This is an absolute must I think. Once we have that, and a more general mask, then the question how to organize DOFs becomes a little interesting. In JuLIP I had a DofManager
that organized this for me.
I left some comments - we can iterate on what should be done now or can be postponed. |
Changes implemented. Ready for another round of review.
|
I somewhat agree, but I don't think that this excuses the ambiguity.
Yes we could define tasks or solvers whatever you want to call them and the run something more generic like solver = EnergyMinimizer()
solver = DimerMethod()
optimize(system, solver) But then the debate just shifts to whether This isn't a big deal. We have a community package and the community can decide how to name things. If I'm outvoted then that's fine and as author you arguably have a bigger say. But my own proposal remains to be unambiguous and bearing in mind that the first three obvious geometry optimization tasks we will want to support are
|
I am fine with this. From my point all fine with the PR. |
Let's get quick feedback from @mfherbst @rkurchin on the naming convention for If you don't want to reread the thread: I am suggesting that |
I guess it depends what is more obvious (and therefore can be left implied), if it's the energy or the geometry. Given the title of the package, @cortner 's suggestion seems reasonable to me. (I guess when dealing with code or math, I typically think about optimizing the objective function, but when thinking more about the application I would think about optimizing the decision variables.) (FWIW, when teaching students how to model concrete problems as mathematical optimization they seem to have more trouble figuring out the unknowns than the criterion, but I'm not sure what side, if any, this speaks in favor of) |
Given the above discussion, I agree with the suggestions and changed I think all comments are addressed now. |
I don't think so. Various comments have been unaddressed and not responded to. |
a71dfc4
to
a3a9a2b
Compare
@cortner sorry I did not respond to the comments. I now added answers in the thread at the corresponding locations.
I hope this addresses what I had left out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for slow response here, I'm back online now – mostly LGTM, but I would strongly advocate for separating out constraints, see my comments for more detail.
On the minimize_energy versus optimize_geometry debate I think given the name of the package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly formatting nits
@CedricTravelletti , thanks for following up. I want to take a quick look at the position and cell optimization before merging if that's ok? I actually can't find examples or tests for optimizing a supercell with and without the cell shape included in the optimization? Can you point me to where I should look? |
Dear Christoph With Michael we think that the part about cell shape optimization can go in a different PR, since there will probably be much more to discuss on that one. So for now, I suggest that this PR only handles fixed cell optimization and that variable cell optimization is taken care of in a next PR mergin the |
Ok. |
In that case is it ready? |
I'm happy for this to be merged! Perhaps we should open an issue regarding the cell shape optimization just to keep visible that that's a to-do item? |
Yes, the non unit-cell optimization part is ready. |
This is a basic implementation of the geometry optimization interface. It allows for plug-and-play modifications of the computational backend through the specification of an AtomsCalculators and also for using various optimization libraries via Optimization.jl.
It features a bunch of examples showcasing the above capabilities.