Exemplo n.º 1
0
class Densityofstates(object):
    def __init__(self):
        self.outcar = OutcarHandler()
        self.doscar = DosParserV()
        self.tdos = None
        self.pdos = None
        self.sumdos = None
        self.numtdos = None
        self.numpdos = None
        self.numsumdos = None
        self.atominfo = None
        self.nedos = None
        self.numpdos_add = None

        return

    def dos(self, fermi):
        tdos = copy.deepcopy(self.doscar.tdos)
        pdos = copy.deepcopy(self.doscar.pdos)
        sumdos = copy.deepcopy(self.doscar.sumdos)

        if fermi == 0.0:
            fermi_e = float(self.outcar.param_from_outcar('E-fermi'))
        else:
            fermi_e = fermi

        # Shifting for the fermi level
        for i in range(len(tdos)):
            tdos[i, 0] -= fermi_e

        for i in range(len(pdos)):
            for j in range(len(pdos[i])):
                pdos[i][j, 0] -= fermi_e

        for i in range(len(sumdos)):
            for j in range(len(sumdos[i])):
                sumdos[i][j, 0] -= fermi_e

        self.tdos = tdos
        self.pdos = pdos
        self.sumdos = sumdos
        self.numtdos = self.doscar.numtdos
        self.numpdos = self.doscar.numpdos
        self.numsumdos = self.doscar.numsumdos
        self.atominfo = self.doscar.atoms
        self.nedos = self.doscar.nedos
        self.numpdos_add = self.doscar.numpdos_add

        return
Exemplo n.º 2
0
    def __init__(self, filename='DOSCAR'):
        self.io = IO(filename)
        self.cont = ContcarHandler()
        self.outcar = OutcarHandler()

        self.numtdos = None
        self.numpdos = None
        self.numsumdos = None
        self.tdos = None
        self.pdos = None
        self.sumdos = None
        self.emax = None
        self.emin = None
        self.nedos = None
        self.atoms = None
        self.numpdos_add = 1

        self.ispin = int(self.outcar.param_from_outcar('ISPIN'))
        self.lorbit = int(self.outcar.param_from_outcar('LORBIT'))
        self.lsorbit = str(self.outcar.param_from_outcar('LSORBIT'))

        self.dosline()
        self.parser()
        return
Exemplo n.º 3
0
    def write_intrans_boltztrap(filename, efermi, ewindow, egrid, tmax, tstep, murange, lpfac, boltz_generic):

        outfile = str(filename + ".intrans")
        n_elec = float(OutcarHandler.param_from_outcar('NELECT'))

        with open(outfile, 'w') as out:
            if boltz_generic:
                out.write("GENE          # use generic interface\n")
            else:
                out.write("WIEN          # use wien interface\n")
            out.write("0 0 0 0.0         # iskip (not presently used) idebug setgap shiftgap \n")
            out.write("%7.5f %7.5f %7.5f %i # E-fermi (Ry), energy grid, energy window, NELECT\n"
                      % (efermi, egrid, ewindow, int(n_elec)))
            out.write("CALC                    # CALC (calculate expansion coeff), NOCALC read from file\n")
            out.write("%i                      # lpfac, number of latt-points per k-point\n" % lpfac)
            out.write("BOLTZ                   # run mode (only BOLTZ is supported)\n")
            out.write("%7.5f                   # (efcut) energy range of chemical potential\n" % murange)
            out.write("%i %i                   # Tmax, temperature grid\n" % (tmax, tstep))
            out.write("-1.                     # energy range of bands in sig_xxx and dos_xxx (xxx is band number)\n")
            out.write("HISTO\n")

        return
