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

Adding H2 geometry optimzation example #278

Merged
merged 5 commits into from
Jul 15, 2020
Merged

Conversation

gkemlin
Copy link
Collaborator

@gkemlin gkemlin commented Jul 9, 2020

No description provided.

@gkemlin gkemlin requested a review from mfherbst July 9, 2020 14:38
@gkemlin
Copy link
Collaborator Author

gkemlin commented Jul 9, 2020

I could have added the optimization geometry on H2O, but it takes way too much time even on my computer, so I don't think it might be a good idea to put it in the examples as it will take too long to compute on the cloud.

@antoine-levitt
Copy link
Member

Yes, having examples that run quickly is important. What is taking so long here? Is it forces?

@gkemlin
Copy link
Collaborator Author

gkemlin commented Jul 9, 2020

Yes, that's it: computing forces along with optimization in R^9.

examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
@gkemlin
Copy link
Collaborator Author

gkemlin commented Jul 9, 2020

The test on Travis to generate doc is failing with the following error (which I don't get on my computer...) :

┌ Error: error when executing notebook based on input file: `~/build/JuliaMolSim/DFTK.jl/examples/geometry_optimization.jl`
└ @ Literate ~/.julia/packages/Literate/5an7K/src/Literate.jl:594

ERROR: LoadError: LoadError: Cannot map the atom at position [-0.6234998046636102, 4.387574846033396e-6, -1.0048786234097246e-5] to another atom of the same element under the symmetry operation (Stilde, τtilde):
([1 0 0; 0 0 -1; 0 1 0], Rational{Int64}[0//1, 1//1, 40903//40904])

Do you know where it might come from ? Maybe we should not use symmetries ?

examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
@antoine-levitt
Copy link
Member

Oh that's a fun error. I'm guessing our check uses tolerances different from the one spglib uses?

Copy link
Member

@mfherbst mfherbst left a comment

Choose a reason for hiding this comment

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

Thanks! A few remarks.

examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
examples/geometry_optimization.jl Outdated Show resolved Hide resolved
@mfherbst
Copy link
Member

mfherbst commented Jul 9, 2020

Ah yes the issue is that spglib uses a tolerance of 1e-5 to find symmetries, but than we check in DFTK whether these symmetries are correct (with probably a different algorithm). If you add some leg freedom for numerical errors in https://github.com/JuliaMolSim/DFTK.jl/blob/master/src/external/spglib.jl#L90 (like a factor 2 or 5 say) than this error should not show up.

@mfherbst mfherbst changed the title adding geometry optimzation for H2 in the examples Adding H2 geometry optimzation example Jul 10, 2020
@mfherbst mfherbst merged commit a6b41a9 into master Jul 15, 2020
@mfherbst mfherbst deleted the geometry_optimization branch July 15, 2020 07:16
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

Successfully merging this pull request may close these issues.

3 participants