solid-dmft 3.3.4__tar.gz → 3.3.5__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.4/python/solid_dmft.egg-info → solid_dmft-3.3.5}/PKG-INFO +1 -1
  2. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/pyproject.toml +1 -1
  3. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/csc_flow.py +11 -3
  4. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dft_managers/mpi_helpers.py +5 -0
  5. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dft_managers/qe_manager.py +3 -2
  6. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dft_managers/vasp_manager.py +54 -11
  7. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_cycle.py +8 -4
  8. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/afm_mapping.py +23 -8
  9. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/observables.py +3 -2
  10. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/io_tools/default.toml +1 -0
  11. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/postprocessing/eval_U_cRPA_Vasp.py +13 -10
  12. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/version.py +4 -4
  13. {solid_dmft-3.3.4 → solid_dmft-3.3.5/python/solid_dmft.egg-info}/PKG-INFO +1 -1
  14. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/COPYING.txt +0 -0
  15. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/LICENSE.txt +0 -0
  16. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/MANIFEST.in +0 -0
  17. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/README.md +0 -0
  18. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/__init__.py +0 -0
  19. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dft_managers/__init__.py +0 -0
  20. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/__init__.py +0 -0
  21. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/convergence.py +0 -0
  22. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/formatter.py +0 -0
  23. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/greens_functions_mixer.py +0 -0
  24. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/initial_self_energies.py +0 -0
  25. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/interaction_hamiltonian.py +0 -0
  26. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/legendre_filter.py +0 -0
  27. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/manipulate_chemical_potential.py +0 -0
  28. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/matheval.py +0 -0
  29. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/results_to_archive.py +0 -0
  30. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/dmft_tools/solver.py +0 -0
  31. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/gw_embedding/__init__.py +0 -0
  32. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/gw_embedding/bdft_converter.py +0 -0
  33. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/gw_embedding/gw_flow.py +0 -0
  34. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/gw_embedding/iaft.py +0 -0
  35. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/gw_embedding/qp_evs_to_eig.py +0 -0
  36. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/io_tools/__init__.py +0 -0
  37. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/io_tools/dict_to_h5.py +0 -0
  38. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/io_tools/postproc_toml_dict.py +0 -0
  39. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/io_tools/verify_input_params.py +0 -0
  40. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/main.py +0 -0
  41. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/postprocessing/__init__.py +0 -0
  42. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/postprocessing/eval_U_cRPA_RESPACK.py +0 -0
  43. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/postprocessing/maxent_gf_imp.py +0 -0
  44. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/postprocessing/maxent_gf_latt.py +0 -0
  45. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/postprocessing/maxent_sigma.py +0 -0
  46. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/postprocessing/pade_sigma.py +0 -0
  47. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/postprocessing/plot_correlated_bands.py +0 -0
  48. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/util/__init__.py +0 -0
  49. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/util/symmetrize_gamma_file.py +0 -0
  50. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft/util/write_kslice_to_h5.py +0 -0
  51. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft.egg-info/SOURCES.txt +0 -0
  52. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft.egg-info/dependency_links.txt +0 -0
  53. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft.egg-info/entry_points.txt +0 -0
  54. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft.egg-info/requires.txt +0 -0
  55. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/python/solid_dmft.egg-info/top_level.txt +0 -0
  56. {solid_dmft-3.3.4 → solid_dmft-3.3.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: solid_dmft
3
- Version: 3.3.4
3
+ Version: 3.3.5
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
@@ -7,7 +7,7 @@ where = ["python"]
7
7
 
8
8
  [project]
9
9
  name = "solid_dmft"
10
- version = "3.3.4"
10
+ version = "3.3.5"
11
11
  authors = [
12
12
  { name="Alexander Hampel", email="mail@alexander-hampel.de" }
13
13
  ]
@@ -98,7 +98,7 @@ def _full_qe_run(seedname, dft_params, mode):
98
98
 
99
99
  # runs a full iteration of DFT
100
100
  qe_wrapper = lambda calc_type: qe.run(dft_params['n_cores'], calc_type, dft_params['dft_exec'],
101
- dft_params['mpi_env'], seedname)
101
+ dft_params['mpi_env'], dft_params['mpi_exe'], seedname)
102
102
 
103
103
  # Initially run an scf calculation
104
104
  if mode == 'initial':
