예제 #1
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'PROCAR.simple')
     p = Procar(filepath)
     self.assertAlmostEqual(p.get_occupation(1, 'd'), 0)
     self.assertAlmostEqual(p.get_occupation(1, 's'), 0.3538125)
     self.assertAlmostEqual(p.get_occupation(1, 'p'), 1.19540625)
     self.assertRaises(ValueError, p.get_occupation, 1, 'm')
     filepath = os.path.join(test_dir, 'PROCAR')
     p = Procar(filepath)
     self.assertAlmostEqual(p.get_occupation(0, 'd'), 4.3698147704200059)
     self.assertAlmostEqual(p.get_occupation(0, 'dxy'), 0.85796295426000124)
예제 #2
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'PROCAR.simple')
     p = Procar(filepath)
     self.assertAlmostEqual(p.get_occupation(1, 'd'), 0)
     self.assertAlmostEqual(p.get_occupation(1, 's'), 0.3538125)
     self.assertAlmostEqual(p.get_occupation(1, 'p'), 1.19540625)
     self.assertRaises(ValueError, p.get_occupation, 1, 'm')
     filepath = os.path.join(test_dir, 'PROCAR')
     p = Procar(filepath)
     self.assertAlmostEqual(p.get_occupation(0, 'd'), 4.3698147704200059)
     self.assertAlmostEqual(p.get_occupation(0, 'dxy'), 0.85796295426000124)
예제 #3
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'PROCAR.simple')
     p = Procar(filepath)
     self.assertAlmostEqual(p.get_occupation(1, 'd'), 0)
     self.assertAlmostEqual(p.get_occupation(1, 's'), 0.3538125)
     self.assertAlmostEqual(p.get_occupation(1, 'p'), 1.19540625)
     self.assertRaises(ValueError, p.get_occupation, 1, 'm')
     self.assertEqual(p.nb_bands, 10)
     self.assertEqual(p.nb_kpoints, 10)
     lat = Lattice.cubic(3.)
     s = Structure(lat, ["Li", "Na", "K"],
                   [[0., 0., 0.], [0.25, 0.25, 0.25], [0.75, 0.75, 0.75]])
     d = p.get_projection_on_elements(s)
     self.assertAlmostEqual(d[1][2][2], {
         'Na': 0.042,
         'K': 0.646,
         'Li': 0.042
     })
     filepath = os.path.join(test_dir, 'PROCAR')
     p = Procar(filepath)
     self.assertAlmostEqual(p.get_occupation(0, 'd'), 4.3698147704200059)
     self.assertAlmostEqual(p.get_occupation(0, 'dxy'), 0.85796295426000124)
예제 #4
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'PROCAR.simple')
     p = Procar(filepath)
     self.assertAlmostEqual(p.get_occupation(1, 'd'), 0)
     self.assertAlmostEqual(p.get_occupation(1, 's'), 0.3538125)
     self.assertAlmostEqual(p.get_occupation(1, 'p'), 1.19540625)
     self.assertRaises(ValueError, p.get_occupation, 1, 'm')
     self.assertEqual(p.nb_bands, 10)
     self.assertEqual(p.nb_kpoints, 10)
     lat = Lattice.cubic(3.)
     s = Structure(lat, ["Li", "Na", "K"], [[0., 0., 0.],
                                            [0.25, 0.25, 0.25],
                                            [0.75, 0.75, 0.75]])
     d = p.get_projection_on_elements(s)
     self.assertAlmostEqual(d[1][2][2], {'Na': 0.042, 'K': 0.646, 'Li': 0.042})
     filepath = os.path.join(test_dir, 'PROCAR')
     p = Procar(filepath)
     self.assertAlmostEqual(p.get_occupation(0, 'd'), 4.3698147704200059)
     self.assertAlmostEqual(p.get_occupation(0, 'dxy'), 0.85796295426000124)