[CP2K:2237] Re: handling periodic images

Teodoro Laino teodor... at gmail.com
Fri Aug 21 20:55:35 UTC 2009


Dear Noam,

there are a couple of things wrong in your input file:
-) unit of CUTOFF are in Hartree (not eV)
-) you need to converge to more than just 1.0E-6 if you want to do 
finite difference with a dx of 1.0E-3

most important is that you have the keyword: CENTER_COORDINATE in every 
input file. This keyword will translate
every geometry to the center of the box. Since PW codes are not 
translational invariant you'll get different forces when you will 
compare the analytical Vs numerical.
Try to switch off the center_coordinate.

I did a DEBUG run, converging to 1.0E-8, 300 H cutoff and removing the 
CENTER_COORDINATE and this is what you get: (first 3 analytical, 3 
numerical, 3 difference ana-num):

ATOM NUMBER ::    1   -0.001875   -0.001576    0.008445   -0.001875   
-0.001575    0.008444    0.000000   -0.000000    0.000000
ATOM NUMBER ::    2    0.004533    0.004784    0.004103    0.004532    
0.004784    0.004102    0.000000    0.000000    0.000000
ATOM NUMBER ::    3   -0.000407    0.002860   -0.001054   -0.000407    
0.002861   -0.001054   -0.000000   -0.000000   -0.000000
ATOM NUMBER ::    4   -0.000081   -0.001564    0.001164   -0.000081   
-0.001564    0.001164   -0.000000   -0.000000    0.000000
ATOM NUMBER ::    5   -0.000233    0.001984   -0.001050   -0.000233    
0.001984   -0.001050   -0.000000    0.000000   -0.000000
ATOM NUMBER ::    6   -0.001734    0.001678   -0.002356   -0.001735    
0.001678   -0.002356    0.000000   -0.000000    0.000000
ATOM NUMBER ::    7   -0.001244   -0.001982   -0.000129   -0.001244   
-0.001982   -0.000129    0.000000   -0.000000    0.000000
ATOM NUMBER ::    8   -0.000890   -0.000294    0.001898   -0.000890   
-0.000294    0.001898   -0.000000    0.000000   -0.000000
ATOM NUMBER ::    9   -0.002796   -0.005983   -0.005432   -0.002796   
-0.005983   -0.005432    0.000000   -0.000000    0.000000
ATOM NUMBER ::   10    0.003654    0.001429    0.000924    0.003654    
0.001429    0.000924    0.000000    0.000000    0.000000
ATOM NUMBER ::   11   -0.000644   -0.008654   -0.008820   -0.000644   
-0.008655   -0.008820   -0.000000    0.000000   -0.000000
ATOM NUMBER ::   12    0.000465   -0.006575   -0.007172    0.000465   
-0.006575   -0.007172    0.000000   -0.000000    0.000000
ATOM NUMBER ::   13   -0.000019    0.006820    0.001652   -0.000020    
0.006820    0.001652    0.000000    0.000000   -0.000000
ATOM NUMBER ::   14   -0.001151    0.002445    0.007460   -0.001152    
0.002445    0.007460    0.000000   -0.000000   -0.000000
ATOM NUMBER ::   15    0.002792    0.002779    0.003535    0.002792    
0.002779    0.003535   -0.000000    0.000000   -0.000000
ATOM NUMBER ::   16   -0.000534    0.000104    0.001004   -0.000534    
0.000104    0.001004    0.000000   -0.000000    0.000000
ATOM NUMBER ::   17    0.000184   -0.000833   -0.001206    0.000184   
-0.000833   -0.001206   -0.000000    0.000000   -0.000000
ATOM NUMBER ::   18   -0.000286    0.001436    0.000277   -0.000286    
0.001436    0.000277   -0.000000    0.000000    0.000000
ATOM NUMBER ::   19    0.000834   -0.000575    0.003454    0.000834   
-0.000575    0.003454   -0.000000    0.000000    0.000000
ATOM NUMBER ::   20   -0.000948   -0.000088   -0.000181   -0.000948   
-0.000088   -0.000181   -0.000000    0.000000    0.000000
ATOM NUMBER ::   21    0.000540   -0.000670    0.000598    0.000540   
-0.000670    0.000598   -0.000000    0.000000    0.000000
ATOM NUMBER ::   22   -0.001248    0.000110   -0.000349   -0.001248    
0.000110   -0.000349   -0.000000    0.000000   -0.000000
ATOM NUMBER ::   23    0.000340    0.000298   -0.003150    0.000340    
0.000298   -0.003150   -0.000000    0.000000    0.000000
ATOM NUMBER ::   24    0.001160    0.000177   -0.000126    0.001160    
0.000177   -0.000126   -0.000000    0.000000    0.000000
ATOM NUMBER ::   25    0.000774    0.000581   -0.000084    0.000774    
0.000581   -0.000083    0.000000   -0.000000   -0.000000
ATOM NUMBER ::   26   -0.000782   -0.000211   -0.000455   -0.000782   
-0.000211   -0.000455   -0.000000    0.000000    0.000000
ATOM NUMBER ::   27   -0.000403    0.000266   -0.000250   -0.000403    
0.000266   -0.000250    0.000000   -0.000000   -0.000000
ATOM NUMBER ::   28    0.001068    0.001330    0.000250    0.001068    
0.001330    0.000250    0.000000   -0.000000    0.000000
ATOM NUMBER ::   29    0.000211   -0.000187    0.000587    0.000211   
-0.000187    0.000587   -0.000000    0.000000   -0.000000
ATOM NUMBER ::   30   -0.000324   -0.001140   -0.000199   -0.000324   
-0.001140   -0.000200    0.000000    0.000000    0.000000

