Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
166 changes: 117 additions & 49 deletions docs/advanced/input_files/input-main.md

Large diffs are not rendered by default.

29 changes: 28 additions & 1 deletion docs/generate_input_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@
]


def normalize_type(type_text: str) -> str:
"""
Normalize legacy type labels for cleaner generated docs.
"""
if not type_text:
return ''

normalized = type_text.strip()
aliases = {
"Bool": "Boolean",
"Int*2": "Integer*2",
}
return aliases.get(normalized, normalized)


def format_description(desc: str) -> str:
"""
Format description text for markdown output.
Expand All @@ -79,6 +94,10 @@ def format_description(desc: str) -> str:
if not desc:
return ''

# Prevent placeholder tokens like <property> from being parsed as raw HTML
# and breaking list/heading structure in rendered docs.
desc = desc.replace('<', '&lt;').replace('>', '&gt;')

lines = desc.split('\n')
result_lines = []

Expand All @@ -94,6 +113,10 @@ def format_description(desc: str) -> str:
if '[WARNING]' in line:
line = line.replace('[WARNING]', '> Warning:')

# Normalize doubled note/warning prefixes from legacy content
line = re.sub(r'>\s*Note:\s*Note\s*:?\s*', '> Note: ', line)
line = re.sub(r'>\s*Warning:\s*Warning\s*:?\s*', '> Warning: ', line)

result_lines.append(line)

# Join and clean up
Expand All @@ -115,7 +138,7 @@ def generate_parameter_markdown(param: Dict[str, str]) -> str:

# Type
if param.get('type', '') != '':
lines.append(f"- **Type**: {param['type']}")
lines.append(f"- **Type**: {normalize_type(str(param['type']))}")

# Availability (before description, as in original format)
if param.get('availability', '') != '':
Expand Down Expand Up @@ -156,6 +179,10 @@ def generate_category_markdown(category: str, params: List[Dict[str, str]]) -> s
for param in params:
lines.append(generate_parameter_markdown(param))

# Keep legacy navigation aid used by downstream tooling/rendering.
lines.append("[back to top](#full-list-of-input-keywords)")
lines.append("")

return '\n'.join(lines)


Expand Down
36 changes: 18 additions & 18 deletions docs/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ parameters:
availability: ""
- name: xc_exch_ext
category: Electronic structure
type: Integer Real ...
type: Integer followed by Real values
description: |
Customized parameterization on the exchange part of XC functional. The first value should be the LibXC ID of the original functional, and latter values are external parameters. Default values are those of Perdew-Burke-Ernzerhof (PBE) functional. For more information on LibXC ID of functionals, please refer to LibXC. For parameters of functionals of interest, please refer to the source code of LibXC, such as PBE functional interface in LibXC: gga_x_pbe.c.

Expand All @@ -587,7 +587,7 @@ parameters:
availability: ""
- name: xc_corr_ext
category: Electronic structure
type: Integer Real ...
type: Integer followed by Real values
description: |
Customized parameterization on the correlation part of XC functional. The first value should be the LibXC ID of the original functional, and latter values are external parameters. Default values are those of Perdew-Burke-Ernzerhof (PBE) functional. For more information on LibXC ID of functionals, please refer to LibXC. For parameters of functionals of interest, please refer to the source code of LibXC, such as PBE functional interface in LibXC: gga_c_pbe.c.

Expand Down Expand Up @@ -2316,7 +2316,7 @@ parameters:
availability: Numerical atomic orbital basis and deepks_scf is true
- name: deepks_band_range
category: DeePKS
type: "Int*2"
type: Integer*2
description: |
The first value should not be larger than the second one and the meaning differs in different cases below
* deepks_bandgap is 1: Bandgap label is the energy between LUMO + deepks_band_range[0] and LUMO + deepks_band_range[1]. If not set, it will calculate energy between HOMO and LUMO states.
Expand Down Expand Up @@ -3477,7 +3477,7 @@ parameters:
availability: ""
- name: out_wannier_mmn
category: Berry phase and wannier90 interface
type: Bool
type: Boolean
description: |
Write the "*.mmn" file or not.
* 0: don't write the "*.mmn" file.
Expand All @@ -3487,7 +3487,7 @@ parameters:
availability: ""
- name: out_wannier_amn
category: Berry phase and wannier90 interface
type: Bool
type: Boolean
description: |
Write the "*.amn" file or not.
* 0: don't write the "*.amn" file.
Expand All @@ -3497,7 +3497,7 @@ parameters:
availability: ""
- name: out_wannier_eig
category: Berry phase and wannier90 interface
type: Bool
type: Boolean
description: |
Write the "*.eig" file or not.
* 0: don't write the "*.eig" file.
Expand All @@ -3507,7 +3507,7 @@ parameters:
availability: ""
- name: out_wannier_unk
category: Berry phase and wannier90 interface
type: Bool
type: Boolean
description: |
Write the "UNK.*" file or not.
* 0: don't write the "UNK.*" file.
Expand All @@ -3517,7 +3517,7 @@ parameters:
availability: ""
- name: out_wannier_wvfn_formatted
category: Berry phase and wannier90 interface
type: Bool
type: Boolean
description: |
Write the "UNK.*" file in ASCII format or binary format.
* 0: write the "UNK.*" file in binary format.
Expand Down Expand Up @@ -3840,25 +3840,25 @@ parameters:
availability: ""
- name: exx_fock_alpha
category: Exact Exchange (Common)
type: "Real \\Real...\\"
type: Vector of Real
description: |
Fraction of full-ranged Fock exchange 1/r () in range-separated hybrid funtionals, so that .
Fraction $\alpha$ of full-ranged Fock exchange $1/r$ in range-separated hybrid functionals.
default_value: see hybrid_func_params
unit: ""
availability: ""
- name: exx_erfc_alpha
category: Exact Exchange (Common)
type: "Real \\Real...\\"
type: Vector of Real
description: |
Fraction of short-ranged Fock exchange erfc(wr)/r () in range-separated hybrid funtionals, so that .
Fraction $\beta$ of short-ranged Fock exchange $\mathrm{erfc}(\omega r)/r$ in range-separated hybrid functionals.
default_value: see hybrid_func_params
unit: ""
availability: ""
- name: exx_erfc_omega
category: Exact Exchange (Common)
type: "Real \\Real...\\"
type: Vector of Real
description: |
Range-separation parameter in exchange, such that
Range-separation parameter $\omega$ in the short-ranged Fock term $\mathrm{erfc}(\omega r)/r$.
default_value: see hybrid_func_params
unit: ""
availability: ""
Expand Down Expand Up @@ -3890,7 +3890,7 @@ parameters:
availability: exx_separate_loop==1
- name: exx_fock_lambda
category: Exact Exchange (LCAO in PW)
type: "Real \\Real...\\"
type: Vector of Real
description: |
It is used to compensate for divergence points at G=0 in the evaluation of Fock exchange using lcao_in_pw method.
default_value: "0.3"
Expand Down Expand Up @@ -4119,16 +4119,16 @@ parameters:
* 1: The first SCF step will use an initial density matrix read from a file named initial_onsite.dm, but for later steps, the onsite density matrix will be updated.
* 2: The same onsite density matrix from initial_onsite.dm will be used throughout the entire calculation.

[NOTE] Note : The easiest way to create initial_onsite.dm is to run a DFT+U calculation, look for a file named onsite.dm in the OUT.prefix directory, and make replacements there. The format of the file is rather straight-forward.
[NOTE] The easiest way to create initial_onsite.dm is to run a DFT+U calculation, look for a file named onsite.dm in the OUT.prefix directory, and make replacements there. The format of the file is rather straight-forward.
default_value: "0"
unit: ""
availability: ""
- name: onsite_radius
category: DFT+U correction
type: Real
description: |
* The Onsite-radius parameter facilitates modulation of the single-zeta portion of numerical atomic orbitals for projections for DFT+U.
* The modulation algorithm includes a smooth truncation applied directly to the tail of the original orbital, followed by normalization. Consider the function: $\sigmar_c\sigmaf'(r)\equiv \mathrm{d}f(r)/\mathrm{d}r\gamma$ is a parameter that adjusts the relative weight of the error function to the derivative error function.
* The onsite_radius parameter facilitates modulation of the single-zeta portion of numerical atomic orbitals used for DFT+U projections.
* The modulation algorithm applies a smooth truncation to the orbital tail followed by normalization. A representative profile is $f(r)=\frac{1}{2}\left[1+\operatorname{erf}\!\left(\frac{r_c-r}{\sigma}\right)\right]$, where $r_c$ is the cutoff radius and $\sigma=\gamma r_c$ controls smoothness.
default_value: "3.0"
unit: Bohr
availability: dft_plus_u is set to 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void ReadInput::item_deepks()
Input_Item item("deepks_band_range");
item.annotation = "(int, int) range of bands for bandgap label";
item.category = "DeePKS";
item.type = "Int*2";
item.type = "Integer*2";
item.description = R"(The first value should not be larger than the second one and the meaning differs in different cases below
* deepks_bandgap is 1: Bandgap label is the energy between LUMO + deepks_band_range[0] and LUMO + deepks_band_range[1]. If not set, it will calculate energy between HOMO and LUMO states.
* deepks_bandgap is 2: Bandgap labels are energies between HOMO and all states in range [LUMO + deepks_band_range[0], LUMO + deepks_band_range[1]] (Thus there are deepks_band_range[1] - deepks_band_range[0] + 1 bandgaps in total). If HOMO is included in the setting range, it will be ignored since it will always be zero and has no valuable messages (deepks_band_range[1] - deepks_band_range[0] bandgaps in this case). NOTICE: The set range can be greater than, less than, or include the value of HOMO. In the bandgap label, we always calculate the energy of the state in the set range minus the energy of HOMO state, so the bandgap can be negative if the state is lower than HOMO.)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ The other way is only available when compiling with LIBXC, and it allows for sup
Input_Item item("xc_exch_ext");
item.annotation = "placeholder for xcpnet exchange functional";
item.category = "Electronic structure";
item.type = "Integer Real ...";
item.type = "Integer followed by Real values";
item.description = "Customized parameterization on the exchange part of XC functional. The first value should be the LibXC ID of the original functional, and latter values are external parameters. Default values are those of Perdew-Burke-Ernzerhof (PBE) functional. For more information on LibXC ID of functionals, please refer to LibXC. For parameters of functionals of interest, please refer to the source code of LibXC, such as PBE functional interface in LibXC: gga_x_pbe.c."
"\n\n[NOTE] Solely setting this keyword will take no effect on XC functionals. One should also set "
"dft_functional to the corresponding functional to apply the customized parameterization. "
Expand Down Expand Up @@ -393,7 +393,7 @@ The other way is only available when compiling with LIBXC, and it allows for sup
Input_Item item("xc_corr_ext");
item.annotation = "placeholder for xcpnet exchange functional";
item.category = "Electronic structure";
item.type = "Integer Real ...";
item.type = "Integer followed by Real values";
item.description = "Customized parameterization on the correlation part of XC functional. The first value should be the LibXC ID of the original functional, and latter values are external parameters. Default values are those of Perdew-Burke-Ernzerhof (PBE) functional. For more information on LibXC ID of functionals, please refer to LibXC. For parameters of functionals of interest, please refer to the source code of LibXC, such as PBE functional interface in LibXC: gga_c_pbe.c."
"\n\n[NOTE] Solely setting this keyword will take no effect on XC functionals. One should also set "
"dft_functional to the corresponding functional to apply the customized parameterization. "
Expand Down Expand Up @@ -1350,7 +1350,7 @@ Use case: When experimental or high-level theoretical results suggest that the S
Input_Item item("bessel_nao_rcut");
item.annotation = "radial cutoff for spherical bessel functions(a.u.)";
item.category = "NAOs";
item.type = "Real";
item.type = "Vector of Real (N values)";
item.description = "Cutoff radius (in Bohr) and the common node of spherical Bessel functions used to construct the NAOs.";
item.default_value = "6.0";
item.unit = "";
Expand Down
24 changes: 12 additions & 12 deletions source/source_io/module_parameter/read_input_item_exx_dftu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ void ReadInput::item_exx()
Input_Item item("exx_fock_alpha");
item.annotation = "fraction of Fock exchange 1/r in hybrid functionals";
item.category = "Exact Exchange (Common)";
item.type = "Real \\Real...\\";
item.description = "Fraction of full-ranged Fock exchange 1/r () in range-separated hybrid funtionals, so that .";
item.type = "Real";
item.description = R"(Fraction of full-ranged Fock exchange $1/r$ in range-separated hybrid functionals.)";
item.default_value = "see hybrid_func_params";
item.unit = "";
item.availability = "";
Expand Down Expand Up @@ -63,8 +63,8 @@ void ReadInput::item_exx()
Input_Item item("exx_erfc_alpha");
item.annotation = "fraction of exchange erfc(wr)/r in hybrid functionals";
item.category = "Exact Exchange (Common)";
item.type = "Real \\Real...\\";
item.description = "Fraction of short-ranged Fock exchange erfc(wr)/r () in range-separated hybrid funtionals, so that .";
item.type = "Real";
item.description = R"(Fraction $\beta$ of short-ranged Fock exchange $\mathrm{erfc}(\omega r)/r$ in range-separated hybrid functionals.)";
item.default_value = "see hybrid_func_params";
item.unit = "";
item.availability = "";
Expand Down Expand Up @@ -113,8 +113,8 @@ void ReadInput::item_exx()
Input_Item item("exx_erfc_omega");
item.annotation = "range-separation parameter erfc(wr)/r in hybrid functionals";
item.category = "Exact Exchange (Common)";
item.type = "Real \\Real...\\";
item.description = "Range-separation parameter in exchange, such that";
item.type = "Real";
item.description = R"(Range-separation parameter $\omega$ in the short-ranged Fock term $\mathrm{erfc}(\omega r)/r$.)";
item.default_value = "see hybrid_func_params";
item.unit = "";
item.availability = "";
Expand Down Expand Up @@ -222,7 +222,7 @@ void ReadInput::item_exx()
"the evaluation of Fock exchange using "
"lcao_in_pw method";
item.category = "Exact Exchange (LCAO in PW)";
item.type = "Real \\Real...\\";
item.type = "Real";
item.description = "It is used to compensate for divergence points at G=0 in the evaluation of Fock exchange using lcao_in_pw method.";
item.default_value = "0.3";
item.unit = "";
Expand Down Expand Up @@ -638,7 +638,7 @@ void ReadInput::item_dftu()
item.annotation = "which correlated orbitals need corrected ; d:2 "
",f:3, do not need correction:-1";
item.category = "DFT+U correction";
item.type = "Integer";
item.type = "Vector of Integer (ntype values)";
item.description = R"(Specifies which orbits need plus U correction for each atom type ( for atom type 1, 2, 3, respectively).
* -1: The plus U correction will not be calculated for this atom.
* 1: For p-electron orbits, the plus U correction is needed.
Expand Down Expand Up @@ -681,7 +681,7 @@ void ReadInput::item_dftu()
Input_Item item("hubbard_u");
item.annotation = "Hubbard Coulomb interaction parameter U(ev)";
item.category = "DFT+U correction";
item.type = "Real";
item.type = "Vector of Real (ntype values)";
item.description = R"(Specifies the Hubbard Coulomb interaction parameter U (eV) in plus U correction, which should be specified for each atom unless the Yukawa potential is used.

[NOTE] Note: Since only the simplified scheme by Duradev is implemented, the 'U' here is actually U-effective, which is given by Hubbard U minus Hund J.)";
Expand Down Expand Up @@ -791,7 +791,7 @@ void ReadInput::item_dftu()
* 1: The first SCF step will use an initial density matrix read from a file named initial_onsite.dm, but for later steps, the onsite density matrix will be updated.
* 2: The same onsite density matrix from initial_onsite.dm will be used throughout the entire calculation.

[NOTE] Note : The easiest way to create initial_onsite.dm is to run a DFT+U calculation, look for a file named onsite.dm in the OUT.prefix directory, and make replacements there. The format of the file is rather straight-forward.)";
[NOTE] The easiest way to create initial_onsite.dm is to run a DFT+U calculation, look for a file named onsite.dm in the OUT.prefix directory, and make replacements there. The format of the file is rather straight-forward.)";
item.default_value = "0";
item.unit = "";
item.availability = "";
Expand All @@ -803,8 +803,8 @@ void ReadInput::item_dftu()
item.annotation = "radius of the sphere for onsite projection (Bohr)";
item.category = "DFT+U correction";
item.type = "Real";
item.description = R"(* The Onsite-radius parameter facilitates modulation of the single-zeta portion of numerical atomic orbitals for projections for DFT+U.
* The modulation algorithm includes a smooth truncation applied directly to the tail of the original orbital, followed by normalization. Consider the function: $\sigmar_c\sigmaf'(r)\equiv \mathrm{d}f(r)/\mathrm{d}r\gamma$ is a parameter that adjusts the relative weight of the error function to the derivative error function.)";
item.description = R"(* The onsite_radius parameter facilitates modulation of the single-zeta portion of numerical atomic orbitals used for DFT+U projections.
* The modulation algorithm applies a smooth truncation to the orbital tail followed by normalization. A representative profile is $f(r)=\frac{1}{2}\left[1+\operatorname{erf}\!\left(\frac{r_c-r}{\sigma}\right)\right]$, where $r_c$ is the cutoff radius and $\sigma=\gamma r_c$ controls smoothness.)";
item.default_value = "3.0";
item.unit = "Bohr";
item.availability = "dft_plus_u is set to 1";
Expand Down
6 changes: 3 additions & 3 deletions source/source_io/module_parameter/read_input_item_other.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void ReadInput::item_others()
Input_Item item("qo_strategy");
item.annotation = "strategy to generate generate radial orbitals";
item.category = "Quasiatomic Orbital (QO) analysis";
item.type = "String";
item.type = "Vector of String (1 or n values where n is the number of atomic types)";
item.description = "Strategy to generate radial orbitals for QO analysis. For hydrogen: energy-valence, for pswfc and szv: all";
item.default_value = "for hydrogen: energy-valence, for pswfc and szv: all";
item.unit = "";
Expand Down Expand Up @@ -284,7 +284,7 @@ void ReadInput::item_others()
Input_Item item("qo_screening_coeff");
item.annotation = "rescale the shape of radial orbitals";
item.category = "Quasiatomic Orbital (QO) analysis";
item.type = "Real";
item.type = "Vector of Real (ntype values; 1 value allowed for qo_basis=pswfc)";
item.description = "The screening coefficient for each atom type to rescale the shape of radial orbitals";
item.default_value = "0.1";
item.unit = "Bohr^-1";
Expand Down Expand Up @@ -953,4 +953,4 @@ void ReadInput::item_others()
this->add_item(item);
}
}
} // namespace ModuleIO
} // namespace ModuleIO
Loading
Loading