Miscellaneous
From Zori Wiki
| Table of contents |
Running in Seaborg
Running ADF
First, get yourself an example directory. There are currently two examples (hexatriene, and hexatriene-triplet (unrestricted case). Familiarize yourself with the input files.
mkdir $HOME/adf
cd $HOME/adf
cp -r $ZORI_HOME/adf_examples/hexatriene .
For running, take a look at the script file. It expects a run file present, with the ADF script file.
module load adf
llsubmit script
After running, ADF leaves a file called Run.t21� That is the TAPE21 file that contains the wave function information. We usually call it an 'orbitals file.
Run the following command to convert it into an orbitals file.
(unrestricted case). Familiarize yourself with the input files.
> $ADFBIN/dmpkf HexaTriene_2.t21 > HexaTriene_2.Orbitals
STOP NORMAL TERMINATION
If you see the STOP NORMAL TERMINATION message, you have a fresh Orbitals file.
Afterward, you can use the adf2xml.py script for converting the run into a Zori run.
For that, you need to load the zori modulemodule load zori
You can run adf2xml.py without arguments to inquire for it's usage:
> adf2xml.py
Zori converter (2004, Berkeley)
ERROR: Not enough arguments supplied
USAGE: ./adf2xml.py output tape21 orbitals_file.xml wavefunction_file.xml
Where output is your ADF file
tape21 is a text version of the ADF tape21 file
orbitals_file.xml is the Zori orbitals file
wavefunction_file.xml is the Zori wavefunction file
We follow the instructions and generate Zori input orbitals and wavefunctions
adf2xml.py HexaTriene_2.out HexaTriene_2.Orbitals orbitals.xml psi.xml
After adf2xml.py is done, you will have the orbitals.xml and psi.xml files ready in your directory.
Edit psi.xml and remove the electron-nuclear cusp condition section of the input file (that contains <Jastrow_eN>..... </Jastrow_eN>. It is not needed for these kinds of calculations.
Now create a zori directory and copy your XML files there:
mkdir $HOME/INCITE/Molecule
cp *.xml $HOME/INCITE/Molecule
copy into your Moelcule directory the example vmc-EDITME.xml dmc-EDITME.xml create-EDITME.xml files from $ZORI_HOME/examples/cp $ZORI_HOME/examples/*-EDITME.xml .��� �� �� �� �� �� �� �� �� �� �� �� �� �� ��
cp $ZORI_HOME/examples/*-EDITME.scr
Edit the XML files, and when you are ready to run, take a look at the *-EDITME.scr (LLQ script files)
This is the run order.
a) First run the create-0.scr� with zori running with the create.xml input file. This will create the random walkers for the run.
b) Then run the vmc.scr using the vmc.xml for an initial run.
Make sure to runzavg
gnuplot
> plot "zori-energy.txt" using 1:2 w l
You have to see the energy decay. I recommend 2-3 VMC runs before moving on to DMC with the same walkers
A good reblocking size seems to be 50 blocks, and skipping 50-100 blocks seems to be sufficient:zavg -s 50 -b 50� is a typicall averaging command.
The commandtar czvf wlk1.tar.gz *.xml *.scr zori-energy.*Will store your current run into a file wlk1. It is very useful in case you have some file problems. You can put a backup like this in your script system. This is left as an exercise to the reader <grin>.
�
When you are ready to move on to dmc, you can create a new directory called dmc, put your walkers and script files there, and start from scratch. Remember that zori-energy.out is overwritten when a run without the -C or -c
command is done.
Compiling with OPT++
I recommend that you follow the instructions for compiling Zori without OPT++ first, and make sure things are kosher like that. Afterward,� follow the following steps to 'activate' OPT++ in your Zori Directory.
a) Obtaining the source code
Obtain the rao-sbg module if you are going to be compiling in Seaborg. Otherwise, get the rao-mac module
export CVSROOT=:pserver:user@sunsite.dk:/pack/cvsroots/zoricvs login
cvs get OPT++.2.1.rao-mac
or
cvs get OPT++.2.1.rao-sbg
b) Compiling OPT++
After that, one needs to compile� OPT++, for which you need to issue the following commands:
In Linux or a Mac:export MPI_ROOT=/usr./configure --with-mpi=no --prefix=$ZORI_HOME
make
And in Seaborg:export MPI_ROOT=/usr./configure --with-mpi=yes --prefix=$ZORI_HOME
make
Then, one needs to link the appropriate libraries:cd lib
In Linux or a Mac:ln -s� libnewmat-linux.a libnewmat.a
ln -s libopt-linux.a libopt.a
Or in AIX (Seaborg):
�ln -s� libnewmat-aix.a libnewmat.a
ln -s libopt-aix.a libopt.a
Afterward, you need to alter your environment variables, and recompile Zori again:export OPTPP_BASE=$ZORI_HOME/OPT++.2.1.rao-mac
# If you have glib 2.0 or higher:export CXX='mpiCC'CC='mpicc -I $ZORI_HOME/include -L$ZORI_HOME/lib' ./autogen.sh \
--prefix=$ZORI_HOME --enable-debug --enable-optpp
# If you have glib 1.2 :export CXX='mpiCC'CC='mpicc -I $ZORI_HOME/include -L$ZORI_HOME/lib' ./autogen.sh \
--prefix=$ZORI_HOME --enable-debug --enable-glib1
� After this, just compile the code:make
You should have a nice and shiny zopt binary sitting there. I will describe how to use zopt below
Optimizing with Zopt
Obtain the example file C2H2_localized.tar.gz (http://zori.aspuru.com/developers/C2H2_localized.tar.gz)�� The ADF files are in the top directory and the Zori files are in a subdirectory.
Go to the zori directorycd C2H2_localized/zori
Run the code as:./zopt -i optimize-optpp-trgss.xml
Check out the wave function file psi.xml� Note the Optimize="True" XML options for the SMBH correlation function.
����� <SMBH Level="2" Check="False" IgnoreSpin="True" EnforceCusp="False" Generate="False">
����� <Kernel� Type="Jastrow"� ee_Chi="0.5" eN_Chi="0.5" ee_Opt_Chi="0.5" eN_Opt_Chi="0.5" />
����� <Triplet Type="like" n="1" l="0" m="0" Value="1.0" Group="0"
����� Optimize="True" />
����� <Triplet Type="like" n="0" l="0" m="1" Value="1.0" Group="0"
����� Optimize="True" />
����� <Triplet Type="like" n="2" l="0" m="0" Value="1.0" Group="0"
����� Optimize="True" />����
����� <Triplet Type="like" n="0" l="2" m="0" Value="1.0" Group="0"
����� Optimize="True" />
����� <Triplet Type="like" n="0" l="0" m="2" Value="1.0" Group="0"
����� Optimize="True" />
����� <Triplet Type="like" n="1" l="0" m="1" Value="1.0" Group="0"
����� Optimize="True" />
���� <Triplet Type="like" n="1" l="0" m="0" Value="1.0" Group="1"
����� Optimize="True" />
����� <Triplet Type="like" n="0" l="0" m="1" Value="1.0" Group="1"
����� Optimize="True" />
����� <Triplet Type="like" n="2" l="0" m="0" Value="1.0" Group="1"
����� Optimize="True" />����
����� <Triplet Type="like" n="0" l="2" m="0" Value="1.0" Group="1"
����� Optimize="True" />
����� <Triplet Type="like" n="0" l="0" m="2" Value="1.0" Group="1"
����� Optimize="True" />
����� <Triplet Type="like" n="1" l="0" m="1" Value="1.0" Group="1"
����� Optimize="True" />
Check how the standard output of the calculation shows which parameters are actually being optimized.
----------------------------------------------
Initializing the Optimizer...
----------------------------------------------
Total number of optimizable parameters: 8
List of parameters
--------------------------------------------------------------------
��������������� Parameter���������� Optimizable���������� Value
--------------------------------------------------------------------
[ SMBH Kernel Jastrow Chi: (0) ]������� [ ]������������ [� 0.500000]
[ SMBH Kernel Jastrow Chi: (1) ]������� [ ]������������ [� 0.500000]
[ SMBH Kernel Jastrow Chi: (2) ]������� [ ]������������ [� 0.500000]
[ SMBH Kernel Jastrow Chi: (3) ]������� [ ]������������ [� 0.500000]
[SMBH Triplet Like-Spin�� Group 0 (n=1,l=0,m=0)]������� [ ]������������ [� 0.500000]
[SMBH Triplet Like-Spin�� Group 0 (n=0,l=0,m=1)]������� [ ]������������ [-12.000000]
[SMBH Triplet Like-Spin�� Group 0 (n=2,l=0,m=0)]������� [x]������������ [� 1.000000]
[SMBH Triplet Like-Spin�� Group 0 (n=0,l=2,m=0)]������� [x]������������ [� 1.000000]
[SMBH Triplet Like-Spin�� Group 0 (n=0,l=0,m=2)]������� [x]������������ [� 1.000000]
[SMBH Triplet Like-Spin�� Group 0 (n=1,l=0,m=1)]������� [x]������������ [� 1.000000]
[SMBH Triplet Like-Spin�� Group 1 (n=1,l=0,m=0)]������� [ ]������������ [� 0.500000]
[SMBH Triplet Like-Spin�� Group 1 (n=0,l=0,m=1)]������� [ ]������������ [ -2.000000]
[SMBH Triplet Like-Spin�� Group 1 (n=2,l=0,m=0)]������� [x]������������ [� 1.000000]
[SMBH Triplet Like-Spin�� Group 1 (n=0,l=2,m=0)]������� [x]������������ [� 1.000000]
[SMBH Triplet Like-Spin�� Group 1 (n=0,l=0,m=2)]������� [x]������������ [� 1.000000]
[SMBH Triplet Like-Spin�� Group 1 (n=1,l=0,m=1)]������� [x]������������ [� 1.000000]
As you can see, the Jastrow Chi parameters are not optimized, and only the 3-body and quadratic terms are optimized. The parameters are numbered as the [X], therefore, the first optimizable paramater is the
[SMBH Triplet Like-Spin�� Group 0 (n=2,l=0,m=0)] term, which means the n=2 SMBH triplet for the Carbon atoms (Symmetry Group 0).
Look at the zopt-output.txt file, It contains the starting parameters (All 1.0) and at the end, the final parameters under the Solution section.
=========� Solution� ===========
�
�
�� i������� xc���������� grad����������� fcn_accrcy
���� 1������ 192.5����������� -645.3������� 2.22e-16
���� 2����� 0.5687������� -1.092e+05������� 2.22e-16
���� 3����� 0.5687������� -1.092e+05������� 2.22e-16
���� 4����� 0.6366������������� 8039������� 2.22e-16
���� 5������ 5.597����������� -645.3������� 2.22e-16
���� 6������ 1.001������������ -2884������� 2.22e-16
���� 7������ 1.014������������ -2884������� 2.22e-16
���� 8����� -3.084������������� 3498������� 2.22e-16
����������������������������������������������������������������������������������������������������������������������������
Function Value���� =��� 1.833e+06
Norm of gradient�� =��� 1.548e+05
Derivative Option� = 0
The parameters that changed the most where the n=2 quadratic electron-electron parameters. We can generate a 2-d scan of the parameters for a given group. For example, let's generate a 2-d surface for parameters 1 and 3:
This can be seen in the relevant section of the optimize-scan.xml input file:
�<Scan x="1" y="3" x_i="1.00" x_f="300.0" y_i="0.0" y_f="2.0" x_n="25"
y_n="25" />
Running the code as ./zori -i optimize-scan.xml
will produce a ./parameter-scan.txt file that can be viewed with GNUPlot as a surface, or that can be� plotted with Matlab, Maple or any other fancier package. I hope Ricardo can send us instructions on how to do it in Matlab soon.
A very simple GNUPLOT command set to plot it is:gnuplot> set noparametric
gnuplot> splot "parameter-scan.txt"
gnuplot> splot "parameter-scan.txt" with lines
orgnuplot> set noparametric
gnuplot> set term postscript eps
Terminal type set to 'postscript'
Options are 'eps noenhanced monochrome dashed defaultplex "Helvetica" 14'
gnuplot> set output "parameter-scan.eps"
gnuplot> plot "parameter-scan.txt" with lines
gnuplot>
convert parameter-scan.eps paramater-scan.jpg
gives you the following figure
Parameter-scan.png
Image:parameter-scan.png
If you want to generate a parmeter scan, so one can see how things vary, let's try to
Creating coordinates from PDB
One can obtain PDB files from the web, or build them using Spartan (Build mode, then Back to Main Menu... Save).
Maestro will count the number of electrons for you, if you import them and setup a Jaguar job.
For converting the PDB file to ADF format, you can use the following command:babel -ipdb 3-alanine.pdb -oxyz 3-alanine.xyzNow, I recommend you to use this ADF header and footer files. Just change the MOLECULE=MoleculeNAME declaration to whatever molecule you want to rename.
I usually do Esc-X insert-file in EMACS to insert the header (http://zori.aspuru.com/developers/header) file at the top of the XYZ and the footer (http://zori.aspuru.com/developers/footer) at the bottom. Make sure to remove the extra couple lines at the beginning of the XYZ file. Your file should look like this (http://zori.aspuru.com/developers/2-alanine.run).
Afterwards, just use dmpkf and go on from [#dmpkf this point] on.

