Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Commit

Permalink
update to last py2 comp version for triqs2
Browse files Browse the repository at this point in the history
- added pytest test suite
- adding new DC options
- new read_config system
- various fixes
  • Loading branch information
the-hampel committed Sep 15, 2020
1 parent ffd436e commit 2300a65
Show file tree
Hide file tree
Showing 16 changed files with 2,011 additions and 805 deletions.
48 changes: 43 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# soliDMFT
# soliDMFT
This program allows to perform DFT+DMFT ''one-shot'' and CSC
calculations from h5 archives or VASP input files for multiband systems using
the TRIQS package, in combination with the CThyb solver and SumkDFT from
Expand Down Expand Up @@ -202,6 +202,7 @@ For a 80 atom unit cell 2 nodes are useful, but for a 20 atom unit cell not at a

## LOCPROJ bug for individual projections:

Example use of LOCPROJ for t2g manifold of SrVO3 (the order of the orbitals seems to be mixed up... this example leads to x^2 -y^2, z^2, yz... )
In the current version there is some mix up in the mapping between selected orbitals in the INCAR and actual selected in the LOCPROJ. This is
what the software does (left side is INCAR, right side is resulting in the LOCPROJ)

Expand All @@ -212,13 +213,13 @@ what the software does (left side is INCAR, right side is resulting in the LOCPR
* z2 -> xy

```
LOCPROJ = 2 : dxz : Pr
LOCPROJ = 2 : dx2-y2 : Pr
LOCPROJ = 2 : dz2 : Pr
LOCPROJ = 2 : dxz : Pr 1
LOCPROJ = 2 : dx2-y2 : Pr 1
LOCPROJ = 2 : dz2 : Pr 1
```
However, if the complete d manifold is chosen, the usual VASP order (xy, yz, z2, xz, x2-y2) is obtained in the LOCPROJ. This is done as shown below
```
LOCPROJ = 2 : d : Pr
LOCPROJ = 2 : d : Pr 1
```

## convergence of projectors with Vasp
Expand All @@ -240,6 +241,43 @@ DAV: 31 -0.394760088659E+02 0.39472E-09 0.35516E-13 132366 0.110E-10
The total energy is lower as well. But more importantly the second calculation produces well converged projectors preserving symmetries way better, with less off-diagonal elements in Gloc, making it way easier for the solver. Always pay attention to rms.


## orbital order in the W90 converter

Some interaction Hamiltonians are sensitive to the order of orbitals (i.e. density-density or Slater Hamiltonian), others are invariant under rotations in orbital space (i.e. the Kanamori Hamiltonian).
For the former class and W90-based DMFT calculations, we need to be careful because the order of W90 (z^2, xz, yz, x^2-y^2, xy) is different from the order expected by TRIQS (xy, yz, z^2, xz, x^2-y^2).
Therefore, we need to specify the order of orbitals in the projections block (example for Pbnm or P21/n cell, full d shell):
```
begin projections
# site 0
f=0.5,0.0,0.0:dxy
f=0.5,0.0,0.0:dyz
f=0.5,0.0,0.0:dz2
f=0.5,0.0,0.0:dxz
f=0.5,0.0,0.0:dx2-y2
# site 1
f=0.5,0.0,0.5:dxy
f=0.5,0.0,0.5:dyz
f=0.5,0.0,0.5:dz2
f=0.5,0.0,0.5:dxz
f=0.5,0.0,0.5:dx2-y2
# site 2
f=0.0,0.5,0.0:dxy
f=0.0,0.5,0.0:dyz
f=0.0,0.5,0.0:dz2
f=0.0,0.5,0.0:dxz
f=0.0,0.5,0.0:dx2-y2
# site 3
f=0.0,0.5,0.5:dxy
f=0.0,0.5,0.5:dyz
f=0.0,0.5,0.5:dz2
f=0.0,0.5,0.5:dxz
f=0.0,0.5,0.5:dx2-y2
end projections
```
Warning: simply using `Fe:dxy,dyz,dz2,dxz,dx2-y2` does not work, VASP/W90 brings the d orbitals back to W90 standard order.

The 45-degree rotation for the sqrt2 x sqrt2 x 2 cell can be ignored because the interaction Hamiltonian is invariant under swapping x^2-y^2 and xy.


## remarks on the Vasp version

Expand Down
762 changes: 466 additions & 296 deletions dmft_cycle.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/lno-csc/dmft_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plo_cfg = plo.cfg
n_iter_dmft_first = 5
n_iter_dmft_per = 1
n_iter_dmft = 10
n_iter_dft = 7

block_threshold= 0.0001
enforce_off_diag = True
Expand All @@ -23,7 +22,7 @@ dc = True
dc_dmft = True
calc_energies = True

[solver_parameters]
[solver]
length_cycle = 200
n_warmup_cycles = 10000
n_cycles_tot = 10e+6
Expand All @@ -34,6 +33,7 @@ measure_g_tau =True
measure_density_matrix = True

[dft]
n_iter = 1
n_iter = 6
n_cores = 12
executable = vasp_std
mpi_env = local
12 changes: 6 additions & 6 deletions examples/svo-csc/dmft_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ seedname = vasp
csc = True
plo_cfg = plo.cfg

n_iter_dmft_first = 5
n_iter_dmft_first = 2
n_iter_dmft_per = 1
n_iter_dmft = 10

Expand All @@ -23,7 +23,7 @@ dc = True
dc_dmft = True
calc_energies = True

[solver_parameters]
[solver]
length_cycle = 120
n_warmup_cycles = 10000
n_cycles_tot = 10e+6
Expand All @@ -34,7 +34,7 @@ measure_g_tau =True
measure_density_matrix = True

[dft]
n_cores = 36
n_iter_dft = 6
#dft_executable = vasp_std
#mpi_env = local
n_cores = 12
n_iter = 6
executable = vasp_std
mpi_env = local
10 changes: 5 additions & 5 deletions examples/svo-one-shot/dmft_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ J = 0.65

beta = 40

n_iter_dmft = 10
n_iter_dmft = 2

dc_type = 1
dc = True
Expand All @@ -26,7 +26,7 @@ load_sigma = False
path_to_sigma = pre/vasp.h5
load_sigma_iter = 1

[solver_parameters]
[solver]
length_cycle = 120
n_warmup_cycles = 8000
n_cycles_tot = 10e+6
Expand All @@ -37,6 +37,6 @@ measure_g_tau =True
measure_density_matrix = True

perform_tail_fit = False
#fit_max_moment = 4
#fit_min_n = 20
#fit_max_n = 100
fit_max_moment = 4
fit_min_n = 20
fit_max_n = 100
6 changes: 3 additions & 3 deletions observables.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _generate_header(general_parameters, sum_k):
header_basic_mask = '{{:>3}} | {{:>10}} | {{:>{0}}} | {{:>{0}}} | {{:>17}}'.format(number_spaces)

# If magnetic calculation is done create two obs files per imp
if general_parameters['magnetic']:
if not general_parameters['csc'] and general_parameters['magnetic']:
for spin in ('up', 'down'):
file_name = 'observables_imp{}_{}.dat'.format(iineq, spin)
headers[file_name] = header_basic_mask.format('it', 'mu', 'G(beta/2) per orbital',
Expand Down Expand Up @@ -213,7 +213,7 @@ def add_dft_values_as_zeroth_iteration(observables, general_parameters, dft_mu,

# for it 0 we just subtract E_DC from E_DFT
if general_parameters['calc_energies']:
observables['E_tot'].append(E_dft - np.sum(dc_per_imp[0] for dc_per_imp in observables['E_DC']))
observables['E_tot'].append(E_dft - sum([dc_per_imp[0] for dc_per_imp in observables['E_DC']]))
else:
observables['E_tot'].append('none')

Expand Down Expand Up @@ -389,7 +389,7 @@ def write_obs(observables, sum_k, general_parameters):
for iineq in range(sum_k.n_inequiv_shells)]

for icrsh in range(sum_k.n_inequiv_shells):
if general_parameters['magnetic']:
if not general_parameters['csc'] and general_parameters['magnetic']:
for spin in ('up', 'down'):
line = '{:3d} | '.format(observables['iteration'][-1])
line += '{:10.5f} | '.format(observables['mu'][-1])
Expand Down
Loading

0 comments on commit 2300a65

Please sign in to comment.