DFTK.jl icon indicating copy to clipboard operation
DFTK.jl copied to clipboard

Cell to supercell routines

Open LaurentVidal95 opened this issue 3 years ago • 5 comments
trafficstars

All the routines contained in the former "ifft on the supercell and plotting wannier functions" without the plotting part.

LaurentVidal95 avatar Mar 10 '22 16:03 LaurentVidal95

Hello everyone, I tried to follow your recommendations Michael hope I didn't break everything !

LaurentVidal95 avatar Mar 10 '22 16:03 LaurentVidal95

Much nicer @LaurentVidal95 , thanks. I'll take a look.

mfherbst avatar Mar 10 '22 16:03 mfherbst

I'm putting back here the description of the last commit: I cleaned and documented (as clearly as I could) a supercell.jl file that basically provides a cell_to_supercell function applying to basis and scfres. These routines are also covered by tests that work on my laptop.

Unfortunately theses routines take quite a long time for real cases (with big kgrid the number of electrons in the supercell is skyrocketing) and I cannot use them to plot as I wanted to. (This was the first motivation for this PR). I have a faster way to do iFFT and plot Wannier functions on the supercell but it doesn't use the general cell_to_supercell function and is more a personal code than a real addition to the DFTK.jl code.

So I have removed all the plot_wannier_function functions appearing in the previous PR and only kept supercell.jl, so that you can use these routines if you're still interested.

(PS: I was able to plot Wannier function with Makie, so that it appears in the wannier90 example, but it keeps somehow squaring up the supercell, is quite heavy to use and the result is not very nice. Maybe the responsibility is on me, not knowing the proper commands, so I can keep digging if needed).

LaurentVidal95 avatar Mar 10 '22 16:03 LaurentVidal95

Dear all, I'm sorry I forgot this branch was involved in a pull request and I pushed it for one of my own code... I hope the tests are not too long. I didn't find how to cancel the push !

LaurentVidal95 avatar Sep 28 '22 09:09 LaurentVidal95

@LaurentVidal95 We / you can also close the PR if you're not really working on this any more (and reopen later or make a new PR later).

mfherbst avatar Oct 12 '22 07:10 mfherbst

SCF accuracy

                          is_converged=DFTK.ScfConvergenceDensity(1e-12),
                          determine_diagtol=DFTK.ScfDiagtol(diagtol_max=1e-12),

epolack avatar Oct 13 '22 12:10 epolack

In the last commit Étienne fixed the test. I still have to adapt to the other supercell PR.

LaurentVidal95 avatar Oct 14 '22 14:10 LaurentVidal95

LGTM, let's merge once Etienne adds his supercell construction routine

antoine-levitt avatar Oct 19 '22 12:10 antoine-levitt

@antoine-levitt I merge the PR of @epolack so you can review the PR and merge if happy with it ! (I rebase beforehand though if needed)

LaurentVidal95 avatar Oct 19 '22 12:10 LaurentVidal95

LGTM

antoine-levitt avatar Oct 19 '22 14:10 antoine-levitt

@LaurentVidal95 There is an issue with MPI. Either disable the routines for MPI or fix it (probably as easy as using a gather_kpts_scfres).

Will do a more careful review later.

mfherbst avatar Oct 19 '22 15:10 mfherbst

Just nits. Otherwise LGTM.

mfherbst avatar Oct 20 '22 08:10 mfherbst

Just a note to add checks for MPI in the main routines (tbd by Michael or Laurent)

epolack avatar Oct 20 '22 13:10 epolack

Just a note to add checks for MPI in the main routines (tbd by Michael or Laurent)

Just realised that will actually be taken care off automatically by the PlaneWaveBasis constructor for only one k-point (which will throw in each MPI process, so no deadlock)

mfherbst avatar Oct 20 '22 14:10 mfherbst