3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-19 04:22:29 +01:00
dft_tools/doc/Ce-gamma_DOS.py

70 lines
2.1 KiB
Python
Raw Normal View History

2014-11-18 11:30:26 +01:00
from pytriqs.applications.dft.sumk_dft_tools import *
2013-08-07 16:40:18 +02:00
from pytriqs.applications.dft.converters.wien2k_converter import *
2014-03-28 23:29:06 +01:00
from pytriqs.applications.impurity_solvers.hubbard_I.hubbard_solver import Solver
2013-08-07 16:40:18 +02:00
# Creates the data directory, cd into it:
#Prepare_Run_Directory(DirectoryName = "Ce-Gamma")
2014-11-18 11:30:26 +01:00
dft_filename = 'Ce-gamma'
2013-08-07 16:40:18 +02:00
Beta = 40
2014-03-28 23:29:06 +01:00
U_int = 6.00
J_hund = 0.70
2013-08-07 16:40:18 +02:00
DC_type = 0 # 0...FLL, 1...Held, 2... AMF, 3...Lichtenstein
load_previous = True # load previous results
2014-11-18 11:30:26 +01:00
useBlocs = False # use bloc structure from DFT input
2013-08-07 16:40:18 +02:00
useMatrix = True # use the U matrix calculated from Slater coefficients instead of (U+2J, U, U-J)
ommin=-4.0
ommax=6.0
N_om=2001
broadening = 0.02
2014-11-18 11:30:26 +01:00
HDFfilename = dft_filename+'.h5'
2013-08-07 16:40:18 +02:00
# Convert DMFT input:
# Can be commented after the first run
2014-11-18 11:30:26 +01:00
Converter = Wien2kConverter(filename=dft_filename,repacking=True)
Converter.convert_dft_input()
2014-03-28 23:29:06 +01:00
Converter.convert_parproj_input()
2013-08-07 16:40:18 +02:00
#check if there are previous runs:
previous_runs = 0
previous_present = False
if mpi.is_master_node():
ar = HDFArchive(HDFfilename,'a')
if 'iterations' in ar:
previous_present = True
previous_runs = ar['iterations']
else:
previous_runs = 0
previous_present = False
del ar
mpi.barrier()
previous_runs = mpi.bcast(previous_runs)
previous_present = mpi.bcast(previous_present)
# if previous runs are present, no need for recalculating the bloc structure
# It has to be commented, if you run this script for the first time, starting
# from a converted h5 archive.
# Init the SumK class
2014-11-18 11:30:26 +01:00
SK = SumkDFTTools(hdf_file=dft_filename+'.h5',use_dft_blocks=False)
2013-08-07 16:40:18 +02:00
if (mpi.is_master_node()):
print 'DC after reading SK: ',SK.dc_imp[SK.invshellmap[0]]
N = SK.corr_shells[0]['dim']
l = SK.corr_shells[0]['l']
2013-08-07 16:40:18 +02:00
# Init the Solver:
2014-03-28 23:29:06 +01:00
S = Solver(beta = Beta, l = l)
S.Nmoments= 8
2013-08-07 16:40:18 +02:00
# set atomic levels:
eal = SK.eff_atomic_levels()[0]
S.set_atomic_levels( eal = eal )
2014-03-28 23:29:06 +01:00
S.GF_realomega(ommin=ommin, ommax = ommax, N_om=N_om,U_int=U_int,J_hund=J_hund)
SK.put_Sigma(Sigma_imp = [S.Sigma])
2013-08-07 16:40:18 +02:00
SK.dos_partial(broadening=broadening)