この文章のオリジナルは https://gist.github.com/t-nissie/4edcf8d62144b4d77f5c に置いてある。
使用するパソコンはIntel Core i5程度のノートパソコンで十分。
cpa2002v009c.tgz
のAugust 26, 2015版を
http://kkr.phys.sci.osaka-u.ac.jp/jp/
から入手した。
$ md5sum cpa2002v009c.tgz | grep 798c7f8175032d2f55137bed49d15409
MD5 (cpa2002v009c.tgz) = 798c7f8175032d2f55137bed49d15409
gfortranでコンパイルできるようにパッチcpa2002v009c.patchをあてる。
tar xf cpa2002v009c.tgz
mv cpa2002v009c/ cpa2002v009c.2015-08-26
cd cpa2002v009c.2015-08-26/
patch -p1 -b < /SOMEWHERE/cpa2002v009c.patch
make
make gpd
make spc
cd util/
gfortran -o fmg fmg.f
cd ..
./specx < in/fe >> data/fe.out; cat data/fe.out
sed -e 's/go/dos/' -e 's/ 4 / 8 /' in/fe > in/fe.dos
./specx < in/fe.dos > data/fe.dos
cat data/fe.info
5.2700 -2522.8176206 2.16492 ←SCF計算の正確な値
5.2700 -2518.5344701 0.17646 ←DOSの計算の不正確な値
./gpd data/fe.dos
まず、さきほどの鉄の計算を元にスピンが反対向きのサイト用のポテンシャルを用意する。
cd util
cat inputsample
./fmg < inputsample
cd ..
diff -u in/fe in/fe_lmd
./specx < in/fe_lmd >> data/fe_lmd.out; cat data/fe_lmd.out
./specx < in/fe_lmd >> data/fe_lmd.out; cat data/fe_lmd.out # 収束しなかったのでもう一回
cat data/fe_lmd.info # スピンモーメントが0になっていることを確認
平均場近似 Tc=(2/3)(E_LMD-E_Ferro)/k_B [K], where k_B=6.3336E-6 (Ry/K) で
(/ (* (- -2522.8055945 -2522.8176206) 0.66666666666666666) 6.3336E-6)
1265.851964099398
コバルトでもできるはず。 ニッケルは縦揺らぎ(スピンの伸び縮み)が大きいのであまり正確でないTcがでるかも。 逆?
in/fe_h
を使う。濃度を0%にして計算する。
cmd2% run "specx < in/fe_h"
cmd2% run "specx < in/fe_h"
cmd2% run "specx < in/fe_h" # 10e-6に収束するまで計算する。
:
*** type-Fe H (z= 1.0) ***
core charge in the muffin-tin sphere = 0.0000000
valence charge in the cell (spin up ) = 0.24232(s) 0.11719(p) 0.03840(d)
valence charge in the cell (spin down) = 0.27799(s) 0.14372(p) 0.03678(d)
total charge= 0.85640 valence charge (up/down)= 0.39791 0.45849
spin moment= -0.06057 orbital moment= 0.00000
:
水素の位置をずらすこともできるらしい。
See H. Akai et al.: progress in theoretical physics Suppl. vol.101 p.11 (1990).
in/co
。hcp
って指定するけど、本当は六方格子で、unit cell中に2つ原子をおくことに注意。
atmicxにa,b,cをつけ忘れないこと。
cmd2% run "specx < in/co"
cmd2% run "specx < in/co"
cmd2% run "specx < in/co"
cmd2% run "specx < in/co"
in/co
編集
cmd2% run "specx < in/co > data/co.dos"
cmd2% ./gpd data/co.dos
Masafumi Shirai et al.: JJAP 39 L1118 (2000).
Positive electrode (LiCoO2): CoO2 + Li+ + e- → LiCoO2 Negative electrode (graphite): Li → Li+ + e-
Coは高価 2000, 6,000, 400 310 30-60 8000
% run "specx < in/licoo2 >> data/licoo2.out" ; grep err data/licoo2.out
% run "specx < in/licoo2 >> data/licoo2.out" ; grep err data/licoo2.out
% run "specx < in/licoo2 >> data/licoo2.out" ; grep err data/licoo2.out
% run "specx < in/licoo2 >> data/licoo2.out" ; grep err data/licoo2.out
% run "specx < in/licoo2 >> data/licoo2.out" ; grep err data/licoo2.out # 収束するまで繰り返す
LiCoO3: -3096.74712993 Ry
% run "specx < in/li >> data/li.out" ; grep err data/li.out
% run "specx < in/li >> data/li.out" ; grep err data/li.out
% run "specx < in/li >> data/li.out" ; grep err data/li.out
Li: -14.8370012
% run "specx < in/vccoo2 >> data/vccoo2.out" ; grep err data/vccoo2.out
VcCoO3: -3081.6365328 Ry
起電力は? -V = Etot(LiCoO2) - Etot(CoO2) - Etot(Li) = -3096.74712993 + 14.8370012 + 3081.6365328 = -0.27359 Ry = -3.72 eV
比較するときはmxlは同じにする。
% diff -u in/licoo2 in/vccoo2
--- in/licoo2 2015-08-25 11:54:34.000000000 +0900
+++ in/vccoo2 2016-03-04 09:30:25.143318378 +0900
@@ -1,5 +1,5 @@
-c----------------------LiCoO2--------------------------------
- go data/licoo2
+c----------------------VcCoO2--------------------------------
+ go data/vccoo2
c------------------------------------------------------------
c brvtyp a c/a b/a alpha beta gamma
rhb 9.373 , , , 32.97 , , ,
@@ -14,8 +14,8 @@
3
c------------------------------------------------------------
c type ncmp rmt field mxl anclr conc
- Li 1 1 0.000 2
- 3 100
+ Vc 1 1 0.000 2
+ 0 100
Co 1 1 0.000 2
27 100
O 1 1 0.000 2
@@ -26,7 +26,7 @@
c------------------------------------------------------------
c atmicx atmtyp
0 , 0 , 0 , Co
- 0.5a , 0.5b , 0.5c , Li
+ 0.5a , 0.5b , 0.5c , Vc
0.26a , 0.26b , 0.26c , O
0.74a , 0.74b , 0.74c , O
c------------------------------------------------------------
Oの2pを積分に入れるか入れないかを注意。
-798.8252139
100% -5.90
10% -3.86
./specx < in/gaas >> data/gaas.out; grep err data/gaas.out
下記のgp5d.fを使った。
sed -e 's/go/dos/' -e 's/ 4 / 8 /' in/gaas > in/gaas.dos
./specx < in/gaas.dos >> data/gaas.dos
SOMEWHERE/gp5d data/gaas.dos
cp data/gaas.plt data/gaas.gp
data/gaas.gp
を適宜編集してPDOSを描く。
grep -A 201 'DOS of component 1' gaas-nmag.dos | tail -n 201 | ruby -e 'load "interpolations.rb"; load "integrations.rb"; d = DataSet.new(STDIN,0,1); printf "%.3f\n", (-1.1250..0.0).simpson(100){|x| d.linear_interpolation(x)}'
Total 9.0
Ga s 0.407 p 0.331 d 3.320
As s 0.680 p 0.927 d 0.020
keyword: Fermi contact interaction
gp5d.f は gpd.f replacement。特徴は
- 独自サブルーチン
lftfil()
を標準内部関数に置き換え:subroutine lftfil(file)
→adjustl(file)
- 独自サブルーチン
chleng()
を標準内部関数に置き換え:subroutine chleng(a,ln)
→len_trim(file)
- インラインデータとしてGNUPLOT 5の新機能の
$u << EOF
の導入。PDOSのプロットに便利。 - 不正でないEPSファイルの出力:
set terminal postscript landscape
→set terminal postscript eps
- PostScript標準フォント(欧文基本14フォント)への置き換え:
arial
→Times-Roman
- シバンの書き換え:
#!/usr/bin/gnuplot
→#!/usr/bin/env gnuplot
-*-Gnuplot-*-
for Emacs