コード例 #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, nk=nk)
        self._test_cu_metallic_frozen_occ(kmf, cell, nk=nk)
        self._test_cu_metallic_frozen_vir(kmf, cell, nk=nk)
コード例 #2
0
ファイル: test_kpoint_rhf.py プロジェクト: chrinide/pyscf
    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)
コード例 #3
0
ファイル: test_kpoint_rhf.py プロジェクト: zwgsyntax/pyscf
    def test_cu_metallic_smearing(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
        self._test_cu_metallic_nonequal_occ(kmf, cell, -0.96676526820520137)
コード例 #4
0
ファイル: test_kpoint_rhf.py プロジェクト: chrinide/pyscf
    def test_cu_metallic_smearing(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
        self._test_cu_metallic_nonequal_occ(kmf, cell, -0.96676526820520137)