mirror of
https://github.com/triqs/dft_tools
synced 2025-05-01 04:34:57 +02:00
[doc] updates to CSC NiO example with VASP
This commit is contained in:
parent
511589c0d5
commit
45db76f559
@ -8,7 +8,7 @@ The VASP interface relies on new options introduced since version 5.4.x In
|
||||
particular, a new INCAR-option `LOCPROJ
|
||||
<https://cms.mpi.univie.ac.at/wiki/index.php/LOCPROJ>`_, the new `LORBIT` modes
|
||||
13 and 14 have been added, and the new `ICHARG` mode 5 for charge
|
||||
self-consistent DFT+DMFT calculations have been added. The VASP interface for charge self-consistent calculations is officially supported as of VASP version 6.5.0 (see `VASP ICHARG=5 documentation <https://www.vasp.at/wiki/index.php/ICHARG>`_). It is highly recommended to compile VASP with hdf5 support enabled (`-DVASP_HDF5`) to enable features of the interface. This allows to use the interface while symmetries are switched on in VASP, and enables spin-polarized feedback in charge self-consistent calculations to VASP.
|
||||
self-consistent DFT+DMFT calculations have been added. The VASP interface for charge self-consistent calculations is officially supported as of VASP version 6.5.0 (see `VASP ICHARG=5 documentation <https://www.vasp.at/wiki/index.php/ICHARG>`_). It is highly recommended to compile VASP with hdf5 support enabled (`-DVASP_HDF5`) to enable all features of the interface. This allows to use the interface while symmetries are switched on in VASP, and enables spin-polarized feedback in charge self-consistent calculations to VASP.
|
||||
|
||||
The VASP interface methodologically builds on the so called projection on
|
||||
localized orbitals (PLO) scheme, where the resulting KS states from DFT are
|
||||
|
@ -188,9 +188,9 @@ To understand the difference please make sure to read `ISTART flag VASP wiki
|
||||
`NELMIN` ensure that VASP does not terminate after the default number of
|
||||
iterations of 60.
|
||||
|
||||
The `LSYNCH5` flag is set to `True` to ensure that the VASP writte vaspout.h5 file can be read while VASP is running. Starting from VASP 6.5.0 all communication between VASP and TRIQS is performed through two h5 files: `vaspout.h5 <https://www.vasp.at/wiki/index.php/Vaspout.h5>`_ and `vaspgamma.h5 <https://www.vasp.at/wiki/index.php/Vaspgamma.h5>`_ when VASP is compiled with hdf5 support.
|
||||
The `LSYNCH5 <https://www.vasp.at/wiki/index.php/LSYNCH5>`_ flag is set to `True` to ensure that the `vaspout.h5 <https://www.vasp.at/wiki/index.php/Vaspout.h5>`_ file can be read while VASP is running. Starting from VASP 6.5.0 all communication between VASP and TRIQS is performed through two hdf5 files: `vaspout.h5 <https://www.vasp.at/wiki/index.php/Vaspout.h5>`_ and `vaspgamma.h5 <https://www.vasp.at/wiki/index.php/Vaspgamma.h5>`_ when VASP is compiled with hdf5 support.
|
||||
|
||||
For more detailed and fine grained methods to run Vasp in CSC also on clusters see the methods implemented in `solid dmft <https://triqs.github.io/solid_dmft/_ref/dft_managers.html>`_.
|
||||
For more detailed and fine grained methods to run VASP in CSC also on clusters see the methods implemented in `solid dmft <https://triqs.github.io/solid_dmft/_ref/dft_managers.html>`_.
|
||||
|
||||
|
||||
Elk
|
||||
|
@ -1,10 +1,8 @@
|
||||
System = NiO
|
||||
|
||||
KPAR = 5
|
||||
|
||||
# better convergence for small kpt grids
|
||||
ISMEAR = 2
|
||||
SIGMA = 0.05
|
||||
SIGMA = 0.04
|
||||
|
||||
# converge wave functions
|
||||
EDIFF = 1.E-7
|
||||
@ -12,7 +10,7 @@ NELMIN = 35
|
||||
|
||||
# the energy window to optimize projector channels (absolute)
|
||||
EMIN = -3
|
||||
EMAX = 10
|
||||
EMAX = 12
|
||||
|
||||
LMAXMIX = 6
|
||||
|
||||
|
@ -1,14 +1,11 @@
|
||||
System = NiO
|
||||
|
||||
KPAR = 5
|
||||
|
||||
# better convergence for small kpt grids
|
||||
ISMEAR = 2
|
||||
SIGMA = 0.05
|
||||
|
||||
# converge wave functions
|
||||
EDIFF = 1.E-7
|
||||
NELMIN = 35
|
||||
|
||||
# the energy window to optimize projector channels (absolute)
|
||||
EMIN = -3
|
||||
@ -25,7 +22,7 @@ LOCPROJ = "1 : d : Pr
|
||||
ICHARG = 5
|
||||
NELM = 1000
|
||||
NELMIN = 1000
|
||||
NELMDL = -1
|
||||
NELMDL = -2
|
||||
IMIX=1
|
||||
BMIX=0.5
|
||||
AMIX=0.02
|
||||
|
@ -13,17 +13,11 @@ warnings.filterwarnings("ignore", category=FutureWarning)
|
||||
|
||||
filename = 'vasp'
|
||||
beta = 5.0
|
||||
mesh = MeshImFreq(beta=beta, S='Fermion', n_iw=1000)
|
||||
mesh = MeshImFreq(beta=beta, S='Fermion', n_iw=500)
|
||||
|
||||
SK = SumkDFT(hdf_file = filename+'.h5', use_dft_blocks = False, mesh=mesh)
|
||||
|
||||
|
||||
# We analyze the block structure of the Hamiltonian
|
||||
Sigma = SK.block_structure.create_gf(mesh=mesh)
|
||||
|
||||
SK.put_Sigma([Sigma])
|
||||
|
||||
|
||||
# Setup CTQMC Solver
|
||||
n_orb = SK.corr_shells[0]['dim']
|
||||
spin_names = ['up','down']
|
||||
@ -56,7 +50,7 @@ SK.chemical_potential = mpi.bcast(SK.chemical_potential)
|
||||
if block_structure:
|
||||
SK.block_structure = block_structure
|
||||
else:
|
||||
G = SK.extract_G_loc()
|
||||
G = SK.extract_G_loc(transform_to_solver_blocks=False, with_Sigma=False)
|
||||
SK.analyse_block_structure_from_gf(G, threshold = 1e-3)
|
||||
|
||||
SK.put_Sigma(Sigma_imp = [Sigma_iw])
|
||||
|
@ -29,7 +29,7 @@ for orb in orbs:
|
||||
gf = gf + G_latt['up'][iO,iO]
|
||||
tm.set_G_iw(gf)
|
||||
tm.omega =LinearOmegaMesh(omega_min=-20, omega_max=20, n_points=201)
|
||||
tm.alpha_mesh = LogAlphaMesh(alpha_min=0.01, alpha_max=20000, n_points=60)
|
||||
tm.alpha_mesh = LogAlphaMesh(alpha_min=0.01, alpha_max=20000, n_points=30)
|
||||
|
||||
tm.set_error(1.e-3)
|
||||
result=tm.run()
|
||||
|
@ -67,8 +67,8 @@ p = {}
|
||||
p["max_time"] = -1
|
||||
p["random_name"] = ""
|
||||
p["length_cycle"] = 400
|
||||
p["n_warmup_cycles"] = 3000
|
||||
p["n_cycles"] = 20000
|
||||
p["n_warmup_cycles"] = 2000
|
||||
p["n_cycles"] = 80000
|
||||
p["fit_max_moment"] = 4
|
||||
p["fit_min_w"] = 20
|
||||
p["fit_max_w"] = 30
|
||||
@ -84,15 +84,15 @@ n_iterations = 10
|
||||
iteration_offset = 0
|
||||
if mpi.is_master_node():
|
||||
with HDFArchive(filename+'.h5', 'a') as ar:
|
||||
if not 'DMFT_results' in ar:
|
||||
if 'DMFT_results' not in ar:
|
||||
ar.create_group('DMFT_results')
|
||||
if not 'Iterations' in ar['DMFT_results']:
|
||||
if 'Iterations' not in ar['DMFT_results']:
|
||||
ar['DMFT_results'].create_group('Iterations')
|
||||
if not 'DMFT_input' in ar:
|
||||
if 'DMFT_input' not in ar:
|
||||
ar.create_group('DMFT_input')
|
||||
if not 'Iterations' in ar['DMFT_input']:
|
||||
if 'Iterations' not in ar['DMFT_input']:
|
||||
ar['DMFT_input'].create_group('Iterations')
|
||||
if not 'code_versions' in ar['DMFT_input']:
|
||||
if 'code_versions' not in ar['DMFT_input']:
|
||||
ar['DMFT_input'].create_group('code_versions')
|
||||
ar['DMFT_input']['code_versions']["triqs_version"] = triqs_version.version
|
||||
ar['DMFT_input']['code_versions']["triqs_git"] = triqs_version.git_hash
|
||||
|
@ -73,8 +73,8 @@ def dmft_cycle():
|
||||
p["max_time"] = -1
|
||||
p["random_name"] = ""
|
||||
p["length_cycle"] = 400
|
||||
p["n_warmup_cycles"] = 3000
|
||||
p["n_cycles"] = 20000
|
||||
p["n_warmup_cycles"] = 2000
|
||||
p["n_cycles"] = 80000
|
||||
p["fit_max_moment"] = 4
|
||||
p["fit_min_w"] = 20
|
||||
p["fit_max_w"] = 30
|
||||
@ -90,15 +90,15 @@ def dmft_cycle():
|
||||
iteration_offset = 0
|
||||
if mpi.is_master_node():
|
||||
with HDFArchive(filename+'.h5', 'a') as ar:
|
||||
if not 'DMFT_results' in ar:
|
||||
if 'DMFT_results' not in ar:
|
||||
ar.create_group('DMFT_results')
|
||||
if not 'Iterations' in ar['DMFT_results']:
|
||||
if 'Iterations' not in ar['DMFT_results']:
|
||||
ar['DMFT_results'].create_group('Iterations')
|
||||
if not 'DMFT_input' in ar:
|
||||
if 'DMFT_input' not in ar:
|
||||
ar.create_group('DMFT_input')
|
||||
if not 'Iterations' in ar['DMFT_input']:
|
||||
if 'Iterations' not in ar['DMFT_input']:
|
||||
ar['DMFT_input'].create_group('Iterations')
|
||||
if not 'code_versions' in ar['DMFT_input']:
|
||||
if not 'code_versions' not in ar['DMFT_input']:
|
||||
ar['DMFT_input'].create_group('code_versions')
|
||||
ar['DMFT_input']['code_versions']["triqs_version"] = triqs_version.version
|
||||
ar['DMFT_input']['code_versions']["triqs_git"] = triqs_version.git_hash
|
||||
@ -182,7 +182,7 @@ def dmft_cycle():
|
||||
SK.chemical_potential = SK.calc_mu(precision=0.000001)
|
||||
|
||||
if mpi.is_master_node():
|
||||
print('calculating GAMMA')
|
||||
print('calculating charge density update')
|
||||
SK.calc_density_correction(dm_type='vasp')
|
||||
|
||||
if mpi.is_master_node():
|
||||
|
@ -95,7 +95,7 @@ In this part we will perform charge self-consistent DMFT calculations. To do so
|
||||
|
||||
which makes VASP wait after each step of its iterative diagonalization until the file vasp.lock is created. It then reads the update of the charge density in the file `GAMMA` or `vaspgamma.h5` if VASP is compiled with hdf5 support. We change the mixing here to stabilize the updating, which can be problem for charge ordered systems. Vasp is terminated by an external script after a desired amount of steps, such that we deactivate all automatic stoping criterion by setting the number of steps to a very high number.
|
||||
|
||||
We take the respective converged DFT and DMFT calculations from before as a starting point. I.e., we copy the `WAVECAR` and `nio.h5` together with the other :program:`VASP` input files (copy INCAR.CSC here) and :file:`plo.cfg` in a new directory. We use a script called :program:`vasp_dmft` to invoke :program:`VASP` in the background and start the DMFT calculation together with :program:`plovasp` and the converter. This script assumes that the dmft sript contains a function `dmft_cycle()` and also the conversion from text files to the h5 file. Additionally we have to add a few lines to calculate the density correction and calculate the correlation energy. We adapt the script straightforwardly (for a working example see :ref:`nio_csc.py`). The most important new lines are::
|
||||
We take the respective converged DFT and DMFT calculations from before as a starting point. I.e., we copy the `WAVECAR`, `CHGCAR`, and `vasp.h5` together with the other :program:`VASP` input files (copy INCAR.CSC here) and :file:`plo.cfg` in a new directory. We use a script called :program:`vasp_dmft` to invoke :program:`VASP` in the background and start the DMFT calculation together with :program:`plovasp` and the converter. This script assumes that the dmft sript contains a function `dmft_cycle()` and also the conversion from text files to the h5 file. Additionally we have to add a few lines to calculate the density correction and calculate the correlation energy. We adapt the script straightforwardly (for a working example see :ref:`nio_csc.py`). The most important new lines are::
|
||||
|
||||
SK.chemical_potential = SK.calc_mu( precision = 0.000001 )
|
||||
SK.calc_density_correction(dm_type='vasp')
|
||||
|
Loading…
x
Reference in New Issue
Block a user