[Pw_forum] How to figure out machine accuracy

2009-09-04 Thread Lorenzo Paulatto
In data 04 settembre 2009 alle ore 15:54:38, Manoj Srivastava  
 ha scritto:
>  The input is CMACH, I can specify various input variables for 'CMACH' to
> get output, but what variable is returned as output, as there is only one
> in this subroutine?  Would you mind having a look at this- its in
> espresso4.0.4/flib/dlamch.f


Dear Manoj,
QE does not use simple LAPACK routines for most of its algebra.  
Hamiltonian diagonalization is computed using a custom implementation of  
the iterative Davidson (or conjugate-gradient) algorithm that only uses  
LAPACK to diagonalize a reduced hamiltonian during each iteration.

Said that, you can control the accuracy to which eigenvalues are computed  
cannot be controlled directly by the user (without modifying the code) and  
is decreased automatically as the self-consistency approaches convergence.

The formula used is the following:
  ethr = MIN( ethr, 0.1D0*dr2 / MAX( 1.D0, nelec ) )
where dr2 is the estimated scf accuracy.
As you can see you can increase the accuracy (at convergence) of  
eigenvalues and eigenvectors by increasing the convergence threshold.


In a more general frame, I think you could disclose some more information  
on your "symmetry problem"; personally I doubt it is caused by  
insufficient diagonalization accuracy.

best regards

-- 
Lorenzo Paulatto
SISSA  &  DEMOCRITOS (Trieste)
phone: +39 040 3787 511
skype: paulatz
www:   http://people.sissa.it/~paulatto/

 *** save italian brains ***
  http://saveitalianbrains.wordpress.com/


[Pw_forum] How to figure out machine accuracy

2009-09-04 Thread Manoj Srivastava
Dear Lorenzo, 
 Thank you for your reply. I figured out my problem. You are right, it is
not coming from lapack routine. 

Regards, 
Manoj

On Fri, 4 Sep 2009, Lorenzo Paulatto wrote:

> In data 04 settembre 2009 alle ore 15:54:38, Manoj Srivastava  
>  ha scritto:
> >  The input is CMACH, I can specify various input variables for 'CMACH' to
> > get output, but what variable is returned as output, as there is only one
> > in this subroutine?  Would you mind having a look at this- its in
> > espresso4.0.4/flib/dlamch.f
> 
> 
> Dear Manoj,
> QE does not use simple LAPACK routines for most of its algebra.  
> Hamiltonian diagonalization is computed using a custom implementation of  
> the iterative Davidson (or conjugate-gradient) algorithm that only uses  
> LAPACK to diagonalize a reduced hamiltonian during each iteration.
> 
> Said that, you can control the accuracy to which eigenvalues are computed  
> cannot be controlled directly by the user (without modifying the code) and  
> is decreased automatically as the self-consistency approaches convergence.
> 
> The formula used is the following:
>   ethr = MIN( ethr, 0.1D0*dr2 / MAX( 1.D0, nelec ) )
> where dr2 is the estimated scf accuracy.
> As you can see you can increase the accuracy (at convergence) of  
> eigenvalues and eigenvectors by increasing the convergence threshold.
> 
> 
> In a more general frame, I think you could disclose some more information  
> on your "symmetry problem"; personally I doubt it is caused by  
> insufficient diagonalization accuracy.
> 
> best regards
> 
> -- 
> Lorenzo Paulatto
> SISSA  &  DEMOCRITOS (Trieste)
> phone: +39 040 3787 511
> skype: paulatz
> www:   http://people.sissa.it/~paulatto/
> 
>  *** save italian brains ***
>   http://saveitalianbrains.wordpress.com/
> ___
> Pw_forum mailing list
> Pw_forum at pwscf.org
> http://www.democritos.it/mailman/listinfo/pw_forum
> 



[Pw_forum] How to figure out machine accuracy

2009-09-04 Thread Manoj Srivastava
Dear PWSCF users and developers, 
 I am wondering how can one find machine accuracy? I am having
some symmetry problem, and for that I want to solve eigen value
problem with the best accuracy. In the lapack library it says-
ABSTOL  (input) DOUBLE PRECISION
*  The absolute error tolerance for the eigenvalues.
*  An approximate eigenvalue is accepted as converged
*  when it is determined to lie in an interval [a,b]
*  of width less than or equal to
*
*  ABSTOL + EPS *   max( |a|,|b| ) ,
*
*  where EPS is the machine precision.  If ABSTOL is less than
*  or equal to zero, then  EPS*|T|  will be used in its place,
*  where |T| is the 1-norm of the tridiagonal matrix obtained
*  by reducing A to tridiagonal form.
*
*  Eigenvalues will be computed most accurately when ABSTOL is
*  set to twice the underflow threshold 2*DLAMCH('S'), not zero.
*  If this routine returns with INFO>0, indicating that some
*  eigenvectors did not converge, try setting ABSTOL to
*  2*DLAMCH('S').

the last paragraph is useful. so i looked up DLAMCH-
  DOUBLE PRECISION FUNCTION DLAMCH( CMACH ) 
 The input is CMACH, I can specify various input variables for 'CMACH' to
get output, but what variable is returned as output, as there is only one
in this subroutine?  Would you mind having a look at this- its in
espresso4.0.4/flib/dlamch.f

espresso4.0.4 can be replaced by whatever version you are using. 

Regards, 
Manoj Srivastava
University of Florida
Gainesville, USA