Skip to content

Commit 15ca4af

Browse files
committed
[fix] fix ctseg afm calculations and update NiO tutorial
1 parent 598a679 commit 15ca4af

File tree

5 files changed

+91
-85
lines changed

5 files changed

+91
-85
lines changed

doc/tutorials/NNO_os_plo_mag/INCAR

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
System = NdNiO2
22

3-
EDIFF = 1e-10
3+
EDIFF = 1e-9
44
ENCUT = 450
55

66
NELMIN = 30
7+
KPAR = 8
8+
KSPACING = 0.2
79

810
ISMEAR = 0
911
SIGMA = 0.1
@@ -17,9 +19,6 @@ NBANDS = 64
1719
LMAXMIX = 6
1820
NEDOS = 3001
1921

20-
# switch off all symmetries
21-
ISYM = -1
22-
2322
# project to Ni d
2423
LORBIT = 14
2524
LOCPROJ = 3 4 : d : Pr

doc/tutorials/NNO_os_plo_mag/KPOINTS

Lines changed: 0 additions & 4 deletions
This file was deleted.

doc/tutorials/NNO_os_plo_mag/dmft_config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ n_iw = 2001
99
n_tau = 20001
1010

1111
prec_mu = 0.001
12+
mu_initial_guess = 0.0
1213

1314
h_int_type = "density_density"
1415
U = 8.0

doc/tutorials/NNO_os_plo_mag/tutorial.ipynb

