Beispiel #1
0
    def test_cu_metallic_high_cost(self):
        mesh = 7
        cell = make_test_cell.test_cell_cu_metallic([mesh]*3)
        nk = [1,1,2]
        ehf_bench = -52.5393701339723

        # KRHF calculation
        kmf = pbcscf.KRHF(cell, exxdiv=None)
        kmf.kpts = cell.make_kpts(nk, scaled_center=[0.0, 0.0, 0.0], wrap_around=True)
        kmf.conv_tol_grad = 1e-6  # Stricter tol needed for answer to agree with supercell
        ehf = kmf.scf()

        self.assertAlmostEqual(ehf, ehf_bench, 6)

        # Run CC calculations
        self._test_cu_metallic_nonequal_occ(kmf, cell)
        self._test_cu_metallic_frozen_occ(kmf, cell)
        self._test_cu_metallic_frozen_vir(kmf, cell)
Beispiel #2
0
    def test_cu_metallic_smearing_high_cost(self):
        mesh = 7
        cell = make_test_cell.test_cell_cu_metallic([mesh]*3)
        nk = [1,1,2]
        ehf_bench = -52.539316985400433

        # KRHF calculation
        kmf = pbcscf.addons.smearing_(pbcscf.KRHF(cell, exxdiv=None), 0.001, "fermi")
        kmf.kpts = cell.make_kpts(nk, scaled_center=[0.0, 0.0, 0.0], wrap_around=True)
        kmf.conv_tol_grad = 1e-6  # Stricter tol needed for answer to agree with supercell
        ehf = kmf.scf()

        self.assertAlmostEqual(ehf, ehf_bench, 6)
        with self.assertRaises(RuntimeError):
            self._test_cu_metallic_nonequal_occ(kmf, cell)
        kmf.smearing_method = False
        kmf.mo_occ = kmf.get_occ()

        # Run CC calculations
        # FIXME: IP from differnt initial guess not matching
        self._test_cu_metallic_nonequal_occ(kmf, cell, -0.96676526820520137)