[gpaw-users] wannier.py : Wannier functions not orthonormal
Ravindra Shinde
neelravi at gmail.com
Tue Aug 13 00:18:52 CEST 2019
Hi All,
I am adding a module to GPAW which requires calculations of Wannier
functions. I am using wannier.py to store them into cube files. These
functions will be read and tested for orthonormality. However, I found that
the overlap matrix of these functions is not identity.
Following are the input files which can reproduce the results and the
added function (to the wannier.py) which calculates the overlap matrix.
def wannier_overlap_matrix(self, calc):
""" This function computes the overlap between Wannier orbitals
stored on the grid """
centers = self.get_centers()
num_wann = np.shape(centers)[0]
overlap = np.zeros((num_wann, num_wann))
for i in range(num_wann):
for j in range(i,num_wann):
wann_i = self.get_function(calc, i, pad=False)
wann_j = self.get_function(calc, j, pad=False)
overlap[i][j] =
(calc.wfs.gd.dv*Bohr**3)*np.sum(wann_i*wann_j)
overlap_matrix = np.transpose(overlap) + overlap
overlap_matrix[np.diag_indices_from(overlap_matrix)] /= 2.0
np.savetxt("overlap_matrix.txt", (overlap_matrix), fmt='%8.6f',
delimiter=' ', newline='\n', header='Overlap Matrix', comments='# Ravindra
:: ', encoding=None)
return
Best regards,
*Ravindra Shinde, Ph.D.*
Department of Chemical and Environmental Engineering
University of California, Riverside
Email: ravindra.shinde at ucr.edu
Phone: +1(951) 466-8168
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/gpaw-users/attachments/20190812/e4f82f8e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01_benzene.py
Type: text/x-python
Size: 948 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/gpaw-users/attachments/20190812/e4f82f8e/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02_benzene_wannier.py
Type: text/x-python
Size: 686 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/gpaw-users/attachments/20190812/e4f82f8e/attachment-0001.py>
More information about the gpaw-users
mailing list