Lines changed: 71 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
"metadata": {},
7777
"outputs": [],
7878
"source": [
79-
"path = './ref/'"
79+
"path = './ref/'\n",
80+
"path = './'"
8081
]
8182
},
8283
{
@@ -105,21 +106,21 @@
105106
"name": "stdout",
106107
"output_type": "stream",
107108
"text": [
108-
"DAV: 25 -0.569483098581E+02 -0.31832E-09 0.42131E-12 29952 0.148E-06 0.488E-07\n",
109-
"DAV: 26 -0.569483098574E+02 0.75124E-09 0.25243E-12 30528 0.511E-07 0.226E-07\n",
110-
"DAV: 27 -0.569483098574E+02 -0.12733E-10 0.17328E-12 28448 0.285E-07 0.826E-08\n",
111-
"DAV: 28 -0.569483098578E+02 -0.41837E-09 0.17366E-12 29536 0.151E-07 0.370E-08\n",
112-
"DAV: 29 -0.569483098576E+02 0.22192E-09 0.19300E-12 29280 0.689E-08 0.124E-08\n",
113-
"DAV: 30 -0.569483098572E+02 0.38563E-09 0.27026E-12 28576 0.388E-08 0.598E-09\n",
114-
"DAV: 31 -0.569483098573E+02 -0.92768E-10 0.34212E-12 29024 0.218E-08\n",
109+
"DAV: 24 -0.569587463051E+02 -0.54570E-10 0.21134E-12 4360 0.707E-06 0.125E-06\n",
110+
"DAV: 25 -0.569587463055E+02 -0.43838E-09 0.23830E-12 4264 0.303E-06 0.702E-07\n",
111+
"DAV: 26 -0.569587463051E+02 0.42382E-09 -0.62915E-13 4248 0.193E-06 0.327E-07\n",
112+
"DAV: 27 -0.569587463052E+02 -0.10004E-09 -0.67480E-12 4192 0.937E-07 0.244E-07\n",
113+
"DAV: 28 -0.569587463048E+02 0.38017E-09 -0.24882E-12 4176 0.634E-07 0.142E-07\n",
114+
"DAV: 29 -0.569587463054E+02 -0.59299E-09 -0.45830E-12 4152 0.346E-07 0.754E-08\n",
115+
"DAV: 30 -0.569587463052E+02 0.26557E-09 -0.13063E-12 4144 0.229E-07\n",
115116
" LOCPROJ mode\n",
116117
" Computing AMN (projections onto localized orbitals)\n",
117-
" 1 F= -.56948310E+02 E0= -.56941742E+02 d E =-.131358E-01\n"
118+
" 1 F= -.56958746E+02 E0= -.56954491E+02 d E =-.851151E-02\n"
118119
]
119120
}
120121
],
121122
"source": [
122-
"!tail -n 10 ref/out.vasp"
123+
"!tail -n 10 {path}/out.vasp"
123124
]
124125
},
125126
{
@@ -252,44 +253,44 @@
252253
"name": "stdout",
253254
"output_type": "stream",
254255
"text": [
256+
"[WARNING]: Reading from vaspout.h5\n",
255257
"Read parameters: LOCPROJ\n",
256-
"0 -> {'label': 'dxy', 'isite': 3, 'l': 2, 'm': 0}\n",
257-
"1 -> {'label': 'dyz', 'isite': 3, 'l': 2, 'm': 1}\n",
258-
"2 -> {'label': 'dz2', 'isite': 3, 'l': 2, 'm': 2}\n",
259-
"3 -> {'label': 'dxz', 'isite': 3, 'l': 2, 'm': 3}\n",
260-
"4 -> {'label': 'dx2-y2', 'isite': 3, 'l': 2, 'm': 4}\n",
261-
"5 -> {'label': 'dxy', 'isite': 4, 'l': 2, 'm': 0}\n",
262-
"6 -> {'label': 'dyz', 'isite': 4, 'l': 2, 'm': 1}\n",
263-
"7 -> {'label': 'dz2', 'isite': 4, 'l': 2, 'm': 2}\n",
264-
"8 -> {'label': 'dxz', 'isite': 4, 'l': 2, 'm': 3}\n",
265-
"9 -> {'label': 'dx2-y2', 'isite': 4, 'l': 2, 'm': 4}\n",
266-
" Found POSCAR, title line: NdNiO2 SC\n",
258+
"0 -> {'label': 'dxy ', 'isite': np.int32(3), 'coord': array([0., 0., 0.]), 'l': 2, 'm': 0}\n",
259+
"1 -> {'label': 'dyz ', 'isite': np.int32(3), 'coord': array([0., 0., 0.]), 'l': 2, 'm': 1}\n",
260+
"2 -> {'label': 'dz2 ', 'isite': np.int32(3), 'coord': array([0., 0., 0.]), 'l': 2, 'm': 2}\n",
261+
"3 -> {'label': 'dxz ', 'isite': np.int32(3), 'coord': array([0., 0., 0.]), 'l': 2, 'm': 3}\n",
262+
"4 -> {'label': 'dx2-y2 ', 'isite': np.int32(3), 'coord': array([0., 0., 0.]), 'l': 2, 'm': 4}\n",
263+
"5 -> {'label': 'dxy ', 'isite': np.int32(4), 'coord': array([-0.5, -0.5, 0. ]), 'l': 2, 'm': 0}\n",
264+
"6 -> {'label': 'dyz ', 'isite': np.int32(4), 'coord': array([-0.5, -0.5, 0. ]), 'l': 2, 'm': 1}\n",
265+
"7 -> {'label': 'dz2 ', 'isite': np.int32(4), 'coord': array([-0.5, -0.5, 0. ]), 'l': 2, 'm': 2}\n",
266+
"8 -> {'label': 'dxz ', 'isite': np.int32(4), 'coord': array([-0.5, -0.5, 0. ]), 'l': 2, 'm': 3}\n",
267+
"9 -> {'label': 'dx2-y2 ', 'isite': np.int32(4), 'coord': array([-0.5, -0.5, 0. ]), 'l': 2, 'm': 4}\n",
267268
" Total number of ions: 8\n",
268269
" Number of types: 3\n",
269-
" Number of ions for each type: [2, 2, 4]\n",
270+
" Number of ions for each type: [2 2 4]\n",
271+
" No tetrahedron data found in vaspout.h5. Skipping...\n",
270272
"\n",
271-
" Total number of k-points: 405\n",
272-
" No tetrahedron data found in IBZKPT. Skipping...\n",
273-
"[WARNING]: Error reading from EIGENVAL, trying LOCPROJ...\n",
274-
"[WARNING]: Error reading Efermi from DOSCAR, trying LOCPROJ...\n",
275-
"eigvals from LOCPROJ\n",
273+
" Reduced number of k-points: 60\n",
274+
" Total number of k-points: 360\n",
275+
" Total number of tetrahedra: 0\n",
276+
"eigvals from EIGENVAL\n",
276277
"\n",
277278
" Unorthonormalized density matrices and overlaps:\n",
278279
" Spin: 1\n",
279280
" Site: 3\n",
280281
" Density matrix Overlap\n",
281-
" 1.1544881 0.0000000 -0.0000000 0.0000000 -0.0000000 0.9626619 -0.0000000 0.0000000 0.0000002 -0.0000000\n",
282-
" 0.0000000 1.7591058 -0.0000000 0.0000000 -0.0000000 -0.0000000 0.9464342 -0.0000000 0.0000000 -0.0000000\n",
283-
" -0.0000000 -0.0000000 1.5114185 0.0000000 -0.0000000 0.0000000 -0.0000000 0.9548582 -0.0000000 0.0000000\n",
284-
" 0.0000000 0.0000000 0.0000000 1.7591058 -0.0000000 0.0000002 0.0000000 -0.0000000 0.9464339 0.0000000\n",
285-
" -0.0000000 -0.0000000 -0.0000000 -0.0000000 1.8114830 -0.0000000 -0.0000000 0.0000000 0.0000000 0.9495307\n",
282+
" 1.1578111 -0.0000000 0.0000000 0.0000000 0.0000000 0.9627229 0.0000001 -0.0000000 0.0000001 0.0000085\n",
283+
" -0.0000000 1.7593494 0.0000000 -0.0000000 0.0000000 0.0000001 0.9466016 -0.0000000 0.0000000 -0.0000001\n",
284+
" 0.0000000 0.0000000 1.5097318 0.0000000 0.0000000 -0.0000000 -0.0000000 0.9549019 0.0000000 -0.0000000\n",
285+
" 0.0000000 -0.0000000 0.0000000 1.7593494 -0.0000000 0.0000001 0.0000000 0.0000000 0.9466016 -0.0000001\n",
286+
" 0.0000000 0.0000000 0.0000000 -0.0000000 1.8109743 0.0000085 -0.0000001 -0.0000000 -0.0000001 0.9500846\n",
286287
" Site: 4\n",
287288
" Density matrix Overlap\n",
288-
" 1.1544881 -0.0000000 0.0000000 0.0000000 0.0000000 0.9626621 0.0000000 -0.0000000 -0.0000001 -0.0000000\n",
289-
" -0.0000000 1.7591058 -0.0000000 -0.0000000 0.0000000 0.0000000 0.9464343 -0.0000000 -0.0000000 0.0000000\n",
290-
" 0.0000000 -0.0000000 1.5114185 -0.0000000 -0.0000000 -0.0000000 -0.0000000 0.9548582 0.0000000 0.0000000\n",
291-
" 0.0000000 -0.0000000 -0.0000000 1.7591058 0.0000000 -0.0000001 -0.0000000 0.0000000 0.9464344 0.0000000\n",
292-
" 0.0000000 0.0000000 -0.0000000 0.0000000 1.8114830 -0.0000000 0.0000000 0.0000000 0.0000000 0.9495307\n",
289+
" 1.1578111 0.0000000 0.0000000 -0.0000000 -0.0000000 0.9627274 0.0000008 0.0000000 -0.0000009 0.0000100\n",
290+
" 0.0000000 1.7593494 -0.0000000 0.0000000 -0.0000000 0.0000008 0.9465839 0.0000000 -0.0000000 -0.0000001\n",
291+
" 0.0000000 -0.0000000 1.5097318 -0.0000000 -0.0000000 0.0000000 0.0000000 0.9549004 -0.0000001 0.0000000\n",
292+
" -0.0000000 0.0000000 -0.0000000 1.7593494 -0.0000000 -0.0000009 -0.0000000 -0.0000001 0.9465839 -0.0000001\n",
293+
" -0.0000000 -0.0000000 -0.0000000 -0.0000000 1.8109743 0.0000100 -0.0000001 0.0000000 -0.0000001 0.9500777\n",
293294
"\n",
294295
" Generating 1 shell...\n",
295296
"\n",
@@ -303,51 +304,52 @@
303304
" Shell 1\n",
304305
"Site diag : True\n",
305306
" Site 1\n",
306-
" 1.9468082 -0.0000000 -0.0000000 0.0000000 -0.0000000\n",
307-
" -0.0000000 1.8880488 -0.0000000 0.0000000 0.0000000\n",
308-
" -0.0000000 -0.0000000 1.5912192 0.0000000 0.0000000\n",
309-
" 0.0000000 0.0000000 0.0000000 1.8880488 0.0000000\n",
310-
" -0.0000000 0.0000000 0.0000000 0.0000000 1.1979419\n",
311-
" trace: 8.512066911392091\n",
307+
" 1.9463589 0.0000000 0.0000000 0.0000000 0.0000000\n",
308+
" 0.0000000 1.8905965 0.0000000 0.0000000 0.0000000\n",
309+
" 0.0000000 0.0000000 1.5897822 0.0000000 0.0000000\n",
310+
" 0.0000000 0.0000000 0.0000000 1.8905965 -0.0000000\n",
311+
" 0.0000000 0.0000000 0.0000000 -0.0000000 1.2014611\n",
312+
" trace: 8.51879524059904\n",
312313
" Site 2\n",
313-
" 1.9468082 0.0000000 -0.0000000 -0.0000000 -0.0000000\n",
314-
" 0.0000000 1.8880488 -0.0000000 -0.0000000 -0.0000000\n",
315-
" -0.0000000 -0.0000000 1.5912192 -0.0000000 -0.0000000\n",
316-
" -0.0000000 -0.0000000 -0.0000000 1.8880488 -0.0000000\n",
317-
" -0.0000000 -0.0000000 -0.0000000 -0.0000000 1.1979419\n",
318-
" trace: 8.512066911289741\n",
314+
" 1.9463589 0.0000000 -0.0000000 -0.0000000 0.0000000\n",
315+
" 0.0000000 1.8905965 -0.0000000 -0.0000000 -0.0000000\n",
316+
" -0.0000000 -0.0000000 1.5897822 -0.0000000 -0.0000000\n",
317+
" -0.0000000 -0.0000000 -0.0000000 1.8905965 0.0000000\n",
318+
" 0.0000000 -0.0000000 -0.0000000 0.0000000 1.2014611\n",
319+
" trace: 8.518795240606394\n",
319320
"\n",
320-
" Impurity density: 17.024133822681833\n",
321+
" Impurity density: 17.037590481205434\n",
321322
"\n",
322323
"Overlap:\n",
323324
" Site 1\n",
324-
"[[ 1. -0. -0. -0. -0.]\n",
325-
" [-0. 1. -0. -0. -0.]\n",
326-
" [-0. -0. 1. -0. -0.]\n",
327-
" [-0. -0. -0. 1. 0.]\n",
328-
" [-0. -0. -0. 0. 1.]]\n",
325+
"[[ 1. 0. 0. 0. 0.]\n",
326+
" [ 0. 1. 0. -0. -0.]\n",
327+
" [ 0. 0. 1. 0. 0.]\n",
328+
" [ 0. -0. 0. 1. 0.]\n",
329+
" [ 0. -0. 0. 0. 1.]]\n",
329330
"\n",
330331
"Local Hamiltonian:\n",
331332
" Shell 1\n",
332333
" Site 1 (real | complex part)\n",
333-
" -1.5179223 0.0000000 0.0000000 -0.0000000 0.0000000 | -0.0000000 -0.0000000 -0.0000000 -0.0000000 -0.0000000\n",
334-
" 0.0000000 -1.2888643 0.0000000 -0.0000000 -0.0000000 | 0.0000000 0.0000000 -0.0000000 -0.0000000 -0.0000000\n",
335-
" 0.0000000 0.0000000 -0.9927644 -0.0000000 -0.0000000 | 0.0000000 0.0000000 -0.0000000 0.0000000 0.0000000\n",
336-
" -0.0000000 -0.0000000 -0.0000000 -1.2888643 0.0000000 | 0.0000000 0.0000000 -0.0000000 0.0000000 0.0000000\n",
337-
" 0.0000000 -0.0000000 -0.0000000 0.0000000 -1.0828254 | 0.0000000 0.0000000 -0.0000000 -0.0000000 0.0000000\n",
334+
" -1.4991738 -0.0000000 -0.0000000 -0.0000000 -0.0000000 | 0.0000000 0.0000000 0.0000000 -0.0000000 -0.0000000\n",
335+
" -0.0000000 -1.2867472 -0.0000000 -0.0000000 -0.0000000 | -0.0000000 0.0000000 0.0000000 -0.0000000 -0.0000000\n",
336+
" -0.0000000 -0.0000000 -0.9820274 -0.0000000 -0.0000000 | -0.0000000 -0.0000000 -0.0000000 0.0000000 -0.0000000\n",
337+
" -0.0000000 -0.0000000 -0.0000000 -1.2867472 0.0000000 | 0.0000000 0.0000000 -0.0000000 0.0000000 0.0000000\n",
338+
" -0.0000000 -0.0000000 -0.0000000 0.0000000 -1.0610135 | 0.0000000 0.0000000 0.0000000 -0.0000000 -0.0000000\n",
338339
" Site 2 (real | complex part)\n",
339-
" -1.5179223 -0.0000000 -0.0000000 -0.0000000 -0.0000000 | 0.0000000 0.0000000 -0.0000000 -0.0000000 -0.0000000\n",
340-
" -0.0000000 -1.2888643 0.0000000 -0.0000000 0.0000000 | -0.0000000 -0.0000000 0.0000000 0.0000000 -0.0000000\n",
341-
" -0.0000000 0.0000000 -0.9927644 0.0000000 0.0000000 | 0.0000000 -0.0000000 0.0000000 -0.0000000 -0.0000000\n",
342-
" -0.0000000 -0.0000000 0.0000000 -1.2888643 0.0000000 | 0.0000000 -0.0000000 0.0000000 -0.0000000 0.0000000\n",
343-
" -0.0000000 0.0000000 0.0000000 0.0000000 -1.0828254 | 0.0000000 0.0000000 0.0000000 -0.0000000 0.0000000\n",
340+
" -1.4991738 -0.0000000 0.0000000 0.0000000 -0.0000000 | -0.0000000 0.0000000 -0.0000000 0.0000000 -0.0000000\n",
341+
" -0.0000000 -1.2867472 0.0000000 0.0000000 0.0000000 | -0.0000000 0.0000000 -0.0000000 0.0000000 0.0000000\n",
342+
" 0.0000000 0.0000000 -0.9820274 0.0000000 0.0000000 | 0.0000000 0.0000000 0.0000000 -0.0000000 -0.0000000\n",
343+
" 0.0000000 0.0000000 0.0000000 -1.2867472 -0.0000000 | -0.0000000 -0.0000000 0.0000000 0.0000000 -0.0000000\n",
344+
" -0.0000000 0.0000000 0.0000000 -0.0000000 -1.0610135 | 0.0000000 -0.0000000 0.0000000 0.0000000 -0.0000000\n",
344345
" Storing ctrl-file...\n",
345346
" Storing PLO-group file 'nno.pg1'...\n",
346-
" Density within window: 42.00000000005771\n",
347+
" Density within window: 42.00000000005755\n",
347348
"Reading input from nno.ctrl...\n",
348349
"{\n",
349350
" \"ngroups\": 1,\n",
350-
" \"nk\": 405,\n",
351+
" \"nk\": 360,\n",
352+
" \"nkibz\": 60,\n",
351353
" \"ns\": 1,\n",
352354
" \"kvec1\": [\n",
353355
" 0.1803844533789928,\n",
@@ -484,12 +486,12 @@
484486
},
485487
{
486488
"cell_type": "code",
487-
"execution_count": 8,
489+
"execution_count": 9,
488490
"id": "f42d62cc-f8b4-4fc7-af76-cdf7ba13e8ea",
489491
"metadata": {},
490492
"outputs": [],
491493
"source": [
492-
"with HDFArchive(path+'/nno.h5','r') as ar:\n",
494+
"with HDFArchive(path+'NNO_lowT/nno.h5','r') as ar:\n",
493495
" Sigma_iw = ar['DMFT_results/last_iter/Sigma_freq_0']\n",
494496
" obs = ar['DMFT_results/observables']\n",
495497
" conv_obs = ar['DMFT_results/convergence_obs']"

python/solid_dmft/dmft_tools/afm_mapping.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,27 @@ def apply(general_params, icrsh, gf_struct_solver, solvers):
8686
mpi.report('\ncopying the self-energy for shell {} from shell {}'.format(icrsh, imp_source))
8787
mpi.report('inverting spin channels: '+str(invert_spin))
8888

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':
9290
solvers[icrsh].Sigma_moments = solvers[imp_source].Sigma_moments
9391
solvers[icrsh].Sigma_Hartree = solvers[imp_source].Sigma_Hartree
94-
solvers[icrsh].G_moments = solvers[imp_source].G_moments
9592
# copy orbital occupations dict with deep copy of arrays
9693
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
97101

98102
# and the same for the perturbation order if measured
99103
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
102110

103111
if invert_spin:
104112
for spin_channel in gf_struct_solver.keys():
@@ -113,11 +121,11 @@ def apply(general_params, icrsh, gf_struct_solver, solvers):
113121
solvers[icrsh].G0_freq[spin_channel] << solvers[imp_source].G0_freq[target_channel]
114122
solvers[icrsh].G_time[spin_channel] << solvers[imp_source].G_time[target_channel]
115123

116-
if solvers[icrsh].solver_params.get('measure_pert_order'):
124+
if solvers[icrsh].solver_params.get('measure_pert_order') and solvers[icrsh].solver_params.get('type') == 'cthyb':
117125
solvers[icrsh].perturbation_order[spin_channel] = solvers[imp_source].perturbation_order[target_channel]
118126

119127
# 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'):
128+
if solvers[icrsh].solver_params.get('measure_density_matrix') or solvers[icrsh].solver_params.get('type') == 'ctseg':
121129
solvers[icrsh].orbital_occupations[spin_channel] = solvers[imp_source].orbital_occupations[target_channel]
122130

123131
else:

0 commit comments

Comments
 (0)