Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phys gw from bare h #156

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for Yambo 5.3.0 r.23898 h.e44de9bd09.
# Generated by GNU Autoconf 2.71 for Yambo 5.3.0 r.23899 h.f567993115.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -610,8 +610,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Yambo'
PACKAGE_TARNAME='yambo'
PACKAGE_VERSION='5.3.0 r.23898 h.e44de9bd09'
PACKAGE_STRING='Yambo 5.3.0 r.23898 h.e44de9bd09'
PACKAGE_VERSION='5.3.0 r.23899 h.f567993115'
PACKAGE_STRING='Yambo 5.3.0 r.23899 h.f567993115'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -1659,7 +1659,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Yambo 5.3.0 r.23898 h.e44de9bd09 to adapt to many kinds of systems.
\`configure' configures Yambo 5.3.0 r.23899 h.f567993115 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1725,7 +1725,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Yambo 5.3.0 r.23898 h.e44de9bd09:";;
short | recursive ) echo "Configuration of Yambo 5.3.0 r.23899 h.f567993115:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1967,7 +1967,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Yambo configure 5.3.0 r.23898 h.e44de9bd09
Yambo configure 5.3.0 r.23899 h.f567993115
generated by GNU Autoconf 2.71

Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2596,7 +2596,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Yambo $as_me 5.3.0 r.23898 h.e44de9bd09, which was
It was created by Yambo $as_me 5.3.0 r.23899 h.f567993115, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -3354,8 +3354,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
SVERSION="5"
SSUBVERSION="3"
SPATCHLEVEL="0"
SREVISION="23898"
SHASH="e44de9bd09"
SREVISION="23899"
SHASH="f567993115"



Expand Down Expand Up @@ -17784,7 +17784,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Yambo $as_me 5.3.0 r.23898 h.e44de9bd09, which was
This file was extended by Yambo $as_me 5.3.0 r.23899 h.f567993115, which was
generated by GNU Autoconf 2.71. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -17848,7 +17848,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
Yambo config.status 5.3.0 r.23898 h.e44de9bd09
Yambo config.status 5.3.0 r.23899 h.f567993115
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"

Expand Down
30 changes: 0 additions & 30 deletions include/driver/version.h

This file was deleted.

6 changes: 3 additions & 3 deletions include/version/version.m4
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
AC_INIT(Yambo, 5.3.0 r.23898 h.e44de9bd09, [email protected])
AC_INIT(Yambo, 5.3.0 r.23899 h.f567993115, [email protected])
SVERSION="5"
SSUBVERSION="3"
SPATCHLEVEL="0"
SREVISION="23898"
SHASH="e44de9bd09"
SREVISION="23899"
SHASH="f567993115"
AC_SUBST(SVERSION)
AC_SUBST(SSUBVERSION)
AC_SUBST(SPATCHLEVEL)
Expand Down
4 changes: 2 additions & 2 deletions interfaces/int_modules/mod_com2y.F
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module mod_com2y
logical :: force_noSYMM
logical :: artificial_spin_pol
logical :: verboseIO
logical :: write_Vloc_Vnl
logical :: force_noPseudo
!
integer :: ng_vec_abinit, wf_nb_io_user
!
Expand Down Expand Up @@ -48,7 +48,7 @@ subroutine interface_presets(in_string)
force_noWFs =index(in_string,'nowf')>0
artificial_spin_pol =index(in_string,'dupl')>0
verboseIO =index(in_string,'verb')>0
write_Vloc_Vnl =index(in_string,'pseu')>0
force_noPseudo =index(in_string,'nops')>0
!
alat_mult_factor=1.
wf_nb_io_user=0
Expand Down
12 changes: 7 additions & 5 deletions interfaces/p2y/mod_p2y.F
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module P2Ym
use pars, ONLY : lchlen,SP,DP,rZERO
use electrons, ONLY : levels
use R_lattice, ONLY : bz_samp
use mod_com2y, ONLY : verboseIO,write_Vloc_Vnl
use mod_com2y, ONLY : verboseIO,force_noPseudo
use parallel_m, ONLY : myid
use parallel_int, ONLY : PP_bcast
use units, ONLY : Da2AU
Expand Down Expand Up @@ -851,8 +851,9 @@ subroutine get_xc
if (ierr/=0) call errore('qexml_read_xc','IOTK error',abs(ierr))
!
if (trim(pw_dft)=="B3LYP") call warning('For a full compatible B3LYP calculation consider to use input_dft=B3LYP-V1R')
if (pw_lda_plus_u.and..not.write_Vloc_Vnl) then
call error(' DFT+U. Rerun p2y with "-p" flag and use the BareHfromScratch flag for GW runs.')
if (pw_lda_plus_u) then
if (force_noPseudo) call error(' DFT+U. Rerun p2y without "-p" flag.')
call warning(' DFT+U. Use the BareHfromScratch flag in input for GW runs.')
endif
GS_xc_FUNCTIONAL = XC_yamboID('pwscf_',pw_func=pw_dft)
if (GS_xc_FUNCTIONAL.eq.XC_HYB_GGA_XC_GAUPBE*XC_FACTOR) then
Expand Down Expand Up @@ -892,8 +893,9 @@ subroutine get_xc
if (ierr/=0) call errore('qexsd_read_xc','fmt error',abs(ierr))
!
if (trim(pw_dft)=="B3LYP") call warning('For a full compatible B3LYP calculation consider to use input_dft=B3LYP-V1R')
if (pw_lda_plus_u.and..not.write_Vloc_Vnl) then
call error(' DFT+U. Rerun p2y with "-p" flag and use the BareHfromScratch flag for GW runs.')
if (pw_lda_plus_u) then
if (force_noPseudo) call error(' DFT+U. Rerun p2y without "-p" flag.')
call warning(' DFT+U. Use the BareHfromScratch flag in input for GW runs.')
endif
GS_xc_FUNCTIONAL = XC_yamboID('pwscf_',pw_func=pw_dft)
if (GS_xc_FUNCTIONAL.eq.XC_HYB_GGA_XC_GAUPBE*XC_FACTOR) then
Expand Down
39 changes: 18 additions & 21 deletions interfaces/p2y/p2y_pseudo.F
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ subroutine p2y_pseudo(k)
use wave_func, ONLY:wf_ng
use pseudo, ONLY:PP_alloc_PWscf,PP_free,pp_n_l_comp, &
& pp_n_l_times_proj_max,pp_n_l_max,pp_table,&
& PP_nlcc_alloc,PP_nlcc_free
& PP_nlcc_alloc,PP_nlcc_free,pp_is_uspp
use IO_int, ONLY:io_control
use IO_m, ONLY:OP_WR_CL,OP_APP_CL,REP
use read_pseudo_mod, ONLY:readpp
use mod_com2y, ONLY:write_Vloc_Vnl
use mod_com2y, ONLY:force_noPseudo
use pw_data, ONLY:ngm_,nsp_
use vlocal, ONLY:vloc_yambo
!
Expand All @@ -42,7 +42,7 @@ subroutine p2y_pseudo(k)
!
integer, external :: io_KB_pwscf
integer, external :: io_NLCC_pwscf
integer, external :: io_USPP_pwscf
integer, external :: io_VPRJ_pwscf
integer, external :: io_VLOC_pwscf
!
interface
Expand Down Expand Up @@ -79,7 +79,7 @@ end subroutine fill_basis_rho
l_Vnl=.true.
if( all(atoms%pseudo(:)%nbeta==0) ) l_Vnl=.false.
!
if(.not.l_Vnl.and..not.write_Vloc_Vnl) return
if((.not.l_Vnl).and.force_noPseudo) return
!
if(l_Vnl) then
!
Expand Down Expand Up @@ -139,34 +139,31 @@ end subroutine fill_basis_rho
call warning(' Pseudo-potentials contain only local part!! ')
endif
!
! write USPP data
! write pseudo-potential data
!
call qe_pseudo_init()
call readpp(input_dft)
!
pp_is_uspp=any(atoms%pseudo(:)%is_uspp)
#ifndef _USPP
if ( pp_is_uspp ) call error("[PPs] Ultrasoft PP not supported")
#endif
!
call pre_init()
call allocate_nlpot()
! [FP]
if ( any(atoms%pseudo(:)%is_uspp) .or. write_Vloc_Vnl ) then
!
if ( .not. force_noPseudo ) then
!
#ifndef _USPP
if (.not. write_Vloc_Vnl) call error("[PPs] Ultrasoft PP not supported")
#endif
! [FP]
call init_us_1()
!
if (write_Vloc_Vnl) then
!
allocate(vloc_yambo(ngm_,nsp_))
call set_vloc_yambo()
!
call io_control(ACTION=OP_WR_CL,COM=REP,SEC=(/1/),ID=ID_vloc)
io_err = io_VLOC_pwscf(ID_vloc)
!
endif
allocate(vloc_yambo(ngm_,nsp_))
call set_vloc_yambo()
!
call io_control(ACTION=OP_WR_CL,COM=REP,SEC=(/1/),ID=ID_vloc)
io_err = io_VLOC_pwscf(ID_vloc)
!
call io_control(ACTION=OP_WR_CL,COM=REP,SEC=(/1/),ID=ID)
io_err=io_USPP_pwscf(ID)
io_err=io_VPRJ_pwscf(ID)
!
!call PP_uspp_free()
!
Expand Down
5 changes: 3 additions & 2 deletions src/dipoles/DIPOLE_setup.F
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ subroutine DIPOLE_setup(Dip)
!
! If we have additional nonlocal contributions such as Hubbard U,
! we need to switch to the covariant approach to capture them
! 2024/04/10 DS: check should be changed, checking for lda+U, and not for l_Hbare
if (l_Hbare.and..not.STRING_same(Dip%approach,"Covariant")) then
if(exp_user) then
call warning(' Dipoles approach should be Covariant for BareH calculations')
call warning(' Covariant dipoles should be used since the Hamiltonian contains U non local projectors')
else
call warning(' Dipoles approach forced to Covariant for BareH calculations')
call warning(' Covariant forced, since Hamiltonian contains U non local projectors')
Dip%approach="Covariant"
endif
endif
Expand Down
6 changes: 3 additions & 3 deletions src/driver/options_interfaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ void options_interfaces(struct options_struct options[],int *i_opt)
options[*i_opt].yambo_string="dupl";
options[*i_opt].section="Interface";
*i_opt=*i_opt+1;
options[*i_opt].short_desc="Write V_loc and V_nl";
options[*i_opt].long_opt="pseudofull";
options[*i_opt].short_desc="Force no pseudopotential";
options[*i_opt].long_opt="nopseudo";
options[*i_opt].short_opt='p';
options[*i_opt].bin="p2y";
options[*i_opt].yambo_string="pseu";
options[*i_opt].yambo_string="nops";
options[*i_opt].section="Interface";
};
55 changes: 34 additions & 21 deletions src/hamiltonian/Bare_Hamiltonian_as_E_ks_minus_Vxc.F
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
!
! Copyright (C) 2009 The Yambo Team
!
! Authors (see AUTHORS file for details): DV DS
! Authors (see AUTHORS file for details): DV DS FP
!
subroutine Bare_Hamiltonian_as_E_ks_minus_Vxc(E,Xk,k)
!
use pars, ONLY:cZERO
use pars, ONLY:cZERO,schlen,lchlen
use electrons, ONLY:levels,n_sp_pol,spin,n_spin
use QP_m, ONLY:QP_nk,QP_Vxc,QP_n_states
use hamiltonian, ONLY:Hzero,E_reference,V_hartree_sc,rho_n,magn_n,V_xc_sc,&
& H_ref_bands,WF_G_max,WF_Go_indx
use parallel_m, ONLY:PAR_IND_WF_k,PAR_IND_WF_linear
use parallel_int, ONLY:PP_redux_wait
use wave_func, ONLY:WF
use com, ONLY:msg,of_open_close
use R_lattice, ONLY:bz_samp,nkibz
use xc_functionals, ONLY:V_xc
use interfaces, ONLY:el_density_and_current,el_magnetization,WF_load
Expand All @@ -38,16 +39,30 @@ subroutine Bare_Hamiltonian_as_E_ks_minus_Vxc(E,Xk,k)
!
! Work space
!
integer :: ik,ib,i_sp_pol,WFbands(2)
integer :: ik,ib,i_sp_pol,WFbands(2),ib1,ib2
logical :: l_write_Hsc
character(schlen) :: Hsc_file,headings(6),msg_format
character(lchlen) :: msg_to_dump
!
Hzero=cZERO
!
call timing('Bare_Hamiltonian_as_E_ks_minus_Vxc',OPR='start')
!
! [DEBUG>]
open(1, file='REF_Hbare_real.dat')
open(2, file='REF_Hbare_imag.dat')
! [<DEBUG]
l_write_Hsc=.false.
call parser('WriteHsc',l_write_Hsc) ! write Hamiltonian on file only for testing purpose
!
if(l_write_Hsc) then
Hsc_file='H_sc'
call of_open_close(Hsc_file,'ot')
call msg('o '//Hsc_file,'#')
call msg('o '//Hsc_file,'# H-Bare Hamiltonian from Eks - Vxc ')
call msg('o '//Hsc_file,'#')
headings=(/'is_pol','kpt ','bnd1 ','bnd2 ','Re[H] ','Img[H]'/)
call msg('o '//Hsc_file,'#',headings,INDENT=0,USE_TABS=.TRUE.)
call msg('o '//Hsc_file,'#')
msg_format='(t006,i7,t025,i7,t044,i7,t063,i7,t082,f16.10,t101,f16.10)'
endif
!
#if defined _SC
!
if (l_sc_magnetic) then
Expand Down Expand Up @@ -141,16 +156,16 @@ subroutine Bare_Hamiltonian_as_E_ks_minus_Vxc(E,Xk,k)
!
call V_qp_basis_to_H(ik,i_sp_pol,-QP_Vxc,Hzero(:,:,ik,i_sp_pol))
!
! [DEBUG>]
write (*,*) "H_bare (ik,i_sp_pol) ",ik,i_sp_pol
write(1,*) "#Re H_bare (ik,i_sp_pol) ",ik,i_sp_pol
write(2,*) "#Im H_bare (ik,i_sp_pol) ",ik,i_sp_pol
do ib=H_ref_bands(1),H_ref_bands(2)
write(*,*) Hzero(ib,:,ik,i_sp_pol)
write(1,*) real (Hzero(ib,:,ik,i_sp_pol))
write(2,*) aimag(Hzero(ib,:,ik,i_sp_pol))
enddo
! [<DEBUG]
if(l_write_Hsc) then
do ib1=H_ref_bands(1),H_ref_bands(2)
do ib2=H_ref_bands(1),H_ref_bands(2)
write(msg_to_dump,msg_format) i_sp_pol,ik,ib1,ib2,&
& real(Hzero(ib1,ib2,ik,i_sp_pol)),aimag(Hzero(ib1,ib2,ik,i_sp_pol))
call msg('o '//Hsc_file,msg_to_dump)
enddo
enddo
endif
!
enddo
!
enddo
Expand All @@ -166,15 +181,13 @@ subroutine Bare_Hamiltonian_as_E_ks_minus_Vxc(E,Xk,k)
endif
!
#endif
!
if(l_write_Hsc) call of_open_close(Hsc_file)
!
YAMBO_FREE(QP_Vxc)
!
call PP_redux_wait(Hzero)
!
close(2)
close(1)
write (*,*) "End of Bare Hamiltonian as E_ks-V_xc "
!
call timing('Bare_Hamiltonian_as_E_ks_minus_Vxc',OPR='stop')
!
end subroutine Bare_Hamiltonian_as_E_ks_minus_Vxc
Loading