Exemplo n.º 4
0
    def parser(self, spin):
        print("Reading VASP PROCAR file...")
        with open(self.filename, 'r') as filestr:
            print("Parsing VASP PROCAR file...")
            eig = filestr.readlines()

            # Reading the header part and remove
            self.numkp = int(eig[1].split()[3])
            self.numstates = int(eig[1].split()[7])
            self.numions = int(eig[1].split()[11])

            for i in range(3):
                del(eig[0])

            states_array = []
            path_array = []
            wgt_array = []
            proj_array = []

            # Parse the kp path and band data, then appends to the numpy array
            if spin is False:
                if outcar.param_from_outcar('LSORBIT') == 'F':
                    for i in range(self.numkp):
                        if len(eig[i * ((self.numions + 5) * self.numstates + 3)].split()) != 9:
                            point = []
                            for x in eig[i * ((self.numions + 5) * self.numstates + 3)].split(':')[1].split()[0:-3]:
                                point.append(x.replace("-", " "))
                            path_array.append(" ".join(point).split())
                            wgt_array.append(eig[i * ((self.numions + 5)
                                                      * self.numstates + 3)].split(':')[1].split()[-1])
                            # wgt_array.append(eig[i * (((self.numions + 1) * 4 + 4)
                            #                           * self.numstates + 3)].split(':')[1].split()[-1])

                        else:
                            path_array.append(eig[i * ((self.numions + 5) * self.numstates + 3)].split()[3:6])
                            wgt_array.append(eig[i * ((self.numions + 5) * self.numstates + 3)].split()[8])
                        for j in range(self.numstates):
                            states_array.append(eig[(i * ((self.numions + 5) * self.numstates + 3)
                                                     + 2 + j * (self.numions + 5))].split()[4])
                            for k in range(self.numions + 1):
                                proj_array.append(eig[(i * ((self.numions + 5) * self.numstates + 3)
                                                       + 2 + j * (self.numions + 5)) + 3 + k].split()[:])

                elif outcar.param_from_outcar('LSORBIT') == 'T':
                    for i in range(self.numkp):
                        if len(eig[i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)].split()) != 9:
                            point = []
                            for x in eig[i * (((self.numions + 1) * 4 + 4)
                                           * self.numstates + 3)].split(':')[1].split()[0:-3]:
                                point.append(x.replace("-", " "))
                            path_array.append(" ".join(point).split())
                            wgt_array.append(eig[i * (((self.numions + 1) * 4 + 4)
                                                      * self.numstates + 3)].split(':')[1].split()[-1])

                        else:
                            path_array.append(eig[i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)].split()[3:6])
                            wgt_array.append(eig[i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)].split()[8])

                        for j in range(self.numstates):
                            states_array.append(eig[(i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)
                                                     + 2 + j * ((self.numions + 1) * 4 + 4))].split()[4])
                            for k in range(self.numions + 1):
                                proj_array.append(eig[(i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)
                                                     + 2 + j * ((self.numions + 1) * 4 + 4)) + 3 + k].split()[:])

                # Unifying the array data type to the float, and then reshape arrays to an appropriate shape
                states_array = np.array(states_array, dtype='d')
                path_array = np.array(path_array, dtype='d')
                wgt_array = np.array(wgt_array, dtype='d')
                proj_array = np.array(proj_array)

                states_array = np.reshape(states_array, (self.numkp, self.numstates))
                path_array = np.reshape(path_array, (self.numkp, 3))
                wgt_array = np.reshape(wgt_array, (self.numkp, 1))
                proj_array = np.reshape(proj_array, (self.numkp, self.numstates, self.numions + 1, 5))

            if spin is True:
                proj_tot = []
                proj_mx = []
                proj_my = []
                proj_mz = []

                for i in range(self.numkp):
                    if len(eig[i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)].split()) != 9:
                        point = []
                        for x in eig[i * (((self.numions + 1) * 4 + 4)
                                              * self.numstates + 3)].split(':')[1].split()[0:-3]:
                            point.append(x.replace("-", " "))
                        path_array.append(" ".join(point).split())
                        wgt_array.append(eig[i * (((self.numions + 1) * 4 + 4)
                                               * self.numstates + 3)].split(':')[1].split()[-1])

                    else:
                        path_array.append(eig[i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)].split()[3:6])
                        wgt_array.append(eig[i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)].split()[8])
                    for j in range(self.numstates):
                        states_array.append(eig[(i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)
                                                 + 2 + j * ((self.numions + 1) * 4 + 4))].split()[4])
                        for k in range(self.numions + 1):
                            proj_tot.append(eig[(i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)
                                                   + 2 + j * ((self.numions + 1) * 4 + 4)) + 3 + k].split()[:])
                            proj_mx.append(eig[(i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)
                                                 + 2 + j * ((self.numions + 1) * 4 + 4)) + 3 + k
                                                 + (self.numions + 1)].split()[:])
                            proj_my.append(eig[(i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)
                                                 + 2 + j * ((self.numions + 1) * 4 + 4)) + 3 + k
                                                 + (self.numions + 1) * 2].split()[:])
                            proj_mz.append(eig[(i * (((self.numions + 1) * 4 + 4) * self.numstates + 3)
                                                 + 2 + j * ((self.numions + 1) * 4 + 4)) + 3 + k
                                                 + (self.numions + 1) * 3].split()[:])

                states_array = np.array(states_array, dtype='d')
                path_array = np.array(path_array, dtype='d')
                wgt_array = np.array(wgt_array, dtype='d')
                proj_array = np.array(proj_tot)
                proj_spin_array = np.array([proj_mx, proj_my, proj_mz])

                states_array = np.reshape(states_array, (self.numkp, self.numstates))
                path_array = np.reshape(path_array, (self.numkp, 3))
                wgt_array = np.reshape(wgt_array, (self.numkp, 1))
                proj_array = np.reshape(proj_array, (self.numkp, self.numstates, self.numions + 1, 5))
                proj_spin_array = np.reshape(proj_spin_array, (3, self.numkp, self.numstates, self.numions + 1, 5))

                self.proj_spin = proj_spin_array

            self.path = path_array
            self.states = states_array
            self.wgt = wgt_array
            self.proj = proj_array
            self.parsed = True
            print("Done!")
        return
