mirror of
https://github.com/triqs/dft_tools
synced 2024-12-22 04:13:47 +01:00
Fix save function and call in init
This commit is contained in:
parent
84bd1ed655
commit
be69c7345b
@ -130,7 +130,7 @@ for Iteration_Number in range(1,Loops+1):
|
||||
|
||||
|
||||
#Save stuff:
|
||||
SK.save()
|
||||
SK.save(['chemical_potential','dc_imp','dc_energ'])
|
||||
if (mpi.is_master_node()):
|
||||
print 'DC after solver: ',SK.dc_imp[SK.invshellmap[0]]
|
||||
|
||||
|
@ -100,9 +100,9 @@ set up the loop over DMFT iterations and the self-consistency condition::
|
||||
l=2,T=None, dim_reps=None, irep=None, n_cycles =10000,
|
||||
length_cycle=200,n_warmup_cycles=1000)
|
||||
|
||||
dm = S.G.density() # density matrix of the impurity problem
|
||||
dm = S.G.density() # Density matrix of the impurity problem
|
||||
SK.set_dc( dm, U_interact = U, J_hund = J, use_dc_formula = 0) # Set the double counting term
|
||||
SK.save() # save everything to the hdf5 arxive
|
||||
SK.save(['chemical_potential','dc_imp','dc_energ']) # Save data in the hdf5 archive
|
||||
|
||||
These basic steps are enough to set up the basic DMFT Loop. For a detailed description of the :class:`SumkDFT` routines,
|
||||
see the reference manual. After the self-consistency steps, the solution of the Anderson impurity problem is calculation by CTQMC.
|
||||
|
@ -144,7 +144,7 @@ previous section, with some additional refinement::
|
||||
SK.set_dc( dm, U_interact = U, J_hund = J, orb = 0, use_dc_formula = dc_type)
|
||||
|
||||
#Save stuff:
|
||||
SK.save()
|
||||
SK.save(['chemical_potential','dc_imp','dc_energ'])
|
||||
|
||||
This is all we need for the DFT+DMFT calculation. At the end, all results are stored in the hdf5 output file.
|
||||
|
||||
|
@ -36,7 +36,7 @@ Now we calculate the modified charge density::
|
||||
SK.put_Sigma(Sigma_imp = [ S.Sigma ])
|
||||
chemical_potential = SK.find_mu( precision = 0.000001 )
|
||||
dN, d = SK.calc_density_correction(filename = dft_filename+'.qdmft')
|
||||
SK.save()
|
||||
SK.save(['chemical_potential','dc_imp','dc_energ'])
|
||||
|
||||
First we find the chemical potential with high precision, and after that the routine
|
||||
``SK.calc_density_correction(filename)`` calculates the density matrix including correlation effects. The result
|
||||
|
@ -131,8 +131,8 @@ for iteration_number in range(1,loops+1):
|
||||
# Set the double counting
|
||||
SK.set_dc( dm, U_interact = U, J_hund = J, orb = 0, use_dc_formula = dc_type)
|
||||
|
||||
# Save stuff into the hdf5 archive:
|
||||
SK.save()
|
||||
# Save stuff into the dft_output group of hdf5 archive in case of rerun:
|
||||
SK.save(['chemical_potential','dc_imp','dc_energ'])
|
||||
|
||||
if mpi.is_master_node():
|
||||
ar = HDFArchive("dftdmft.h5",'w')
|
||||
|
@ -114,11 +114,6 @@ class SumkDFT:
|
||||
# Analyse the block structure and determine the smallest blocks, if desired
|
||||
if use_dft_blocks: dm = self.analyse_block_structure()
|
||||
|
||||
# Now save new things to HDF5:
|
||||
# FIXME WHAT HAPPENS TO h_field? INPUT TO __INIT__? ADD TO OPTIONAL_THINGS?
|
||||
things_to_save = ['chemical_potential','dc_imp','dc_energ','h_field']
|
||||
self.save(things_to_save)
|
||||
|
||||
################
|
||||
# HDF5 FUNCTIONS
|
||||
################
|
||||
@ -171,7 +166,7 @@ class SumkDFT:
|
||||
|
||||
|
||||
def save(self,things_to_save):
|
||||
"""Saves some quantities into an HDF5 archive"""
|
||||
"""Saves given quantities into the 'dft_output' subgroup of the HDF5 archive"""
|
||||
|
||||
if not (mpi.is_master_node()): return # do nothing on nodes
|
||||
ar = HDFArchive(self.hdf_file,'a')
|
||||
|
Loading…
Reference in New Issue
Block a user