You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Specify parameters in `band.py` or `dos.py` directly, and then `python band.py` or `python dos.py`. And you can also import module in your own script e.g. `from abacus_plot.band import Band`
24
-
2. Command-line tools are also supported in this tool. In this way, you need prepare an input file and execute some commands as follows
24
+
1. Specify parameters in `band.py` or `dos.py` directly, and then `python band.py` or `python dos.py`. And you can also import module in your own script e.g. `from abacus_plot.band import Band`. (Recommend)
25
+
2. Command-line tools are also supported in this tool. In this way, you need prepare an input file and execute some commands (see below). You can use `abacus-plot -h` to check command-line information
25
26
26
27
### Band Structure
27
-
First, prepare a json file e.g. band-input.json:
28
+
First, prepare a file named 'config.json' in json format:
|*bandfile*|`str` or `List[str]`| Bands data file output from ABACUS |
39
-
|*efermi*|`float` or `List[float]`| Fermi level in eV |
40
-
|*energy_range*|`list`| Range of energy in eV |
41
-
|*shift*|`bool`|If set `'true'`, it will evaluate band gap. Default: `'false'`|
42
-
|*index*|`List[int]` or `Dict[int, List[int]]` or `Dict[int, Dict[int, List[int]]]]`| Extract PDOS of each atom e.g. [0, 1], {0:[0, 1], 1:[0]}, [0:{0:[0]}, 1:{1:[0, 1]}]|
43
-
|*atom_index*|`List[int]` or `Dict[int, List[int]]` or `Dict[int, Dict[int, List[int]]]]`| Extract PDOS of each atom with same atom_index e.g. [0, 1], {0:[0, 1], 1:[0]}, [0:{0:[0]}, 1:{1:[0, 1]}]|
44
-
|*species*|`List[str]` or `Dict[str, List[int]]` or `Dict[str, Dict[int, List[int]]]]`| Extract PDOS of each atom with same species e.g. ["C", "Si"], {"C":[0, 1], "Si":[0]}, ["C":{0:[0]}, "Si":{1:[0, 1]}]|
45
-
|*kptfile*|`str`| K-points file in ABACUS format |
46
-
|*label*|`str` or `List[str]`| Label of band structure |
47
-
|*color*|`str` or `List[str]`| Color of band structure |
|*bandfile*|`str` or `List[str]`|Bands data file output from ABACUS. 'BANDS_*.dat' for band structure and 'PBANDS_*' for projected band structure |
40
+
|*efermi*|`float` or `List[float]`|Fermi level in eV|
41
+
|*energy_range*|`list`|Range of energy in eV|
42
+
|*shift*|`bool`|If set `'true'`, it will evaluate band gap (only for semiconductors and insulators). Default: `'false'`|
43
+
|*index*|`List[int]` or `Dict[str, List[int]]` or `Dict[str, Dict[int, List[int]]]]`|Extract PBANDS of each atom from 'PBANDS_*' file e.g. [index_0, index_1...] or {index_0:[l_0, l_1, ...], ...}, [index_0:{l_0:[m_0, m_1, ...], ...}, ...]|
44
+
|*atom_index*|`List[int]` or `Dict[str, List[int]]` or `Dict[str, Dict[int, List[int]]]]`| Extract PBANDS of each atom with same atom_index from 'PBANDS_*' file e.g. [atom_index_0, atom_index_1...] or {atom_index_0:[l_0, l_1, ...], ...}, [atom_index_0:{l_0:[m_0, m_1, ...], ...}, ...]|
45
+
|*species*|`List[str]` or `Dict[str, List[int]]` or `Dict[str, Dict[int, List[int]]]]`|Extract PBANDS of each atom with same species from 'PBANDS_*' file e.g. [elem_0, elem_1...] or {elem_0:[l_0, l_1, ...], ...}, [elem_0:{l_0:[m_0, m_1, ...], ...}, ...]|
46
+
|*kptfile*|`str`|K-points file with `Line` mode in ABACUS format|
47
+
|*label*|`str` or `List[str]`|Label of band structure|
48
+
|*color*|`str` or `List[str]`|Color of band structure|
48
49
49
50
If you want to plot band structure of `nspin=2` or compare two band structure on same k-path, you can set *bandfile*, *efermi*, *label*, *color* in `list` type.
50
51
@@ -63,15 +64,25 @@ Line
63
64
```
64
65
Then, use the following command to plot band structure:
65
66
```shell
66
-
abacus-plot -b -f band-input.json
67
+
abacus-plot -b
68
+
```
69
+
70
+
Then, the following command will plot projected band structure and figures output to directory `PBAND*_FIG` ($*=1$ for $nspin=1$, $*=2$ for $nspin=2$):
71
+
```shell
72
+
abacus-plot -d -p
73
+
```
74
+
75
+
Then, the following command will output parsed partial DOS to directory `PBAND*_FILE` ($*=1$ for $nspin=1$, $*=2$ for $nspin=2$):
76
+
```shell
77
+
abacus-plot -d -o
67
78
```
68
79
69
80
### DOS
70
-
First, prepare a json file e.g. dos-input.json:
81
+
First, prepare a file named 'config.json' in json format:
71
82
```json
72
83
{
73
84
"pdosfile": "PDOS",
74
-
"efermi": 10.39537843955395,
85
+
"efermi": 6.585653952007503,
75
86
"energy_range": [
76
87
-5,
77
88
7
@@ -82,10 +93,10 @@ First, prepare a json file e.g. dos-input.json:
82
93
],
83
94
"species": {
84
95
"C": {
85
-
0: [
96
+
"0": [
86
97
0
87
98
],
88
-
1: [
99
+
"1": [
89
100
0,
90
101
1
91
102
]
@@ -99,30 +110,30 @@ First, prepare a json file e.g. dos-input.json:
99
110
}
100
111
```
101
112
If you only want to plot total DOS, you can modify `pdosfile` to `tdosfile` and do not set `species` and `pdosfig`.
|*tdosfile*|`str`| Total DOS data file output from ABACUS |
105
-
|*pdosfile*|`str`| Partial DOS data file output from ABACUS in xml format |
106
-
|*efermi*|`float`| Fermi level in eV |
107
-
|*energy_range*|`list`| Range of energy in eV |
108
-
|*shift*|`bool`| If set `'true'`, it will evaluate band gap. Default: `'false'`|
109
-
|*index*|`List[int]` or `Dict[int, List[int]]` or `Dict[int, Dict[int, List[int]]]]`| Extract PDOS of each atom e.g. [0, 1], {0:[0, 1], 1:[0]}, [0:{0:[0]}, 1:{1:[0, 1]}]|
110
-
|*atom_index*|`List[int]` or `Dict[int, List[int]]` or `Dict[int, Dict[int, List[int]]]]`| Extract PDOS of each atom with same atom_index e.g. [0, 1], {0:[0, 1], 1:[0]}, [0:{0:[0]}, 1:{1:[0, 1]}]|
111
-
|*species*|`List[str]` or `Dict[str, List[int]]` or `Dict[str, Dict[int, List[int]]]]`| Extract PDOS of each atom with same species e.g. ["C", "Si"], {"C":[0, 1], "Si":[0]}, ["C":{0:[0]}, "Si":{1:[0, 1]}]|
|*tdosfile*|`str`|Total DOS data file output from ABACUS|
116
+
|*pdosfile*|`str`|Partial DOS data file output from ABACUS in xml format|
117
+
|*efermi*|`float`|Fermi level in eV|
118
+
|*energy_range*|`list`|Range of energy in eV|
119
+
|*shift*|`bool`|If set `'true'`, it will evaluate band gap. Default: `'false'`|
120
+
|*index*|`List[int]` or `Dict[str, List[int]]` or `Dict[str, Dict[str, List[int]]]]`|Extract PDOS of each atom e.g. [index_0, index_1...] or {index_0:[l_0, l_1, ...], ...}, [index_0:{l_0:[m_0, m_1, ...], ...}, ...]|
121
+
|*atom_index*|`List[int]` or `Dict[str, List[int]]` or `Dict[str, Dict[str, List[int]]]]`| Extract PDOS of each atom with same atom_index e.g. [atom_index_0, atom_index_1...] or {atom_index_0:[l_0, l_1, ...], ...}, [atom_index_0:{l_0:[m_0, m_1, ...], ...}, ...]|
122
+
|*species*|`List[str]` or `Dict[str, List[int]]` or `Dict[str, Dict[str, List[int]]]]`|Extract PDOS of each atom with same species e.g. [elem_0, elem_1...] or {elem_0:[l_0, l_1, ...], ...}, [elem_0:{l_0:[m_0, m_1, ...], ...}, ...]|
123
+
|*tdosfig*|`str`|Output picture of total DOS|
124
+
|*pdosfig*|`str`|Output picture of partial DOS|
114
125
115
126
Then, the following command will plot total DOS:
116
127
```shell
117
-
abacus-plot -t tdos-input.json
128
+
abacus-plot -d
118
129
```
119
130
120
131
Then, the following command will plot partial DOS:
121
132
```shell
122
-
abacus-plot -p pdos-input.json
133
+
abacus-plot -d -p
123
134
```
124
135
125
136
Then, the following command will output parsed partial DOS to directory `PDOS_FILE`:
0 commit comments