Skip to content
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

Consider redesign of constraints #20

Open
cortner opened this issue Oct 1, 2016 · 19 comments
Open

Consider redesign of constraints #20

cortner opened this issue Oct 1, 2016 · 19 comments

Comments

@cortner
Copy link
Member

cortner commented Oct 1, 2016

to make it easy to implement much more general constraints, Including bound constraints, box constraints, all sorts of useful stuff.

@cortner
Copy link
Member Author

cortner commented Oct 12, 2016

FixedCell and VariableCell would either become DofManagers or alternatively VariableCell could be the default while FixedCell just becomes another constraint to add to the system.

@thudso
Copy link

thudso commented Oct 30, 2018

Constraints which maintain cubic symmetry of the cell (or other symmetries) during minimisation would be helpful. I occasionally get 1e-5 variation in side lengths for the unit cell, which can lead to significant asymmetry when constructing large systems.

@jameskermode
Copy link
Collaborator

We have this in Python already :-)

@jameskermode
Copy link
Collaborator

@cortner
Copy link
Member Author

cortner commented Oct 30, 2018

interesting - how would one implement this?

@cortner
Copy link
Member Author

cortner commented Oct 30, 2018

Are these just linear constraints on the cell matrix?

@jameskermode
Copy link
Collaborator

Essentially we use spglib to find the symmetry group and project out contributions to force and stress that depart from symmetry.

@cortner
Copy link
Member Author

cortner commented Oct 30, 2018

force as well?

@jameskermode
Copy link
Collaborator

Yes - atomic positions may be symmetry-constrained for multilattices

@jameskermode
Copy link
Collaborator

Maybe this is a good example of a special-case that should be coded once, and this provides an opportunity to improve JuLIP <---> ASE convenience bindings

@jameskermode
Copy link
Collaborator

It's currently implemented by wrapping the Calculator, but I've agreed to try to turn it into an ASE constraint. Could we add an ASEConstraint wrapper to JuLIP that calls adjust_forces() and adjust_positions()?

@cortner
Copy link
Member Author

cortner commented Oct 30, 2018

But we would allow this only for linear constraints. Even then I'm a bit nervous... One also needs to incorporate the constraint into the preconditioners...

@jameskermode
Copy link
Collaborator

That's fair. In the ASE implementation we just project back on to the constraint manifold after each step and it seems to work (most of the time), even with the preconditioned optimizers.

Perhaps an advantage of keeping it as a Calculator wrapper is that a non-linear transformation of the forces and stresses is then ok?

Code is not huge it you want to reimplement in Julia, I'm just worried about the overhead if we have to code/test/maintain everything twice

https://gitlab.com/ase/ase/merge_requests/950/diffs?view=inline

@cortner
Copy link
Member Author

cortner commented Oct 30, 2018

Well, my suggestion would be as a first step to not automate it as you did, but to put the burden onto the user :). I.e. just offer the option of a linear constraint on the cell.

As a second step we could maybe find out how to "read" the constraint from ASE but then implement it within the JuLIP framework.

@jameskermode
Copy link
Collaborator

Sounds like a good plan

@cortner
Copy link
Member Author

cortner commented Oct 30, 2018

Tom - can we have a chat at some point about how to implement - and more important test - this?

@thudso
Copy link

thudso commented Oct 30, 2018

Certainly!

@cortner
Copy link
Member Author

cortner commented Jul 8, 2019

Some thoughts on a new DoF Manager Design:

  • have a generic Dog Manager
  • the atoms mask can be a specific constraint that we can apply
    set_constraint!(Clamp(free = , clamp = , mask = , clampx = , clampy = , ... ))
    set_contraint!(InPlane), set_constraint!(AntiPlane)
  • set_variablecell!(true/false) or set_fixedcell!(true / false)
    or set_constraint!(FixedCell), set_constraint!(VariableCell)
  • clear_constraints!(at)

@cortner
Copy link
Member Author

cortner commented Jul 16, 2019

new dof manager is done. Will look at linear constraints when there is time / a need!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants