Dear Stefano,
I tried to write some code that is like the code you wrote, using both s_1psi()
ans s_psi(), and I tested it with a wavefunction I believe is normalized. The
result is a matrix that resembles the identity matrix, except that the diagonal
elements are not one but range from about 0.2 to 0.3. I got a similar result
when I tested the subroutine check_ortho() in ortho_wfc.f90. Is there
something I'm missing?
Here is an example of some code I tested:
call calbec( npw, vkb, evc, becp )
call s_psi(npwx, npw, nbnd, evc, tddft_spsi)
do ibnd = 1, nbnd
do jbnd = 1, nbnd
! calculate <psi_i| S |psi_j>
norm = 0
do ipw = 1, npw
norm = norm + conjg( evc(ipw,ibnd) ) * tddft_spsi(ipw,jbnd)
enddo
write(stdout,*) " i " , ibnd , " j " , jbnd , "<psi_i| S |psi_j>" ,
norm
enddo
enddo
Best regards,
John
________________________________
From: users <[email protected]> on behalf of Stefano de
Gironcoli <[email protected]>
Sent: Tuesday, December 11, 2018 10:26:15 AM
To: [email protected]
Subject: Re: [QE-users] How is the wavefunction supposed to be normalized?
yes, except the S matrix is never stored anywhere but is applied to the wfc by
the s_1psi routine,
so more something like
sum = 0.d0
call s_1psi( npwx, npw, evc(1,b), spsi )
DO i = 1,npw
sum = sum + conjg(evc(i,b)) * spsi(i)
END DO
stefano
On 11/12/18 15:36, John McFarland wrote:
Dear all,
As I understand it, the wavefunction for each k-point is given by ecv(:,:),
with the first index representing a single particle basis and the second index
representing each band. I'm guessing that when a normalized wavefunction is
contracted over the S matrix, the result should equal one for each band. What
I think this would look like in code is:
sum = 0
DO i = 1,npwx
DO j = 1,npwx
sum = sum + evc(i,b) * S(i,j) * evc(j,b)
END DO
END DO
and sum should equal 1 for any band b. Is my understanding correct?
Best regards,
John McFarland
_______________________________________________
users mailing list
[email protected]<mailto:[email protected]>
https://lists.quantum-espresso.org/mailman/listinfo/users<https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.quantum-2Despresso.org_mailman_listinfo_users&d=DwMD-g&c=MNHwOqQ8N1u91SoMLfIblwuGXKgp50OPUXjl8uRAbak&r=aBqxGb3Z1QZuWuPQzYblq8v7-w7hDZgkvgBYwm8sq8Y&m=0_ldi_kPdbF9G-LbLtc8g1MiFx1QDdFx9WUZmApxI8M&s=dRaIjvkziJzsYp5az0bdiOPHS0PsijOxraxkUi-8mkk&e=>
_______________________________________________
users mailing list
[email protected]
https://lists.quantum-espresso.org/mailman/listinfo/users