-
Notifications
You must be signed in to change notification settings - Fork 18
/
FPoptbas.html
executable file
·237 lines (212 loc) · 10.2 KB
/
FPoptbas.html
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
<HTML><HEAD><TITLE>LMTO-FP extension package (v6.14) </TITLE></HEAD><BODY bgcolor="#cccccc">
<H1><B><FONT size="+2">FP tutorial to demonstrate optimization of basis (v6.14)</FONT></B></H1>
This tutorial uses the SrTiO3 input file <A
href="FPsamples/ctrl.srtio3">ctrl.srtio3</A> found in directory
`doc/fp/samples.' (Output files are also in this directory.) It
assumes you have read the <A href="fp.html">FP documentation</A> and
the <A href="lmto.html">ASA documentation</A>. This tutorial's
purpose is limited to demonstration of the automatic basis
optimization option in lmf. It assumes that you have gone through the
basic <A href="FPtutorial.html">FP tutorial</A> and <A
href="ASAtutorial.html">ASA tutorial</A>.
<BR><BR> To follow this tutorial, start in the top-level directory.
Copy file <A href="FPsamples/ctrl.srtio3">doc/FPsamples/ctrl.srtio3</A> to
this directory.
In addition to making each sphere self-consistent, program
<strong>lmfa</strong> also finds parameters RSMH and EH for each
occupied orbital of each free atom, by minimizing the free-atom total
energy. While this is not in general an optimum basis for the solid,
it provides a reasonable choice, and thus a reasonable starting guess.
You may tell <strong>lmf</strong> to read parameters of a basis from a
separate input file, overriding the parameters specified in the ctrl
file. Do this using token <TT> --rdbasp[:fn=name]. </TT> The part in
brackets is optional, to specify which file the parameters are to be
read from. If you don't specify a name, <strong>lmf</strong> uses
file <TT> basp </TT> (an extension is automatically appended to the
name)
In this case, we will use as starting values parameters generated by
<strong>lmfa</strong>, which stores the data in file
<TT> atm.srtio3 </TT>.
Note that the input file uses local orbitals for the Ti
<EM>p</EM> and Sr <EM>p</EM> orbitals. (see input files, tokens
<TT> PZ=0,4.9 </TT> for Sr and <TT> PZ=0,3.9 </TT> for Ti.
<BR><BR> We begin by invoking <strong>lmfa</strong> : <pre>
lmfa srtio3 </pre>
which makes each sphere self-consistent, and stores the
free-atom data in file <TT> atm.srtio3 </TT> along with the parameters
RSMH and EH it determined for the free atom. The latter data is found
at the end of file <TT> atm.srtio3 </TT>: <pre>
BASIS:
Sr RSMH= 3.1 1.185 1.873 -1 EH= -0.114 -1.202 -0.1 0
Ti RSMH= 2.335 0.815 1.137 -1 EH= -0.12 -2.057 -0.1 0
O RSMH= 0.854 0.767 -1 EH= -1.289 -0.33 0
</pre>
Note that the starting values EH for the Sr and Ti <EM>p</EM> orbitals
are very deep. This is because turning on local orbitals in these
channels causes <strong>lmfa</strong> to treat these channels (Sr 4p
and Ti 3p) as valence states. <strong>lmfa</strong> also restricts
RSMH not to exceed the MT radius for any orbital; that is why RSMH for
the Sr <EM>s</EM> orbital is 3.1. <BR><BR>
At this point we can carry out an optimization by minimizing
the total energy using the Harris-Foulkes functional of the
(non-self-consistent) density constructed out of a superposition of
free-atom densities (Mattheis construction). Instead of doing that,
let's make the density self-consistent using the basis generated by
<strong>lmfa</strong>. We use a very small number of
<EM>k</EM>-divisions because we are only interested in a potential
resembling the potential of the crystal, for purposes of finding an
optimum basis. The Mattheis construction for oxides is a little too
crude because of the large charge transfer effects. <pre>
lmf -vnk=2 srtio3 --rdbasp:fn=atm </pre>
The output can be found in <A href="FPsamples/out.srtio3.lmf0">out.srtio3.lmf0</A>.
<BR><BR>
Now we can optimize the basis using this (approximately
self-consistent) density. Once again, there is little point in
converging everything to a high precision. We use 2 <EM>k</EM>-divisions
as before. To tell <strong>lmf</strong> to optimize the basis, use a
command-line switch <TT>--optbas</TT>. When <TT>--optbas</TT> is
invoked, <strong>lmf</strong> will not attempt to make the output
density, but instead just computes the Harris-Foulkes total energy
while varying basis parameters you specify until an optimum is
reached. The optimizer is not sophisticated; it minimizes the energy
varying one parameter at a time, running through all the parameters you
specify. This means that the order of optimization matters somewhat,
though in practice it doesn't seem to matter much. The syntax for
optimization is <pre>
--optbas[:sort]:spec=spec-name[,rs][,e][,l=list]:spec=...
</pre>
Some notes about the syntax of --optbas:
<OL>
<LI> At least one species must be specified. For example, for species
O, use <TT>:spec=O</TT>
<BR><BR>
<LI> You tell lmf whether to optimize wrt to RSM by using <TT>,rs</TT>
or EH by using <TT>,e</TT>. You can specify both by e,g. for
species O, use <TT>:spec=O,rs,e,...</TT>
<BR><BR>
<LI> You specify which <EM>l</EM> orbitals to optimize with the ,l=list.
Here list consists of a list of integers strung together. For
example, to optimize the O RSM for both <EM>s</EM> and <EM>p</EM> orbitals, use
<TT>:spec=O,rs,l=01</TT>.
<BR><BR>
<LI> Optional <TT>:sort</TT> tells <strong>lmf</strong> to choose for
itself the order in which parameters are taken for optimization.
It will pick smoothing radii first, because usually the total
energy is more sensitive to RSMH than to EH. It orders the
parameters from smallest (which correspond to more atomic-like
states) to largest because the total energy is more sensitive to
small-RSM orbitals.
<BR><BR>
</OL>
Just for fun, let's optimize wrt most of the orbitals we have.
(With only 1 irreducible <EM>k</EM>-point, <strong>lmf</strong>
runs pretty fast.) Note that we still need to read the basis from file atm. <pre>
lmf -vnk=2 srtio3 --optbas:sort:spec=O,rs,e,l=01:spec=Ti,rs,e,l=012:spec=Sr,rs,e,l=012 --rdbasp:fn=atm
</pre>
Early in the output you should see the following table: <pre>
LMFOPB: optimizing energy wrt 16 parameters:
spec l type start
3:O 1 rsm 0.767
2:Ti 1 rsm 0.815
3:O 0 rsm 0.854
2:Ti 2 rsm 1.137
1:Sr 1 rsm 1.185
1:Sr 2 rsm 1.873
2:Ti 0 rsm 2.335
1:Sr 0 rsm 3.100
2:Ti 1 eh -2.057
3:O 0 eh -1.289
1:Sr 1 eh -1.202
3:O 1 eh -0.330
2:Ti 0 eh -0.120
1:Sr 0 eh -0.114
2:Ti 2 eh -0.100
1:Sr 2 eh -0.100
</pre>
<strong>lmf</strong> optimizes the total energy wrt each variable, in
order shown. (lmf changed the order because of the <TT>:sort</TT> option).
The output can be found in <A href="FPsamples/out.srtio3.lmfopt">out.srtio3.lmfopt</A>.
<BR><BR>
The part of the <A href="FPsamples/out.srtio3.lmfopt">output</A>
connected with basis optimization can be found in lines beginning with
<TT>LMFOPB:</TT>, e.g. <pre>
LMFOPB: continue optimization of var #2, species Ti val=0.888867
MNBRAK: found=T x,f= 0.81500000 -2.65965498
MNBRAK: found=T x,f= 1.01500000 -2.65785139
MNBRAK: found=T x,f= 0.93860680 -2.65933813
MNBRAK: found=T x,f= 0.86163389 -2.65967351
BRENT: found=T x,f= 0.88886657 -2.65963089
LMFOPB: var #2 converged in 5 iterations to 0.862: ehf=-2.659674 ... writing file basp
</pre>
After optimization is complete, lmf will (1) write the optimized basis
to file <TT>basp.srtio3</TT>, (2) print out how much the energy
changed on account of the optimization: <pre>
LMFOPB: before optimization ehf=-2.5815. After optimization ehf=-2.7009
</pre>
and exit.
<BR><BR>
You might repeat this optimization, since the optimization
consisted of a series of independent optimizations one followed after
another. In that case, don't read the basis from the file
<TT>atm</TT> but from file <TT>basp</TT>: <pre>
lmf -vnk=2 srtio3 --optbas:sort:spec=O,rs,e,l=01:spec=Ti,rs,e,l=012:spec=Sr,rs,e,l=012 --rdbasp
</pre>
After the second optimization, the energy changes to:
<pre>
LMFOPB: before optimization ehf=-2.7011. After optimization ehf=-2.7203
</pre>
Repeating the optimization still once more lowers the energy slightly:
<pre>
LMFOPB: before optimization ehf=-2.7211. After optimization ehf=-2.7267
</pre>
File basp contains a reasonably optimized basis:
<pre>
BASIS:
Sr RSMH= 3.1 1.345 2.013 EH= -0.02 -1.175 -0.518
Ti RSMH= 0.9 0.962 1.142 EH= -0.02 -2.597 -0.411
O RSMH= 0.922 0.802 EH= -1.104 -0.02
</pre>
It is interesting to compare this basis to the initial one selected by
<strong>lmfa</strong>.
<BR><BR>
You can use your text editor to cut and paste this basis into your
ctrl file. Alternatively you can carry around file <TT>basp.srtio3</TT> and
always remember to invoke <strong>lmf</strong> with <TT>--basp</TT>.
<BR><BR>
The procedure just outlined has the advantage that it is completely
automatic. However, there are a couple of pitfalls. There is a
possibility that it will get stuck in local minima. Also, some
orbitals, e.g. the Sr <EM>d</EM> orbital and the O <EM>p</EM> orbitals
have no occupation in the free atom, so they were left out of the
basis. They do, however, contribute in a non-negligible way to the
energy. Optimizing the basis with these orbitals included generates
the following
<pre>
BASIS:
Sr RSMH= 0.948 1 1.847 1 EH= -0.086 -1.046 -0.347 -0.1
Ti RSMH= 1 0.8 1.052 0 EH= -0.073 -2 -0.279 0
O RSMH= 0.899 0.8 2.4 EH= -0.956 -0.065 -0.1
</pre>
This was obtained by using the basis supplied by the input file, and
optimizing it:
<pre>
lmf -vnk=2 srtio3 --optbas:sort:spec=O,rs,e,l=01:spec=Ti,rs,e,l=012:spec=Sr,rs,e,l=012
</pre>
It produced
<pre>
LMFOPB: before optimization ehf=-2.7507. After optimization ehf=-2.7607
</pre>
One could go further, choosing a still larger basis (one is supplied
by the input file, which is used if you invoke <strong>lmf</strong>
with <TT>-vbigbas=t</TT>)
<pre>
lmf -vnk=2 srtio3 --optbas:sort:spec=O,rs,e,l=01:spec=Ti,rs,e,l=012:spec=Sr,rs,e,l=012 -vbigbas=t
</pre>
which produced
<pre>
LMFOPB: before optimization ehf=-2.7711. After optimization ehf=-2.7888
</pre>
This energy (-2.7888 Ry), is not so much larger than the minimal-basis energy
(-2.7267) --- it is deeper by 12 mRy/atom. Thus, the minimal basis is
quite reasonable.
</HTML>