From e3a85d1d5c89d7b0d294bf9c5758873bfecb731b Mon Sep 17 00:00:00 2001 From: Alexander Hampel Date: Mon, 10 Jun 2024 16:03:47 -0400 Subject: [PATCH] [feat] add print of avg order for ctseg --- python/solid_dmft/dmft_tools/results_to_archive.py | 1 + python/solid_dmft/dmft_tools/solver.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/python/solid_dmft/dmft_tools/results_to_archive.py b/python/solid_dmft/dmft_tools/results_to_archive.py index d227e955..5bdc89ec 100644 --- a/python/solid_dmft/dmft_tools/results_to_archive.py +++ b/python/solid_dmft/dmft_tools/results_to_archive.py @@ -110,6 +110,7 @@ def _compile_information(sum_k, general_params, solver_params, solvers, map_imp_ write_to_h5['F_time_{}'.format(icrsh)] = solvers[icrsh].F_time if solver_params[isolvsec]['measure_pert_order']: write_to_h5['pert_order_histo_imp_{}'.format(icrsh)] = solvers[icrsh].perturbation_order_histo + write_to_h5['avg_order_imp_{}.format(icrsh)'] = solvers[icrsh].avg_pert_order if solver_params[isolvsec]['measure_nnt']: write_to_h5['O_NN_{}'.format(icrsh)] = solvers[icrsh].triqs_solver.results.nn_tau if solver_params[isolvsec]['measure_statehist']: diff --git a/python/solid_dmft/dmft_tools/solver.py b/python/solid_dmft/dmft_tools/solver.py index 204f5823..45e62728 100755 --- a/python/solid_dmft/dmft_tools/solver.py +++ b/python/solid_dmft/dmft_tools/solver.py @@ -1382,6 +1382,7 @@ def set_Gs_from_G_l(): # first print average sign if mpi.is_master_node(): print('\nAverage sign: {}'.format(self.triqs_solver.results.sign)) + # get Delta_time from solver self.Delta_time << self.triqs_solver.Delta_tau @@ -1511,5 +1512,9 @@ def set_Gs_from_G_l(): if self.solver_params['measure_pert_order']: self.perturbation_order_histo = self.triqs_solver.results.perturbation_order_histo_Delta + bin_vec = np.arange(0, self.perturbation_order_histo.data.shape[0]) + self.avg_pert_order = np.sum(bin_vec * self.perturbation_order_histo.data[:]) + if mpi.is_master_node(): + print(f'Average perturbation order: {self.avg_pert_order}') return