[QE-users] Probable bug in additional_kpoints.f90 subroutine

2022-02-14 Thread Prasenjit Ghosh
Dear Lorenzo and others,

I think there is a bug in the above subroutine when either nqx1, nqx2 and
nqx3, or all of them are greater than 1. The example does not work with the
original version of the code because a lot of k-points with coordinates
(0,0,0 are generated as shown below:

k(1) = (  -0.250   0.250   0.250), wk =   0.500
k(2) = (   0.250  -0.250   0.750), wk =   1.500
k(3) = (   0.000   0.000   0.000), wk =   0.000
k(4) = (   0.000   0.000   0.000), wk =   0.000
k(5) = (   0.000   0.000   0.000), wk =   0.000
k(6) = (   0.000   0.000   0.000), wk =   0.000
k(7) = (   0.000   0.000   0.000), wk =   0.000
k(8) = (   0.000   0.000   0.000), wk =   0.000
k(9) = (   0.500   0.500   0.500), wk =   0.000

In the above list, k-points #3 to #7 are all (0, 0,0). Because of this,
when running the bands.x code, it complains and stops.

I was working with QE-6.8. The same problem I think persists also in 7.0.

In line 89 of the subroutine, the value of the counter 'iq' seems to be
wrongly initialized. With this the array elements are wrongly assigned in
xk(:,ik). The correct one should be:

iq=nkstot_old

Further the array elements of 'wk', corresponding to the additional
k-points also need to be set to zero. This can be done right after line 98
by adding the following line:
wk(iq)=0.0d0

The modified subroutine is attached.

With regards,
Prasenjit


With regards,
Prasenjit
-- 
PRASENJIT GHOSH,
IISER Pune,
Dr. Homi Bhabha Road, Pashan
Pune, Maharashtra 411008, India

Phone: +91 (20) 2590 8203
Fax: +91 (20) 2589 9790
!
! Copyright (C) 2020-2014 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
! Written by Lorenzo Paulatto , July 2020
!
MODULE additional_kpoints
  USE kinds, ONLY : DP
  USE parameters,   ONLY : npk
  IMPLICIT NONE
  REAL(DP),ALLOCATABLE :: xk_add(:,:) !, wk_add(:)
  CHARACTER(len=80) :: k_points_add = 'bogus'
  INTEGER :: nkstot_add=0


  CONTAINS
  !
  SUBROUTINE bcast_additional_kpoints
USE mp, ONLY : mp_bcast
USE io_global,  ONLY : ionode_id
USE mp_images,  ONLY: intra_image_comm
!
IMPLICIT NONE
CALL mp_bcast(nkstot_add, ionode_id, intra_image_comm)
IF(nkstot_add==0) RETURN
CALL mp_bcast(xk_add, ionode_id, intra_image_comm)

  END SUBROUTINE
  !
  SUBROUTINE add_additional_kpoints(nkstot, xk, wk)
 USE input_parameters, ONLY : nqx1, nqx2, nqx3
 USE cell_base,ONLY : bg
 USE io_global,ONLY : stdout
 IMPLICIT NONE
 INTEGER,INTENT(inout)  :: nkstot
 REAL(DP),INTENT(inout) :: xk(3,npk), wk(npk)
 !
 REAL(DP),ALLOCATABLE :: xk_old(:,:), wk_old(:)
 INTEGER :: nkstot_old
 INTEGER :: nk1_old, nk2_old, nk3_old
 INTEGER :: k1_old,  k2_old,  k3_old
 INTEGER :: nqtot, i,j,k, iq, jq
 REAL(DP) :: xq(3), rq(3)
 LOGICAL, EXTERNAL  :: matches
 !
! IF(.not.allocated(xk) .or. .not.allocated(wk))&
!   CALL errore("add_kpoints", "K-points not ready yet",1)
 CALL bcast_additional_kpoints()
 IF(nkstot_add==0) RETURN

 IF(matches("crystal",k_points_add))THEN
 CALL cryst_to_cart(nkstot_add,xk_add,bg,+1)
 ENDIF
 !
 ! Back-up existing points
 nkstot_old = nkstot
 ALLOCATE(xk_old(3,nkstot_old))
 ALLOCATE(wk_old(nkstot_old))
 xk_old = xk(1:3, 1:nkstot)
 wk_old = wk(1:nkstot)
! DEALLOCATE(xk,wk)
 nkstot = 0
 !
 ! Simple case: EXX not used or used with self-exchange only: 
 IF( nqx1<=1 .and. nqx2<=1 .and. nqx3<=1 ) THEN
   nkstot = nkstot_old + nkstot_add
   IF(nkstot>npk) CALL errore("add_kpoint", "Number of k-points exceeded: increase npk in pwcom", 1)
   xk(:,1:nkstot_old) = xk_old
   xk(:,nkstot_old+1:nkstot_old+nkstot_add) = xk_add
   wk(1:nkstot_old) = wk_old
   wk(nkstot_old+1:nkstot_old+nkstot_add) = 0._dp
   nqtot=1
 ELSE
 ! Difficult case: EXX with a finite grid of q-points. Ideally, we would want to use
 ! The grid from module EXX, but it may not have been initialized at this points.
 ! Furthermore, the q-point grid is obtained by opening the k-points one, so this would
 ! be a dog wagging its own tails
   nqtot = nqx1*nqx2*nqx3
   nkstot = nkstot_old + nkstot_add *nqtot
   IF(nkstot>npk) CALL errore("add_kpoint", "Number of k-points exceeded: increase npk in pwcom", 1)
   xk(:,1:nkstot_old) = xk_old
   wk(1:nkstot_old) = wk_old
   
   rq = (/nqx1,nqx2,nqx3/)
   write(stdout,*) rq(1), rq(2), rq(3)
   rq = 1._dp / rq
   write(stdout,*) rq(1), rq(2), rq(3)
!   iq = nqtot
   iq = nkstot_old
   

Re: [QE-users] wrong total_weight error

2022-02-14 Thread Mohamed Ahmed Abd-Elati
Dear Professor Lorenzo
Attached are all of the inputs (scf.in, ph.in, q2r.in, and matdyan.in) that
provide all of the specifics about the MoSiN structure.
Best regards
*Mohammed A. Abdelati*
*Assistant Lecturer*
Laser Applications in Metrology Photochemistry and Agriculture (LAMPA)
Department, National Institute of Laser Enhanced Sciences (NILES), Cairo
University, Giza, Egypt.
Mobile   +20 1009752922
Home+201152605076
E-mailma198...@yahoo.com


On Sun, Feb 13, 2022 at 11:48 AM Mohamed Ahmed Abd-Elati 
wrote:

> Dear all
> I want to calculate the phonon dispersion for MoSiN structure.
> The steps  scf, ph, and q2r have completed successfully.
> During matdyan step I faced the following error
> ...
> Error in routine frc_blk (1):
>  wrong total_weight
> **
> I've included all of the inputs here.* .*
> *Best regards*
>
> *Mohammed A. Abdelati*
> *Assistant Lecturer*
> Laser Applications in Metrology Photochemistry and Agriculture (LAMPA)
> Department, National Institute of Laser Enhanced Sciences (NILES), Cairo
> University, Giza, Egypt.
> Mobile   +20 1009752922
> Home+201152605076
> E-mailma198...@yahoo.com
>


matdyn.in
Description: Binary data


ph.in
Description: Binary data


q2r.in
Description: Binary data


scf.in
Description: Binary data
___
Quantum ESPRESSO is supported by MaX (www.max-centre.eu)
users mailing list users@lists.quantum-espresso.org
https://lists.quantum-espresso.org/mailman/listinfo/users

Re: [QE-users] convergence NOT achieved using DFT+U

2022-02-14 Thread Paolo Giannozzi
On Mon, Feb 14, 2022 at 10:53 AM Iurii TIMROV via users <
users@lists.quantum-espresso.org> wrote:

> conv_thr=  1e-5
>
> This is too large. You should use 1e-10 -- 1e-15
>
It depends upon which quantities one wants to calculate. 1e-5 is definitely
too large except for quick and dirty tests, but I think 1e-8 is typically
sufficient for total energies and structural properties

Paolo
-- 
Paolo Giannozzi, Dip. Scienze Matematiche Informatiche e Fisiche,
Univ. Udine, via delle Scienze 206, 33100 Udine, Italy
Phone +39-0432-558216, fax +39-0432-558222
___
Quantum ESPRESSO is supported by MaX (www.max-centre.eu)
users mailing list users@lists.quantum-espresso.org
https://lists.quantum-espresso.org/mailman/listinfo/users

Re: [QE-users] convergence NOT achieved using DFT+U

2022-02-14 Thread Iurii TIMROV via users
Dear William,


Do not forget to indicate your affiliation when posting on this forum.


> Hubbard_U(1) = 3.4 (this value I took from a paper: Aykol, M., Kim, S., & 
> Wolverton, C. (2015).


This is not correct. They used VASP which uses different Hubbard projectors, 
while you are using QE with "atomic" Hubbard projectors. Check this paper: 
https://aip.scitation.org/doi/10.1063/1.4945608


I recommend to compute U using the HP code of QE. Also use 'ortho-atomic' 
instead of 'atomic' projectors, because the former are more accurate: 
http://theossrv1.epfl.ch/Main/DFTHubbard


> conv_thr=  1e-5


This is too large. You should use 1e-10 -- 1e-15


> diagonalization =  'cg'


Better use "davidson"


How did you obtain your structure? Did you visualize it and check that all is 
correct? In the past I also modeled CoO2 and it converged fine (my input looks 
different from yours). Check available crystal structure databases and search 
for CoO2 there.


HTH


Iurii


--
Dr. Iurii TIMROV
Senior Research Scientist
Theory and Simulation of Materials (THEOS)
Swiss Federal Institute of Technology Lausanne (EPFL)
CH-1015 Lausanne, Switzerland
+41 21 69 34 881
http://people.epfl.ch/265334

From: users  on behalf of Antonio 
Pancho Ramirez 
Sent: Monday, February 14, 2022 10:27:42 AM
To: users@lists.quantum-espresso.org
Subject: [QE-users] convergence NOT achieved using DFT+U

Dear Members,

I have been working with LiCoO2 and CoO2, performing DFT calculation to 
determine  the intercalation potential. However,  when it comes to CoO2 after 
adding  the Hubbard correction (DFT+U) convergences cannot  be reached. I have 
just added two lines to the original input file: lda_plus_u = .true. and 
Hubbard_U(1) = 3.4 (this value I took from a paper: Aykol, M., Kim, S., & 
Wolverton, C. (2015). Van der Waals interactions in layered lithium cobalt 
oxides. The Journal of Physical Chemistry C, 119(33), 19053-19058.). I have 
performed all the calculations using QE v.6.7MaX.

Kindly have a look at the input file and suggest why its so hard to converge 
this relatively simple system after adding the U correction

&CONTROL
  calculation = 'scf'
  outdir='tmp',
  prefix = 'CoO_U'
  pseudo_dir = '.',
  tprnfor = .true.
  verbosity = 'high'
/
&SYSTEM
  ecutrho = 800
  ecutwfc = 70
  ibrav = 0
  nat = 3
  ntyp = 2
  occupations='smearing', smearing='gauss', degauss=0.015,
  nspin=2
  starting_magnetization(1) = 0.1
  lda_plus_u = .true.,
  Hubbard_U(1) = 3.4
  vdw_corr='grimme-d3'

/
&ELECTRONS
/
ATOMIC_SPECIES
Co  58.933194 co_pbe_v1.2.uspp.F.UPF
O   15.999o_pbe_v1.2.uspp.F.UPF
CELL_PARAMETERS angstrom
  2.8413505554   0.00   0.00
  1.4206751885   2.4606823642   0.00
  1.4206754552   0.8202267469   4.7143528794
ATOMIC_POSITIONS crystal
Co   0.00   0.00   0.00
O0.7396634820   0.7396634820   0.7810095550
O0.2603365180   0.2603365180   0.2189904750
K_POINTS automatic
6 6 6 0 0 0

I had already tried to change the conv_thr, diagonalization, etc.  as it is 
show below

  conv_thr=  1e-5
   diagonalization =  'cg'
   mixing_beta =  0.3
   mixing_mode =  'local-TF'

But noting seems to work. I believe that the problem could be related to the 
magnetization (hing and low spin state). Maybe to force the system to low spin 
state but I not sure how to do that or if the problem is connected with that. 
Additionally, I use gbrv pseudopotential for these calculation.


Best regards

William Pancho

___
Quantum ESPRESSO is supported by MaX (www.max-centre.eu)
users mailing list users@lists.quantum-espresso.org
https://lists.quantum-espresso.org/mailman/listinfo/users

Re: [QE-users] wrong total_weight error

2022-02-14 Thread Lorenzo Paulatto
Hello Mohamed,
probably some problem with atoms being close to but not exactly at high 
symmetry positions. Its hard to say anything as you do not provide any detail.

kind regards
--
Lorenzo Paulatto - Paris
On Feb 13 2022, at 10:48 am, Mohamed Ahmed Abd-Elati  wrote:
> Dear all
> I want to calculate the phonon dispersion for MoSiN structure.
> The steps scf, ph, and q2r have completed successfully.
> During matdyan step I faced the following error
> ...
> Error in routine frc_blk (1):
> wrong total_weight
>
> 
> I've included all of the inputs here. .
> Best regards
>
> Mohammed A. Abdelati
> Assistant Lecturer
>
> Laser Applications in Metrology Photochemistry and Agriculture (LAMPA) 
> Department, National Institute of Laser Enhanced Sciences (NILES), Cairo 
> University, Giza, Egypt.
> Mobile +20 1009752922
>
> Home +201152605076
>
> E-mail ma198...@yahoo.com (mailto:ma198...@yahoo.com)
>
>
>
>
>
>
>
> ___
> Quantum ESPRESSO is supported by MaX (www.max-centre.eu)
> users mailing list users@lists.quantum-espresso.org
> https://lists.quantum-espresso.org/mailman/listinfo/users

___
Quantum ESPRESSO is supported by MaX (www.max-centre.eu)
users mailing list users@lists.quantum-espresso.org
https://lists.quantum-espresso.org/mailman/listinfo/users

[QE-users] convergence NOT achieved using DFT+U

2022-02-14 Thread Antonio Pancho Ramirez
Dear Members,

I have been working with LiCoO2 and CoO2, performing DFT calculation to 
determine  the intercalation potential. However,  when it comes to CoO2 after 
adding  the Hubbard correction (DFT+U) convergences cannot  be reached. I have 
just added two lines to the original input file: lda_plus_u = .true. and 
Hubbard_U(1) = 3.4 (this value I took from a paper: Aykol, M., Kim, S., & 
Wolverton, C. (2015). Van der Waals interactions in layered lithium cobalt 
oxides. The Journal of Physical Chemistry C, 119(33), 19053-19058.). I have 
performed all the calculations using QE v.6.7MaX.

Kindly have a look at the input file and suggest why its so hard to converge 
this relatively simple system after adding the U correction

&CONTROL
  calculation = 'scf'
  outdir='tmp',
  prefix = 'CoO_U'
  pseudo_dir = '.',
  tprnfor = .true.
  verbosity = 'high'
/
&SYSTEM
  ecutrho = 800
  ecutwfc = 70
  ibrav = 0
  nat = 3
  ntyp = 2
  occupations='smearing', smearing='gauss', degauss=0.015,
  nspin=2
  starting_magnetization(1) = 0.1
  lda_plus_u = .true.,
  Hubbard_U(1) = 3.4
  vdw_corr='grimme-d3'

/
&ELECTRONS
/
ATOMIC_SPECIES
Co  58.933194 co_pbe_v1.2.uspp.F.UPF
O   15.999o_pbe_v1.2.uspp.F.UPF
CELL_PARAMETERS angstrom
  2.8413505554   0.00   0.00
  1.4206751885   2.4606823642   0.00
  1.4206754552   0.8202267469   4.7143528794
ATOMIC_POSITIONS crystal
Co   0.00   0.00   0.00
O0.7396634820   0.7396634820   0.7810095550
O0.2603365180   0.2603365180   0.2189904750
K_POINTS automatic
6 6 6 0 0 0

I had already tried to change the conv_thr, diagonalization, etc.  as it is 
show below

  conv_thr=  1e-5
   diagonalization =  'cg'
   mixing_beta =  0.3
   mixing_mode =  'local-TF'

But noting seems to work. I believe that the problem could be related to the 
magnetization (hing and low spin state). Maybe to force the system to low spin 
state but I not sure how to do that or if the problem is connected with that. 
Additionally, I use gbrv pseudopotential for these calculation.


Best regards

William Pancho

___
Quantum ESPRESSO is supported by MaX (www.max-centre.eu)
users mailing list users@lists.quantum-espresso.org
https://lists.quantum-espresso.org/mailman/listinfo/users