コード例 #1
0
ファイル: chain_hubbardI_so.py プロジェクト: FermiQ/DCore
def test_chain_hubbardI_so(request):
    org_dir = os.getcwd()
    os.chdir(request.fspath.dirname)
    seedname = 'test'
    dcore_pre('dmft.ini')
    dcore('dmft.ini')
    dcore_post('dmft.ini')

    data_files = glob.glob('./ref/*')

    for path in data_files:
        base_name = os.path.basename(path)
        print("base_nam,e ", base_name)
        if base_name == seedname + '.h5':
            h5diff(base_name, path)
        elif base_name == seedname + '.out.h5':
            h5diff(base_name, path, "dmft_out/Sigma_iw")
        elif not re.search('.dat$', base_name) is None:
            numdiff(base_name, path)
        else:
            raise RuntimeError("Uknown how to check " + base_name)

    os.chdir(org_dir)
コード例 #2
0
        dcore_bse("sparse_fit.ini" + postfix)
        sys.stdout.flush()

        # interpolated data
        bse = h5BSE("dmft_bse.h5" + postfix)
        xloc_fit = bse.get(('X_loc', 0))

        # compare
        for key in xloc_fit:
            # for test
            print("distance:", numpy.linalg.norm(xloc_fit[key] - self.xloc_ref[key]))
            sys.stdout.flush()

            # compare
            numpy.testing.assert_allclose(xloc_fit[key], self.xloc_ref[key], atol=1e-2)
            # self.assertTrue(numpy.allclose(xloc_fit[key], self.xloc_ref[key], rtol=1e-2))
            sys.stdout.flush()

    def test_fit_Lambda100(self):
        self._fit_and_compare(".Lambda100")


if __name__ == '__main__':
    input_ini = "sparse_fit.ini.ref"
    dcore_pre(input_ini)
    dcore(input_ini)
    dcore_bse(input_ini)

    unittest.main()
コード例 #3
0
#
# DCore -- Integrated DMFT software for correlated electrons
# Copyright (C) 2017 The University of Tokyo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
from __future__ import print_function
from dcore.tools import h5diff
from dcore.dcore import dcore

dcore('dmft.ini')

h5diff("test.out.h5", "test_ref.out.h5", "dmft_out/Sigma_iw")