Skip to content

Commit f2c5f94

Browse files
dyzhengjiyuang1041176461
authored
Feature: out_proj_band added from abacusmodeling (#919)
* extract PDOS by index(atom_index) using plot-tools * add function to parse projected band in plot-tools * add projected band plotting tools * add projected band structure ouput * modify README for plot-tools * Update band-struc.md add description for projected band structure * Update band-struc.md * fix energy_dos.cpp compiling bug * set default value of 'kkbeta' with 'size' * Revert "set default value of 'kkbeta' with 'size'" This reverts commit 0a9da9c. * move Name_Angular from constant.h to energy.h * add a new parameter named "out_proj_band" Co-authored-by: jiyuang <jiyuyang@mail.ustc.com> Co-authored-by: jiyuyang <1041176461@qq.com> Co-authored-by: dyzheng <dyzheng@mail.ustc.edu.cn>
1 parent b8a0882 commit f2c5f94

File tree

14 files changed

+1267
-371
lines changed

14 files changed

+1267
-371
lines changed

docs/examples/band-struc.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pw_diag_thr 1.0e-7
2727
#Parameters (File)
2828
init_chg file
2929
out_band 1
30+
out_proj_band 1
3031
3132
#Parameters (Smearing)
3233
smearing_method gaussian
@@ -58,4 +59,35 @@ points.
5859
Run the program, and you will see a file named BANDS_1.dat in the output directory. Plot it
5960
to get energy band structure.
6061

61-
[back to top](#band-structure)
62+
If "out_proj_band" set 1, it will also produce the projected band structure in a file called PBAND_1 in xml format.
63+
64+
The PBAND_1 file starts with number of atomic orbitals in the system, the text contents of element <band structure> is the same as data in the BANDS_1.dat file, such as:
65+
```
66+
<pband>
67+
<nspin>1</nspin>
68+
<norbitals>153</norbitals>
69+
<band_structure nkpoints="96" nbands="50" units="eV">
70+
...
71+
72+
```
73+
74+
The rest of the files arranged in sections, each section with a header such as below:
75+
76+
```
77+
<orbital
78+
index=" 1"
79+
atom_index=" 1"
80+
species="Si"
81+
l=" 0"
82+
m=" 0"
83+
z=" 1"
84+
>
85+
<data>
86+
...
87+
</data>
88+
89+
```
90+
91+
The shape of text contents of element <data> is (Number of k-points, Number of bands)
92+
93+
[back to top](#band-structure)

docs/input-main.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
- [Variables related to output information](#variables-related-to-output-information)
3434

35-
[out_force](#out_force) | [out_mul](#out_mul) | [out_freq_elec](#out_freq_elec) | [out_freq_ion](#out_freq_ion) | [out_chg](#out_chg) | [out_pot](#out_pot) | [out_dm](#out-dm) | [out_wfc_pw](#out_wfc_pw) | [out_wfc_r](#out_wfc_r) | [out_wfc_lcao](#out_wfc_lcao) | [out_dos](#out-dos) | [out_band](#out-band) | [out_stru](#out-stru) | [out_level](#out_level) | [out_alllog](#out-alllog) | [out_mat_hs](#out_mat_hs) | [out_mat_r](#out_mat_r) | [out_mat_hs2](#out_mat_hs2) | [out_element_info](#out-element-info) | [restart_save](#restart_save) | [restart_load](#restart_load)
35+
[out_force](#out_force) | [out_mul](#out_mul) | [out_freq_elec](#out_freq_elec) | [out_freq_ion](#out_freq_ion) | [out_chg](#out_chg) | [out_pot](#out_pot) | [out_dm](#out-dm) | [out_wfc_pw](#out_wfc_pw) | [out_wfc_r](#out_wfc_r) | [out_wfc_lcao](#out_wfc_lcao) | [out_dos](#out-dos) | [out_band](#out-band) | [out_proj_band](#out-proj-band) | [out_stru](#out-stru) | [out_level](#out_level) | [out_alllog](#out-alllog) | [out_mat_hs](#out_mat_hs) | [out_mat_r](#out_mat_r) | [out_mat_hs2](#out_mat_hs2) | [out_element_info](#out-element-info) | [restart_save](#restart_save) | [restart_load](#restart_load)
3636

3737
- [Density of states](#density-of-states)
3838

@@ -735,6 +735,12 @@ This part of variables are used to control the output of properties.
735735
- **Description**: Controls whether to output the band structure. For mroe information, refer to the [worked example](examples/band-struc.md)
736736
- **Default**: 0
737737
738+
#### out_proj_band
739+
740+
- **Type**: Integer
741+
- **Description**: Controls whether to output the projected band structure. For mroe information, refer to the [worked example](examples/band-struc.md)
742+
- **Default**: 0
743+
738744
#### out_stru
739745
740746
- **Type**: Boolean

source/input.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ void Input::Default(void)
268268
out_wfc_r = 0;
269269
out_dos = 0;
270270
out_band = 0;
271+
out_proj_band = 0;
271272
out_mat_hs = 0;
272273
out_mat_hs2 = 0; // LiuXh add 2019-07-15
273274
out_mat_r = 0; // jingan add 2019-8-14
@@ -995,6 +996,10 @@ bool Input::Read(const std::string &fn)
995996
{
996997
read_value(ifs, out_band);
997998
}
999+
else if (strcmp("out_proj_band", word) == 0)
1000+
{
1001+
read_value(ifs, out_proj_band);
1002+
}
9981003

9991004
else if (strcmp("out_mat_hs", word) == 0)
10001005
{
@@ -1941,6 +1946,7 @@ void Input::Bcast()
19411946
Parallel_Common::bcast_int(out_wfc_r);
19421947
Parallel_Common::bcast_int(out_dos);
19431948
Parallel_Common::bcast_int(out_band);
1949+
Parallel_Common::bcast_int(out_proj_band);
19441950
Parallel_Common::bcast_int(out_mat_hs);
19451951
Parallel_Common::bcast_int(out_mat_hs2); // LiuXh add 2019-07-15
19461952
Parallel_Common::bcast_int(out_mat_r); // jingan add 2019-8-14
@@ -2227,6 +2233,7 @@ void Input::Check(void)
22272233
out_stru = 0;
22282234
out_dos = 0;
22292235
out_band = 0;
2236+
out_proj_band = 0;
22302237
cal_force = 0;
22312238
init_wfc = "file";
22322239
init_chg = "atomic"; // useless,
@@ -2248,6 +2255,7 @@ void Input::Check(void)
22482255
out_stru = 0;
22492256
out_dos = 0;
22502257
out_band = 0;
2258+
out_proj_band = 0;
22512259
cal_force = 0;
22522260
init_wfc = "file";
22532261
init_chg = "atomic";

source/input.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ class Input
206206
int out_wfc_r; // 0: no; 1: yes
207207
int out_dos; // dos calculation. mohan add 20090909
208208
int out_band; // band calculation pengfei 2014-10-13
209+
int out_proj_band; // projected band structure calculation jiyy add 2022-05-11
209210
int out_mat_hs; // output H matrix and S matrix in local basis.
210211
int out_mat_hs2; // LiuXh add 2019-07-16, output H(R) matrix and S(R) matrix in local basis.
211212
int out_mat_r; // jingan add 2019-8-14, output r(R) matrix.

source/input_conv.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ void Input_Conv::Convert(void)
434434
GlobalC::wf.out_wfc_r = INPUT.out_wfc_r;
435435
GlobalC::en.out_dos = INPUT.out_dos;
436436
GlobalC::en.out_band = INPUT.out_band;
437+
GlobalC::en.out_proj_band = INPUT.out_proj_band;
437438
#ifdef __LCAO
438439
Local_Orbital_Charge::out_dm = INPUT.out_dm;
439440
Pdiag_Double::out_mat_hs = INPUT.out_mat_hs;

0 commit comments

Comments
 (0)