[QE-developers] TR: Bugs in cp.x from QE 7.2 affecting stresses calculated with US pseudos and CG
Paolo Giannozzi
paolo.giannozzi at uniud.it
Sat Oct 12 10:53:36 CEST 2024
Thank you for reporting.
i) nkb and nhsa are actually the same variable. Not sure what "nrcx" is,
but in any case, the called routine is in a module so one can just write
real(dp) :: dbec(:,:,:,:)
and stop worrying about the correctness of the
ii) almost no code is executed for CG calculations (tcg=.true.) in
from_scra.f90; for tcg=.false., the needed call is present, it seems to
me. What did you change exactly?
iii) Is stress working after your changes? can you provide a simple example?
Paolo
On 04/10/2024 09:41, RABONE Jeremy wrote:
>
> ------------------------------------------------------------------------
> *De :* RABONE Jeremy
> *Envoyé :* jeudi 3 octobre 2024 13:04
> *À :* users at lists.quantum-espresso.org
> *Objet :* Bugs in cp.x from QE 7.2 affecting stresses calculated with US
> pseudos and CG
>
> Hello,
>
> I have been getting some weird stress values in MD calculations using
> cp.x from QE 7.2 with ultrasoft pseudopotentials and after some
> rummaging I have found a couple of bugs:
>
> i) The dbec array gets inadvertantly altered through the call to
> cg_sub.f90 where is is assigned a different size "real(dp) :: dbec(nkb,
> nbspx, 3, 3)" than initially allocated in mainvar.f90
> "ALLOCATE( dbec( nhsa, 2*nrcx, 3, 3 ), STAT=ierr )". The upshot of this
> is that the values of dbec get jumbled and the resulting stress tensor
> is messed up (and physically nonsensical). Also, since dbec is not
> zeroed and the initially allocated size does not seem to correspond to
> the used size, this also has the effect of introducing random values
> into the stress tensor, although zeroing dbec after the allocation in
> mainvar.f90 fixes this.
>
> ii) In fromscra.f90 the constraints contribution to the stress is
> calculated "if ( tstress ) CALL nlfh( stress, bec_bgrp, dbec, lambda,
> idesc )" before the dbec array has been calculated "if ( tstress ) CALL
> caldbec_bgrp( eigr, cm_bgrp, dbec, idesc )".
>
>
> Kind regards,
>
> Jeremy
>
>
> ________________________________________________
> The Quantum ESPRESSO community stands by the Ukrainian people
> and expresses its concerns about the devastating effects that
> the Russian military offensive has on their country and on the
> free and peaceful scientific, cultural, and economic cooperation
> amongst peoples.
> _______________________________________________
> developers mailing list
> developers at lists.quantum-espresso.org
> https://lists.quantum-espresso.org/mailman/listinfo/developers
--
Paolo Giannozzi, Dip. Scienze Matematiche Informatiche e Fisiche,
Univ. Udine, via delle Scienze 206, 33100 Udine Italy, +39-0432-558216
More information about the developers
mailing list