CHECK_NN, CHECK_KE

General discussion of the Cambridge quantum Monte Carlo code CASINO; how to install and setup; how to use it; what it does; applications.
varelse
Posts: 44
Joined: Mon Jun 10, 2013 10:17 pm

CHECK_NN, CHECK_KE

Post by varelse »

Warning : [CHECK_NN] calculated nuclear repulsion energy differs from value in
gwfn.data. If the difference between the numbers above is large, you should
investigate this problem.
Warning: [CHECK_KE] This may indicate a problem. Continuing run, however,
because the KE_FORGIVE flag is set to T.

What can these warnings indicate?
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: CHECK_NN, CHECK_KE

Post by Mike Towler »

Missing pseudopotential file?

M.
varelse
Posts: 44
Joined: Mon Jun 10, 2013 10:17 pm

Re: CHECK_NN, CHECK_KE

Post by varelse »

And for all-electron calculation?
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: CHECK_NN, CHECK_KE

Post by Mike Towler »

Hi Blazej,

You need to supply more information I'm afraid (see earlier note about being psychic). :)

Is the difference large or small? Is this a periodic or a finite system? What code is generating the gwfn.data? Which version of the code? etc. etc.

Can you attach your input and the header of the gwfn.data file (you'll need to gzip it).

M.
varelse
Posts: 44
Joined: Mon Jun 10, 2013 10:17 pm

Re: CHECK_NN, CHECK_KE

Post by varelse »

Input file:

Code: Select all

#-------------------#
# CASINO input file #
#-------------------#

# 

# SYSTEM
neu               : 73              #*! Number of up electrons (Integer)
ned               : 71              #*! Number of down electrons (Integer)
periodic          : F              #*! Periodic boundary conditions (Boolean)
atom_basis_type   : gaussian       #*! Basis set type (text)

# RUN
runtype           : vmc_opt            #*! Type of calculation (Text)
newrun            : T              #*! New run or continue old (Boolean)
testrun           : F              #*! Test run flag (Boolean)

# VMC
vmc_equil_nstep   : 50000           #*! Number of equilibration steps (Integer)
vmc_nstep         : 500000         #*! Number of steps (Integer)
vmc_nblock        : 4              #*! Number of checkpoints (Integer)
vmc_nconfig_write : 500000              #*! Number of configs to write (Integer)
complex_wf        : F              #*! Wave function real or complex (Boolean)
vmc_decorr_period : 12
dtvmc             : 0.2            #*! VMC time step (Double Precision)
opt_dtvmc         : 1              #*! Optimize VMC timestep (Integer)

# DMC
dmc_equil_nstep   : 2000           #*! Number of steps (Integer)
dmc_equil_nblock  : 1              #*! Number of checkpoints (Integer)
dmc_stats_nstep   : 5000000          #*! Number of steps (Integer)
dmc_stats_nblock  : 50000              #*! Number of checkpoints (Integer)
dmc_target_weight : 1000.0         #*! Total target weight in DMC (Real)
dtdmc             : 0.002          #*! DMC time step (Real)
use_tmove         : F              #*! Casula nl pp for DMC (Boolean)
dmc_ave_period    : 1

# RMC

# OPTIMIZATION
opt_method        : varmin         #*! Opt method (varmin/madmin/emin/...)
opt_cycles        : 5              #*! Number of optimization cycles (Integer)
opt_jastrow       : T              #*! Optimize Jastrow factor (Boolean)
opt_det_coeff     : F              #*! Optimize determinant coeffs (Boolean)
opt_backflow      : F              #*! Optimize backflow parameters (Boolean)
opt_orbitals      : F              #*! Optimize orbital parameters (Boolean)

# GENERAL PARAMETERS
use_jastrow       : T              #*! Use a Jastrow function (Boolean)
backflow          : F              #*! Use backflow corrections (Boolean)
expot             : F              #*! Use external potential (Boolean)
timing_info       : F              #*! Activate subroutine timers (Boolean)
esupercell        : F              #*! Energy/supercell in output (Boolean)
neighprint        : 0              #*! Neighbour analysis (Integer)
mpc_cutoff        : 30.d0 hartree  #*! G vector cutoff for MPC (Physical)
forces            : F              #*! Evaluate forces on atoms (Boolean)
checkpoint        : 1              #*! Checkpoint level (Integer)
cusp_correction   : T

# EXPECTATION VALUES
density           : F              #*! Accumulate density (Boolean)
spin_density      : F              #*! Accumulate spin densities (Boolean)
pair_corr         : F              #*! Accumulate rec. space PCF (Boolean)
pair_corr_sph     : F              #*! Accumulate sph. real space PCF (Boolean)
loc_tensor        : F              #*! Accumulate localization tensor (Boolean)
structure_factor  : F              #*! Accumulate structure factor (Boolean)
struc_factor_sph  : F              #*! Accumulate sph. struc. factor (Boolean)
onep_density_mat  : F              #*! Accumulate 1p density matrix (Boolean)
twop_density_mat  : F              #*! Accumulate 2p density matrix (Boolean)
cond_fraction     : F              #*! Accumulate cond fraction (Boolean)
dipole_moment     : F              #*! Accumulate elec. dipole moment (Boolean)
expval_cutoff     : 30.d0 hartree  #*! G vector cutoff for expval (Physical)
permit_den_symm   : F              #*! Symmetrize QMC charge data (Boolean)
qmc_density_mpc   : F              #*! Use QMC density in MPC int (Boolean)
int_sf            : F              #*! Calc ee int from strucfac (Boolean)

# BLOCK INPUT
The

Code: Select all

 Nuclear repulsion energy (au)
 =============================
 EIONION from file  : 1594.198005508400
 Calculated EIONION : 1594.783653466851

 Difference         : 0.585647958451

 Warning : [CHECK_NN] calculated nuclear repulsion energy differs from value
 in gwfn.data. If the difference between the numbers above is large, you
 should investigate this problem.
The warnings in the out file

Code: Select all

 Wave function failed kinetic energy check
 -----------------------------------------
 Test failed for Slater determinants:
  Analytical Fisq     : 0.17327488E+02
  Numerical Fisq      : 0.17307501E+02 (for stepsize #6)
  Analytical Ti       : 0.26378502E+02
  Numerical Ti        : 0.26399603E+02 (for stepsize #4)

 Warning: [CHECK_KE] This may indicate a problem.  Continuing run, however,
 because the KE_FORGIVE flag is set to T.


 Kinetic energy check performed.
  Slater determinants - gradient: bad, Laplacian: poor.
 End of report.
and the gwfn.data file
http://www.mediafire.com/download/pw2if ... ata.tar.gz
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: CHECK_NN, CHECK_KE

Post by Mike Towler »

Hi Blazej,

OK - I ran CASINO on your input and I can confirm the error message (I'm doing a run with testrun=T and focussing solely on the n-n repulsion energy).

There is nothing wrong with CASINO itself; it is just - presumably correctly - reporting that the gwfn.data file is internally inconsistent, in the sense that the N-N repulsion energy in gwfn.data (which is is just a number copied from the GAUSSIAN09 output file) is not what you get if you take all the nuclear positions in gwfn.data (which are just copied from the Gaussian .fchk file), and add up 1/r for all unique pairs of nuclei.

I'm not sure why this is the case, but it should be easy to resolve, as it's just a large molecule and we don't have to worry about Ewald interactions or anything like that.

Questions:

(1) Have you or anyone else edited the gwfn.data file, or is it the pure file as generated by the converter utility supplied with CASINO?

(2) Is the nuclear-nuclear repulsion energy in gwfn.data the same as the one in the Gaussian output file (search for 'nuclear repulsion energy')? (note the former seems to be divided by the number of atoms, for some reason).

(3) Do the positions of the 34 atoms in gwfn.data correspond to the 34 positions in the GAUSSIAN output file? [I note the numbers in the Gaussian fchk file are in something similar to single precision, and it's possible that the nn repulsion is generated inside Gaussian using double precision, but of course that shouldn't affect the numbers to this extent. Possible internal length unit conversions inside Gaussian could also introduce a difference, but not by this much..].

(4) Where it says 'Atomic numbers for each atom' in gwfn.data - are those in the correct order for your mixture of 22 C and 12 H as written in the .fchk file (search for 'Atomic numbers')?

Enough people use GAUSSIAN09 and CASINO in combination that if there was a blatant error somewhere, it should have been reported. You should therefore see an error only if:

(1) you're doing something really unusual, and the error only appears in those unusual circumstances. About the only weird thing I can see is that you're using ROHF in your Gaussian calculation (most people would use UHF for spin-polarized systems).

(2) Someone has recently introduced an error in one of the codes, and given that no-one has recently changed GAUSSIAN09 or the CASINO converter utility as far as I know, that would have to be CASINO itself (but again, I don't know of any recent changes that would affect the computation of the nuclear repulsion..) I'm presuming you're using the current_beta version of CASINO - you still haven't told me..

Mike

PS: you're probably using too many configs for optimization - half a million will take ages.
varelse
Posts: 44
Joined: Mon Jun 10, 2013 10:17 pm

Re: CHECK_NN, CHECK_KE

Post by varelse »

I think I know where the problem is. I used a Gaussian file from structure optimization calculation. So the repulsion energy from gwfn. data equals the one in Gaussian output, but before the optimization.

Nevertheless, the atom coordinates from .fchk file do not match any of the coordinate sets from out file and this is weird, I don't know which one was taken/
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: CHECK_NN, CHECK_KE

Post by Mike Towler »

OK, so to summarize the discussion: GAUSSIAN produces its output in two files, the output file and the fchk file. You were using the output file from one calculation, and the fchk file from another one with a different geometry. Good job CASINO does robust error checking, eh? 8-)

That said, the GAUSSIAN converter utility really should have detected that this was likely to be a problem.. I've therefore updated the status of your CASINO login ID to the sacred 'developer' rank (as befits all former Summer School Champions) - why don't you see if you can persuade the utility to detect such an error, as your first contribution to the great CASINO project..? We would be very grateful for your help..

[I hope of course that you can speak Fortran, and haven't been corrupted by modern computer scientist types who have collectively and wrongly managed to convince themselves that the language is obsolete.. It's got to the stage where it doesn't even feature in polls of the 'top 100 computer languages' any more because nobody contributing to such polls has ever heard of it'. Sigh - young people nowadays...]

M.

PS: you see how desperate we are to recruit active developers.. My effort to convince Yasmine the other day was a total failure.. sigh..
varelse
Posts: 44
Joined: Mon Jun 10, 2013 10:17 pm

Re: CHECK_NN, CHECK_KE

Post by varelse »

Mike Towler wrote:OK, so to summarize the discussion: GAUSSIAN produces its output in two files, the output file and the fchk file. You were using the output file from one calculation, and the fchk file from another one with a different geometry. Good job CASINO does robust error checking, eh? 8-)
Not exactly. It was the same calculation, but with geometry optimization, and it prints the repulsion energy to the out file twice: before and after optimization. How come the coordinates in fchk are different - I don't know, but i only made one calculation in this folder.

Nevertheless, I'll run single point calculation with the optimized coordinates and see if it will work.
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: CHECK_NN, CHECK_KE

Post by Mike Towler »

Not exactly. It was the same calculation, but with geometry optimization, and it prints the repulsion energy to the out file twice: before and after optimization. How come the coordinates in fchk are different - I don't know, but i only made one calculation in this folder.
OK, but from the way you describe it, the logical explanation would be that GAUSSIAN prints the nuclear repulsion before and after the optimization (and CASINO grabs the 'before' one), then it prints the optimized coordinates to fchk, no? This is what I would expect it to do..

In which case, you've discovered an error, namely that the GAUSSIAN utility converter doesn't work for structural optimizations. If that's correct, it's easy to fix. Count the number of times 'nuclear repulsion energy' appears in the output file. If it's more than once, use the second one.. or something like that. Can you fix it for us? (I don't have a copy of GAUSSIAN, so it's up to you..).

The GAUSSIAN converter was written almost 15 years ago by a transient student - it's amazing it works at all, to be honest.

M.
Post Reply