From a1b5421864a53ce17aea81cdd2ca803db1e269b0 Mon Sep 17 00:00:00 2001 From: Alexander Hampel Date: Mon, 16 Aug 2021 12:51:55 -0400 Subject: [PATCH] fix for python binary, c order for arrays, and NiO tutorial --- bin/plovasp.in | 2 +- bin/vasp_dmft.in | 2 +- doc/tutorials/images_scripts/NiO_local_lattice_GF.py | 2 +- doc/tutorials/images_scripts/converter.py | 2 +- doc/tutorials/images_scripts/nio.py | 11 ++++++----- doc/tutorials/images_scripts/nio_csc.py | 7 ++++--- doc/tutorials/images_scripts/plo.cfg | 2 ++ .../triqs_dft_tools/converters/plovasp/proj_shell.py | 2 +- 8 files changed, 17 insertions(+), 13 deletions(-) diff --git a/bin/plovasp.in b/bin/plovasp.in index f9468454..851a4f3d 100755 --- a/bin/plovasp.in +++ b/bin/plovasp.in @@ -1,4 +1,4 @@ #!/bin/bash -python -m triqs_dft_tools.converters.plovasp.converter $@ +@TRIQS_PYTHON_EXECUTABLE@ -m triqs_dft_tools.converters.plovasp.converter $@ diff --git a/bin/vasp_dmft.in b/bin/vasp_dmft.in index d94bee03..bf1d79b6 100755 --- a/bin/vasp_dmft.in +++ b/bin/vasp_dmft.in @@ -122,5 +122,5 @@ rm -f vasp.lock stdbuf -o 0 $MPIRUN_CMD -np $NPROC "$VASP_DIR" & -$MPIRUN_CMD -np $NPROC python -m triqs_dft_tools.converters.plovasp.sc_dmft $(jobs -p) $NITER $NDFTITER $DMFT_SCRIPT 'plo.cfg' $VASP_VERSION || kill %1 +$MPIRUN_CMD -np $NPROC @TRIQS_PYTHON_EXECUTABLE@ -m triqs_dft_tools.converters.plovasp.sc_dmft $(jobs -p) $NITER $NDFTITER $DMFT_SCRIPT 'plo.cfg' $VASP_VERSION || kill %1 diff --git a/doc/tutorials/images_scripts/NiO_local_lattice_GF.py b/doc/tutorials/images_scripts/NiO_local_lattice_GF.py index b48c9b98..e8683ce3 100644 --- a/doc/tutorials/images_scripts/NiO_local_lattice_GF.py +++ b/doc/tutorials/images_scripts/NiO_local_lattice_GF.py @@ -37,7 +37,7 @@ if mpi.is_master_node(): ar = HDFArchive(filename+'.h5','a') if not 'DMFT_results' in ar: ar.create_group('DMFT_results') if not 'Iterations' in ar['DMFT_results']: ar['DMFT_results'].create_group('Iterations') - if 'iteration_count' in ar['DMFT_results']: + if 'iteration_count' in ar['DMFT_results']: iteration_offset = ar['DMFT_results']['iteration_count']+1 print(('offset',iteration_offset)) Sigma_iw = ar['DMFT_results']['Iterations']['Sigma_it'+str(iteration_offset-1)] diff --git a/doc/tutorials/images_scripts/converter.py b/doc/tutorials/images_scripts/converter.py index bef29d99..9fc145d2 100644 --- a/doc/tutorials/images_scripts/converter.py +++ b/doc/tutorials/images_scripts/converter.py @@ -1,3 +1,3 @@ from triqs_dft_tools.converters.vasp import * -Converter = VaspConverter(filename = 'nio') +Converter = VaspConverter(filename = 'nio', proj_or_hk = 'hk') Converter.convert_dft_input() diff --git a/doc/tutorials/images_scripts/nio.py b/doc/tutorials/images_scripts/nio.py index 996ed15e..d93d399b 100644 --- a/doc/tutorials/images_scripts/nio.py +++ b/doc/tutorials/images_scripts/nio.py @@ -6,6 +6,7 @@ from triqs.gf import * import sys, triqs.version as triqs_version from triqs_dft_tools.sumk_dft import * from triqs_dft_tools.sumk_dft_tools import * +from triqs_dft_tools.block_structure import gf_struct_flatten from triqs.operators.util.hamiltonians import * from triqs.operators.util.U_matrix import * from triqs_cthyb import * @@ -40,7 +41,7 @@ spin_names = ['up','down'] orb_names = [i for i in range(0,n_orb)] #gf_struct = set_operator_structure(spin_names, orb_names, orb_hyb) -gf_struct = SK.gf_struct_solver[0] +gf_struct = gf_struct_flatten(SK.gf_struct_solver[0]) mpi.report('Sumk to Solver: %s'%SK.sumk_to_solver) mpi.report('GF struct sumk: %s'%SK.gf_struct_sumk) mpi.report('GF struct solver: %s'%SK.gf_struct_solver) @@ -70,7 +71,7 @@ p["max_time"] = -1 p["random_name"] = "" p["random_seed"] = 123 * mpi.rank + 567 p["length_cycle"] = 100 -p["n_warmup_cycles"] = 20000 +p["n_warmup_cycles"] = 8000 p["n_cycles"] = 200000 p["fit_max_moment"] = 4 p["fit_min_n"] = 30 @@ -96,10 +97,10 @@ ns') ar['DMFT_input']['code_versions']["triqs_version"] = triqs_version.version ar['DMFT_input']['code_versions']["triqs_git"] = triqs_version.git_hash ar['DMFT_input']['code_versions']["cthyb_version"] = cthyb_version.version - ar['DMFT_input']['code_versions']["cthyb_git"] = cthyb_version.cthyb_hash + ar['DMFT_input']['code_versions']["cthyb_git"] = cthyb_version.triqs_cthyb_hash ar['DMFT_input']['code_versions']["dft_tools_version"] = dft_tools_version.version - ar['DMFT_input']['code_versions']["dft_tools_version"] = dft_tools_version.dft_tools_hash - if 'iteration_count' in ar['DMFT_results']: + ar['DMFT_input']['code_versions']["dft_tools_version"] = dft_tools_version.triqs_dft_tools_hash + if 'iteration_count' in ar['DMFT_results']: iteration_offset = ar['DMFT_results']['iteration_count']+1 S.Sigma_iw = ar['DMFT_results']['Iterations']['Sigma_it'+str(iteration_offset-1)] SK.dc_imp = ar['DMFT_results']['Iterations']['dc_imp'+str(iteration_offset-1)] diff --git a/doc/tutorials/images_scripts/nio_csc.py b/doc/tutorials/images_scripts/nio_csc.py index 6f54c012..329d5a89 100644 --- a/doc/tutorials/images_scripts/nio_csc.py +++ b/doc/tutorials/images_scripts/nio_csc.py @@ -6,6 +6,7 @@ from triqs.gf import * import sys, triqs.version as triqs_version from triqs_dft_tools.sumk_dft import * from triqs_dft_tools.sumk_dft_tools import * +from triqs_dft_tools.block_structure import gf_struct_flatten from triqs.operators.util.hamiltonians import * from triqs.operators.util.U_matrix import * from triqs_cthyb import * @@ -103,10 +104,10 @@ def dmft_cycle(): ar['DMFT_input']['code_versions']["triqs_version"] = triqs_version.version ar['DMFT_input']['code_versions']["triqs_git"] = triqs_version.git_hash ar['DMFT_input']['code_versions']["cthyb_version"] = cthyb_version.version - ar['DMFT_input']['code_versions']["cthyb_git"] = cthyb_version.cthyb_hash + ar['DMFT_input']['code_versions']["cthyb_git"] = cthyb_version.triqs_cthyb_hash ar['DMFT_input']['code_versions']["dft_tools_version"] = dft_tools_version.version - ar['DMFT_input']['code_versions']["dft_tools_git"] = dft_tools_version.dft_tools_hash - if 'iteration_count' in ar['DMFT_results']: + ar['DMFT_input']['code_versions']["dft_tools_git"] = dft_tools_version.triqs_dft_tools_hash + if 'iteration_count' in ar['DMFT_results']: iteration_offset = ar['DMFT_results']['iteration_count']+1 S.Sigma_iw = ar['DMFT_results']['Iterations']['Sigma_it'+str(iteration_offset-1)] SK.dc_imp = ar['DMFT_results']['Iterations']['dc_imp'+str(iteration_offset-1)] diff --git a/doc/tutorials/images_scripts/plo.cfg b/doc/tutorials/images_scripts/plo.cfg index c370bf17..e527ee9d 100644 --- a/doc/tutorials/images_scripts/plo.cfg +++ b/doc/tutorials/images_scripts/plo.cfg @@ -1,6 +1,8 @@ [General] BASENAME = nio DOSMESH = -21 55 400 +HK = True +COMPLEMENT = True [Group 1] SHELLS = 1 2 diff --git a/python/triqs_dft_tools/converters/plovasp/proj_shell.py b/python/triqs_dft_tools/converters/plovasp/proj_shell.py index 628357b0..f334f264 100644 --- a/python/triqs_dft_tools/converters/plovasp/proj_shell.py +++ b/python/triqs_dft_tools/converters/plovasp/proj_shell.py @@ -420,7 +420,7 @@ class ProjectorShell: w_k[ik, ib, isp, io, :] = proj_k * proj_k.conj() # eigv_ef = el_struct.eigvals[ik, ib, isp] - el_struct.efermi - itt = el_struct.kmesh['itet'].T + itt = el_struct.kmesh['itet'].T.copy() # k-indices are starting from 0 in Python itt[1:, :] -= 1 for isp in range(ns):