Skip to content

Commit

Permalink
finish test 00,01,02,03
Browse files Browse the repository at this point in the history
  • Loading branch information
weilinscenccs committed Apr 5, 2024
1 parent 3500274 commit c2ab469
Show file tree
Hide file tree
Showing 99 changed files with 5,986 additions and 47 deletions.
186 changes: 186 additions & 0 deletions content/00lectures.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,189 @@


## Basic About How to Run EMTO Code

|exe |function|
|--------|---|
|bmdl |Calculates the Madelung potentials|
|kstr |Computes the energy dependent slope matrix in real space.|
|shape |Computes the so called shape function, which transforms any integral over the unit cell into an integral over a sphere surrounding the unit cell.|
|kgrn_cpa|Solves the actual self-consistent Kohn-Sham equations And calculate the Full charge density|
|kfcd_cpa|Evaluate the total energy functional from the full charge density generated by kgrn|

### Running dependence of EMTO subprograms

```{image} img/001.svg
:width: 400px
:align: center
```

Commands to run the code looks like:
```
exe < input
```

#### Exercise 00

```bash
tree 00

```


```{caution}
EMTO input files have very strict format, an extra space may cause some problems.
```
#### KSTR

```{code-block}
:caption: The input file (kstr/fcc.dat) of kstr for the *fcc* primitive cell
:emphasize-lines: 2,3,4,8,9,13
:lineno-start: 1
KSTR HP......=N 22 Jan 08
JOBNAM...=fcc MSGL.= 1 MODE...=B STORE..=Y HIGH...=Y
DIR001=smx/
DIR006=./
Slope matrices, fcc (spdf), (kappa*w)^2= 0.0
NL.....= 4 NLH...=11 NLW...= 9 NDER..= 6 ITRANS= 3 NPRN..= 0
(K*W)^2..= 0.000000 DMAX....= 1.7000 RWATS...= 0.10
NQ3...= 1 LAT...= 2 IPRIM.= 0 NGHBP.=13 NQR2..= 0
A........= 1.0000000 B.......= 1.0000000 C.......= 1.0000000
BSX......= 0.5000000 BSY.....= 0.5000000 BSZ.....= 0.0000000
BSX......= 0.0000000 BSY.....= 0.5000000 BSZ.....= 0.5000000
BSX......= 0.5000000 BSY.....= 0.0000000 BSZ.....= 0.5000000
QX(IQ)...= 0.0000000 QY......= 0.0000000 QZ......= 0.0000000
a/w(IQ)..= 0.70 0.70 0.70 0.70
LAMDA....= 2.5000 AMAX....= 4.5000 BMAX....= 4.5000
```

