diff --git a/CMakeLists.txt b/CMakeLists.txt index 56a1b55d7..bf5812cee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(som CXX) set(CMAKE_BUILD_TYPE Release) # Version number of the application -set(SOM_VERSION "0.9") +set(SOM_VERSION "1.0") message(STATUS "Configuring SOM version ${SOM_VERSION}") # Append triqs installed files to the cmake load path diff --git a/TODO.md b/TODO.md deleted file mode 100644 index a720033e8..000000000 --- a/TODO.md +++ /dev/null @@ -1,3 +0,0 @@ -* Test all kernels and close #3 accordingly -* Add automatic Python tests chi_*, chi_auto_* and zerotemp_* -* Make sure all tests run successfully with versions 0.9 and 0.95 diff --git a/doc/example.py b/doc/example.py index 25f76bb46..d56272c9f 100644 --- a/doc/example.py +++ b/doc/example.py @@ -36,6 +36,13 @@ S.data[:] = 1.0 # Construct a SOM object +# +# Valid observable kinds are 'FermionGf', 'BosonCorr', 'BosonAutoCorr' and 'ZeroTemp' +# +# Expected norms of spectral functions can be passed to the constructor as +# norms = numpy.array([norm_1, norm_2, ..., norm_N]), where N is the matrix +# dimension of g_input (only diagonal elements will be continued). All norms +# are set to 1.0 by default. cont = Som(g_input, S, kind = "FermionGf") # Run! diff --git a/doc/index.rst b/doc/index.rst index 672f6e0b8..8afe40f4c 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -41,8 +41,3 @@ heights. on the Bayesian statistical inference (MaxEnt) or Padé approximants. Its primary design goal is the ability to resolve fine spectral features, rather than giving a quick insight into general shape of the spectrum.* - -.. warning:: - - The code is still of alpha-quality. All its parts are subject to change, including the Python API. - Be critical about obtained results and cross-check with other analytic continuation tools when possible. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 84525a274..d93e9ea2a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,2 +1 @@ add_subdirectory(c++) -add_subdirectory(python) \ No newline at end of file diff --git a/test/python/CMakeLists.txt b/test/python/CMakeLists.txt deleted file mode 100644 index 2e9b6fdfc..000000000 --- a/test/python/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -find_package(TriqsTest) - -file(GLOB all_h5_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h5) -file(COPY ${all_h5_files} DESTINATION .) - -triqs_add_python_test(gf_imtime) -triqs_add_python_test(gf_imfreq) -triqs_add_python_test(gf_legendre) diff --git a/test/python/gf_imfreq.py b/test/python/gf_imfreq.py deleted file mode 100644 index b2666e735..000000000 --- a/test/python/gf_imfreq.py +++ /dev/null @@ -1,62 +0,0 @@ -############################################################################## -# -# SOM: Stochastic Optimization Method for Analytic Continuation -# -# Copyright (C) 2016-2017 by I. Krivenko -# -# SOM 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. -# -# SOM 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 -# SOM. If not, see . -# -############################################################################## - -from pytriqs.gf.local import * -from pytriqs.archive import HDFArchive -import pytriqs.utility.mpi as mpi -from pytriqs.applications.analytical_continuation.som import Som -from pytriqs.utility.comparison_tests import * - -arch = HDFArchive('gf_imfreq.ref.h5', 'r') - -g_iw = arch['g_iw'] - -cont = Som(g_iw, kind = "FermionGf") - -run_params = {'energy_window' : (-5,5)} -run_params['verbosity'] = 3 -run_params['random_seed'] = 34788 + 928374 * mpi.rank -run_params['adjust_f'] = False -run_params['adjust_l'] = False -run_params['t'] = 100 -run_params['f'] = 50 -run_params['l'] = 30 -run_params['make_histograms'] = True - -cont.run(**run_params) - -g_rec_iw = g_iw.copy() -g_rec_iw << cont - -g_w = GfReFreq(window = (-6.0,6.0), n_points = 1200, indices = g_iw.indices) -g_w << cont - -if mpi.is_master_node(): -# del arch -# with HDFArchive('gf_imfreq.ref.h5', 'a') as arch: -# arch['g_rec_iw'] = g_rec_iw -# arch['g_w'] = g_w -# arch['histograms'] = cont.histograms - assert_gfs_are_close(g_rec_iw, arch['g_rec_iw']) - assert_gfs_are_close(g_w, arch['g_w'], 6e-4) - assert_arrays_are_close(g_w.tail.data, arch['g_w'].tail.data, 6e-4) - assert_arrays_are_close(cont.histograms[0].data, arch['histograms'][0].data) - assert_arrays_are_close(cont.histograms[1].data, arch['histograms'][1].data) diff --git a/test/python/gf_imfreq.ref.h5 b/test/python/gf_imfreq.ref.h5 deleted file mode 100644 index 937ced513..000000000 Binary files a/test/python/gf_imfreq.ref.h5 and /dev/null differ diff --git a/test/python/gf_imtime.py b/test/python/gf_imtime.py deleted file mode 100644 index c8ba6fe9b..000000000 --- a/test/python/gf_imtime.py +++ /dev/null @@ -1,62 +0,0 @@ -############################################################################## -# -# SOM: Stochastic Optimization Method for Analytic Continuation -# -# Copyright (C) 2016-2017 by I. Krivenko -# -# SOM 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. -# -# SOM 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 -# SOM. If not, see . -# -############################################################################## - -from pytriqs.gf.local import * -from pytriqs.archive import HDFArchive -import pytriqs.utility.mpi as mpi -from pytriqs.applications.analytical_continuation.som import Som -from pytriqs.utility.comparison_tests import * - -arch = HDFArchive('gf_imtime.ref.h5', 'r') - -g_tau = arch['g_tau'] - -cont = Som(g_tau, kind = "FermionGf") - -run_params = {'energy_window' : (-5,5)} -run_params['verbosity'] = 3 -run_params['random_seed'] = 34788 + 928374 * mpi.rank -run_params['adjust_f'] = False -run_params['adjust_l'] = False -run_params['t'] = 100 -run_params['f'] = 50 -run_params['l'] = 30 -run_params['make_histograms'] = True - -cont.run(**run_params) - -g_rec_tau = g_tau.copy() -g_rec_tau << cont - -g_w = GfReFreq(window = (-6.0,6.0), n_points = 1200, indices = g_tau.indices) -g_w << cont - -if mpi.is_master_node(): -# del arch -# with HDFArchive('gf_imtime.ref.h5', 'a') as arch: -# arch['g_rec_tau'] = g_rec_tau -# arch['g_w'] = g_w -# arch['histograms'] = cont.histograms - assert_gfs_are_close(g_rec_tau, arch['g_rec_tau']) - assert_gfs_are_close(g_w, arch['g_w'], 1e-5) - assert_arrays_are_close(g_w.tail.data, arch['g_w'].tail.data, 1e-5) - assert_arrays_are_close(cont.histograms[0].data, arch['histograms'][0].data) - assert_arrays_are_close(cont.histograms[1].data, arch['histograms'][1].data) diff --git a/test/python/gf_imtime.ref.h5 b/test/python/gf_imtime.ref.h5 deleted file mode 100644 index 9b1eef484..000000000 Binary files a/test/python/gf_imtime.ref.h5 and /dev/null differ diff --git a/test/python/gf_legendre.py b/test/python/gf_legendre.py deleted file mode 100644 index 36ae3c05c..000000000 --- a/test/python/gf_legendre.py +++ /dev/null @@ -1,62 +0,0 @@ -############################################################################## -# -# SOM: Stochastic Optimization Method for Analytic Continuation -# -# Copyright (C) 2016-2017 by I. Krivenko -# -# SOM 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. -# -# SOM 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 -# SOM. If not, see . -# -############################################################################## - -from pytriqs.gf.local import * -from pytriqs.archive import HDFArchive -import pytriqs.utility.mpi as mpi -from pytriqs.applications.analytical_continuation.som import Som -from pytriqs.utility.comparison_tests import * - -arch = HDFArchive('gf_legendre.ref.h5', 'r') - -g_l = arch['g_l'] - -cont = Som(g_l, kind = "FermionGf") - -run_params = {'energy_window' : (-5,5)} -run_params['verbosity'] = 3 -run_params['random_seed'] = 34228 + 921233 * mpi.rank -run_params['adjust_f'] = False -run_params['adjust_l'] = False -run_params['t'] = 100 -run_params['f'] = 50 -run_params['l'] = 30 -run_params['make_histograms'] = True - -cont.run(**run_params) - -g_rec_l = g_l.copy() -g_rec_l << cont - -g_w = GfReFreq(window = (-6.0,6.0), n_points = 1200, indices = g_l.indices) -g_w << cont - -if mpi.is_master_node(): -# del arch -# with HDFArchive('gf_legendre.ref.h5', 'a') as arch: -# arch['g_rec_l'] = g_rec_l -# arch['g_w'] = g_w -# arch['histograms'] = cont.histograms - assert_gfs_are_close(g_rec_l, arch['g_rec_l']) - assert_gfs_are_close(g_w, arch['g_w'], 1e-5) - assert_arrays_are_close(g_w.tail.data, arch['g_w'].tail.data, 1e-5) - assert_arrays_are_close(cont.histograms[0].data, arch['histograms'][0].data) - assert_arrays_are_close(cont.histograms[1].data, arch['histograms'][1].data) diff --git a/test/python/gf_legendre.ref.h5 b/test/python/gf_legendre.ref.h5 deleted file mode 100644 index dfcf01031..000000000 Binary files a/test/python/gf_legendre.ref.h5 and /dev/null differ