Exemplo n.º 5
0
class DosParserV(object):
    """
    Class object to parse DOSCAR file from VASP.

    """
    def __init__(self, filename='DOSCAR'):
        self.io = IO(filename)
        self.cont = ContcarHandler()
        self.outcar = OutcarHandler()

        self.numtdos = None
        self.numpdos = None
        self.numsumdos = None
        self.tdos = None
        self.pdos = None
        self.sumdos = None
        self.emax = None
        self.emin = None
        self.nedos = None
        self.atoms = None
        self.numpdos_add = 1

        self.ispin = int(self.outcar.param_from_outcar('ISPIN'))
        self.lorbit = int(self.outcar.param_from_outcar('LORBIT'))
        self.lsorbit = str(self.outcar.param_from_outcar('LSORBIT'))

        self.dosline()
        self.parser()
        return

    def dosline(self):

        orbit_mult = None
        # mag_mult = None

        tdos_avail = [3, 5]
        pdos_avail = [4, 7, 10, 13, 19, 37]

        # tDOS
        # ISPIN = 2, LSORBIT = F
        # 5 - E tu td inu ind
        # Others
        # 3 - E t in
        if self.ispin == 2 and self.lsorbit == "F":
            self.numtdos = 5
            self.numpdos_add = 2
        else:
            self.numtdos = 3

        # pDOS
        # ISPIN=1, LORBIT=10
        # 4  - E s p d
        # ISPIN=2, LORBIT=10
        # 7  - E su sd pu pd du dd
        # ISPIN=1, LORBIT=11,12
        # 10 - E s px py pz dxy dyz dz2 dxz dx2
        # ISPIN=1, LORBIT=10, LSORBIT=T
        # 13 - E st smx smy smz pt pmx pmy pmz dmt pmx pmy pmz

        # ISPIN=2, LORBIT=11,12
        # 19 - E su sd pxu pxd pyu pyd pzu pzd dxyu dxyd dyzu dyzd dz2u dz2d dxzu dxzd dx2u dx2d (????)
        # ISPIN=1,2, LORBIT=11,12, LSORBIT=T
        # 37 - E ???
        if self.lorbit == 10:
            orbit_mult = 3
        elif self.lorbit == 11 or self.lorbit == 12:
            orbit_mult = 9

        if self.lsorbit == "T":
            mag_mult = 4
        else:
            mag_mult = 1

        self.numpdos = (self.ispin * orbit_mult * mag_mult) + 1

        if self.numtdos not in tdos_avail or self.numpdos not in pdos_avail:
            raise NotImplementedError("Can't parse this DOSCAR file!")
        else:
            pass

        return

    def parser(self):
        print("Reading VASP DOSCAR file...")
        filestr = self.io.ReadFile()

        print("Parsing VASP DOSCAR file...")
        dos = filestr.readlines()

        # Reading the header part, only number of kps and number of bands
        # Other header parts are removed
        self.emax = float(dos[5].split()[0])
        self.emin = float(dos[5].split()[1])
        self.nedos = int(dos[5].split()[2])

        for i in range(5):
            del (dos[0])

        tdos_array = []
        pdos_array = []
        sumdos_array = []

        # Writing tDOS part to an array
        del dos[0]
        for i in range(self.nedos):
            tdos_array.append(dos.pop(0).split())
        tdos_array = np.reshape(np.array(tdos_array, dtype='d'),
                                (self.nedos, self.numtdos))

        # Multiplying -1 to down-spin tdos
        if self.numpdos_add == 2:
            tdos_array[:, 2] = tdos_array[:, 2] * -1
            tdos_array[:, 4] = tdos_array[:, 4] * -1

        # Writing pDOS part to an array
        self.atoms = self.cont.atominfo()
        totalcount = 0
        for x in self.atoms.values():
            totalcount += int(x)

        for i in range(totalcount):
            del dos[0]
            tmp_array = []
            for j in range(self.nedos):
                tmp_array.append(dos.pop(0).split())
            tmp_array = np.array(tmp_array, dtype='d')

            if self.numpdos_add == 2:
                up = tmp_array[:, 1::2].sum(1)
                down = tmp_array[:, 2::2].sum(1)
                tmp_array = np.column_stack((tmp_array, up, down))
            else:
                sum = tmp_array[:, 1:].sum(1)
                tmp_array = np.column_stack((tmp_array, sum))

            pdos_array.append(tmp_array)

        # Multiplying -1 to down-spin pdos
        if self.numpdos_add == 2:
            for i in range(totalcount):
                for j in range(self.numpdos + self.numpdos_add):
                    if j == 0:
                        pass
                    else:
                        if np.mod(j, 2) == 0:
                            pdos_array[i][:, j] = pdos_array[i][:, j] * -1
                        else:
                            pass

        # Summing up pDOS to generate sumDOS array
        count = 0
        self.numsumdos = len(self.atoms)
        for x in self.atoms.keys():
            tmp_array = []
            for y in range(int(self.atoms[x])):
                if y == 0:
                    tmp_array = copy.deepcopy(pdos_array[y + count])
                else:
                    tmp_array += pdos_array[y + count]

            tmp_array[:, 0] = tmp_array[:, 0] / int(self.atoms[x])
            count += int(self.atoms[x])
            sumdos_array.append(tmp_array)

        sumdos_array = np.reshape(
            sumdos_array,
            (self.numsumdos, self.nedos, self.numpdos + self.numpdos_add))

        self.tdos = tdos_array
        self.pdos = pdos_array
        self.sumdos = sumdos_array

        print("Done!")
        return
