Preparing optimization runs with zopt
From Zori Wiki
Oh my god... this page really looks bad, but it is the cut and paste from the other/old site.... we have to fix it.
Zori: Setting up an optimization run with OPT++
Paths
Make sure you have zopt , zori, zavg in your path (In this example, we are using the src/ directory of your installation.
export PATH=$PATH:$ZORI_HOME/zori/src/
�
Change directory to your $ZORI_HOME/molecules/SpecificMolecule/zoriIO directory. The SpecificMolecule/ directory contains the original ab-initio program's data files. The zoriIO/ subdirectory contains all zori-specific input and output files.
cd $ZORI_HOME/molecules/SpecificMolecule/zoriIO/
Copy optimize-optpp.xml to your run directory, and edit to taste.
cp $ZORI_HOME/zori/src/optimize-optpp.xml .
emacs optimize-optpp.xml
Of specific interest is the ERefType parameter. The options that it can take are:
| ERefType option | Description |
| Mean | Set the reference energy to the initial mean of the fixed-sample to be optimized (safe parameter) |
| AdaptiveMean | Dynamically set the reference energy to the mean of the sample at each step of the optimization run (expermiental) |
| External | Specify an external energy. A good choice is the estimated exact answer, or the Hartree-Fock energy minus your estimate of the correlation energy. (Expert user) �The use of External requires setting the ERef parameter equal to the reference energy desired. |
Make sure to set the WalkersPerProcessor parameter to the number of walkers in your sample file.
Note: A good approximation for knowing the number of walkers is by using the ls -l command and dividing the number of lines by the number of electrons + 2. We will write a count_walkers.py script for doing this in the near future.
Also make sure that the Particles parameter is set to the number of electrons of your system. You can usually figure that out by reading the new_walkers-*.xml, input.xml, dmc.xml or vmc.xml file present in the same directory. The code will die with an error if the number of Particles does not match the number of particules in your walkers file.
Afterward, you need to run the optimizer:
zopt -i optimize-optpp.xml -r new_walkers [-p psi.xml]
Where the file after the -i command-line option is the run input file. The file after the -r command-line option is the prefix of the set of walker files (for example, a set of new_walkers-0.xml, new_walkers-1.xml, ...) that comes from a previous VMC run.
Note: If you prefer, you can rename optimize-optpp.xml to input.xml, which is Zori's default input file.
The output of the optimization run appears in the� zopt-output.txt file.
Parameters to optimize
The parameters to optimized are in the psi.xml wavefunction file. By default, zori optimizes the� Corrleation component (eg. Jastrow, SMBH, Sun):
| Correlatin Type option | Description | ||
| None | No correlation function present. Therefore, no parameters to optimize. Zori exits if you attempt to optimize with no correlation parameters. | ||
| Jastrow |
Two-body Jastrow function.� The Jastrow parameters are described below: | Order | Polynomial order of the expansion. Usually 1 or 2 |
| IgnoreSpin | If True, the same parameters are used for like and unlike spin. If False, the parameter list will start with the like-spin parameters followed by the unlike-spin parameters. | ||
| EnforceCusp | The parameters fixed by the electron-electron and electron-nuclear cusp conditions are not optimized. |
The functional form is� A/B where
A = (a1*r + a2*r^2 + a3*r^3 + ...)
B =(� 1 + b1*r + b2*r^2 + ...)
The order of the parameters is A , then B for like spin, followed by unlike spin.
You can figure out the number and order of parameters from this source-code comment:
/*! The 'params_list' vector contains the Jastrow parameters serialized in the
following order:
x First 'order' number of parameters of 'a' like electron parameters
x Second, 'order' number of paramemers of 'b' like electron parameters
x Third, 'order' number of parameters of 'a' unlike electron parameters
x Fourth, ... 'b' unlike ...................
i.e.
a_1, a_2, b_1, b_2 (for like)
a_1, a_2, b_1, b_2 (for unlike)
|-
| style="vertical-align: top; background-color: rgb(255, 204, 255);" | Sun
| style="vertical-align: top;" | Same as above, but Order is not applicable
|-
| style="vertical-align: top; background-color: rgb(255, 204, 255);" | SMBH
| style="vertical-align: top;" | Correlation function with 3-body terms and above.
|}
*/]

