crest-lab / crest

CREST - A program for the automated exploration of low-energy molecular chemical space.
https://crest-lab.github.io/crest-docs/
GNU Lesser General Public License v3.0
183 stars 42 forks source link

QCG structures in crest_rotamers_0.xyz #192

Closed alan-arnold closed 5 months ago

alan-arnold commented 1 year ago

Me again I'm afraid :) After a few more QCG experiments following your changes in #183, which by design trades off a longer run-time for a more comprehensive search for minima in the energy hypersurface, I realized that I don't understand why it's necessary to optimize all of the large number of structures in crest_rotamers_0.xyz that arise from the MTD sampling, instead of only those within a reasonable energy window of the current lowest energy structure?

So, I took a close look at a few of the temporary files that are created during and after the MTD cycles.

This is the beginning if the output from a QCG solvation run for methane in a 100-waters cluster that had previously been grown with aISS:

crest CH4.xyz --T 24 --qcg h2o.xyz --gsolv --alpb h2o --mdlen 5 -keepdir > CH4_crest_5_qcg100_3.1.out &


  =========================================
  |   quantum cluster growth: ENSEMBLE    |
  =========================================

   Method for ensemble search:--gff               
 Starting ensemble cluster generation by CREST routine

------------------------------------------------
Generating MTD length from a flexibility measure
------------------------------------------------
 System flexiblity is set to 1.0 for NCI mode
 flexibility measure :   1.000
 t(MTD) / ps set by command line  :     5.0
 t(MTD) / ps    :     5.0
 Σ(t(MTD)) / ps :    60.0 (12 MTDs)

-------------------------------------
Starting a trial MTD to test settings
-------------------------------------
 Estimated runtime for one MTD (5.0 ps) on a single thread: 12 h 31 min 25 sec
 Estimated runtime for a batch of 12 MTDs on 24 threads: 6 h 15 min 43 sec

 list of Vbias parameters applied:
$metadyn    0.00050   1.000
$metadyn    0.00025   1.000
$metadyn    0.00013   1.000
$metadyn    0.00050   0.500
$metadyn    0.00025   0.500
$metadyn    0.00013   0.500
$metadyn    0.00050   0.250
$metadyn    0.00025   0.250
$metadyn    0.00013   0.250
$metadyn    0.00050   0.125
$metadyn    0.00025   0.125
$metadyn    0.00013   0.125

*******************************************************************************************
**                        N E W    I T E R A T I O N    C Y C L E                        **
*******************************************************************************************

========================================
            MTD Iteration  1
========================================

     ========================================
     |         Meta-MD (MTD) Sampling       |
     ========================================

Starting Meta-MD   1 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.1525
     Vbias exp α /bohr⁻²:    1.00
Starting Meta-MD   2 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.0762
     Vbias exp α /bohr⁻²:    1.00
Starting Meta-MD   3 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.0381
     Vbias exp α /bohr⁻²:    1.00
Starting Meta-MD   4 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.1525
     Vbias exp α /bohr⁻²:    0.50
Starting Meta-MD   5 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.0762
     Vbias exp α /bohr⁻²:    0.50
Starting Meta-MD   6 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.0381
     Vbias exp α /bohr⁻²:    0.50
Starting Meta-MD   7 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.1525
     Vbias exp α /bohr⁻²:    0.25
Starting Meta-MD   8 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.0762
     Vbias exp α /bohr⁻²:    0.25
Starting Meta-MD   9 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.0381
     Vbias exp α /bohr⁻²:    0.25
Starting Meta-MD  10 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.1525
     Vbias exp α /bohr⁻²:    0.12
Starting Meta-MD  11 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.0762
     Vbias exp α /bohr⁻²:    0.12
Starting Meta-MD  12 with the settings:
     MD time /ps        :     5.0
     dt /fs             :     1.5
     dumpstep(trj) /fs  :      50
     dumpstep(Vbias)/ps :     1.0
     Vbias factor k /Eh :  0.0381
     Vbias exp α /bohr⁻²:    0.12
*Meta-MTD 10 finished*
*Meta-MTD 2 finished*
*Meta-MTD 12 finished*
*Meta-MTD 4 finished*
*Meta-MTD 1 finished*
*Meta-MTD 11 finished*
*Meta-MTD 6 finished*
*Meta-MTD 3 finished*
*Meta-MTD 8 finished*
*Meta-MTD 9 finished*
*Meta-MTD 5 finished*
*Meta-MTD 7 finished*

-----------------------
Multilevel Optimization
-----------------------

 -------------------------
 1. crude pre-optimization
 -------------------------
 Optimizing all 1200 structures from file "crest_rotamers_0.xyz" ...
 1 2 3 4 5 6 7 8 9 10...1196 1197 1198 1199 1200
 done.
 input  file name : crest_rotamers_1.xyz
 output file name : crest_rotamers_2.xyz
 reference state Etot :  -35.0794530000000     
 1200 structures remain within     6.00 kcal/mol window

It appears that the 1200 optimized structures for the initial cycle of 12 MTDs are stored in the temporary file .cre_0.xyz

I imported this file into Excel (don't ask !!) and sorted the 1200 energies, which range from -35.07945300 to -34.95850797 Eh

The lowest energy structure (-35.07945300) is the 2nd in the file - the one after the 1st structure marked "!input"

This value seems to be taken as the "reference state Etot" in the output above for this 1st MTD Iteration.

However, only 18 other structures (not 1200) have Etot within 6.00 kcal/mol of this lowest energy, so the last line in the output above, ie. "1200 structures remain within 6.00 kcal/mol window" does not appear to be correct. And a lot of cpu-time is spent optimising them!

The same conclusion can be reached for the subsequent MTD cycles which create the corresponding .cre_1.xyz, .cre_2.xyz etc., each with only 1000 structures this time (only 10MTDs):

.cre_1.xyz from MTD Iteration 2 has only 8 of 1000 structures within 6 kcal/mol of the reference state Etot -35.09724733, and .cre_2.xyz from MTD Iteration 3 has only 6 of 1000 structures within 6 kcal/mol of the reference state Etot -35.11145228 etc.

So, is the "1200 (or 1000) structures remain within" just a printout bug, or am I misunderstanding what's going on here? And where do these 18+8+6 + ... lowest-energy structures end up?

cplett commented 1 year ago

Hi Alan, Thank you for looking into this. All the structures are optimized because it is unclear how large the energy change will be upon optimization. This depends on how far the M(T)D snapshot is from a local minimum. That 1200 structures remain in the energy window seems to be either a printout or an actual error, but the number of structures refers usually to the structures in the crest_rotamers_X.xyz files. I will check this. The lowest-energy structures of each M(T)D run are collected and should occur at the end of the ensemble run.

github-actions[bot] commented 5 months ago

This issue had no activity for 6 months. It will be closed in 1 week unless there is some new activity.