Exemplo n.º 6
0
    def band_data(self, fermi, fakeweight, shift):

        self.eigen = EigenParserV()
        self.numband = self.eigen.numstates

        recvec = np.array(utils().recvec(cont.unitvec()))
        path = np.array([])
        band = np.array([])
        numkp = 0

        # Handling the fake-weight type bandstructure calculations
        if fakeweight is True:
            print("Fake-weight bandstructure calculation...")
            for i in range(len(self.eigen.path)):
                if self.eigen.wgt[i][0] != 0.0:
                    pass
                else:
                    numkp += 1
                    path = np.append(path, self.eigen.path[i])
                    band = np.append(band, self.eigen.states[i])

            path = np.reshape(path, (numkp, 3))
            band = np.reshape(band, (numkp, self.numband))

        else:
            print("Normal bandstructure calculation...")
            numkp = copy.deepcopy(self.eigen.numkp)
            path = copy.deepcopy(self.eigen.path)
            band = copy.deepcopy(self.eigen.states)

        if fermi == 0.0:
            fermi_e = float(Outcar.param_from_outcar('E-fermi'))
        else:
            fermi_e = fermi

        # Shifting for the fermi level value
        # Extra shifting of vbm only if it is turned on
        if shift is True:
            self.bandedge(fermi_e)
            band -= self.vbm[2]
        else:
            band -= fermi_e

        # Converting the path trajectory with 2pi scaling and reciprocal vector
        path_conv = np.array([])

        for i in range(len(path)):
            for j in range(3):
                path_conv = np.append(path_conv, (path[i] * recvec * 2 *
                                                  math.pi)[:, j].sum())

        path_conv = np.array(path_conv, dtype='d')
        path_conv = np.reshape(path_conv, (len(path), 3))

        # Assigning k vector using the distance between k-points
        k_vec = np.array([])
        for i in range(len(path_conv)):
            if i == 0:
                k_vec = np.append(k_vec, 0.0)
            else:
                k_vec = np.append(
                    k_vec, k_vec[i - 1] +
                    (utils.vectordistance(path_conv[i], path_conv[i - 1])))

        k_vec = np.reshape(np.array(k_vec, dtype='d'), (numkp, 1))

        self.numkp = numkp
        self.band = band
        self.kvec = k_vec
        self.path = path
        self.traj = path_conv

        return
