This protocol allows optimization of parameters entering the calculation via cuby input file. The optimization can use the same algorithms available for geometry optimization, the gradient of the parameters is calculated by finite differences. Alternatively, the Nelder-Mead gradient-free simplex method can be used. Its convergence is slower and for small number of parameters, gradient optimization is usually more efficient even though the evaluation of the gradient requires extra calculations.
The keyword optimized_parameters specifies the keywords to be optimized. It has the form of "keyword: starting_value" hash. It is also possible to optimize numerical values in hash-type keywords. The synatx is then e.g. 'hash_keyword->key1->key2: starting_value'. If the hash keys are symbols, write them as ":key", if they are numbers, write them as e.g. #3.
More occurences of the same parameter in a single input can be parametrized separately. To do this, the blocks in which these parameters are used should be labeled using the block_flag keyword, and in the optimized_parameters list, they are then disttinguished by this flag and written as 'keyword@flag: starting_value'.
The parameters are updated only in the places in the input where the keyword is set in the input file.
Some keywords are read only once upon preparation of the calculation and not re-read when the calculation is actually performed. To optimize such keyword, the calculation has to be rebuilt in each calculation called during the parameterization. This can be activated using the para_rebuild_calculations
This protocol does not use any specific keywords
The following examples, along with all other files needed to run them, can be found in the directory cuby4/protocols/parametrize/examples
#===============================================================================
# Parametrize protocol example 1 - parameterizing D3 correction
#===============================================================================
# This inputs shows parameterziation of the D3 dispersion correction for PM6
# method on benzene dimer
job: parametrize
optimizer: rfo
opt_quality: 0.1
# For the dispersion interface, it is not necessary to rebuild
# the calculations when parameters change
para_rebuild_calculations: no
# The parametres to be optimized
optimized_parameters:
d3_s8: 1.3845
d3_a1: 0.4613
d3_a2: 4.5062
calculation:
job: dataset
dataset: S66x8
# Select benzene dimer in both parallel-displaced and T-shape geometries
dataset_select_name: '^24|^47'
interface: mopac
method: PM6
modifiers: dispersion3
# Save the PM6 calculation and read the results in the subsequent
# cycles - they do not change
job_cleanup: no
existing_calc_dir: read_results
modifier_dispersion3:
# These options must be set to override the default
# setup of D3 for PM6:
d3_damping: :bj
d3_hh_fix: no
d3_hybridization: grimme
# These parameters will be changed:
d3_s8: 1.3845
d3_a1: 0.4613
d3_a2: 4.5062
#===============================================================================
# Parametrize protocol example 2 - parameters inside hash
#===============================================================================
# This inputs shows optimization parameter inside a hash-type keyword
# It is an optimization of the H-bonding correction for PM6 for water dimer
job: parametrize
optimizer: rfo
opt_quality: 0.1
# In this case, teh parameters are used in the preparation of the calculation
# which thus has to be rebuild in each step
para_rebuild_calculations: yes
# The parametres to be optimized
optimized_parameters:
"h_bonds4_parameters->oh_o": 2.0
calculation:
job: dataset
dataset: S66x8
# Select water dimer form the S66x8 data set
dataset_select_name: '^01'
interface: mopac
method: PM6
modifiers: dispersion3, h_bonds4
modifier_h_bonds4:
h_bonds4_parameters:
# This value is optimized:
oh_o: 2.32
# This parameter is set to non-default value:
multiplier_wh_o: 1.00
# The rest are default values but they must be here,
# this is a single keyword and when it is present in the
# input, defaults are not read
oh_n: 3.10
nh_o: 1.07
nh_n: 2.01
multiplier_coo: 1.41
multiplier_nh4: 3.61