Skip to content

Commit 6a33b67

Browse files
authored
Merge pull request #135 from 1041176461/develop
Adds the ability to output projected band structure
2 parents 02ca019 + bd415d2 commit 6a33b67

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_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_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

@@ -723,6 +723,12 @@ This part of variables are used to control the output of properties.
723723
- **Description**: Controls whether to output the band structure. For mroe information, refer to the [worked example](examples/band-struc.md)
724724
- **Default**: 0
725725
726+
#### out_proj_band
727+
728+
- **Type**: Integer
729+
- **Description**: Controls whether to output the projected band structure. For mroe information, refer to the [worked example](examples/band-struc.md)
730+
- **Default**: 0
731+
726732
#### out_stru
727733
728734
- **Type**: Boolean

source/input.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ void Input::Default(void)
266266
out_wfc_r = 0;
267267
out_dos = 0;
268268
out_band = 0;
269+
out_proj_band = 0;
269270
out_mat_hs = 0;
270271
out_mat_hs2 = 0; // LiuXh add 2019-07-15
271272
out_mat_r = 0; // jingan add 2019-8-14
@@ -985,6 +986,10 @@ bool Input::Read(const std::string &fn)
985986
{
986987
read_value(ifs, out_band);
987988
}
989+
else if (strcmp("out_proj_band", word) == 0)
990+
{
991+
read_value(ifs, out_proj_band);
992+
}
988993

989994
else if (strcmp("out_mat_hs", word) == 0)
990995
{
@@ -1929,6 +1934,7 @@ void Input::Bcast()
19291934
Parallel_Common::bcast_int(out_wfc_r);
19301935
Parallel_Common::bcast_int(out_dos);
19311936
Parallel_Common::bcast_int(out_band);
1937+
Parallel_Common::bcast_int(out_proj_band);
19321938
Parallel_Common::bcast_int(out_mat_hs);
19331939
Parallel_Common::bcast_int(out_mat_hs2); // LiuXh add 2019-07-15
19341940
Parallel_Common::bcast_int(out_mat_r); // jingan add 2019-8-14
@@ -2215,6 +2221,7 @@ void Input::Check(void)
22152221
out_stru = 0;
22162222
out_dos = 0;
22172223
out_band = 0;
2224+
out_proj_band = 0;
22182225
cal_force = 0;
22192226
init_wfc = "file";
22202227
init_chg = "atomic"; // useless,
@@ -2236,6 +2243,7 @@ void Input::Check(void)
22362243
out_stru = 0;
22372244
out_dos = 0;
22382245
out_band = 0;
2246+
out_proj_band = 0;
22392247
cal_force = 0;
22402248
init_wfc = "file";
22412249
init_chg = "atomic";

source/input.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ class Input
204204
int out_wfc_r; // 0: no; 1: yes
205205
int out_dos; // dos calculation. mohan add 20090909
206206
int out_band; // band calculation pengfei 2014-10-13
207+
int out_proj_band; // projected band structure calculation jiyy add 2022-05-11
207208
int out_mat_hs; // output H matrix and S matrix in local basis.
208209
int out_mat_hs2; // LiuXh add 2019-07-16, output H(R) matrix and S(R) matrix in local basis.
209210
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
@@ -432,6 +432,7 @@ void Input_Conv::Convert(void)
432432
GlobalC::wf.out_wfc_r = INPUT.out_wfc_r;
433433
GlobalC::en.out_dos = INPUT.out_dos;
434434
GlobalC::en.out_band = INPUT.out_band;
435+
GlobalC::en.out_proj_band = INPUT.out_proj_band;
435436
#ifdef __LCAO
436437
Local_Orbital_Charge::out_dm = INPUT.out_dm;
437438
Pdiag_Double::out_mat_hs = INPUT.out_mat_hs;

0 commit comments

Comments
 (0)