-
Notifications
You must be signed in to change notification settings - Fork 111
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
Fix breaking change to ISMEAR=-5 handling for NKPT<4 (attempt 2) #337
Conversation
After some discussion with @Andrew-S-Rosen, we decided on the following:
There's a new function If the calculation uses explicit k-points, or if the k-point density has already been increased, fall back to Gaussian smearing.
Only remaining task is to generate a test file for the |
Thanks, @esoteric-ephemera! A few comments from me in return based on your changes. I fully approve the "tet" error handler changes but have some remaining questions about the "dentet" error handler.
custodian/custodian/vasp/handlers.py Line 1900 in d8a7896
|
@esoteric-ephemera: For the large structure test, you may wish to use https://next-gen.materialsproject.org/materials/mp-1200292 and/or https://next-gen.materialsproject.org/mofs/qmof-d475ee7 as representative examples. The former is a zeolite on the Materials Explorer, and the latter is a MOF from the MOF Explorer. |
Thanks @Andrew-S-Rosen!
Good point - the first check is now ensuring the grid is Gamma-centered. If it is, then the k-point density is increased at most twice. Then the smearing is changed. Warnings are raised each time
That's intentional - there should always be at least one k-point used in the calculation. Note these are the actual number of k-points used, a zero here doesn't mean automatic grid generation
Yeah it may be, feedback on this is welcome. It's been moved to a separate
No this just bumps up the k-point density until it finds a grid which has more k-points than the original grid, and has at least the number of
Added as suggested - this is a good fallback |
Thanks! My only remaining question is if bumping up to 2x2x1 in an example like the zeolite is wise. That's likely a very painful increase in cost, and so the question I'm still wrestling with is it worth it to do this or instead fall back to the ISMEAR change? And if so, where do we define that breakeven point? Do we try to avoid changing gamma-point only calculations at all? (NB: remember that switching to the standard version of VASP not only slows down execution but also means you can't rely on an old WAVECAR anymore and have to do SCF from scratch) These are tough, subjective questions without a clear answer so let's not let it hold up this PR. But just something to think on. In any case, your changes make sense to me. Thank you! |
I would suggest a small mod - add a |
…able k-point increase for large structures
Thanks @Andrew-S-Rosen and @shyuep! I've added a There may be discussion needed as to whether the k-point density increase is worthwhile keeping. There are clear cases (slabs/surfaces, wires) where increasing the k-point density isn't physically a good idea. And many examples that @Andrew-S-Rosen has brought up for practical reasons It's at least there if we choose to stick with it, but the simplest and best solution may just be to change the smearing and warn the user |
custodian/vasp/handlers.py
Outdated
@@ -66,17 +67,20 @@ class VaspErrorHandler(ErrorHandler): | |||
""" | |||
|
|||
is_monitor = True | |||
max_natoms: int = 50 |
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.
It's likely worth adding documentation here because it's not immediately obvious to the end-user what this is being used for.
With numpy docstrings, you can do
Attributes
----------
is_monitor
blah blah
max_natoms
blah blah blah
Also, I think max_natoms
as a name might be misleading because the user might think that they should (for some reason) be specifying the maximum number of atoms across all the systems they intend to run with Custodian when in reality, it is simply a tolerance used elsewhere. Admittedly, I am not sure of a better name (maybe natoms_tol
? no...).
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.
Fleshed out the docstr a bit and renamed this to num_sites_kpoint_cutoff
. Not the most appealing name but hopefully clearer
Thank you, @esoteric-ephemera! I appreciate your hard work on this. I have left one comment but otherwise am happy to defer to you and @shyuep for the remainder of this PR. |
This looks good to me. Is it ready to be merged? |
Sorry! I was on vacation without internet access. It's ready to go from my perspective. Just for second opinions: @Andrew-S-Rosen and @mkhorton, do you have any concerns about the new logic/handling? |
No comments from me, except thank you! Also, good catch about the bug in the VASP manual. |
Closes #335.