Skip to content

Implement Newton DFT solver#75

Merged
prehner merged 10 commits intomainfrom
newton_solver
Dec 4, 2022
Merged

Implement Newton DFT solver#75
prehner merged 10 commits intomainfrom
newton_solver

Conversation

@prehner
Copy link
Copy Markdown
Contributor

@prehner prehner commented Nov 11, 2022

This PR implements a quickly converging Newton DFT solver that uses a matrix-free linear solver (GMRES) to calculate the linear subsystem. The action fo the Jacobian on the Newton step is calculated efficiently using fast Fourier transforms.

In addition, a solver log is added to every DFTProfile that keeps track of the residual and the execution time of the solver. This allows a detailed analysis of the choice of solver and solver parameters for any DFT calculation.

closing #74

@prehner prehner added enhancement New feature or request DFT DFT related feature or issue labels Nov 11, 2022
@prehner prehner linked an issue Nov 11, 2022 that may be closed by this pull request
@prehner prehner linked an issue Dec 1, 2022 that may be closed by this pull request
@prehner prehner marked this pull request as ready for review December 1, 2022 13:02
Copy link
Copy Markdown
Contributor

@g-bauer g-bauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two overarching comments:

  • the damping coefficient is \nu in the documentation (theory section) and \beta in the code and in the interfaces which can be confusing when going through the theory section and then work with the code - should we change it to be \nu in the interfaces/code as well (breaking change)?
  • nitpick: dr vs \mathrm{d}r for integrals is different in each document. We should decide which variant to use and use it everywhere.

Awesome PR!

Comment thread docs/theory/dft/euler_lagrange_equation.md Outdated
Comment thread docs/theory/dft/euler_lagrange_equation.md Outdated
Comment thread docs/theory/dft/euler_lagrange_equation.md Outdated
Comment thread docs/theory/dft/solver.md Outdated
Comment thread docs/theory/dft/solver.md Outdated
Comment thread docs/theory/dft/solver.md Outdated
Comment thread docs/theory/dft/solver.md Outdated
Comment thread feos-dft/src/profile.rs Outdated
Comment thread feos-dft/src/python/solver.rs
Comment thread feos-dft/src/python/solver.rs
@prehner
Copy link
Copy Markdown
Contributor Author

prehner commented Dec 3, 2022

You are right! The notation in the theory guide should follow the code as close as possible. That is the wohle point of it.

So beta is already used of course. alpha is also commonly used when discussing line search, but alpha is used as a segment index. I went with the very explicit damping_coefficient instead of a spelled out greek letter. This is indeed a breaking change in Python but I think that is ok.

@prehner prehner merged commit d0127e1 into main Dec 4, 2022
@prehner prehner deleted the newton_solver branch December 4, 2022 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DFT DFT related feature or issue enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theory guide: DFT solvers Second order DFT solver

2 participants