@@ -179,15 +179,23 @@ def _full_vasp_run(general_params, dft_params, initial_run, n_iter_dft=1, sum_k=
179
179
  if initial_run:
180
180
  assert n_iter_dft == 1
181
181
  else:
182
+ dft_iter_init = vasp.read_dft_iter()
182
183
  assert n_iter_dft == 1 or sum_k is not None, 'Sumk object needed to run multiple DFT iterations'
183
184
 
184
185
  for i in range(n_iter_dft):
185
186
  if initial_run:
186
187
  vasp_process_id = vasp.run_initial_scf(dft_params['n_cores'], dft_params['dft_exec'],
187
- dft_params['mpi_env'])
188
+ dft_params['mpi_exe'], dft_params['mpi_env'])
188
189
  else:
189
190
  vasp_process_id = None
190
191
  vasp.run_charge_update()
192
+ dft_iter = vasp.read_dft_iter()
193
+ mpi.report(f'\nDFT SCF iteration {dft_iter} finished. Running converter:')
194
+ if not dft_iter == dft_iter_init+i+1:
195
+ mpi.report(f'DFT iteration number did not increase. Aborting.\n \
196
+ DFT iteration {dft_iter} != {dft_iter_init+i+1}')
197
+ vasp.kill(vasp_process_id)
198
+ exit()
191
199
 
192
200
  if dft_params['projector_type'] == 'plo':
193
201
  _run_plo_converter(general_params, dft_params)
@@ -221,7 +229,7 @@ def _full_vasp_run(general_params, dft_params, initial_run, n_iter_dft=1, sum_k=
221
229
  sum_k.calc_mu(precision=general_params['prec_mu'])
222
230
 
223
231
  # Writes out GAMMA file
224
- sum_k.calc_density_correction(dm_type='vasp', kpts_to_write=irred_indices)
232
+ sum_k.calc_density_correction(dm_type='vasp', kpts_to_write=irred_indices, spinave=True)
225
233
 
226
234
  return vasp_process_id, irred_indices
227
235
 
@@ -93,6 +93,11 @@ def find_path_to_mpi_command(env_vars, mpi_exe):
93
93
  string: absolute path to mpi command
94
94
  """
95
95
 
96
+ # first check if mpi_exe is already full path to executable
97
+ if os.path.isfile(mpi_exe):
98
+ return mpi_exe
99
+
100
+ # otherwise, check if mpi_exe is in PATH
96
101
  for path_directory in env_vars.get('PATH').split(os.pathsep):
97
102
  if path_directory:
98
103
  potential_path = os.path.join(path_directory, mpi_exe)
@@ -82,7 +82,7 @@ def _start_with_piping(mpi_exe, mpi_arguments, qe_file_ext, env_vars, seedname):
82
82
  subprocess.check_call(mpi_arguments + [seedname], env=env_vars, shell=False)
83
83
 
84
84
 
85
- def run(number_cores, qe_file_ext, qe_exec, mpi_profile, seedname):
85
+ def run(number_cores, qe_file_ext, qe_exec, mpi_profile, mpi_exe_param, seedname):
86
86
  """
87
87
  Starts the VASP child process. Takes care of initializing a clean
88
88
  environment for the child process. This is needed so that VASP does not
@@ -111,7 +111,8 @@ def run(number_cores, qe_file_ext, qe_exec, mpi_profile, seedname):
111
111
  env_vars[var_name] = var
112
112
 
113
113
  # assuming that mpirun points to the correct mpi env
114
- mpi_exe = mpi_helpers.find_path_to_mpi_command(env_vars, 'mpirun')
114
+ mpi_exe = mpi_helpers.find_path_to_mpi_command(env_vars, mpi_exe_param)
115
+ print('\nMPI executable for QE:', mpi_exe)
115
116
 
116
117
  if qe_file_ext in ['scf', 'nscf', 'mod_scf', 'bnd']:
117
118
  qe_exec += f'pw.x -nk {number_cores}'
@@ -36,6 +36,7 @@ import signal
36
36
  import time
37
37
  import numpy as np
38
38
 
39
+ from h5 import HDFArchive
39
40
  import triqs.utility.mpi as mpi
40
41
 
41
42
  from solid_dmft.dft_managers import mpi_helpers
@@ -99,7 +100,7 @@ def remove_legacy_projections_suppressed():
99
100
  mpi.barrier()
100
101
 
101
102
 
102
- def run_initial_scf(number_cores, vasp_command, cluster_name):
103
+ def run_initial_scf(number_cores, vasp_command, mpi_exe_param, cluster_name):
103
104
  """
104
105
  Starts the VASP child process. Takes care of initializing a clean
105
106
  environment for the child process. This is needed so that VASP does not
@@ -133,7 +134,8 @@ def run_initial_scf(number_cores, vasp_command, cluster_name):
133
134
  env_vars[var_name] = var
134
135
 
135
136
  # assuming that mpirun points to the correct mpi env
136
- mpi_exe = mpi_helpers.find_path_to_mpi_command(env_vars, 'mpirun')
137
+ mpi_exe = mpi_helpers.find_path_to_mpi_command(env_vars, mpi_exe_param)
138
+ print('\nMPI executable for Vasp:', mpi_exe)
137
139
 
138
140
  arguments = mpi_helpers.get_mpi_arguments(cluster_name, mpi_exe, number_cores, vasp_command, hostfile)
139
141
  vasp_process_id = _fork_and_start_vasp(mpi_exe, arguments, env_vars)
@@ -171,17 +173,56 @@ def run_charge_update():
171
173
 
172
174
  def read_dft_energy():
173
175
  """
174
- Reads DFT energy from the last line of Vasp's OSZICAR.
176
+ Reads DFT energy from the last line of Vasp's OSZICAR or from vasptriqs.h5
175
177
  """
178
+ if os.path.isfile('vaspout.h5'):
179
+ with HDFArchive('vaspout.h5', 'r') as h5:
180
+ if 'oszicar' in h5['intermediate/ion_dynamics']:
181
+ # h5 access returns a numpy scalar/array; cast defensively
182
+ return float(np.asarray(h5['intermediate/ion_dynamics/oszicar'][-1, 1]).item())
183
+
184
+ # Backup: use OSZICAR file
185
+ last_nonempty_line = None
176
186
  with open('OSZICAR', 'r') as file:
177
- nextline = file.readline()
178
- while nextline.strip():
179
- line = nextline
180
- nextline = file.readline()
181
- dft_energy = float(line.split()[2])
187
+ for line in file:
188
+ if line.strip():
189
+ last_nonempty_line = line
190
+
191
+ if last_nonempty_line is None:
192
+ raise RuntimeError('OSZICAR is empty (cannot read DFT energy).')
193
+
194
+ parts = last_nonempty_line.split()
195
+ try:
196
+ # Typical OSZICAR line: " 1 F= -10.123 E0= ..." -> energy at index 2
197
+ return float(parts[2])
198
+ except (IndexError, ValueError) as err:
199
+ raise RuntimeError(f'Failed to parse DFT energy from OSZICAR line: {last_nonempty_line!r}') from err
200
+
201
+ def read_dft_iter():
202
+ """
203
+ Reads DFT iteration number from the last line of the OSZICAR or from Vasp's vasptriqs.h5
204
+ """
205
+ if os.path.isfile('vaspout.h5'):
206
+ with HDFArchive('vaspout.h5', 'r') as h5:
207
+ if 'oszicar' in h5['intermediate/ion_dynamics']:
208
+ return int(np.asarray(h5['intermediate/ion_dynamics/oszicar'][-1, 0]).item())
209
+
210
+ # Backup: use OSZICAR file
211
+ last_nonempty_line = None
212
+ with open('OSZICAR', 'r') as file:
213
+ for line in file:
214
+ if line.strip():
215
+ last_nonempty_line = line
182
216
 
183
- return dft_energy
217
+ if last_nonempty_line is None:
218
+ raise RuntimeError('OSZICAR is empty (cannot read DFT iteration).')
184
219
 
220
+ parts = last_nonempty_line.split()
221
+ try:
222
+ # Typical OSZICAR line: " 1 F= -10.123 ..." -> iteration at index 1
223
+ return int(parts[1])
224
+ except (IndexError, ValueError) as err:
225
+ raise RuntimeError(f'Failed to parse DFT iteration from OSZICAR line: {last_nonempty_line!r}') from err
185
226
 
186
227
  def read_irred_kpoints(kpts):
187
228
  """ Reads the indices of the irreducible k-points from the OUTCAR. """
@@ -214,6 +255,7 @@ def read_irred_kpoints(kpts):
214
255
  symmetry_mapping = np.full(outcar_kpoints.shape[0], -1, dtype=int)
215
256
 
216
257
  for i, (kpt_outcar, outcar_index) in enumerate(zip(outcar_kpoints, outcar_indices)):
258
+ found_match = False
217
259
  for j, kpt in enumerate(kpts):
218
260
  if np.allclose(kpt_outcar, kpt):
219
261
  # Symmetry-irreducible k points
@@ -222,10 +264,11 @@ def read_irred_kpoints(kpts):
222
264
  # Symmetry-reducible
223
265
  else:
224
266
  symmetry_mapping[j] = outcar_index
267
+ found_match = True
225
268
  break
226
269
 
227
- # Asserts that loop left through break, i.e. a pair was found
228
- assert np.allclose(kpt_outcar, kpt)
270
+ # Assert that a matching k-point was found
271
+ assert found_match, f'OUTCAR k-point {kpt_outcar} not found in provided kpts.'
229
272
 
230
273
  irreds, irred_indices = np.unique(symmetry_mapping, return_index=True)
231
274
  assert np.all(np.diff(irreds) == 1)
@@ -293,15 +293,19 @@ def dmft_cycle(general_params, solver_params, advanced_params, dft_params,
293
293
  updated observable array for calculation
294
294
  """
295
295
 
296
+ # print version info and git hashes
297
+ mpi.report('\nsolid_dmft version: {} (git hash: {})'.format(solid_dmft_version, solid_dmft_hash))
298
+ mpi.report('TRIQS version: {} (git hash: {})\n'.format(triqs_version, triqs_hash))
299
+
296
300
  # Creates real- or imaginary-frequency mesh to store Green functions on
297
301
  if general_params['beta'] is not None:
298
- mpi.report('Running solid_dmft on imag-freq grid because "general.beta" specified')
302
+ mpi.report('Running solid_dmft on imag-freq grid because "general.beta" specified\n')
299
303
  sumk_mesh = MeshImFreq(beta=general_params['beta'],
300
304
  S='Fermion',
301
305
  n_iw=general_params['n_iw'])
302
306
  broadening = None
303
307
  else:
304
- mpi.report('Running solid_dmft on real-freq grid because "general.beta" not specified')
308
+ mpi.report('Running solid_dmft on real-freq grid because "general.beta" not specified\n')
305
309
  sumk_mesh = MeshReFreq(window=general_params['w_range'],
306
310
  n_w=general_params['n_w'])
307
311
  broadening = general_params['eta']
@@ -315,7 +319,7 @@ def dmft_cycle(general_params, solver_params, advanced_params, dft_params,
315
319
  # if magnetic field is set we make sure that this is a magnetic calculation
316
320
  if general_params['h_field'] != 0.0:
317
321
  if not general_params['magnetic']:
318
- mpi.report('WARNING: Magnetic field set but general.magnetic is False. Setting it to True now.')
322
+ mpi.report('WARNING: Magnetic field set but general.magnetic is False. Setting it to True now.\n')
319
323
  general_params['magnetic'] = True
320
324
 
321
325
  # determine chemical potential for bare DFT sum_k object
@@ -796,7 +800,7 @@ def _dmft_step(sum_k, solvers, it, general_params, solver_params, gw_params,
796
800
  if general_params['csc']:
797
801
  # handling the density correction for fcsc calculations
798
802
  assert dft_irred_kpt_indices is None or dft_params['dft_code'] == 'vasp'
799
- deltaN, dens, E_bandcorr = sum_k.calc_density_correction(dm_type=dft_params['dft_code'],
803
+ deltaN, dens, E_bandcorr = sum_k.calc_density_correction(dm_type=dft_params['dft_code'], spinave=True,
800
804
  kpts_to_write=dft_irred_kpt_indices)
801
805
  elif general_params['calc_energies']:
802
806
  # for a one shot calculation we are using our own method
@@ -86,19 +86,30 @@ 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
89
+ if solvers[icrsh].solver_params.get('measure_density_matrix') or solvers[icrsh].solver_params.get('type') == 'ctseg':
92
90
  solvers[icrsh].Sigma_moments = solvers[imp_source].Sigma_moments
93
91
  solvers[icrsh].Sigma_Hartree = solvers[imp_source].Sigma_Hartree
94
- solvers[icrsh].G_moments = solvers[imp_source].G_moments
95
92
  # copy orbital occupations dict with deep copy of arrays
96
93
  solvers[icrsh].orbital_occupations = {key: occ.copy() for key, occ in solvers[imp_source].orbital_occupations.items()}
94
+ if solvers[icrsh].solver_params.get('type') == 'cthyb':
95
+ solvers[icrsh].G_moments = solvers[imp_source].G_moments
96
+ solvers[icrsh].density_matrix = solvers[imp_source].density_matrix
97
+ solvers[icrsh].h_loc_diagonalization = solvers[imp_source].h_loc_diagonalization
98
+
99
+ if solvers[icrsh].solver_params.get('type') == 'ctseg' and solvers[icrsh].solver_params.get('measure_state_hist'):
100
+ solvers[icrsh].state_histogram = solvers[imp_source].state_histogram
97
101
 
98
102
  # and the same for the perturbation order if measured
99
103
  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
104
+ if solvers[icrsh].solver_params.get('type') == 'cthyb':
105
+ solvers[icrsh].perturbation_order = {key: hist for key, hist in solvers[imp_source].perturbation_order.items()}
106
+ solvers[icrsh].perturbation_order_total = solvers[imp_source].perturbation_order_total
107
+ elif solvers[icrsh].solver_params.get('type') == 'ctseg':
108
+ solvers[icrsh].perturbation_order_histo = solvers[imp_source].perturbation_order_histo
109
+ solvers[icrsh].avg_pert_order = solvers[imp_source].avg_pert_order
110
+
111
+ if solvers[icrsh].solver_params.get('type') == 'hartree':
112
+ solvers[icrsh].DC_energy = solvers[imp_source].DC_energy
102
113
 
103
114
  if invert_spin:
104
115
  for spin_channel in gf_struct_solver.keys():
@@ -113,13 +124,17 @@ def apply(general_params, icrsh, gf_struct_solver, solvers):
113
124
  solvers[icrsh].G0_freq[spin_channel] << solvers[imp_source].G0_freq[target_channel]
114
125
  solvers[icrsh].G_time[spin_channel] << solvers[imp_source].G_time[target_channel]
115
126
 
116
- if solvers[icrsh].solver_params.get('measure_pert_order'):
127
+ if solvers[icrsh].solver_params.get('measure_pert_order') and solvers[icrsh].solver_params.get('type') == 'cthyb':
117
128
  solvers[icrsh].perturbation_order[spin_channel] = solvers[imp_source].perturbation_order[target_channel]
118
129
 
119
130
  # 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'):
131
+ if solvers[icrsh].solver_params.get('measure_density_matrix') or solvers[icrsh].solver_params.get('type') == 'ctseg':
121
132
  solvers[icrsh].orbital_occupations[spin_channel] = solvers[imp_source].orbital_occupations[target_channel]
122
133
 
134
+ # and for the hartree solver we also need to copy the real frequency self-energy for the correct spin channel
135
+ if solvers[icrsh].solver_params.get('type') == 'hartree':
136
+ solvers[icrsh].Sigma_Refreq[spin_channel] = solvers[imp_source].Sigma_Refreq[target_channel]
137
+
123
138
  else:
124
139
  solvers[icrsh].Sigma_freq << solvers[imp_source].Sigma_freq
125
140
  solvers[icrsh].G_freq << solvers[imp_source].G_freq
@@ -511,7 +511,8 @@ def calc_dft_kin_en(general_params, sum_k, dft_mu):
511
511
  E_kin = 0.0
512
512
  ikarray = np.array(list(range(sum_k.n_k)))
513
513
  for ik in mpi.slice_array(ikarray):
514
- nb = int(sum_k.n_orbitals[ik])
514
+ # sum_k.n_orbitals[ik] is a 1-element array, so extract the scalar explicitly.
515
+ nb = int(np.asarray(sum_k.n_orbitals[ik]).item())
515
516
  # calculate lattice greens function need here to set sigma other n_iw is assumend to be 1025!
516
517
  # TODO: implement here version for FTPS!
517
518
  G_freq_lat = sum_k.lattice_gf(ik, with_Sigma=True, mu=dft_mu).copy()
@@ -560,7 +561,7 @@ def calc_bandcorr_man(general_params, sum_k, E_kin_dft):
560
561
  # kinetic energy from dmft lattice Greens functions
561
562
  ikarray = np.array(list(range(sum_k.n_k)))
562
563
  for ik in mpi.slice_array(ikarray):
563
- nb = int(sum_k.n_orbitals[ik])
564
+ nb = int(np.asarray(sum_k.n_orbitals[ik]).item())
564
565
  # calculate lattice greens function
565
566
  G_freq_lat = sum_k.lattice_gf(ik, with_Sigma=True, with_dc=True).copy()
566
567
  # calculate G(beta) via the function density, which is the same as fourier trafo G(w) and taking G(b)
@@ -178,6 +178,7 @@ with_fock = false
178
178
  dft_code = "<none>"
179
179
  dft_exec = "vasp_std"
180
180
  mpi_env = "default"
181
+ mpi_exe = "mpirun"
181
182
  n_cores = "<none>"
182
183
  n_iter = 4
183
184
  n_iter_first = "<dft.n_iter>"
@@ -124,24 +124,27 @@ def red_to_2ind(uijkl, n_sites, n_orb, out=False):
124
124
  dim = n_sites*n_orb
125
125
 
126
126
  # create 2 index matrix
127
- Uij_anti = np.zeros((dim, dim))
128
- Uij_par = np.zeros((dim, dim))
129
- Uiijj = np.zeros((dim, dim))
130
- Uijji = np.zeros((dim, dim))
127
+ # Coulomb matrices are expected to be real. If uijkl happens to be complex
128
+ # (e.g. numerical noise), take the real part explicitly to avoid
129
+ # ComplexWarning about discarding the imaginary part.
130
+ Uij_anti = np.zeros((dim, dim), dtype=float)
131
+ Uij_par = np.zeros((dim, dim), dtype=float)
132
+ Uiijj = np.zeros((dim, dim), dtype=float)
133
+ Uijji = np.zeros((dim, dim), dtype=float)
131
134
 
132
135
  for i in range(0, dim):
133
136
  for j in range(0, dim):
134
137
  # the indices in VASP are switched: U_ijkl ---VASP--> U_ikjl
135
- Uij_anti[i, j] = uijkl[i, i, j, j]
136
- Uij_par[i, j] = uijkl[i, i, j, j]-uijkl[i, j, j, i]
137
- Uiijj[i, j] = uijkl[i, j, i, j]
138
- Uijji[i, j] = uijkl[i, j, j, i]
138
+ Uij_anti[i, j] = np.real(uijkl[i, i, j, j])
139
+ Uij_par[i, j] = np.real(uijkl[i, i, j, j] - uijkl[i, j, j, i])
140
+ Uiijj[i, j] = np.real(uijkl[i, j, i, j])
141
+ Uijji[i, j] = np.real(uijkl[i, j, j, i])
139
142
 
140
143
  np.set_printoptions(precision=3, suppress=True)
141
144
 
142
145
  if out:
143
- print('reduced U anti-parallel = U_mm\'\^oo\' = U_mm\'mm\' matrix : \n', Uij_anti)
144
- print('reduced U parallel = U_mm\'\^oo = U_mm\'mm\' - U_mm\'m\'m matrix : \n', Uij_par)
146
+ print(r"reduced U anti-parallel = U_mm'\^oo' = U_mm'mm' matrix : \n", Uij_anti)
147
+ print(r"reduced U parallel = U_mm'\^oo = U_mm'mm' - U_mm'm'm matrix : \n", Uij_par)
145
148
  print('reduced Uijji : \n', Uijji)
146
149
  print('reduced Uiijj : \n', Uiijj)
147
150
 
@@ -22,12 +22,12 @@
22
22
  #
23
23
  ################################################################################
24
24
 
25
- version = "3.3.4"
26
- triqs_hash = "e0692a5bc9a8df98ec544abef51f06a728b37105"
27
- solid_dmft_hash = "598a67977a6ff7eeca9394ec35138f569dd9a5f7"
25
+ version = "3.3.5"
26
+ triqs_hash = "b85f3d131d6a20fe59ce224ffe4c1319b6dc4676"
27
+ solid_dmft_hash = "a1e3dc1441887348fb336a76bf822bb7bc331dcf"
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"%("598a67977a6ff7eeca9394ec35138f569dd9a5f7", triqs_hash))
33
+ print("\nYou are using solid_dmft git hash %s based on triqs git hash %s\n"%("a1e3dc1441887348fb336a76bf822bb7bc331dcf", triqs_hash))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: solid_dmft
3
- Version: 3.3.4
3
+ Version: 3.3.5
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
File without changes
File without changes
File without changes
File without changes
File without changes