Beispiel #1
0
    def setUp(self):
        conf_file = _rpath + 'example.cfg'
        self.pars = ConfigParameters(conf_file)
        self.pars.parse_input()
        vasp_data = VaspData(_rpath + 'one_site/')
        self.el_struct = ElectronicStructure(vasp_data)

        efermi = self.el_struct.efermi
        self.eigvals = self.el_struct.eigvals - efermi
        struct = self.el_struct.structure
        kmesh = self.el_struct.kmesh

        self.proj_sh = ProjectorShell(self.pars.shells[0], vasp_data.plocar.plo, vasp_data.plocar.proj_params, kmesh, struct, 0)
        self.proj_gr = ProjectorGroup(self.pars.groups[0], [self.proj_sh], self.eigvals)
Beispiel #2
0
    def setUp(self):
        """
        """
        conf_file = _rpath + 'example.cfg'
        self.pars = ConfigParameters(conf_file)
        self.pars.parse_input()
        vasp_data = VaspData(_rpath + 'one_site/')
        self.el_struct = ElectronicStructure(vasp_data)

        #        efermi = vasp_data.doscar.efermi
        #        eigvals = vasp_data.eigenval.eigs - efermi
        efermi = self.el_struct.efermi
        eigvals = self.el_struct.eigvals - efermi
        emin, emax = self.pars.groups[0]['ewindow']
        struct = self.el_struct.structure
        kmesh = self.el_struct.kmesh

        self.proj_sh = ProjectorShell(self.pars.shells[0],
                                      vasp_data.plocar.plo,
                                      vasp_data.plocar.proj_params, kmesh,
                                      struct, 0)
        self.proj_gr = ProjectorGroup(self.pars.groups[0], [self.proj_sh],
                                      eigvals)
Beispiel #3
0
                    dm[iorb, iorb2] = den_mat[ispin, ind, ind2]
                    ov[iorb, iorb2] = overlap[ispin, ind, ind2]
            den_mat_sites.append(dm)

            print "  Density matrix" + (12 * norb - 12) * " " + "Overlap"
            for drow, dov in zip(dm, ov):
                out = ''.join(map("{0:12.7f}".format, drow))
                out += "    "
                out += ''.join(map("{0:12.7f}".format, dov))
                print out
    return den_mat_sites

vasp_dir = './'

# extract density matrices and write them to rotations file -> done
vasp_data = VaspData(vasp_dir, efermi_required=True)
el_struct = ElectronicStructure(vasp_data)
den_mat = calc_density_matrix(el_struct)

rot_file = open('rotations.dat', 'w')
print den_mat
for i, mat in enumerate(den_mat):
    mat = mat * 0.5
    e_values, e_vectors = np.linalg.eigh(mat)
    print e_values
    print e_vectors
    rot_file.write('# site ' + str(i) + '\n')
    rot_file.write(" ".join(str(x) for x in e_vectors[:, 0]) + '\n')
    rot_file.write(" ".join(str(x) for x in e_vectors[:, 1]) + '\n')
    rot_file.write('\n')
    #print np.dot(e_vectors[:,0:2].transpose(),np.dot(mat,e_vectors[:,0:2]))