This to me looks perfect.

Best,
Teo

p.s.: in attachment the output of the DEBUG run.

Noam Bernstein wrote:
> On Thu, Aug 20, 2009 at 2:58 PM, Teodoro Laino<teodor... at gmail.com> wrote:
>   
>> Nothing that you are missing Noam.. the only relevant thing is to check
>> versus larger values of cutoff.
>> If this still does not work could you please send us an input file that
>> shows this problem?
>> Teo
>>     
>
> Hi Teo - the problem still seems to be happening for higher cutoffs
> (in the DFT / MGRID section.  Or did you mean some other cutoff?):
> original was 280 eV, I've tested up to 500 eV.  It seems to be
> associated with a non cubic box.
>
> I've compared finite difference (displacements of 0.001 A) and analytical
> forces for atoms # 11 and 12.  Output from my script is below.  As you can
> see, atom 11 (0, 1, 2 indicate x,y,z) is always fine.  Atom 12, y component
> is bad for all cutoffs.  The problem is definitely there for the 8x8x12 box,
> but probably also significant for 8x8x8 box, at least for 500 eV cutoff.
>
> I've attached a tar of the input and output files for the 280 eV cutoff case.
> cp2k_input_00.inp is with the unperturbed atoms.
> cp2k_input_{11,12}_{0,1,2}_{p,m}.inp are the input files for perturbing atom
> 11 or 12, along x,y,z (0,1,2) plus (p) or minus (m).
>
> In case you're wondering if atom 11 is just lucky, and the errors I'm seeing
> are just the inherent uncertainty (finite convergence, etc), I'm pretty sure
> that's not the case: I've also attached a plot of the 280 eV cutoff calculation
> perturbing each atom in turn.  Most are fine, but some components of some
> atoms are bad. Results appear to be deteministic (to roundoff - I
> haven't activated
> by deterministic BLACS thing or anything) :)
>
> cutoff_280
> 11 0 box_8_8_8 f.\hat{dp} 0.0004916814 -(Ep-Em)/|dp| 0.000491293521011838
> 11 1 box_8_8_8 f.\hat{dp} -0.0066867012 -(Ep-Em)/|dp| -0.00668865940421648
> 11 2 box_8_8_8 f.\hat{dp} -0.0073745659 -(Ep-Em)/|dp| -0.00737709426227125
> 12 0 box_8_8_8 f.\hat{dp} -0.0021136905 -(Ep-Em)/|dp| -0.00211417815708393
> 12 1 box_8_8_8 f.\hat{dp} 0.0055726993 -(Ep-Em)/|dp| 0.00549849856222641
> 12 2 box_8_8_8 f.\hat{dp} 0.0014391103 -(Ep-Em)/|dp| 0.00143906924693971
>
> 11 0 box_8_12_12 f.\hat{dp} -0.0007123294 -(Ep-Em)/|dp| -0.000711781726224949
> 11 1 box_8_12_12 f.\hat{dp} 0.0002379379 -(Ep-Em)/|dp| 0.000237385293054698
> 11 2 box_8_12_12 f.\hat{dp} -0.001559587 -(Ep-Em)/|dp| -0.00155971078403945
> 12 0 box_8_12_12 f.\hat{dp} -0.0029006498 -(Ep-Em)/|dp| -0.00290494006892761
> 12 1 box_8_12_12 f.\hat{dp} 0.0020685417 -(Ep-Em)/|dp| 0.00141395716560188
> 12 2 box_8_12_12 f.\hat{dp} -0.0029360325 -(Ep-Em)/|dp| -0.00293513967970238
>
> cutoff_400
> 11 0 box_8_8_8 f.\hat{dp} 0.0004532311 -(Ep-Em)/|dp| 0.000452920517698878
> 11 1 box_8_8_8 f.\hat{dp} -0.0065719708 -(Ep-Em)/|dp| -0.00657400259956961
> 11 2 box_8_8_8 f.\hat{dp} -0.0072055205 -(Ep-Em)/|dp| -0.00720823932810143
> 12 0 box_8_8_8 f.\hat{dp} -0.0016856163 -(Ep-Em)/|dp| -0.00168413189450205
> 12 1 box_8_8_8 f.\hat{dp} 0.0041391955 -(Ep-Em)/|dp| 0.00441285014032413
> 12 2 box_8_8_8 f.\hat{dp} -0.0011994313 -(Ep-Em)/|dp| -0.00119672725088764
>
> 11 0 box_8_12_12 f.\hat{dp} -0.0007816439 -(Ep-Em)/|dp| -0.000781034905513324
> 11 1 box_8_12_12 f.\hat{dp} -7.26663e-05 -(Ep-Em)/|dp| -7.30428596077753e-05
> 11 2 box_8_12_12 f.\hat{dp} -0.0018072394 -(Ep-Em)/|dp| -0.00180724910219993
> 12 0 box_8_12_12 f.\hat{dp} -0.0023819861 -(Ep-Em)/|dp| -0.00238044322314767
> 12 1 box_8_12_12 f.\hat{dp} -0.0010494 -(Ep-Em)/|dp| -0.000692416029119044
> 12 2 box_8_12_12 f.\hat{dp} -0.0052477217 -(Ep-Em)/|dp| -0.00524389075836397
>
> cutoff_500
> 11 0 box_8_8_8 f.\hat{dp} 0.0004411373 -(Ep-Em)/|dp| 0.00044082063995588
> 11 1 box_8_8_8 f.\hat{dp} -0.0065601726 -(Ep-Em)/|dp| -0.00656222765598964
> 11 2 box_8_8_8 f.\hat{dp} -0.007251686 -(Ep-Em)/|dp| -0.00725439636545722
> 12 0 box_8_8_8 f.\hat{dp} 0.0005936416 -(Ep-Em)/|dp| 0.000592566653785405
> 12 1 box_8_8_8 f.\hat{dp} 0.0065679237 -(Ep-Em)/|dp| 0.00494262781109822
> 12 2 box_8_8_8 f.\hat{dp} 0.0016459685 -(Ep-Em)/|dp| 0.00164566239381169
>
> 11 0 box_8_12_12 f.\hat{dp} -0.0008026305 -(Ep-Em)/|dp| -0.000802018700904088
> 11 1 box_8_12_12 f.\hat{dp} -6.38405e-05 -(Ep-Em)/|dp| -6.42142294224967e-05
> 11 2 box_8_12_12 f.\hat{dp} -0.0018938615 -(Ep-Em)/|dp| -0.00189382499706237
> 12 0 box_8_12_12 f.\hat{dp} -7.53328e-05 -(Ep-Em)/|dp| -7.63967225168129e-05
> 12 1 box_8_12_12 f.\hat{dp} 0.001442685 -(Ep-Em)/|dp| -0.000163606731184927
> 12 2 box_8_12_12 f.\hat{dp} -0.002501446 -(Ep-Em)/|dp| -0.00250087689833935
>
> >
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: out.gz
Type: application/gzip
Size: 49952 bytes
Desc: not available
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20090821/e3a058f8/attachment.gz>


More information about the CP2K-user mailing list