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

Minus sign in Fourier transform of projectors #855

Closed
qiaojunfeng opened this issue May 11, 2023 · 6 comments · Fixed by #856
Closed

Minus sign in Fourier transform of projectors #855

qiaojunfeng opened this issue May 11, 2023 · 6 comments · Fixed by #856

Comments

@qiaojunfeng
Copy link
Contributor

While I was rewriting the Wannier interface (#854), I need to project Bloch states onto localized orbitals, so I need sth similar to build_form_factors here,

for l in 0:psp.lmax, m in -l:l
angular = im^l * ylm_real(l, m, q)
for iproj_l in 1:count_n_proj_radial(psp, l)
form_factors[iq, count] = radials_q[iproj_l, l+1] * angular
count += 1
end
end

However, when I check the equations, I think it should be (-im)^l instead of the current im^l. I wrote down some formulas here
https://wannierjl.org/theory/initial_projection/
and some numerical tests here
https://wannierjl.org/theory/pluto_fourier

I uses (-im)^l in the #854, in principle this is just a phase factor of wavefunctions. But for instance, if we were to construct a linear combination of s and px orbitals, then this minus sign will give us different results, s+px or s-px, so maybe we should also update the build_form_factors

@qiaojunfeng
Copy link
Contributor Author

@azadoks maybe you also paste here the table containing investigations on the QE subroutines? Thanks a lot!

@azadoks
Copy link
Contributor

azadoks commented May 11, 2023

Wannier90 interface in QE:  (-i)^l
Atomic WFC code in QE:      (+i)^l
Non-local projectors in QE: (-i)^l
Wikipedia:                  (-i)^l
DFTK code:                  (+i)^l
DFTK docs:                  (-i)^l  (equivalently written as ylm_real(-r/|r|))
ABINIT:                     ??????

@antoine-levitt
Copy link
Member

Yes, of course, https://en.wikipedia.org/wiki/Spherical_harmonics#Parity so the formula at https://docs.dftk.org/dev/developer/useful_formulas/ can (and should) be rewritten as (-i)^l. I think we haphazardly coded the formula in the very beginning of DFTK, and then later did the docs properly, but didn't see there was an error in the code, since it doesn't affect the physical properties... Thanks a lot for finding this! You can just fix it in your wannier (or a separate) PR if that's convenient, otherwise I'll just fix it later.

@antoine-levitt
Copy link
Member

I went ahead and did it: #856

@qiaojunfeng
Copy link
Contributor Author

I went ahead and did it: #856

Thanks a lot for the clarification, this is great!

@mfherbst
Copy link
Member

Thanks for flagging this @qiaojunfeng !

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 a pull request may close this issue.

4 participants