Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
- [basis\_type](#basis_type)
- [ks\_solver](#ks_solver)
- [nbands](#nbands)
- [nbands_mul](#nbands_mul)
- [nelec](#nelec)
- [nelec\_delta](#nelec_delta)
- [nupdown](#nupdown)
Expand Down Expand Up @@ -967,9 +968,15 @@ calculations.
- **Type**: Integer
- **Description**: The number of Kohn-Sham orbitals to calculate. It is recommended to setup this value, especially when smearing techniques are utilized, more bands should be included.
- **Default**:
- nspin=1: max(1.2\*occupied_bands, occupied_bands + 10)
- nspin=2: max(1.2\*nelec_spin, nelec_spin + 10), in which nelec_spin = max(nelec_spin_up, nelec_spin_down)
- nspin=4: max(1.2\*nelec, nelec + 20)
- nspin=1: max(`nbands_mul`\*occupied_bands, occupied_bands + 10)
- nspin=2: max(`nbands_mul`\*nelec_spin, nelec_spin + 10), in which nelec_spin = max(nelec_spin_up, nelec_spin_down)
- nspin=4: max(`nbands_mul`\*nelec, nelec + 20)

### nbands_mul

- **Type**: Real
- **Description**: the multiply value of default formular of `nbands`. It is recommended that the user set a larger default multiplier for systems with complex electron levels near the Fermi surface, such as `2.0`.
- **Default**: 1.2

### nelec

Expand Down
4 changes: 3 additions & 1 deletion source/module_cell/read_atoms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,9 @@ bool UnitCell::read_atom_positions(std::ifstream &ifpos, std::ofstream &ofs_runn
}
}
}
if (autoset_mag)
// atomic initial magnetism will be autoset if user set zero for every atom
// one exception is `lspinorb 1` with `noncolin 0`, this setting imply no-mag material but SOC included
if (autoset_mag && !PARAM.inp.lspinorb || PARAM.inp.noncolin)
{
if(PARAM.inp.nspin==4)
{
Expand Down
6 changes: 3 additions & 3 deletions source/module_elecstate/cal_nelec_nband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void cal_nbands(const int& nelec, const int& nlocal, const std::vector<double>&
if (PARAM.inp.nspin == 1)
{
const int nbands1 = static_cast<int>(occupied_bands) + 10;
const int nbands2 = static_cast<int>(1.2 * occupied_bands) + 1;
const int nbands2 = static_cast<int>(PARAM.inp.nbands_mul * occupied_bands) + 1;
nbands = std::max(nbands1, nbands2);
if (PARAM.inp.basis_type != "pw") {
nbands = std::min(nbands, nlocal);
Expand All @@ -93,7 +93,7 @@ void cal_nbands(const int& nelec, const int& nlocal, const std::vector<double>&
else if (PARAM.inp.nspin == 4)
{
const int nbands3 = nelec + 20;
const int nbands4 = static_cast<int>(1.2 * nelec) + 1;
const int nbands4 = static_cast<int>(PARAM.inp.nbands_mul * nelec) + 1;
nbands = std::max(nbands3, nbands4);
if (PARAM.inp.basis_type != "pw") {
nbands = std::min(nbands, nlocal);
Expand All @@ -103,7 +103,7 @@ void cal_nbands(const int& nelec, const int& nlocal, const std::vector<double>&
{
const double max_occ = std::max(nelec_spin[0], nelec_spin[1]);
const int nbands3 = static_cast<int>(max_occ) + 11;
const int nbands4 = static_cast<int>(1.2 * max_occ) + 1;
const int nbands4 = static_cast<int>(PARAM.inp.nbands_mul * max_occ) + 1;
nbands = std::max(nbands3, nbands4);
if (PARAM.inp.basis_type != "pw") {
nbands = std::min(nbands, nlocal);
Expand Down
12 changes: 12 additions & 0 deletions source/module_io/read_input_item_elec_stru.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,18 @@ void ReadInput::item_elec_stru()
};
this->add_item(item);
}
{
Input_Item item("nbands_mul");
item.annotation = "value to multiply the number of bands";
read_sync_double(input.nbands_mul);
item.check_value = [](const Input_Item& item, const Parameter& para) {
if (para.input.nbands_mul < 1.0)
{
ModuleBase::WARNING_QUIT("ReadInput", "nbands_mul should be greater than 1.0");
}
};
this->add_item(item);
}
{
Input_Item item("nelec");
item.annotation = "input number of electrons";
Expand Down
1 change: 1 addition & 0 deletions source/module_parameter/input_parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ struct Input_para
std::string basis_type = "pw"; ///< xiaohui add 2013-09-01, for structural adjustment
bool use_paw = false; ///< whether to use PAW in pw calculation
int nbands = 0; ///< number of bands
double nbands_mul = 1.2; ///< multiplier for nbands
double nelec = 0.0; ///< total number of electrons
double nelec_delta = 0.0; ///< change in the number of total electrons
double nupdown = 0.0;
Expand Down
10 changes: 5 additions & 5 deletions tests/integrate/104_PW_NC_magnetic/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -6156.9375288900891974
etotperatomref -3078.4687644450
totalforceref 2.221910
totalstressref 76009.325784
totaltimeref 13.66
etotref -6156.9375268152816716
etotperatomref -3078.4687634076
totalforceref 2.210980
totalstressref 76010.262300
totaltimeref 3.16
3 changes: 2 additions & 1 deletion tests/integrate/140_PW_15_SO/README
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This test for:
*kpoints 2*2*2
*sg15 pseudopotential
*smearing_method gauss
*ks_solver cg
*ks_solver dav_subspace
*mixing_type broyden-kerker
*mixing_beta 0.4
*initial magnetic won't be autoset with SOC only
10 changes: 5 additions & 5 deletions tests/integrate/140_PW_15_SO/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -1678.3650981686614614
etotperatomref -839.1825490843
totalforceref 1.739332
totalstressref 34372.194072
totaltimeref 0.99
etotref -1678.3523145468475377
etotperatomref -839.1761572734
totalforceref 2.046010
totalstressref 34365.396224
totaltimeref 0.89
4 changes: 2 additions & 2 deletions tests/integrate/140_PW_15_SO_wfcinit/STRU
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ ATOMIC_POSITIONS
Direct //Cartesian or Direct coordinate.

As
0
1.0
1
0.2500000 0.2500000 0.25000000 0 0 0

Ga //Element Label
0
1.0
1 //number of atom
0.00000 0.00000 0.000000 0 0 0
2 changes: 1 addition & 1 deletion tests/integrate/204_NO_KP_NC/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ smearing_sigma 0.02

#Parameters (5.Mixing)
mixing_type broyden
mixing_beta 0.7
mixing_beta 0.2
mixing_ndim 15
mixing_gg0 1.0

Expand Down
8 changes: 4 additions & 4 deletions tests/integrate/204_NO_KP_NC/result.ref
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
etotref -6436.214785882292
etotperatomref -3218.1073929411
totalforceref 0.000002
totaltimeref 10.22
etotref -6436.214785907474
etotperatomref -3218.1073929537
totalforceref 0.000004
totaltimeref 9.89
10 changes: 5 additions & 5 deletions tests/integrate/240_NO_KP_15_SO/result.ref
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
etotref -1964.0663947982982336
etotperatomref -982.0331973991
totalforceref 0.162298
totalstressref 1877.059021
totaltimeref 2.87
etotref -1964.0663947983234721
etotperatomref -982.0331973992
totalforceref 0.162510
totalstressref 1877.059106
totaltimeref 2.71
6 changes: 3 additions & 3 deletions tests/integrate/240_NO_KP_15_SO_average/result.ref
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
etotref -1956.345026588574
etotperatomref -978.1725132943
totaltimeref 1.75
etotref -1956.154886109712
etotperatomref -978.0774430549
totaltimeref 2.08
Loading