Exemplo n.º 7
0
    def projectedband_data(self, fermi, fakeweight, shift, spin, atom,
                           orbital):
        dic = Procar(None, spin).as_dict()

        numbands = dic['numbands']
        numkps = dic['numkps']
        # numions = dic['numions']
        path_orig = dic['path']
        states = dic['states']
        weight = dic['weight']
        proj = dic['proj']
        proj_spin = dic['proj_spin']

        recvec = np.array(utils().recvec(cont.unitvec()))
        path = []
        band = []
        numkp = 0

        atomnum = []
        if atom is not None:
            for x in atom:
                tmp = []
                tmp2 = []
                if '-' in x:
                    for y in range(int(x.split('-')[0]), int(x.split('-')[1])):
                        tmp.append(y)
                    atomnum.append(tmp)
                else:
                    tmp2.append(x)

                if len(tmp2) != 0:
                    atomnum.append(tmp2)
                else:
                    pass

        else:
            pass

        # Handling the fake-weight type bandstructure calculations
        if fakeweight is True:
            print("Fake-weight bandstructure calculation...")
            for i in range(len(path_orig)):
                if weight[i][0] != 0.0:
                    pass
                else:
                    numkp += 1
                    path.append(path_orig[i])
                    band.append(states[i])

        else:
            print("Normal bandstructure calculation...")
            numkp = copy.deepcopy(numkps)
            path = copy.deepcopy(path_orig)
            band = copy.deepcopy(states)

        numkp = np.array(numkp)
        path = np.array(path)
        band = np.array(band)

        if fermi == 0.0:
            fermi_e = float(Outcar.param_from_outcar('E-fermi'))
        else:
            fermi_e = fermi

        self.fermi = fermi_e

        # Shifting for the fermi level value
        # Extra shifting of vbm only if it is turned on
        if shift is True:
            self.bandedge(fermi_e)
            band -= self.vbm[2]
        else:
            band -= fermi_e

        # Converting the path trajectory with 2pi scaling and reciprocal vector
        path_conv = []

        for i in range(len(path)):
            for j in range(3):
                path_conv.append((path[i] * recvec * 2 * math.pi)[:, j].sum())

        path_conv = np.array(path_conv, dtype='d')
        path_conv = np.reshape(path_conv, (len(path), 3))

        # Assigning k vector using the distance between k-points
        k_vec = []
        for i in range(len(path_conv)):
            if i == 0:
                k_vec.append(0.0)
            else:
                k_vec.append(k_vec[i - 1] + (
                    utils.vectordistance(path_conv[i], path_conv[i - 1])))

        k_vec = np.reshape(np.array(k_vec, dtype='d'), (numkp, 1))

        proj_atom = []
        proj_orb = []
        atom_data = []

        for x in cont.atominfo().items():
            atom_data.append(x)

        self.atominfo = atom_data
        numatoms = len(atom_data)

        if atom is None:
            for i in range(numbands):
                for j in range(numkp):
                    proj_atom.append(proj[j][i][-1])

            numatoms = 1

            # proj_atom = np.reshape(np.array(proj_atom), (1, self.eigen.numstates, self.eigen.numkp, 5))

        elif atom is not None:
            if len(atomnum) == 0:
                for i in range(len(atom_data)):
                    proj_atom.append([])

                for i in range(numbands):
                    for j in range(numkp):
                        count = 0
                        for k in range(len(atom_data)):
                            tmp = []
                            for l in range(int(atom_data[k][1])):
                                tmp.append(proj[j][i][l + count])
                            count += int(atom_data[k][1])
                            tmp = np.array(tmp, dtype='d')
                            proj_atom[k].append(np.sum(tmp, axis=0))

                # proj_atom = np.reshape(np.array(proj_atom), (numatoms, self.eigen.numstates, self.eigen.numkp, 5))

            else:
                for i in range(len(atomnum)):
                    proj_atom.append([])

                for i in range(numbands):
                    for j in range(numkp):
                        for k in range(len(atomnum)):
                            tmp = []
                            for l in atomnum[k]:
                                tmp.append(proj[j][i][int(l)])
                            tmp = np.array(tmp, dtype='d')
                            proj_atom[k].append(np.sum(tmp, axis=0))

                numatoms = len(atomnum)
                # proj_atom = np.reshape(np.array(proj_atom), (len(atomnum), self.eigen.numstates, self.eigen.numkp, 5))

        proj_atom = np.reshape(np.array(proj_atom),
                               (numatoms, numbands, numkp, 5))

        # Ion type - # of band - # of kp
        if orbital is False:
            for i in range(len(proj_atom)):
                for j in range(numbands):
                    proj_orb.append(proj_atom[i, j, :, 4])

            proj_orb = np.reshape(np.array(proj_orb),
                                  (numatoms, 1, numbands, numkp))

        # Ion type - type of orbital - # of band - # of kp
        elif orbital is True:
            for i in range(len(proj_atom)):
                for k in range(4):
                    for j in range(numbands):
                        proj_orb.append(proj_atom[i, j, :, k + 1])

            proj_orb = np.reshape(np.array(proj_orb),
                                  (numatoms, 4, numbands, numkp))

        self.path = path_conv
        self.proj = proj_orb
        self.numkp = numkp
        self.band = band
        self.kvec = k_vec
        self.numband = numbands

        if spin is True:
            proj_atom = []
            proj_orb = []

            if atom is None:
                for i in range(numbands):
                    for j in range(numkp):
                        proj_atom.append(proj_spin[2][j][i][-1])
                numatoms = 1

            elif atom is not None:
                if len(atomnum) == 0:
                    for i in range(len(atom_data)):
                        proj_atom.append([])

                    for i in range(numbands):
                        for j in range(numkp):
                            count = 0
                            for k in range(len(atom_data)):
                                tmp = []
                                for l in range(int(atom_data[k][1])):
                                    tmp.append(proj_spin[2][j][i][l + count])
                                count += int(atom_data[k][1])
                                tmp = np.array(tmp, dtype='d')
                                proj_atom[k].append(np.sum(tmp, axis=0))

                else:
                    for i in range(len(atomnum)):
                        proj_atom.append([])

                    for i in range(numbands):
                        for j in range(numkp):
                            for k in range(len(atomnum)):
                                tmp = []
                                for l in atomnum[k]:
                                    tmp.append(proj_spin[2][j][i][int(l)])
                                tmp = np.array(tmp, dtype='d')
                                proj_atom[k].append(np.sum(tmp, axis=0))

                    numatoms = len(atomnum)

            proj_atom = np.reshape(np.array(proj_atom),
                                   (numatoms, numbands, numkp, 5))

            # Ion type - # of band - # of kp
            if orbital is False:
                for i in range(len(proj_atom)):
                    for j in range(numbands):
                        proj_orb.append(proj_atom[i, j, :, 4])

                proj_orb = np.reshape(np.array(proj_orb),
                                      (numatoms, 1, numbands, numkp))

            # Ion type - type of orbital - # of band - # of kp
            elif orbital is True:
                for i in range(len(proj_atom)):
                    for k in range(4):
                        for j in range(numbands):
                            proj_orb.append(proj_atom[i, j, :, k + 1])

                proj_orb = np.reshape(np.array(proj_orb),
                                      (numatoms, 4, numbands, numkp))

            self.proj_mz = proj_orb
        return