Beispiel #1
0
def test_pdos_compute(pdos_bin, bands_file):
    """Test computing pdos"""
    from sumo.io.castep import (_read_bands_header_verbose,
                                read_bands_eigenvalues, _is_metal, _get_vbm,
                                _ry_to_ev)

    header = _read_bands_header_verbose(bands_file)
    _, weights, eigenvalues = read_bands_eigenvalues(bands_file, header)

    bin_width = 0.01
    bins = np.arange(0.0, 10.0 + bin_width, bin_width)

    pdos = compute_pdos(pdos_bin, eigenvalues, weights, bins)
Beispiel #2
0
    def test_castep_bands_read_eigenvalues(self):
        with open(self.si_header_ref, 'r') as f:
            ref_header = json.load(f)
        kpoints, weights, eigenvals = read_bands_eigenvalues(
            self.si_bands, ref_header)

        for i, k in enumerate([0.5, 0.36111111, 0.63888889]):
            self.assertAlmostEqual(kpoints[4][i], k)

        self.assertAlmostEqual(eigenvals[Spin.up][2, 4],
                               0.09500443 * _ry_to_ev * 2)

        for weight in weights:
            self.assertAlmostEqual(weight, 0.02272727)