Hi all,
I'd like to compute the overlap between Bloch states. For a given computed wavefunction \psi_k I have tried getting its overlap with itself as a first test as:
wfc = nlread('file.hdf5', BlochState)[-1]
wfc_array = wfc.toArray()
wfc_s0 = wfc_array[:,:,:,0]
psi_2 = numpy.conj(wfc_s0) * wfc_s0
delta_x = wfc.gridCoordinate(1,1,1).inUnitsOf(Bohr)[0]
integrated_x = numpy.trapz(psi_2, axis=0, dx=delta_x)
integrated_y = numpy.trapz(integrated_x, axis=0, dx=delta_x)
overlap = numpy.trapz(integrated_y, axis=0, dx=delta_x)
(Note: cell is simple cubic so dx=dy=dz)
And that final 'overlap' would be the final result. Does this seem correct? The overlap doesn't integrate to 1 , or to a number of electrons as far as I can see. Although that's to be expected perhaps? Any feedback would be greatly appreciated.
Thanks for your help,
A
Here is a better way:
from NanoLanguage import *
bulk_configuration = BulkConfiguration(
FaceCenteredCubic(4.08*Angstrom),
[Gold],
[[0, 0, 0]]*Angstrom,
)
bulk_configuration.setCalculator(LCAOCalculator())
bloch_state_5 = BlochState(bulk_configuration, quantum_number=5, k_point=[0.0, 0.5, 0.5])
bloch_state_6 = BlochState(bulk_configuration, quantum_number=6, k_point=[0.0, 0.5, 0.5])
[a,b,c] = bloch_state_6.volumeElement()
dV = numpy.dot(numpy.cross(a,b),c)
# These should be 0.0
i56 = numpy.abs(numpy.sum(e5.conjugate()*e6))/Ang**3 * dV
i65 = numpy.abs(numpy.sum(e6.conjugate()*e5))/Ang**3 * dV
print i56, i65
# These should be 1.0
i55 = numpy.abs(numpy.sum(e5.conjugate()*e5))/Bohr**3 * dV
i66 = numpy.abs(numpy.sum(e6.conjugate()*e6))/Bohr**3 * dV
print i55, i66