A part of the input file of `kstr` describes the lattice informations:
- Total number of sites is set by NQ3.
- The symmetry is set by `LAT`, more in the [online manual](https://emto.gitlab.io/manual/manual.html#kstr).
- The lattice parameters are renormalized to the length of first lattice vector A (`A=1`).
- **Cartesian Coordinates** are used for sites/"atom" with `QX,QY,QZ`.

Commands for run the `kstr`:
- `DIR006=./` and `JOBNAM...=fcc`: a file `fcc.prn` will be generated in the current directory.
- `DIR001=smx`: "slop matrix" will save to `smx/fcc.tfh`.

```
kstr < fcc.dat
```

Or add `time` in front to have a feeling about the how much time each code consumes:

```bash
time kstr < fcc.dat
```

`MSGL.= 0` silence the screen printing.

#### BMDL

```{code-block}
:caption: The input file (bmdl/fcc.dat) of `bmdl`
:emphasize-lines: 2,3,8,9,10,11,12,13
:lineno-start: 1
BMDL HP......=N 22 Jan 08
JOBNAM...=fcc MSGL.= 1 NPRN.= 0
DIR001=mdl/
DIR006=
Madelung potential for fcc bulk
NL.....= 7
LAMDA....= 2.50 AMAX....= 4.50 BMAX....= 4.50
NQ....= 1 LAT...= 2 IPRIM.= 0 NQR2..= 0
A........= 1.0000000 B.......= 1.0000000 C.......= 1.0000000
BSX......= 0.5000000 BSY.....= 0.5000000 BSZ.....= 0.0000000
BSX......= 0.0000000 BSY.....= 0.5000000 BSZ.....= 0.5000000
BSX......= 0.5000000 BSY.....= 0.0000000 BSZ.....= 0.5000000
QX(IQ)...= 0.0000000 QY......= 0.0000000 QZ......= 0.0000000
```

The Lattice information must be consistent with `kstr`, and the output files will be `./fcc.prn` and `mdl/fcc.mdl`

#### SHAPE

The input file (shape/fcc.dat) for `bmdl` contains similar lattice information as `kstr`:

```{code-block}
:emphasize-lines: 2,3,4
:lineno-start: 1
HAPE HP......=N 22 Jan 08
JOBNAM...=fcc MSGL.= 1
FOR001=../kstr/smx/fcc.tfh
DIR002=shp/
DIR006=./
Lmax..= 30 NSR..=129 NFI..= 11
NPRN..= 0 IVEF.= 3
```

`FOR001=../kstr/smx/fcc.tfh` shows `shape` needs the "slop matrix" from the result of `kstr`.
The output will be `shp/fcc.shp`.

```{hint}
`kstr,bmdl` and `shape` only contains lattice information with a reduced unit,
They could be reused for any system which present with same lattice setup.
```

#### KGRN


```{code-block}
:emphasize-lines: 2,4,8,10,24,26
:lineno-start: 1
KGRN 13 Oct 12
JOBNAM=cu
STRT..= A MSGL.= 0 EXPAN.= S FCD..= Y FUNC..= SCA
FOR001=../kstr/smx/fcc.tfh
FOR001=../kstr/smx/fcc30.tfh
DIR002=pot/
DIR003=pot/
FOR004=../bmdl/mdl/fcc.mdl
DIR006=
DIR009=pot/
DIR010=chd/
DIR011=/tmp/
Self-consistent KKR calculation for fcc Cu
Band: 10 lines
NITER.= 50 NLIN.= 31 NPRN.= 0 NCPA.= 7 NT...= 1 MNTA.= 1
MODE..= 3D FRC..= N DOS..= N OPS..= N AFM..= P CRT..= M
Lmaxh.= 8 Lmaxt= 4 NFI..= 31 FIXG.= 2 SHF..= 0 SOFC.= N
KMSH...= G IBZ..= 2 NKX..= 0 NKY..= 13 NKZ..= 0 FBZ..= N
KMSH2..= G IBZ2.= 1 NKX2.= 4 NKY2.= 0 NKZ2.= 51
ZMSH...= C NZ1..= 16 NZ2..= 8 NZ3..= 8 NRES.= 4 NZD.=1500
DEPTH..= 1.000 IMAGZ.= 0.020 EPS...= 0.200 ELIM..= -1.000
AMIX...= 0.100 EFMIX.= 1.000 VMTZ..= 0.000 MMOM..= 0.000
TOLE...= 1.d-07 TOLEF.= 1.d-07 TOLCPA= 1.d-06 TFERMI= 500.0 (K)
SWS......=2.686842 NSWS.= 1 DSWS..= 0.05 ALPCPA= 0.6020
Setup: 2 + NQ*NS lines
EFGS...= 0.000 HX....= 0.100 NX...= 5 NZ0..= 6 STMP..= N
Symb IQ IT ITA NZ CONC Sm(s) S(ws) WS(wst) QTR SPLT Fix
Cu 1 1 1 29 1.000 1.000 1.000 1.000 0.0 0.0 N
Atom: 4 lines + NT*NTA*6 lines
IEX...= 4 NP..= 251 NES..= 15 NITER=100 IWAT.= 0 NPRNA= 0
VMIX.....= 0.300000 RWAT....= 3.500000 RMAX....= 20.000000
DX.......= 0.030000 DR1.....= 0.002000 TEST....= 1.00E-12
TESTE....= 1.00E-12 TESTY...= 1.00E-12 TESTV...= 1.00E-12
Cu
Iz= 29 Norb= 10 Ion= 0 Config= 3d10_4s1
n 1 2 2 2 3 3 3 3 3 4
Kappa -1 -1 1 -2 -1 1 -2 2 -3 -1
Occup 2 2 2 4 2 2 4 4 6 1
Valen 0 0 0 0 0 0 0 1 1 1
```
- need `chd` and `pot` folder to be exist.
- `JOBNAM=cu` will decide the output files start with `cu`: cu.prn, chd/cu.chd, pot/cu.pot …
- `FOR001=../kstr/smx/fcc.tfh` and `FOR004=../bmdl/mdl/fcc.mdl`.
- `IBZ..= 2` should consistent with `LAT=2` in `kstr` and `bmdl` for `fcc`.
- `NITER.= 50`, `TOLE...= 1.d-07 TOLEF.= 1.d-07`, \
check with `egrep "erre|Converged|NOS|Finished" cu.prn`.
- `AMIX...= 0.100` mixing factor for new charge.
- `SWS......=2.686842`: The average Wigner-Seitz radius (bohr) to scale the lattice.

```{math}
N(\epsilon_F)=\frac{1}{2\pi i}\oint_{\epsilon_F} G(z)~dz
```
```{image} img/contour_dos.svg
:width: 800px
:align: center
```
1 change: 0 additions & 1 deletion content/01eqs.md

This file was deleted.

2 changes: 1 addition & 1 deletion content/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ class TypealongDirective(_BaseCRDirective):

def setup(app):
for obj in DIRECTIVES:
app.add_directive(obj.cssname(), obj)
app.add_directive(obj.get_cssname(), obj)
11 changes: 11 additions & 0 deletions content/exercise/00/bmdl/fcc.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
BMDL HP......=N 22 Jan 08
JOBNAM...=fcc MSGL.= 1 NPRN.= 0
DIR001=mdl/
DIR006=
Madelung potential for fcc bulk
NL.....= 7
LAMDA....= 2.50 AMAX....= 4.50 BMAX....= 4.50
NQ....= 1 LAT...= 2 IPRIM.= 1 NQR2..= 0
A........= 1.000 B.......= 1.000 C.......= 1.000
ALFA.....= 90.0 BETA....= 90.0 GAMMA...= 90.0
QX(1)....= 0.0 QY(1)...= 0.0 QZ(1)...= 0.0
10 changes: 10 additions & 0 deletions content/exercise/00/kfcd/cu.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
KFCD MSGL..= 1 22 Jan 08
JOBNAM...=cu
STRNAM...=fcc
DIR001=../kstr/smx/
DIR002=../kgrn/chd/
DIR003=../shape/shp/
DIR004=../bmdl/mdl/
DIR006=./
Lmaxs.= 30 NTH..= 41 NFI..= 81 FPOT..= N
OVCOR.= Y UBG..= N NPRN.= 0
39 changes: 39 additions & 0 deletions content/exercise/00/kgrn/cu.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
KGRN 13 Oct 12
JOBNAM=cu
STRT..= A MSGL.= 0 EXPAN.= S FCD..= Y FUNC..= SCA
FOR001=../kstr/smx/fcc.tfh
FOR001=../kstr/smx/fcc30.tfh
DIR002=pot/
DIR003=pot/
FOR004=../bmdl/mdl/fcc.mdl
DIR006=
DIR009=pot/
DIR010=chd/
DIR011=/tmp/
Self-consistent KKR calculation for fcc Cu
Band: 10 lines
NITER.= 50 NLIN.= 31 NPRN.= 0 NCPA.= 7 NT...= 1 MNTA.= 1
MODE..= 3D FRC..= N DOS..= N OPS..= N AFM..= P CRT..= M
Lmaxh.= 8 Lmaxt= 4 NFI..= 31 FIXG.= 2 SHF..= 0 SOFC.= N
KMSH...= G IBZ..= 2 NKX..= 0 NKY..= 37 NKZ..= 0 FBZ..= N
KMSH2..= G IBZ2.= 1 NKX2.= 4 NKY2.= 0 NKZ2.= 51
ZMSH...= C NZ1..= 16 NZ2..= 8 NZ3..= 8 NRES.= 4 NZD.=1500
DEPTH..= 1.000 IMAGZ.= 0.020 EPS...= 0.200 ELIM..= -1.000
AMIX...= 0.100 EFMIX.= 1.000 VMTZ..= 0.000 MMOM..= 0.000
TOLE...= 1.d-07 TOLEF.= 1.d-07 TOLCPA= 1.d-06 TFERMI= 500.0 (K)
SWS......=2.686842 NSWS.= 1 DSWS..= 0.05 ALPCPA= 0.6020
Setup: 2 + NQ*NS lines
EFGS...= 0.000 HX....= 0.100 NX...= 5 NZ0..= 6 STMP..= N
Symb IQ IT ITA NZ CONC Sm(s) S(ws) WS(wst) QTR SPLT Fix
Cu 1 1 1 29 1.000 1.000 1.000 1.000 0.0 0.0 N
Atom: 4 lines + NT*NTA*6 lines
IEX...= 4 NP..= 251 NES..= 15 NITER=100 IWAT.= 0 NPRNA= 0
VMIX.....= 0.300000 RWAT....= 3.500000 RMAX....= 20.000000
DX.......= 0.030000 DR1.....= 0.002000 TEST....= 1.00E-12
TESTE....= 1.00E-12 TESTY...= 1.00E-12 TESTV...= 1.00E-12
Cu
Iz= 29 Norb= 10 Ion= 0 Config= 3d10_4s1
n 1 2 2 2 3 3 3 3 3 4
Kappa -1 -1 1 -2 -1 1 -2 2 -3 -1
Occup 2 2 2 4 2 2 4 4 6 1
Valen 0 0 0 0 0 0 0 1 1 1
15 changes: 15 additions & 0 deletions content/exercise/00/kstr/fcc.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
KSTR HP......=N 22 Jan 08
JOBNAM...=fcc MSGL.= 0 MODE...=B STORE..=Y HIGH...=Y
DIR001=smx/
DIR006=./
Slope matrices, fcc (spdf), (kappa*w)^2= 0.0
NL.....= 4 NLH...=11 NLW...= 9 NDER..= 6 ITRANS= 3 NPRN..= 0
(K*W)^2..= 0.000000 DMAX....= 1.7000 RWATS...= 0.10
NQ3...= 1 LAT...= 2 IPRIM.= 0 NGHBP.=13 NQR2..= 0
A........= 1.0000000 B.......= 1.0000000 C.......= 1.0000000
BSX......= 0.5000000 BSY.....= 0.5000000 BSZ.....= 0.0000000
BSX......= 0.0000000 BSY.....= 0.5000000 BSZ.....= 0.5000000
BSX......= 0.5000000 BSY.....= 0.0000000 BSZ.....= 0.5000000
QX(IQ)...= 0.0000000 QY......= 0.0000000 QZ......= 0.0000000
a/w(IQ)..= 0.70 0.70 0.70 0.70
LAMDA....= 2.5000 AMAX....= 4.5000 BMAX....= 4.5000
7 changes: 7 additions & 0 deletions content/exercise/00/shape/fcc.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SHAPE HP......=N 22 Jan 08
JOBNAM...=fcc MSGL.= 1
FOR001=../kstr/smx/fcc.tfh
DIR002=shp/
DIR006=./
Lmax..= 30 NSR..=129 NFI..= 11
NPRN..= 0 IVEF.= 3
13 changes: 13 additions & 0 deletions content/exercise/solutions/00/bmdl/fcc.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
BMDL HP......=N 22 Jan 08
JOBNAM...=fcc MSGL.= 1 NPRN.= 0
DIR001=mdl/
DIR006=
Madelung potential for fcc bulk
NL.....= 7
LAMDA....= 2.50 AMAX....= 4.50 BMAX....= 4.50
NQ....= 1 LAT...= 2 IPRIM.= 0 NQR2..= 0
A........= 1.0000000 B.......= 1.0000000 C.......= 1.0000000
BSX......= 0.5000000 BSY.....= 0.5000000 BSZ.....= 0.0000000
BSX......= 0.0000000 BSY.....= 0.5000000 BSZ.....= 0.5000000
BSX......= 0.5000000 BSY.....= 0.0000000 BSZ.....= 0.5000000
QX(IQ)...= 0.0000000 QY......= 0.0000000 QZ......= 0.0000000
1 change: 1 addition & 0 deletions content/exercise/solutions/00/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rm -fv */*.prn */*/*
10 changes: 10 additions & 0 deletions content/exercise/solutions/00/kfcd/cu.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
KFCD MSGL..= 1 22 Jan 08
JOBNAM...=cu
STRNAM...=fcc
DIR001=../kstr/smx/
DIR002=../kgrn/chd/
DIR003=../shape/shp/
DIR004=../bmdl/mdl/
DIR006=./
Lmaxs.= 30 NTH..= 41 NFI..= 81 FPOT..= N
OVCOR.= Y UBG..= N NPRN.= 0
39 changes: 39 additions & 0 deletions content/exercise/solutions/00/kgrn/cu.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
KGRN 13 Oct 12
JOBNAM=cu
STRT..= A MSGL.= 0 EXPAN.= S FCD..= Y FUNC..= SCA
FOR001=../kstr/smx/fcc.tfh
FOR001=../kstr/smx/fcc30.tfh
DIR002=pot/
DIR003=pot/
FOR004=../bmdl/mdl/fcc.mdl
DIR006=
DIR009=pot/
DIR010=chd/
DIR011=/tmp/
Self-consistent KKR calculation for fcc Cu
Band: 10 lines
NITER.= 50 NLIN.= 31 NPRN.= 0 NCPA.= 7 NT...= 1 MNTA.= 1
MODE..= 3D FRC..= N DOS..= N OPS..= N AFM..= P CRT..= M
Lmaxh.= 8 Lmaxt= 4 NFI..= 31 FIXG.= 2 SHF..= 0 SOFC.= N
KMSH...= G IBZ..= 2 NKX..= 0 NKY..= 13 NKZ..= 0 FBZ..= N
KMSH2..= G IBZ2.= 1 NKX2.= 4 NKY2.= 0 NKZ2.= 51
ZMSH...= C NZ1..= 16 NZ2..= 8 NZ3..= 8 NRES.= 4 NZD.=1500
DEPTH..= 1.000 IMAGZ.= 0.020 EPS...= 0.200 ELIM..= -1.000
AMIX...= 0.100 EFMIX.= 1.000 VMTZ..= 0.000 MMOM..= 0.000
TOLE...= 1.d-07 TOLEF.= 1.d-07 TOLCPA= 1.d-06 TFERMI= 500.0 (K)
SWS......=2.686842 NSWS.= 1 DSWS..= 0.05 ALPCPA= 0.6020
Setup: 2 + NQ*NS lines
EFGS...= 0.000 HX....= 0.100 NX...= 5 NZ0..= 6 STMP..= N
Symb IQ IT ITA NZ CONC Sm(s) S(ws) WS(wst) QTR SPLT Fix
Cu 1 1 1 29 1.000 1.000 1.000 1.000 0.0 0.0 N
Atom: 4 lines + NT*NTA*6 lines
IEX...= 4 NP..= 251 NES..= 15 NITER=100 IWAT.= 0 NPRNA= 0
VMIX.....= 0.300000 RWAT....= 3.500000 RMAX....= 20.000000
DX.......= 0.030000 DR1.....= 0.002000 TEST....= 1.00E-12
TESTE....= 1.00E-12 TESTY...= 1.00E-12 TESTV...= 1.00E-12
Cu
Iz= 29 Norb= 10 Ion= 0 Config= 3d10_4s1
n 1 2 2 2 3 3 3 3 3 4
Kappa -1 -1 1 -2 -1 1 -2 2 -3 -1
Occup 2 2 2 4 2 2 4 4 6 1
Valen 0 0 0 0 0 0 0 1 1 1
15 changes: 15 additions & 0 deletions content/exercise/solutions/00/kstr/fcc.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
KSTR HP......=N 22 Jan 08
JOBNAM...=fcc MSGL.= 0 MODE...=B STORE..=Y HIGH...=Y
DIR001=smx/
DIR006=./
Slope matrices, fcc (spdf), (kappa*w)^2= 0.0
NL.....= 4 NLH...=11 NLW...= 9 NDER..= 6 ITRANS= 3 NPRN..= 0
(K*W)^2..= 0.000000 DMAX....= 1.7000 RWATS...= 0.10
NQ3...= 1 LAT...= 2 IPRIM.= 0 NGHBP.=13 NQR2..= 0
A........= 1.0000000 B.......= 1.0000000 C.......= 1.0000000
BSX......= 0.5000000 BSY.....= 0.5000000 BSZ.....= 0.0000000
BSX......= 0.0000000 BSY.....= 0.5000000 BSZ.....= 0.5000000
BSX......= 0.5000000 BSY.....= 0.0000000 BSZ.....= 0.5000000
QX(IQ)...= 0.0000000 QY......= 0.0000000 QZ......= 0.0000000
a/w(IQ)..= 0.70 0.70 0.70 0.70
LAMDA....= 2.5000 AMAX....= 4.5000 BMAX....= 4.5000
Loading

0 comments on commit c2ab469

Please sign in to comment.