Skip to content

Commit f49d437

Browse files
committed
fix(nupdown): only set two_fermi when nupdown is non-zero
When nupdown=0.0 is explicitly set in INPUT, it should behave the same as not setting nupdown at all. Previously, reading any nupdown value would unconditionally set two_fermi=true, causing different code paths even when nupdown=0.0. Now two_fermi is only set to true when nupdown != 0.0, making nupdown=0 equivalent to not specifying the parameter.
1 parent b5ff54c commit f49d437

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/source_io/module_parameter/read_input_item_elec_stru.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Then the user has to correct the input file and restart the calculation.)";
297297
item.availability = "";
298298
item.read_value = [](const Input_Item& item, Parameter& para) {
299299
para.input.nupdown = doublevalue;
300-
para.sys.two_fermi = true;
300+
para.sys.two_fermi = (doublevalue != 0.0);
301301
};
302302
item.reset_value = [](const Input_Item&, Parameter& para) {
303303
if (para.input.nspin == 1)

0 commit comments

Comments
 (0)