예제 #1
0
파일: wfkfile.py 프로젝트: akakcolin/abipy
    def get_wave(self, spin, kpoint, band):
        """
        Read and return the wavefunction with the given spin, band and kpoint.

        Args:
            spin: spin index. Must be in (0, 1)
            kpoint: Either :class:`Kpoint` instance or integer giving the sequential index in the IBZ (C-convention).
            band: band index.

            returns:
                :class:`WaveFunction` instance.
        """
        k = self.kindex(kpoint)

        if (spin not in range(self.nsppol) or 
            k not in range(self.nkpt) or
            band not in range(self.nband_sk[spin, k])):
            raise ValueError("Wrong (spin, band, kpt) indices")

        ug_skb = self.reader.read_ug(spin, kpoint, band)

        # Istantiate the wavefunction object and set the FFT mesh
        # using the divisions reported in the WFK file.
        wave = PWWaveFunction(self.nspinor, spin, band, self.gspheres[k], ug_skb)
        wave.set_mesh(self.fft_mesh)

        return wave
예제 #2
0
def pww_rspace_translation(self, tau):
    gsph = self.gsphere.copy()
    wpww = PWWaveFunction(self.structure, self.nspinor, self.spin, self.band,
                          gsph, self.ug.copy())
    wpww.set_mesh(self.mesh)
    wpww.pww_rspace_translation_inplace(tau)
    return wpww
예제 #3
0
    def get_wave(self, spin, kpoint, band):
        """
        Read and return the wavefunction with the given spin, band and kpoint.

        Args:
            spin: spin index. Must be in (0, 1)
            kpoint: Either :class:`Kpoint` instance or integer giving the sequential index in the IBZ (C-convention).
            band: band index.

            returns:
                :class:`WaveFunction` instance.
        """
        ik = self.kindex(kpoint)

        if (spin not in range(self.nsppol) or ik not in range(self.nkpt)
                or band not in range(self.nband_sk[spin, ik])):
            raise ValueError("Wrong (spin, band, kpt) indices")

        ug_skb = self.reader.read_ug(spin, kpoint, band)

        # Istantiate the wavefunction object and set the FFT mesh
        # using the divisions reported in the WFK file.
        wave = PWWaveFunction(self.structure, self.nspinor, spin, band,
                              self.gspheres[ik], ug_skb)
        wave.set_mesh(self.fft_mesh)

        return wave
예제 #4
0
def pww_translation(self, gvector, rprimd=None):
    """Returns the pwwave of the kpoint translated by one gvector."""
    gsph = self.gsphere.copy()
    wpww = PWWaveFunction(self.structure, self.nspinor, self.spin, self.band,
                          gsph, self.ug.copy())
    # wpww.mesh = self.mesh
    wpww.set_mesh(self.mesh)
    wpww.pww_translation_inplace(gvector, rprimd)
    return wpww