solid-dmft 3.3.2__tar.gz → 3.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. {solid_dmft-3.3.2/python/solid_dmft.egg-info → solid_dmft-3.3.4}/PKG-INFO +12 -2
  2. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/README.md +11 -1
  3. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/pyproject.toml +1 -1
  4. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_cycle.py +7 -1
  5. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/afm_mapping.py +22 -15
  6. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/initial_self_energies.py +4 -4
  7. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/matheval.py +10 -2
  8. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/solver.py +61 -27
  9. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/io_tools/default.toml +1 -1
  10. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/io_tools/verify_input_params.py +7 -2
  11. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/version.py +4 -4
  12. {solid_dmft-3.3.2 → solid_dmft-3.3.4/python/solid_dmft.egg-info}/PKG-INFO +12 -2
  13. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/COPYING.txt +0 -0
  14. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/LICENSE.txt +0 -0
  15. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/MANIFEST.in +0 -0
  16. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/__init__.py +0 -0
  17. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/csc_flow.py +0 -0
  18. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dft_managers/__init__.py +0 -0
  19. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dft_managers/mpi_helpers.py +0 -0
  20. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dft_managers/qe_manager.py +0 -0
  21. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dft_managers/vasp_manager.py +0 -0
  22. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/__init__.py +0 -0
  23. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/convergence.py +0 -0
  24. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/formatter.py +0 -0
  25. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/greens_functions_mixer.py +0 -0
  26. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/interaction_hamiltonian.py +0 -0
  27. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/legendre_filter.py +0 -0
  28. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/manipulate_chemical_potential.py +0 -0
  29. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/observables.py +0 -0
  30. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/dmft_tools/results_to_archive.py +0 -0
  31. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/gw_embedding/__init__.py +0 -0
  32. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/gw_embedding/bdft_converter.py +0 -0
  33. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/gw_embedding/gw_flow.py +0 -0
  34. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/gw_embedding/iaft.py +0 -0
  35. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/gw_embedding/qp_evs_to_eig.py +0 -0
  36. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/io_tools/__init__.py +0 -0
  37. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/io_tools/dict_to_h5.py +0 -0
  38. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/io_tools/postproc_toml_dict.py +0 -0
  39. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/main.py +0 -0
  40. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/postprocessing/__init__.py +0 -0
  41. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/postprocessing/eval_U_cRPA_RESPACK.py +0 -0
  42. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/postprocessing/eval_U_cRPA_Vasp.py +0 -0
  43. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/postprocessing/maxent_gf_imp.py +0 -0
  44. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/postprocessing/maxent_gf_latt.py +0 -0
  45. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/postprocessing/maxent_sigma.py +0 -0
  46. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/postprocessing/pade_sigma.py +0 -0
  47. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/postprocessing/plot_correlated_bands.py +0 -0
  48. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/util/__init__.py +0 -0
  49. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/util/symmetrize_gamma_file.py +0 -0
  50. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft/util/write_kslice_to_h5.py +0 -0
  51. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft.egg-info/SOURCES.txt +0 -0
  52. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft.egg-info/dependency_links.txt +0 -0
  53. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft.egg-info/entry_points.txt +0 -0
  54. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft.egg-info/requires.txt +0 -0
  55. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/python/solid_dmft.egg-info/top_level.txt +0 -0
  56. {solid_dmft-3.3.2 → solid_dmft-3.3.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: solid_dmft
3
- Version: 3.3.2
3
+ Version: 3.3.4
4
4
  Summary: solid_dmft: a versatile python wrapper to perform DFT+DMFT calculations utilizing the TRIQS software library
5
5
  Author-email: Alexander Hampel <mail@alexander-hampel.de>
6
6
  Project-URL: Homepage, https://triqs.github.io/solid_dmft
@@ -21,7 +21,8 @@ Dynamic: license-file
21
21
 
22
22
  ![logo_soliDMFT](https://raw.githubusercontent.com/triqs/solid_dmft/unstable/doc/logos/logo_solid_dmft.png)
23
23
 
24
- ![CI](https://github.com/triqs/solid_dmft/actions/workflows/build.yml/badge.svg)
24
+ ![CI dev](https://github.com/triqs/solid_dmft/actions/workflows/build_unstable_doc.yml/badge.svg)
25
+ ![CI stable](https://github.com/triqs/solid_dmft/actions/workflows/build_release.yml/badge.svg)
25
26
  [![PyPI version](https://badge.fury.io/py/solid_dmft.svg)](https://badge.fury.io/py/solid_dmft)
26
27
  [![status](https://joss.theoj.org/papers/48eb529b08c6bb464b235ba919d78922/status.svg)](https://joss.theoj.org/papers/48eb529b08c6bb464b235ba919d78922)
27
28
 
@@ -65,3 +66,12 @@ and the Center for Computational Quantum Physics, Flatiron Institute.
65
66
  If you are using this code for your research, please cite it with this
66
67
  [bib file](https://github.com/TRIQS/solid_dmft/blob/unstable/cite_solid_dmft.bib).
67
68
 
69
+ ## Support
70
+
71
+ <picture>
72
+ <source media="(prefers-color-scheme: dark)" width="20%" srcset="doc/_static/CCQ-dark.png">
73
+ <img alt="Flatiron Center for Computational Quantum Physics logo." width="20%" src="doc/_static/CCQ.png">
74
+ </picture>
75
+
76
+ TRIQS/solid_dmft is supported by the Flatiron Institute, a division of the Simons Foundation.
77
+
@@ -1,6 +1,7 @@
1
1
  ![logo_soliDMFT](https://raw.githubusercontent.com/triqs/solid_dmft/unstable/doc/logos/logo_solid_dmft.png)
2
2
 
3
- ![CI](https://github.com/triqs/solid_dmft/actions/workflows/build.yml/badge.svg)
3
+ ![CI dev](https://github.com/triqs/solid_dmft/actions/workflows/build_unstable_doc.yml/badge.svg)
4
+ ![CI stable](https://github.com/triqs/solid_dmft/actions/workflows/build_release.yml/badge.svg)
4
5
  [![PyPI version](https://badge.fury.io/py/solid_dmft.svg)](https://badge.fury.io/py/solid_dmft)
5
6
  [![status](https://joss.theoj.org/papers/48eb529b08c6bb464b235ba919d78922/status.svg)](https://joss.theoj.org/papers/48eb529b08c6bb464b235ba919d78922)
6
7
 
@@ -44,3 +45,12 @@ and the Center for Computational Quantum Physics, Flatiron Institute.
44
45
  If you are using this code for your research, please cite it with this
45
46
  [bib file](https://github.com/TRIQS/solid_dmft/blob/unstable/cite_solid_dmft.bib).
46
47
 
48
+ ## Support
49
+
50
+ <picture>
51
+ <source media="(prefers-color-scheme: dark)" width="20%" srcset="doc/_static/CCQ-dark.png">
52
+ <img alt="Flatiron Center for Computational Quantum Physics logo." width="20%" src="doc/_static/CCQ.png">
53
+ </picture>
54
+
55
+ TRIQS/solid_dmft is supported by the Flatiron Institute, a division of the Simons Foundation.
56
+
@@ -7,7 +7,7 @@ where = ["python"]
7
7
 
8
8
  [project]
9
9
  name = "solid_dmft"
10
- version = "3.3.2"
10
+ version = "3.3.4"
11
11
  authors = [
12
12
  { name="Alexander Hampel", email="mail@alexander-hampel.de" }
13
13
  ]
@@ -312,6 +312,12 @@ def dmft_cycle(general_params, solver_params, advanced_params, dft_params,
312
312
 
313
313
  iteration_offset = 0
314
314
 
315
+ # if magnetic field is set we make sure that this is a magnetic calculation
316
+ if general_params['h_field'] != 0.0:
317
+ if not general_params['magnetic']:
318
+ mpi.report('WARNING: Magnetic field set but general.magnetic is False. Setting it to True now.')
319
+ general_params['magnetic'] = True
320
+
315
321
  # determine chemical potential for bare DFT sum_k object
316
322
  if mpi.is_master_node():
317
323
  archive = HDFArchive(general_params['jobname']+'/'+general_params['seedname']+'.h5', 'a')
@@ -559,7 +565,7 @@ def dmft_cycle(general_params, solver_params, advanced_params, dft_params,
559
565
  for it in range(iteration_offset + 1, iteration_offset + n_iter + 1):
560
566
 
561
567
  # remove h_field when number of iterations is reached
562
- if sum_k.h_field != 0.0 and general_params['h_field_it'] != 0 and it > general_params['h_field_it']:
568
+ if sum_k.h_field != 0.0 and general_params['h_field_it'] != -1 and it > general_params['h_field_it']:
563
569
  mpi.report('\nRemoving magnetic field now.\n')
564
570
  sum_k.h_field = 0.0
565
571
  # enforce recomputation of eff_atomic_levels
@@ -54,9 +54,9 @@ def determine(general_params, archive, n_inequiv_shells):
54
54
  # determine if we need to switch up and down channel
55
55
  switch = np.isclose(general_params['magmom'][icrsh], -general_params['magmom'][source])
56
56
 
57
- afm_mapping[icrsh] = [True, source, switch]
57
+ afm_mapping[icrsh] = [True, int(source), bool(switch)]
58
58
  else:
59
- afm_mapping[icrsh] = [False, icrsh, False]
59
+ afm_mapping[icrsh] = [False, int(icrsh), False]
60
60
 
61
61
 
62
62
  print('AFM calculation selected, mapping self energies as follows:')
@@ -86,6 +86,20 @@ def apply(general_params, icrsh, gf_struct_solver, solvers):
86
86
  mpi.report('\ncopying the self-energy for shell {} from shell {}'.format(icrsh, imp_source))
87
87
  mpi.report('inverting spin channels: '+str(invert_spin))
88
88
 
89
+ if solvers[icrsh].solver_params.get('measure_density_matrix'):
90
+ solvers[icrsh].density_matrix = solvers[imp_source].density_matrix
91
+ solvers[icrsh].h_loc_diagonalization = solvers[imp_source].h_loc_diagonalization
92
+ solvers[icrsh].Sigma_moments = solvers[imp_source].Sigma_moments
93
+ solvers[icrsh].Sigma_Hartree = solvers[imp_source].Sigma_Hartree
94
+ solvers[icrsh].G_moments = solvers[imp_source].G_moments
95
+ # copy orbital occupations dict with deep copy of arrays
96
+ solvers[icrsh].orbital_occupations = {key: occ.copy() for key, occ in solvers[imp_source].orbital_occupations.items()}
97
+
98
+ # and the same for the perturbation order if measured
99
+ if solvers[icrsh].solver_params.get('measure_pert_order'):
100
+ solvers[icrsh].perturbation_order = {key: hist for key, hist in solvers[imp_source].perturbation_order.items()}
101
+ solvers[icrsh].perturbation_order_total = solvers[imp_source].perturbation_order_total
102
+
89
103
  if invert_spin:
90
104
  for spin_channel in gf_struct_solver.keys():
91
105
  if 'up' in spin_channel:
@@ -99,11 +113,12 @@ def apply(general_params, icrsh, gf_struct_solver, solvers):
99
113
  solvers[icrsh].G0_freq[spin_channel] << solvers[imp_source].G0_freq[target_channel]
100
114
  solvers[icrsh].G_time[spin_channel] << solvers[imp_source].G_time[target_channel]
101
115
 
102
- if solvers[icrsh].solver_params['measure_pert_order']:
103
- if not hasattr(solvers[icrsh], 'perturbation_order'):
104
- solvers[icrsh].perturbation_order = {}
116
+ if solvers[icrsh].solver_params.get('measure_pert_order'):
105
117
  solvers[icrsh].perturbation_order[spin_channel] = solvers[imp_source].perturbation_order[target_channel]
106
- solvers[icrsh].perturbation_order_total = solvers[imp_source].perturbation_order_total
118
+
119
+ # we also need to swap the orbital occupations, but we skip moments since the whole self-energy is copied anyway
120
+ if solvers[icrsh].solver_params.get('measure_density_matrix'):
121
+ solvers[icrsh].orbital_occupations[spin_channel] = solvers[imp_source].orbital_occupations[target_channel]
107
122
 
108
123
  else:
109
124
  solvers[icrsh].Sigma_freq << solvers[imp_source].Sigma_freq
@@ -112,15 +127,7 @@ def apply(general_params, icrsh, gf_struct_solver, solvers):
112
127
  solvers[icrsh].G0_freq << solvers[imp_source].G0_freq
113
128
  solvers[icrsh].G_time << solvers[imp_source].G_time
114
129
 
115
- if solvers[icrsh].solver_params['measure_pert_order']:
116
- solvers[icrsh].perturbation_order = solvers[imp_source].perturbation_order
117
- solvers[icrsh].perturbation_order_total = solvers[imp_source].perturbation_order_total
118
-
119
- if solvers[icrsh].solver_params['measure_density_matrix']:
120
- solvers[icrsh].density_matrix = solvers[imp_source].density_matrix
121
- solvers[icrsh].h_loc_diagonalization = solvers[imp_source].h_loc_diagonalization
122
-
123
- if 'measure_chi' in solvers[icrsh].solver_params and solvers[icrsh].solver_params['measure_chi'] is not None:
130
+ if solvers[icrsh].solver_params.get('measure_chi'):
124
131
  solvers[icrsh].O_time = solvers[imp_source].O_time
125
132
 
126
133
  return solvers
@@ -533,9 +533,9 @@ def determine_dc_and_initial_sigma(general_params, gw_params, advanced_params, s
533
533
  # if magmom positive the up channel will be favored
534
534
  for spin_channel in sum_k.gf_struct_solver[icrsh].keys():
535
535
  if 'up' in spin_channel:
536
- start_sigma[icrsh][spin_channel] << -np.eye(dc_pot[spin_channel].shape[0])*fac + dc_pot[spin_channel]
536
+ start_sigma[icrsh][spin_channel] << dc_pot[spin_channel] - fac*np.eye(dc_pot[spin_channel].shape[0])
537
537
  else:
538
- start_sigma[icrsh][spin_channel] << np.eye(dc_pot[spin_channel].shape[0])*fac + dc_pot[spin_channel]
538
+ start_sigma[icrsh][spin_channel] << dc_pot[spin_channel] + fac*np.eye(dc_pot[spin_channel].shape[0])
539
539
  else:
540
540
  for spin_channel in sum_k.gf_struct_solver[icrsh].keys():
541
541
  start_sigma[icrsh][spin_channel] << dc_pot[spin_channel]
@@ -554,9 +554,9 @@ def determine_dc_and_initial_sigma(general_params, gw_params, advanced_params, s
554
554
  # if magmom positive the up channel will be favored
555
555
  for spin_channel in sum_k.gf_struct_solver[icrsh].keys():
556
556
  if 'up' in spin_channel:
557
- start_sigma[icrsh][spin_channel] << -fac
557
+ start_sigma[icrsh][spin_channel] << -fac*np.eye(start_sigma[icrsh][spin_channel].target_shape[0])
558
558
  else:
559
- start_sigma[icrsh][spin_channel] << fac
559
+ start_sigma[icrsh][spin_channel] << fac*np.eye(start_sigma[icrsh][spin_channel].target_shape[0])
560
560
  else:
561
561
  start_sigma = [sum_k.block_structure.create_gf(ish=iineq, gf_function=Gf, space='solver', mesh=sum_k.mesh)
562
562
  for iineq in range(sum_k.n_inequiv_shells)]
@@ -4,8 +4,12 @@ import ast
4
4
  import math
5
5
 
6
6
 
7
+ # Determine numeric/constant node for compatibility across Python versions
8
+ _AST_CONSTANT = getattr(ast, "Constant", None)
9
+
7
10
  class MathExpr(object):
8
- allowed_nodes = (
11
+ # Base allowed nodes (version-agnostic)
12
+ _base_allowed = (
9
13
  ast.Module,
10
14
  ast.Expr,
11
15
  ast.Load,
@@ -13,7 +17,6 @@ class MathExpr(object):
13
17
  ast.Add,
14
18
  ast.Sub,
15
19
  ast.UnaryOp,
16
- ast.Num,
17
20
  ast.BinOp,
18
21
  ast.Mult,
19
22
  ast.Div,
@@ -32,6 +35,11 @@ class MathExpr(object):
32
35
  ast.Name,
33
36
  )
34
37
 
38
+ # Extend allowed nodes with version-specific constant node
39
+ allowed_nodes = _base_allowed + (
40
+ _AST_CONSTANT if _AST_CONSTANT is not None else ast.Num,
41
+ )
42
+
35
43
  functions = {
36
44
  "abs": abs,
37
45
  "complex": complex,
@@ -30,7 +30,6 @@ from triqs.gf.tools import inverse, make_zero_tail
30
30
  from triqs.gf.descriptors import Fourier
31
31
  from triqs.operators import c_dag, c, Operator, util
32
32
  from triqs.operators.util.U_matrix import reduce_4index_to_2index
33
- from triqs.operators.util.extractors import block_matrix_from_op
34
33
  import triqs.utility.mpi as mpi
35
34
  import itertools
36
35
  from h5 import HDFArchive
@@ -105,12 +104,7 @@ def _gf_fit_tail_fraction(Gf, fraction=0.4, replace=None, known_moments=[]):
105
104
 
106
105
  return Gf_fit
107
106
 
108
- def _fit_tail_window(
109
- Sigma_iw,
110
- fit_min_n=None, fit_max_n=None,
111
- fit_min_w=None, fit_max_w=None,
112
- fit_max_moment=None, fit_known_moments=None
113
- ):
107
+ def _fit_tail_window(Sigma_iw, fit_min_n=None, fit_max_n=None, fit_min_w=None, fit_max_w=None, fit_max_moment=None, fit_known_moments=None):
114
108
  """
115
109
  Fit a high frequency 1/(iw)^n expansion of Sigma_iw
116
110
  and replace the high frequency part with the fitted high frequency expansion.
@@ -121,7 +115,7 @@ def _fit_tail_window(
121
115
  Parameters
122
116
  ----------
123
117
  Sigma_iw : Gf
124
- Self-energy.
118
+ Self-energy.
125
119
  fit_min_n : int, optional, default=int(0.8*len(Sigma_iw.mesh))
126
120
  Matsubara frequency index from which tail fitting should start.
127
121
  fit_max_n : int, optional, default=int(len(Sigma_iw.mesh))
@@ -131,7 +125,7 @@ def _fit_tail_window(
131
125
  fit_max_w : float, optional
132
126
  Matsubara frequency at which tail fitting should end.
133
127
  fit_max_moment : int, optional
134
- Highest moment to fit in the tail of Sigma_iw.
128
+ Highest moment to fit in the tail of Sigma_iw.
135
129
  fit_known_moments : ``ndarray.shape[order, Sigma_iw[0].target_shape]``, optional, default = None
136
130
  Known moments of Sigma_iw, given as an numpy ndarray
137
131
 
@@ -140,17 +134,17 @@ def _fit_tail_window(
140
134
  tail_barr : dict of arr
141
135
  fitted tail of Sigma_iw
142
136
  """
143
- from triqs.gf import fit_hermitian_tail_on_window
137
+ from triqs.gf.gf_fnt import fit_hermitian_tail_on_window, replace_by_tail
144
138
 
145
139
  # Define default tail quantities
146
140
  if fit_min_w is not None:
147
- fit_min_n = int(0.5*(fit_min_w*Sigma_iw.mesh.beta/np.pi - 1.0))
141
+ fit_min_n = int(0.5 * (fit_min_w * Sigma_iw.mesh.beta / np.pi - 1.0))
148
142
  if fit_max_w is not None:
149
- fit_max_n = int(0.5*(fit_max_w*Sigma_iw.mesh.beta/np.pi - 1.0))
143
+ fit_max_n = int(0.5 * (fit_max_w * Sigma_iw.mesh.beta / np.pi - 1.0))
150
144
  if fit_min_n is None:
151
- fit_min_n = int(0.8*len(Sigma_iw.mesh)/2)
145
+ fit_min_n = int(0.8 * len(Sigma_iw.mesh) / 2)
152
146
  if fit_max_n is None:
153
- fit_max_n = int(len(Sigma_iw.mesh)/2)
147
+ fit_max_n = int(len(Sigma_iw.mesh) / 2)
154
148
  if fit_max_moment is None:
155
149
  fit_max_moment = 3
156
150
 
@@ -158,24 +152,25 @@ def _fit_tail_window(
158
152
  fit_known_moments = {}
159
153
  for name, sig in Sigma_iw:
160
154
  shape = [0] + list(sig.target_shape)
161
- fit_known_moments[name] = np.zeros(shape, dtype=complex) # no known moments
155
+ fit_known_moments[name] = np.zeros(shape, dtype=complex) # no known moments
162
156
 
163
157
  # Now fit the tails of Sigma_iw and replace the high frequency part with the tail expansion
164
158
  tail_barr = {}
165
- for name, sig in Sigma_iw:
166
-
159
+ Sigma_fit = Sigma_iw.copy()
160
+ for name, sig in Sigma_fit:
167
161
  tail, err = fit_hermitian_tail_on_window(
168
162
  sig,
169
- n_min = fit_min_n,
170
- n_max = fit_max_n,
171
- known_moments = fit_known_moments[name],
163
+ n_min=fit_min_n,
164
+ n_max=fit_max_n,
165
+ known_moments=fit_known_moments[name],
172
166
  # set max number of pts used in fit larger than mesh size, to use all data in fit
173
- n_tail_max = 10 * len(sig.mesh),
174
- expansion_order = fit_max_moment
175
- )
167
+ n_tail_max=10 * len(sig.mesh),
168
+ expansion_order=fit_max_moment,
169
+ )
176
170
  tail_barr[name] = tail
171
+ replace_by_tail(sig, tail, n_min=fit_min_n)
177
172
 
178
- return tail_barr
173
+ return Sigma_fit, tail_barr
179
174
 
180
175
  class SolverStructure:
181
176
 
@@ -1168,6 +1163,7 @@ class SolverStructure:
1168
1163
  self.Sigma_moments = self.triqs_solver.Sigma_moments
1169
1164
  self.Sigma_Hartree = self.triqs_solver.Sigma_Hartree
1170
1165
  self.G_moments = self.triqs_solver.G_moments
1166
+ self.orbital_occupations = self.triqs_solver.orbital_occupations
1171
1167
 
1172
1168
  if self.solver_params['measure_pert_order']:
1173
1169
  self.perturbation_order = self.triqs_solver.perturbation_order
@@ -1251,8 +1247,8 @@ class SolverStructure:
1251
1247
  # get everything from solver
1252
1248
  self.G0_freq << self.triqs_solver.G0_iw
1253
1249
  self.G_freq_unsym << self.triqs_solver.G_iw
1250
+ self.G_freq << self.triqs_solver.G_iw
1254
1251
  self.sum_k.symm_deg_gf(self.G_freq, ish=self.icrsh)
1255
- self.G_freq << self.G_freq
1256
1252
  for bl, gf in self.Sigma_freq:
1257
1253
  self.Sigma_freq[bl] << self.triqs_solver.Sigma_HF[bl]
1258
1254
  self.Sigma_Refreq[bl] << self.triqs_solver.Sigma_HF[bl]
@@ -1346,6 +1342,8 @@ class SolverStructure:
1346
1342
  r'''
1347
1343
  Organize G_freq, G_time, Sigma_freq and G_l from ctseg solver
1348
1344
  '''
1345
+ from solid_dmft.postprocessing.eval_U_cRPA_RESPACK import construct_Uijkl
1346
+ from triqs.operators.util.extractors import extract_U_dict2, dict_to_matrix
1349
1347
 
1350
1348
  def set_Gs_from_G_l():
1351
1349
 
@@ -1442,7 +1440,7 @@ class SolverStructure:
1442
1440
  # get G_time, G_freq, Sigma_freq from G_l
1443
1441
  set_Gs_from_G_l()
1444
1442
  # if improved estimators are turned on calc Sigma from F_tau, otherwise:
1445
- elif self.solver_params['improved_estimator']:
1443
+ elif self.solver_params['improved_estimator'] and not self.solver_params['perform_tail_fit']:
1446
1444
  self.F_freq = self.G_freq.copy()
1447
1445
  self.F_freq << 0.0
1448
1446
  self.F_time = self.G_time.copy()
@@ -1460,6 +1458,42 @@ class SolverStructure:
1460
1458
  for block, fw in self.F_freq:
1461
1459
  for iw in fw.mesh:
1462
1460
  self.Sigma_freq[block][iw] = self.F_freq[block][iw] / self.G_freq[block][iw]
1461
+ elif self.solver_params['perform_tail_fit']:
1462
+ if not self.solver_params['improved_estimator']:
1463
+ mpi.report('Self-energy post-processing algorithm: tail fitting with analytic static impurity self-energy')
1464
+ self.Sigma_freq = inverse(self.G0_freq) - inverse(self.G_freq)
1465
+ else:
1466
+ mpi.report('Self-energy post-processing algorithm: '
1467
+ 'improved estimator + tail fitting with analytic static imppurity self-energy')
1468
+ self.F_freq = self.G_freq.copy()
1469
+ self.F_freq << 0.0
1470
+ self.F_time = self.G_time.copy()
1471
+ self.F_time << self.triqs_solver.results.F_tau
1472
+ F_known_moments = make_zero_tail(self.F_freq, n_moments=1)
1473
+ for i, bl in enumerate(self.F_freq.indices):
1474
+ self.F_freq[bl] << Fourier(self.triqs_solver.results.F_tau[bl], F_known_moments[i])
1475
+
1476
+ for block, fw in self.F_freq:
1477
+ for iw in fw.mesh:
1478
+ self.Sigma_freq[block][iw] = self.F_freq[block][iw] / self.G_freq[block][iw]
1479
+
1480
+ # without any degenerate shells we run the minimization for all blocks
1481
+ if mpi.is_master_node():
1482
+ self.Sigma_freq, tail = _fit_tail_window(
1483
+ self.Sigma_freq,
1484
+ fit_min_n=self.solver_params['fit_min_n'],
1485
+ fit_max_n=self.solver_params['fit_max_n'],
1486
+ fit_min_w=self.solver_params['fit_min_w'],
1487
+ fit_max_w=self.solver_params['fit_max_w'],
1488
+ fit_max_moment=self.solver_params['fit_max_moment'],
1489
+ fit_known_moments=self.Sigma_moments,
1490
+ )
1491
+
1492
+ # recompute G_freq from Sigma with fitted tail
1493
+ self.G_freq = inverse(inverse(self.G0_freq) - self.Sigma_freq)
1494
+
1495
+ self.Sigma_freq << mpi.bcast(self.Sigma_freq)
1496
+ self.G_freq << mpi.bcast(self.G_freq)
1463
1497
 
1464
1498
  elif self.solver_params['crm_dyson_solver']:
1465
1499
  from triqs.gf.dlr_crm_dyson_solver import minimize_dyson
@@ -1490,7 +1524,7 @@ class SolverStructure:
1490
1524
  # minimize dyson for the first entry of each deg shell
1491
1525
  self.Sigma_dlr = self.sum_k.block_structure.create_gf(ish=self.icrsh, gf_function=Gf, mesh=mesh_dlr_iw, space='solver')
1492
1526
  # without any degenerate shells we run the minimization for all blocks
1493
- tail = _fit_tail_window(Sigma_iw,
1527
+ _, tail = _fit_tail_window(Sigma_iw,
1494
1528
  fit_min_n=self.solver_params['fit_min_n'],
1495
1529
  fit_max_n=self.solver_params['fit_max_n'],
1496
1530
  fit_min_w=self.solver_params['fit_min_w'],
@@ -20,7 +20,7 @@ g0_mix_type = "linear"
20
20
  gimp_conv_crit = -1.0
21
21
  gw_embedding = false
22
22
  h_field = 0.0
23
- h_field_it = 0
23
+ h_field_it = -1
24
24
  h_int_basis = "triqs"
25
25
  h_int_type = "<no default>"
26
26
  h5_save_freq = 5
@@ -28,6 +28,11 @@ def _verify_input_params_general(params: FullConfig) -> None:
28
28
  if params['general']['calc_energies'] and any(entry['type'] == 'ftps' for entry in params['solver']):
29
29
  raise ValueError('"calc_energies" is not valid for solver of type = "ftps"')
30
30
 
31
+ if params['general']['n_iter_dmft'] is None:
32
+ raise ValueError('"n_iter_dmft" must be specified.')
33
+ elif params['general']['n_iter_dmft'] < 0:
34
+ raise ValueError('"n_iter_dmft" must be at least 0.')
35
+
31
36
  # Checks validity of other general params
32
37
  h_int_type_options = (
33
38
  'density_density',
@@ -110,8 +115,8 @@ def _verify_input_params_solver(params: FullConfig) -> None:
110
115
  entry['legendre_fit'],
111
116
  entry['improved_estimator'],
112
117
  entry['perform_tail_fit']]
113
- if sum(tail_op) > 1:
114
- raise ValueError('Only one of the options "crm_dyson_solver", "legendre_fit", "improved_estimator", and "perform_tail_fit" can be set to True.')
118
+ if sum(tail_op) > 1 and not (entry['improved_estimator'] and entry['perform_tail_fit']):
119
+ raise ValueError('Only one of the options "crm_dyson_solver", "legendre_fit", "improved_estimator", and "perform_tail_fit" can be set to True. You can only combine "improved_estimator" and "perform_tail_fit".')
115
120
  if entry['type'] == 'cthyb':
116
121
  tail_op = [entry['crm_dyson_solver'],
117
122
  entry['legendre_fit'],
@@ -22,12 +22,12 @@
22
22
  #
23
23
  ################################################################################
24
24
 
25
- version = "3.3.2"
26
- triqs_hash = "2642a94a63558f20e2ec7f32207c8df6cc13193b"
27
- solid_dmft_hash = "12b01d076e9c00fe86fab31aea8062d9e307326c"
25
+ version = "3.3.4"
26
+ triqs_hash = "e0692a5bc9a8df98ec544abef51f06a728b37105"
27
+ solid_dmft_hash = "598a67977a6ff7eeca9394ec35138f569dd9a5f7"
28
28
 
29
29
  def show_version():
30
30
  print("\nYou are using solid_dmft version %s\n"%version)
31
31
 
32
32
  def show_git_hash():
33
- print("\nYou are using solid_dmft git hash %s based on triqs git hash %s\n"%("12b01d076e9c00fe86fab31aea8062d9e307326c", triqs_hash))
33
+ print("\nYou are using solid_dmft git hash %s based on triqs git hash %s\n"%("598a67977a6ff7eeca9394ec35138f569dd9a5f7", triqs_hash))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: solid_dmft
3
- Version: 3.3.2
3
+ Version: 3.3.4
4
4
  Summary: solid_dmft: a versatile python wrapper to perform DFT+DMFT calculations utilizing the TRIQS software library
5
5
  Author-email: Alexander Hampel <mail@alexander-hampel.de>
6
6
  Project-URL: Homepage, https://triqs.github.io/solid_dmft
@@ -21,7 +21,8 @@ Dynamic: license-file
21
21
 
22
22
  ![logo_soliDMFT](https://raw.githubusercontent.com/triqs/solid_dmft/unstable/doc/logos/logo_solid_dmft.png)
23
23
 
24
- ![CI](https://github.com/triqs/solid_dmft/actions/workflows/build.yml/badge.svg)
24
+ ![CI dev](https://github.com/triqs/solid_dmft/actions/workflows/build_unstable_doc.yml/badge.svg)
25
+ ![CI stable](https://github.com/triqs/solid_dmft/actions/workflows/build_release.yml/badge.svg)
25
26
  [![PyPI version](https://badge.fury.io/py/solid_dmft.svg)](https://badge.fury.io/py/solid_dmft)
26
27
  [![status](https://joss.theoj.org/papers/48eb529b08c6bb464b235ba919d78922/status.svg)](https://joss.theoj.org/papers/48eb529b08c6bb464b235ba919d78922)
27
28
 
@@ -65,3 +66,12 @@ and the Center for Computational Quantum Physics, Flatiron Institute.
65
66
  If you are using this code for your research, please cite it with this
66
67
  [bib file](https://github.com/TRIQS/solid_dmft/blob/unstable/cite_solid_dmft.bib).
67
68
 
69
+ ## Support
70
+
71
+ <picture>
72
+ <source media="(prefers-color-scheme: dark)" width="20%" srcset="doc/_static/CCQ-dark.png">
73
+ <img alt="Flatiron Center for Computational Quantum Physics logo." width="20%" src="doc/_static/CCQ.png">
74
+ </picture>
75
+
76
+ TRIQS/solid_dmft is supported by the Flatiron Institute, a division of the Simons Foundation.
77
+
File without changes
File without changes
File without changes
File without changes