1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
|
<html>
<head>
<title>Analysis Tools</title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {color: #0000FF}
-->
</style>
</head>
<body bgcolor="#ffffff">
<hr>
<h1>ABINIT, tutorial on analysis tools:</h1>
<h2>How to use the program <em>cut3d</em> to get more information. </h2>
<hr>
<p>This lesson covers some of the features available in the program <em>cut3d</em>
and how to use other programs (not distributed with the Abinit package) to treat them.
The help file on this program can be view at <a href="../users/cut3d_help.html" target="helpsimg">cut3d_help</a>.
<p>The <em>cut3d</em> program can produce output that can be read by several other programs. At present, the supported programs are:</p>
<ul>
<li>XCrySDen (<a href="http://www.xcrysden.org/">www.xcrysden.org</a>)</li>
<li>Molekel (<a href="http://molekel.cscs.ch/wiki/pmwiki.php">www.cscs.ch/molekel/</a>) </li>
<li>OpenDX (<a href="http://www.opendx.org/">www.opendx.org</a>)</li>
</ul>
<p>All these software are freely available.
XCrySDen and Molekel are complete applications designed to display electronic structure data.
It should be easy to learn how to use them and to have a quick look at your data.
OpenDX is a more general tool to visualize data.
<p> IMPORTANT NOTE : the OpenDX software is not maintained anymore ! Section 3 (and the next sections) have become obsolete.
<p>
It is object oriented and let you "code" the image you want to display.
It is a bit harder to master but once you know how to use it, it is a powerful tool.
Over the years, we have developped a series of macros and modules to treat electronic structure data.
This lesson will concentrate on how to use OpenDX to display Abinit's output. </p>
<p>The <i>cut3d</i> program can be used to treat data in a density file (_DEN),
a potential file (_POT) or a wavefunction file (_WFK).
In this lesson will we see how to use this program to: </p>
<ul>
<li>Obtain the value of the density on a line
<li>View density using OpenDX
<li>View a wavefunction using OpenDX
</ul>
<p>This lesson should take about 1 hour. </p>
<h5>Copyright (C) 2000-2014 ABINIT group (MC,SP) <br>
This file is distributed under the terms of the GNU General Public License, see ~abinit/COPYING or <a href="http://www.gnu.org/copyleft/gpl.txt"> http://www.gnu.org/copyleft/gpl.txt </a>. <br>
For the initials of contributors, see ~abinit/doc/developers/contributors.txt . </h5>
<script type="text/javascript" src="list_internal_links.js"> </script>
<h3><b>Contents of lesson 1:</b></h3>
<ul>
<li><a href="#AT.1">1.</a> Obtaining the density and wavefunctions files for Silicon.</li>
<li><a href="#AT.2">2.</a> Getting the density on a given line.</li>
<li><a href="#AT.3">3.</a> Getting the OpenDX software and the macros and modules for electronic structure.</li>
<li><a href="#AT.4">4.</a> Obtaining the charge density to use with OpenDX.</li>
<li><a href="#AT.5">5.</a> Running OpenDX with a density file.</li>
<li><a href="#AT.6">6.</a> Visualizing Abinit wavefunction with OpenDX.</li>
</ul>
<hr>
<a name="AT.1"></a>
<h3><b>1. Obtain the density and wavefunctions files for Silicon.</b> </h3>
<p>We will first start by a simple example: viewing Silicon density information.
Before using the <em>cut3d</em> program, we first have to generate the density and
the wavefunctions files by running the Abinit program.
For this simple case, we will use the last input file used in <a href="lesson_base3.html#35">lesson 3</a> (tbase3_5.in).
That input file contains two datasets, one to obtain a self-consistent density
and the other to obtain a selected number of k-point wavefunctions.
If you do not have the output of this case, you will need to rerun it, at this stage, this should be fairly easy for you!</p>
<p>The output files that are of interest for us now are: </p>
<pre>tbase3_5o_DS1_DEN
tbase3_5o_DS1_WFK
tbase3_5o_DS2_WFK</pre>
<p><strong>NOTE:</strong> To ask Abinit to output the density, you have to set the input parameter "prtden 1" in the input file as it was done in the first dataset in this example.</p>
<p><strong>NOTE:</strong> In DS1, the self-consistent dataset, we have a good density (file: tbase3_5o_DS1_DEN) which is physically relevant.
Careful, if you run a non-self-consistent job, you may obtain a density but it will not be physical!</p>
<p><strong>NOTE: </strong>The wavefunctions in DS1 (file: tbase3_5o_DS1_WFK) are those of the Monkhorst and Pack grid which are good for self-consistent calculations but often not really inspiring physically. For this reason, we often have to do a non-self-consistent run to get relevant wavefunctions as it is done in this case. The DS2 (file: tbase3_5o_DS2_WFK) contains the interesting wavefunctions that we want to analyse. </p>
<hr>
<a name="AT.2"></a>
<h3><b>2. Getting the density on a given line.</b></h3>
<p>Now we are ready to use the <em>cut3d</em> program.
First we must make sure that we have compiled the program.
If you have run the command "make" in the Abinit main directory, and everything went well,
then you have obtained the <em>abinit</em> program and all the accompanying program, in particular <em>cut3d</em>.
You can obtain only the cut3d program by issuing the command "make cut3d" in the Abinit main directory.</p>
<p>Assuming that we are in the directory Tutorial/Work_tools, and the cut3d program can be accessed by simply typing
its name, now write the command:</p>
<pre>promp% cut3d</pre>
<p>The <em>cut3d</em> program will ask you several questions in order to determine what you want him to do. In this lesson, the text coming from the cut3d program are in black and the input that you have to type in are in <span class="style1">red</span>. </p>
<p>After some text about the version and the licence, you will see the question:</p>
<pre>What is the name of the 3D function (density, potential or wavef) file ? </pre>
<p>You can enter the density file:</p>
<p><span class="style1">tbase3_5o_DS1_DEN</span></p>
<p>You will then see:</p>
<pre> => Your 3D function file is : tbase3_5o_DS1_DEN
Does this file contain formatted 3D ASCII data (=0)
or unformatted binary header + 3D data (=1) ? </pre>
<p>Your answer is <span class="style1">1</span> as generally all output of Abinit are in unformatted binary form.
After you have pressed enter, <em>cut3d</em> prints out a lot of information contained in this file
that explain how that density was obtained.
At this point, you can double check that this is really the file that you want to analyse.
Then you will have the choices:</p>
<pre>
What is your choice ? Type:
1 => point (interpolation of data for a single point)
2 => line (interpolation of data along a line)
3 => plane (interpolation of data in a plane)
4 => volume (interpolation of data in a volume)
5 => 3D formatted data (output the bare 3D data - one column)
6 => 3D indexed data (bare 3D data, preceeded by 3D index)
7 => 3D Molekel formatted data
8 => 3D data with coordinates (tecplot ASCII format)
9 => output .xsf file for XCrysDen
10 => output .dx file for OpenDx
11 => compute atomic charge using the Hirshfeld method
12 => NetCDF file
13 => exit </pre>
<p>As you can see, there are many options available! At the moment, we will do something simple which is getting the density along a given line. </p>
<p>Choose option <span class="style1">2</span>. You will be given the following choices:</p>
<pre>Type 1) for a line between two cartesian-defined points
or 2) for a line between two crystallographic-defined points
or 3) for a line defined by its direction</pre>
<p>Select option <span class="style1">1</span>. You will get the message: </p>
<pre>Type the first point coordinates (Bohrs):
-> X-dir Y-dir Z-dir:</pre>
<p>We will ask for the density along the [111] direction starting from the origin and extending to two unit cell.
For the first point, enter <span class="style1">0 0 0</span>. You will get the message:</p>
<pre>Type the second point coordinates (Bohrs):
-> X-dir Y-dir Z-dir: </pre>
<p>Looking at the input file, we see that the cubic side has a length of 10.217 bohr. To get 2 unit cells, you will enter <span class="style1">20.434 20.434 20.434</span>. You will then be asked for the line resolution.</p>
<pre>Enter line resolution: </pre>
<p>This is how many points are calculated for the line. Typically, you should enter a large number, say <span class="style1">5000</span>. You will then be asked for the file name.</p>
<pre>Enter the name of an output file:</pre>
<p>Enter something meaningful, <span class="style1">si_den_111.dat</span>. </p>
<pre>
More analysis of the 3D file ? (1=default=yes,2=no)</pre>
<p>Enter <span class="style1">2</span> to finish with <em>cut3d</em>. If you do a list of the files in your working directory, you should see the "si_den_111.dat" file. You can look at this file, you will see that this is a simple two columns file. You can visualize it with your favorite plotting software (ex: xmgrace, gnuplot, ...). If you open this file with xmgrace, you will obtain the following graph:</p>
<p align="center"><img src="lesson_analysis_tools/si_den_111.png" width="400"></p>
<p>We can learn quite a lot from this graph. Looking at the input file,
we see that we have a silicon atom at the origin and another 1/4 along the diagonal.
We note also that there is almost no density at the origin.
By doing the line in the [111] direction, we have crossed
the first silicon-silicon bond which we can see as a large density peak indicated by the <span class="style1">red arrows</span>. </p>
<p>By the way, cut3d works with the so-called "trilinear" interpolation of the density. That is, the FFT grid, on which the
density is defined, in real space, leads to a partitioning of the space in small rectangular parallelipipeds, and in each
such parallelipiped, the eight values
of the density on the corner are used to define an interpolation that is linear in each the dimensions of the cube. More explicitely,
let us chose one of the corner as origin, and define reduced coordinates, varying from 0 to 1 inside the parallelipiped,
the density inside the parallelipiped is given by
<pre>
density(dx,dy,dz)=density(0,0,0)+ c100 * dx + c010 * dy + c001 * dz + c110 * dx * dy + c101 * dx * dz + c011 * dy * dz + c111 * dx * dy * dz
</pre>
where the 7 coefficients c100, c010, c001, c110, c101, c011, c111 are to be determined from the knowledge
of the density at the 7 other corners.
<p>This trilinear interpolation guarantees that the overall function of space is continuous, but do not guarantee
that the derivatives change continuously. This is seen in the above figure, as the two abrupt changes of slopes,
close to the maximum. These are completely spurious features, that can be avoided is a finer FFT grid is used to determine
the density. Actually, the density profile along the bond, with a fine FFT grid, behave quite smoothly,
and reach its maximum at the mid point between the two atoms, in contrast to the figure presented previously.
<p><strong>NOTE: </strong>An important point to remember when doing visualization of density obtained with a pseudopotential calculation is that the core charge is not included! This is the reason why we use pseudopotential and the charge we get is only the valence charge. It is possible to include some of the core charge by doing calculations using pseudos with partial core charge. The fact that the core charge is missing means that there is no charge at the nucleus of our atoms. This means that we are getting low density at the nucleus center and we have to remember that this is not a physical effect! The location of the silicon atoms have been indicating by <span class="style2">blue arrows</span>. </p>
<hr>
<a name="AT.3"></a>
<h3><b>3. Getting the Opendx software and the macros and modules for electronic structure.</b> </h3>
<h4>The OpenDX software:</h4>
<p> IMPORTANT NOTE : the OpenDX software is not maintained anymore ! This section 3 and the next sections have become obsolete.
<p>On the OpenDX web site, in the download section (<a href="http://www.opendx.org/download.html">www.opendx.org/download.html</a>), you can obtain quite a few binaries for different platforms.
For Mac OS, the package might be available from the
Fink utility Web site (http://www.finkproject.org).
<p>There are a number of tutorials on the web where you can get introduce to OpenDX. Do a Google search with "OpenDX tutorial" and you will find quite a few. If you find one particularly useful, let us know so that we can indicate it here for future users. </p>
<h4>Obtaining and compiling the modules and macros for electronic structure:</h4>
<p>The modules and macros that we have developped for electronic structure calculations are not part of the Abinit package as they can be use by other program. We have provided a version of these modules and macros with this lesson, see the file <a href="ftp://www.abinit.org/pub/abinitio/ElectStruc_OpenDX_dist.tar.gz">ElecStruc_OpenDX_dist.tar.gz</a>.
<p>Gunzip and untar this file. In the README file, you will find all the information on how to compile the modules. </p>
<hr>
<a name="AT.4"></a>
<h3>4. Obtaining the charge density to use with OpenDX.</h3>
<p>Before we can use the OpenDX software, we have to use <em>cut3d</em> to get the data in a form so that OpenDX will understand it. We have implemented an option in cut3d to write the charge density in NetCDF format which has the advantage to be compact and fast to access as well as being portable to any architecture.</p>
<p>Rerun the cut3d program as in section <a href="#AT.2">2</a> but now choose option 12 to produce a NetCDF file of the charge density. Cut3d will ask you for the name of the file you want, enter <span class="style1">si_den</span>. You will have the possibility to add a title to this NetCDF file. Then, quit the <em>cut3d</em> program. </p>
<hr>
<h3><a name="AT.5"></a> 5. Running OpenDX with a density file
</h3>
<p>In the main directory of the ElecStruc_OpenDX_dist, start OpenDX with the command:</p>
<pre>prompt% ./dxstart </pre>
<p>If everything goes well, you should see this window:</p>
<p align="center"><img src="lesson_analysis_tools/opendx_vpe1.png" width="80%"></p>
<p>You have in front of you an OpenDX Visual Program. In OpenDX, you have to program the image you want to see. Fortunately, OpendDX is fully object oriented and with a couple of examples, you will be able to explore the possibilities of OpenDX. </p>
<p>A Visual Program in OpenDX can be divided in many sections as is this one. The different sections can be accessed by the tabs on top. Press on the 'atomcoord' tab marked by a <span class="style1">red arrow</span> in the above figure. You will see a different section of this Visual Program:</p>
<p align="center"><img src="lesson_analysis_tools/opendx_vpe2.png" width="80%"></p>
<p>We now have to edit this Visual Program to access our silicon charge density. Double clic on the 'FileSelector' box marked by the <span class="style1">red arrow</span>. You will see the Control Panel with all the parameters that you can set.</p>
<p align="center"><img src="lesson_analysis_tools/opendx_cp1.png" width="80%"> </p>
<p>Now you can press on the '...' next to the red arrow and move through the files to select the 'si_den.nc' file that we have created above. It turns out that this package is sent with the same file and it is located in the 'data' directory given. In general, you will put your own file there. </p>
<p>Now, go to the 'Execute' menu and select 'Execute once', you should see a 3x3x3 supercell of Silicon atoms, e.g. a lot of green spheres (Everyone knows that Silicon is green!). You will not see bonds on this figure. To see the bonds, go to the box on the Control Panel window where you can set the variable 'max_band_length', marked by a <span class="style2">blue arrow</span> and set it to 3. The unit is in Angstroms. Go to the 'Execute' menu and 'Execute once' again. The bonds should appear.</p>
<p>Now, on the 'import' tab of the Visual Program, the first window that appeared, locate the box 'Sequencer' and double clic on it. You will see the following window: </p>
<p align="center"><img src="lesson_analysis_tools/opendx_sequencer_control.png" width="487" height="109"></p>
<p>Press on the Play button (triangle) and watch the 'Image' window. You can stop the animation by pressing the Stop button (square). </p>
<p>With the animation stopped, press the 'Options' menu of the 'Image' window and select 'View control ...'. You will see this window appear:</p>
<p align="center"><img src="lesson_analysis_tools/opendx_view_control.png" width="301" height="235"></p>
<p>In the Mode selector, choose 'Rotate'. Now with the mouse over the image, you will be able to rotate the image. You can select the 'Execute on change' in the 'Execute' menu to see the image rotates in real time, if your processor is fast enough to follow your motion!</p>
<p>You can play with this Visual Program and learn more how to use the OpenDX softwave. In the next section, we will see how to visualize wavefunctions produced by Abinit.</p>
<hr>
<h3><a name="AT.6"></a> 6. Visualizing Abinit wavefunctions with OpenDX</h3>
<p>The first thing to do is to get the data from the WFK file with <em>cut3d</em>. Start <em>cut3d</em> as before but this time enter the wavefunction file of the second dataset (tbase3_5o_DS2_WFK). Answer all the questions and select k-point 11 and band 4, which is the Gamma point and the top valence state. Next, cut3d will ask you if you want an analysis of angular projection for that state:</p>
<pre>Do you want the atomic analysis for this state :
(kpt,band)= (11 4)?
If yes, enter the radius of the atomic spheres, in bohr
If no, enter 0 </pre>
<p>Go ahead and try it, choose a radius of 2 bohrs. Follow the analysis and you should see that this state is mostly of character <em>p</em> as it should! </p>
<p>Next, you will be given the choice of several options, select option 12 to produce a NetCDF file that you will be able to image in OpenDX. You will have to enter a file name, cut3d automatically add the the information about the k-point, band and spin to the file name and you will have the possibility to add a title to the NetCDF file.</p>
<p>In OpenDX, go to the 'File' menu and select 'Open program...'. You will have the option to save the program you were working on and then a window will appear where you will select another Visual Program. Select the 'wfkphase.net' Visual Program. The advance feature of this Visual Program is that it adds the Block phase to Abinit ouput.</p>
<p>Now you have the choice to run this program with the default values in which case you will see an image of the HOMO state of poly(para-phenylenevinylene) polymer, or in the 'Control Panel' select the file that you have just produce. You will have to adjust the parameters to contruct a nice image of the wavefunction.</p>
<p>A lot more can be said on how to use OpenDX with Abinit outputs. We hope that this brief introduction will have shown you some of the features available. Enjoy! </p>
<p> </p>
<script type="text/javascript" src="list_internal_links.js"> </script>
</body>
</html>
|