merzlab / QUICK

QUICK: A GPU-enabled ab intio quantum chemistry software package
Mozilla Public License 2.0
157 stars 43 forks source link

Improve gradient printout #283

Open agoetz opened 1 year ago

agoetz commented 1 year ago

Currently the gradient is printed in a single column and there is a typo, VARIABLES is missing an A.

 ANALYTICAL GRADIENT: 
------------------------
 VARIBLES    NEW_GRAD
------------------------
    1X    -0.0066581453
    1Y    -0.0235117742
    1Z     0.0041963421
    2X     0.0014871380
    2Y     0.0212612260
    2Z    -0.0069824337
...

I suggest to print it by atom. Renaming to ATOM will also fix the typo.

 ANALYTICAL GRADIENT: 
---------------------------------------------------------
   ATOM         X                Y                Z
---------------------------------------------------------
    1    -0.0066581453    -0.0235117742     0.0041963421
    2     0.0014871380     0.0212612260    -0.0069824337
...

I can fix it but I don't know when I find time. It might required updating tests and/or test scripts. If someone works on this please comment and mention others so we don't have two people working on it.

akhilshajan commented 1 year ago

I can work on this one.

agoetz commented 1 year ago

Thanks @akhilshajan . @Madu86 please let Akhil know what else we need to keep in mind when changing output format (your test scripts, QUICK tests reference output, Amber tests reference output etc). Thanks.

Madu86 commented 1 year ago

Good suggestion but not sure if we want to do this as we approach a release. You will have to change runtest script, reference test output files and file based QM/MM interface in AMBER. @agoetz Can you please confirm the last one? Is this quick_module.f90? Separate reference output files are no longer available for AMBER tests.

agoetz commented 1 year ago

This is a good point to avoid large changes right before a release. On the other hand more people are starting to use QUICK and it would be good to make changes in output format sooner than later to avoid breaking any interfaces people may write.

agoetz commented 1 year ago

The file based QM/MM interface in AMBER is in qm2_extern_quick_module.F90. Relevant is subroutine read_results(). Specifically, gradients are read in the code block starting at line 544

       ! look for QM gradients and read into dxyzqm                                                               
       if ( do_grad ) then

          if (read_buffer(1:21) == ' ANALYTICAL GRADIENT:' ) then
             do i = 1, 3
        read (iunit, '(a)', iostat = ios) read_buffer
             end do
             do iqm = 1, nqmatoms
                do ixyz = 1, 3
                   read (iunit, '(a)', iostat = ios) read_buffer
                   if (ios < 0) then
                      call sander_bomb('read_results (qm2_extern_quick_module)', &
                           'Error reading Quick output from file '//outfile, &
                           '(Problem reading QM gradient.)')
                   end if
                   read (read_buffer(24:),*) dxyzqm(ixyz,iqm)
                end do
             end do
          end if

       end if