diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 5ada0540ef..1575474a36 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -174,7 +174,7 @@ An practical example is class [LCAO_Deepks](https://github.com/deepmodeling/abac ABACUS includes a built-in help system that allows users to query INPUT parameters directly from the command line (e.g., `abacus -h ecutwfc`). Parameter metadata is defined inline in the C++ source files (`source/source_io/module_parameter/read_input_item_*.cpp`) using `Input_Item` registrations. -A checked-in file `docs/parameters.yaml` contains a YAML dump of all parameter metadata, generated from the binary itself. This file is used by Sphinx to produce the online documentation page `input-main.md`. +The C++ `Input_Item` registrations are the source of truth for parameter metadata. The checked-in `docs/parameters.yaml` and `docs/advanced/input_files/input-main.md` files are generated artifacts: do not edit either file manually. `parameters.yaml` is generated from the binary and is used by Sphinx to produce `input-main.md`. ### When to Update `docs/parameters.yaml` @@ -198,13 +198,13 @@ Then verify the YAML is valid: python3 -c "import yaml; d=yaml.safe_load(open('docs/parameters.yaml')); print(len(d['parameters']), 'parameters')" ``` -You can also regenerate the markdown documentation locally: +Then regenerate the markdown documentation locally: ```bash python3 docs/generate_input_main.py docs/parameters.yaml --output docs/advanced/input_files/input-main.md ``` -**Important:** Include the updated `docs/parameters.yaml` and `input-main.md` in your commit when submitting a PR that modifies INPUT parameters. Reviewers should verify the YAML changes match the C++ source changes and the `input-main.md` is updated. +**Important:** Include the updated `docs/parameters.yaml` and `input-main.md` in your commit when submitting a PR that modifies INPUT parameters. CI regenerates both files from the built binary and rejects any mismatch. Do not fix a documentation mismatch by editing either generated file; update the C++ `Input_Item` registration and regenerate them instead. ### Parameter Documentation Format @@ -218,7 +218,7 @@ When adding or modifying INPUT parameters in C++ source, set the following field item.description = "Description of what this parameter does."; item.default_value = "0"; item.unit = "Ry"; // Optional, empty string if no unit - item.availability = ""; // Optional, empty string if always available + item.set_availability("basis_type==pw"); // Optional; omit if always available // ... read_value, reset_value, check_value functions ... this->add_item(item); } diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index 375b451eed..1d55f8e719 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -739,7 +739,7 @@ ### mem_saver - **Type**: Integer -- **Availability**: *Used only for nscf calculations with plane wave basis set.* +- **Availability**: *calculation==nscf and basis_type==pw* - **Description**: Save memory when performing nscf calculations. - 0: no memory saving techniques are used. - 1: a memory saving technique will be used for many k point calculations. @@ -754,7 +754,7 @@ ### diago_proc - **Type**: Integer -- **Availability**: *Used only for plane wave basis set.* +- **Availability**: *basis_type==pw* - **Description**: - 0: it will be set to the number of MPI processes. - >0: it specifies the number of processes used for carrying out diagonalization. Must be less than or equal to total number of MPI processes. - **Default**: 0 @@ -807,7 +807,7 @@ ### precision - **Type**: String -- **Availability**: *Used only for plane wave basis set.* +- **Availability**: *basis_type==pw* - **Description**: Specifies the precision when performing scf calculation. - single: single precision - double: double precision @@ -816,7 +816,7 @@ ### gint_precision - **Type**: String -- **Availability**: *Used only for LCAO basis set.* +- **Availability**: *basis_type==lcao* - **Description**: Specifies the precision when performing grid integral in LCAO calculations. - single: single precision - double: double precision @@ -899,14 +899,14 @@ ### restart_load - **Type**: Boolean -- **Availability**: *Used only when numerical atomic orbitals are employed as basis set.* +- **Availability**: *basis_type==lcao* - **Description**: If restart_save is set to true and an electronic iteration is finished, calculations can be restarted from the charge density file, which are saved in the former calculation. - **Default**: False ### spillage_outdir - **Type**: String -- **Availability**: *Used only for plane wave basis set.* +- **Availability**: *basis_type==pw* - **Description**: The directory to save the spillage files. - **Default**: "./" @@ -980,7 +980,7 @@ ### pw_seed - **Type**: Integer -- **Availability**: *Only used for plane wave basis.* +- **Availability**: *basis_type==pw* - **Description**: Specify the random seed to initialize wave functions. Only positive integers are available. - **Default**: 0 @@ -1039,14 +1039,14 @@ ### use_k_continuity - **Type**: Boolean -- **Availability**: *Used only for plane wave basis set.* +- **Availability**: *basis_type==pw* - **Description**: If TRUE, the wavefunctions at k-point will be initialized from the converged wavefunctions at the nearest k-point, which can speed up the SCF convergence. Only works for PW basis. - **Default**: false ### pw_diag_nmax - **Type**: Integer -- **Availability**: *basis_type==pw, ks_solver==cg/dav/dav_subspace/bpcg* +- **Availability**: *basis_type==pw and ks_solver in [cg, dav, dav_subspace, bpcg]* - **Description**: Only useful when you use ks_solver = cg/dav/dav_subspace/bpcg. It indicates the maximal iteration number for cg/david/dav_subspace/bpcg method. - **Default**: 50 @@ -1350,7 +1350,7 @@ ### mixing_dmr - **Type**: Boolean -- **Availability**: *Only for mixing_restart >= 0.0* +- **Availability**: *mixing_restart>=0* - **Description**: At n-th iteration which is calculated by drho<mixing_restart, SCF will start a mixing for real-space density matrix by using the same coefficiences as the mixing of charge density. - **Default**: false @@ -1383,7 +1383,7 @@ ### mixing_angle - **Type**: Real -- **Availability**: *Only relevant for non-colinear calculations nspin=4.* +- **Availability**: *nspin==4* - **Description**: Normal broyden mixing can give the converged result for a given magnetic configuration. If one is not interested in the energies of a given magnetic configuration but wants to determine the ground state by relaxing the magnetic moments' directions, one cannot rely on the standard Broyden mixing algorithm. To enhance the ability to find correct magnetic configuration for non-colinear calculations, ABACUS implements a promising mixing method proposed by J. Phys. Soc. Jpn. 82 (2013) 114706. Here, mixing_angle is the angle mixing parameter. In fact, only mixing_angle=1.0 is implemented currently. - <=0: Normal broyden mixing - >0: Angle mixing for the modulus with mixing_angle=1.0 @@ -1392,7 +1392,6 @@ ### mixing_tau - **Type**: Boolean -- **Availability**: *Only relevant for meta-GGA calculations.* - **Description**: Whether to mix the kinetic energy density. - True: The kinetic energy density will also be mixed. It seems for general cases, SCF converges fine even without this mixing. However, if there is difficulty in converging SCF for meta-GGA, it might be helpful to turn this on. - False: The kinetic energy density will not be mixed. @@ -1401,7 +1400,7 @@ ### mixing_dftu - **Type**: Boolean -- **Availability**: *Only relevant for DFT+U calculations.* +- **Availability**: *dft_plus_u==1* - **Description**: Whether to mix the occupation matrices. - True: The occupation matrices will also be mixed by plain mixing. From experience this is not very helpful if the +U calculation does not converge. - False: The occupation matrices will not be mixed. @@ -1410,7 +1409,7 @@ ### gamma_only - **Type**: Boolean -- **Availability**: *Only used in localized orbitals set* +- **Availability**: *basis_type==lcao* - **Description**: Whether to use gamma_only algorithm. - 0: more than one k-point is used and the ABACUS is slower compared to the gamma only algorithm. - 1: ABACUS uses gamma only, the algorithm is faster and you don't need to specify the k-points file. @@ -1505,7 +1504,7 @@ ### soc_lambda - **Type**: Real -- **Availability**: *Only works when lspinorb=true* +- **Availability**: *lspinorb==true* - **Description**: Modulates the strength of spin-orbit coupling effect. Sometimes, for some real materials, both scalar-relativistic and full-relativistic pseudopotentials cannot describe the exact spin-orbit coupling. Artificial modulation may help in such cases. soc_lambda, which has value range [0.0, 1.0], is used to modulate SOC effect: @@ -1532,7 +1531,7 @@ ### method_sto - **Type**: Integer -- **Availability**: *esolver_type = sdft* +- **Availability**: *esolver_type==sdft* - **Description**: Different methods to do stochastic DFT - 1: Calculate twice, this method cost less memory but is slower. - 2: Calculate once but needs much more memory. This method is much faster. Besides, it calculates with a smaller nche_sto. However, when the memory is not enough, only method 1 can be used. @@ -1542,7 +1541,7 @@ ### nbands_sto - **Type**: Integer or string -- **Availability**: *esolver_type = sdft* +- **Availability**: *esolver_type==sdft* - **Description**: The number of stochastic orbitals - 1-1000000: Perform stochastic DFT. Increasing the number of bands improves accuracy and reduces stochastic errors; To perform mixed stochastic-deterministic DFT, you should set nbands, which represents the number of KS orbitals. - 0: Invalid. Use all for the complete-basis SDFT mode. @@ -1552,14 +1551,14 @@ ### nche_sto - **Type**: Integer -- **Availability**: *esolver_type = sdft* +- **Availability**: *esolver_type==sdft* - **Description**: Chebyshev expansion orders for stochastic DFT. - **Default**: 100 ### emin_sto - **Type**: Real -- **Availability**: *esolver_type = sdft* +- **Availability**: *esolver_type==sdft* - **Description**: Trial energy to guess the lower bound of eigen energies of the Hamiltonian Operator. - **Default**: 0.0 - **Unit**: Ry @@ -1567,7 +1566,7 @@ ### emax_sto - **Type**: Real -- **Availability**: *esolver_type = sdft* +- **Availability**: *esolver_type==sdft* - **Description**: Trial energy to guess the upper bound of eigen energies of the Hamiltonian Operator. - **Default**: 0.0 - **Unit**: Ry @@ -1575,7 +1574,7 @@ ### seed_sto - **Type**: Integer -- **Availability**: *esolver_type = sdft* +- **Availability**: *esolver_type==sdft* - **Description**: The random seed to generate stochastic orbitals. - >= 0: Stochastic orbitals have the form of exp(i*theta), where theta is a uniform distribution in [0, 2*pi). - 0: the seed is decided by time(NULL). @@ -1586,7 +1585,7 @@ ### initsto_ecut - **Type**: Real -- **Availability**: *esolver_type = sdft* +- **Availability**: *esolver_type==sdft* - **Description**: Stochastic wave functions are initialized in a large box generated by "4*initsto_ecut". initsto_ecut should be larger than ecutwfc. In this method, SDFT results are the same when using different cores. Besides, coefficients of the same G are the same when ecutwfc is rising to initsto_ecut. If it is smaller than ecutwfc, it will be turned off. - **Default**: 0.0 - **Unit**: Ry @@ -1594,7 +1593,7 @@ ### initsto_freq - **Type**: Integer -- **Availability**: *esolver_type = sdft* +- **Availability**: *esolver_type==sdft* - **Description**: Frequency (once each initsto_freq steps) to generate new stochastic orbitals when running md. - positive integer: Update stochastic orbitals - 0: Never change stochastic orbitals. @@ -1603,7 +1602,7 @@ ### npart_sto - **Type**: Integer -- **Availability**: *method_sto = 2 and out_dos = 1 or cal_cond = True* +- **Availability**: *(method_sto==2 and out_dos==1) or cal_cond==true* - **Description**: Make memory cost to 1/npart_sto times of the previous one when running the post process of SDFT like DOS or conductivities. - **Default**: 1 @@ -1639,7 +1638,7 @@ ### relax_scale_force - **Type**: Real -- **Availability**: *Only used when relax_method is cg 2* +- **Availability**: *relax_method in [cg 2]* - **Description**: The paramether controls the size of the first conjugate gradient step. A smaller value means the first step along a new CG direction is smaller. This might be helpful for large systems, where it is safer to take a smaller initial step to prevent the collapse of the whole configuration. - **Default**: 0.5 @@ -1652,7 +1651,7 @@ ### relax_cg_thr - **Type**: Real -- **Availability**: *Only used when relax_method is cg_bfgs* +- **Availability**: *relax_method==cg_bfgs* - **Description**: When relax_method is set to cg_bfgs, a mixed algorithm of conjugate gradient (CG) and Broyden–Fletcher–Goldfarb–Shanno (BFGS) is used. The ions first move according to the CG method, then switch to the BFGS method when the maximum force on atoms is reduced below this threshold. - **Default**: 0.5 - **Unit**: eV/Angstrom @@ -1681,21 +1680,21 @@ ### relax_bfgs_w1 - **Type**: Real -- **Availability**: *Only used when relax_method is bfgs or cg_bfgs* +- **Availability**: *relax_method in [bfgs, cg_bfgs]* - **Description**: Controls the Wolfe condition for the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm used in geometry relaxation. This parameter sets the sufficient decrease condition (c1 in Wolfe conditions). For more information, see Phys. Chem. Chem. Phys., 2000, 2, 2177. - **Default**: 0.01 ### relax_bfgs_w2 - **Type**: Real -- **Availability**: *Only used when relax_method is bfgs or cg_bfgs* +- **Availability**: *relax_method in [bfgs, cg_bfgs]* - **Description**: Controls the Wolfe condition for the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm used in geometry relaxation. This parameter sets the curvature condition (c2 in Wolfe conditions). For more information, see Phys. Chem. Chem. Phys., 2000, 2, 2177. - **Default**: 0.5 ### relax_bfgs_rmax - **Type**: Real -- **Availability**: *Only used when relax_method is bfgs or cg_bfgs* +- **Availability**: *relax_method in [bfgs, cg_bfgs]* - **Description**: Maximum allowed total displacement of all atoms during geometry optimization. The sum of atomic displacements can increase during optimization steps but cannot exceed this value. - **Default**: 0.8 - **Unit**: Bohr @@ -1703,7 +1702,7 @@ ### relax_bfgs_rmin - **Type**: Real -- **Availability**: *Only used when relax_method is bfgs 1 (traditional BFGS)* +- **Availability**: *relax_method in [bfgs 1]* - **Description**: Minimum allowed total displacement of all atoms. When the total atomic displacement falls below this value and force convergence is not achieved, the calculation will terminate. Note: This parameter is not used in the default BFGS algorithm (relax_method = bfgs 2 or bfgs). - **Default**: 1e-5 - **Unit**: Bohr @@ -1711,7 +1710,7 @@ ### relax_bfgs_init - **Type**: Real -- **Availability**: *Only used when relax_method is bfgs or cg_bfgs* +- **Availability**: *relax_method in [bfgs, cg_bfgs]* - **Description**: Initial total displacement of all atoms in the first BFGS step. This sets the scale for the initial movement. - **Default**: 0.5 - **Unit**: Bohr @@ -1747,7 +1746,7 @@ ### fixed_axes - **Type**: String -- **Availability**: *Only used when calculation is set to cell-relax* +- **Availability**: *calculation==cell-relax* - **Description**: Specifies which cell degrees of freedom are fixed during variable-cell relaxation. The available options depend on relax_method: With relax_method = cg 2 (default), all options are available: @@ -1771,7 +1770,7 @@ ### fixed_ibrav - **Type**: Boolean -- **Availability**: *Only used with relax_method = cg 2. A specific latname must be provided.* +- **Availability**: *relax_method in [cg 2] and latname!=none* - **Description**: - True: the lattice type will be preserved during relaxation. The lattice vectors are reconstructed to match the specified Bravais lattice type after each update. - False: No restrictions are exerted during relaxation in terms of lattice type @@ -1875,7 +1874,7 @@ ### out_dmk - **Type**: Boolean \[Integer\](optional) -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Whether to output the density matrix for each k-point into files in the folder OUT.${suffix}. For current develop versions, out_dmk writes *_nao.txt files and includes a g{istep} index in the file name: - For gamma only case: - nspin = 1 and 4: dmg1_nao.txt; @@ -1894,7 +1893,7 @@ ### out_dmr - **Type**: Boolean \[Integer\](optional) -- **Availability**: *Numerical atomic orbital basis (multi-k points)* +- **Availability**: *basis_type==lcao and gamma_only==0* - **Description**: Whether to output the density matrix with Bravias lattice vector R index into files in the folder OUT.${suffix}. The files are named as dmr{s}{spin index}{g}{geometry index}{_nao} + {".csr"}. Here, 's' refers to spin, where s1 means spin up channel while s2 means spin down channel, and the sparse matrix format 'csr' is mentioned in out_hsr. Finally, if out_app_flag is set to false, the file name contains the optional 'g' index for each ionic step that may have different geometries, and if out_app_flag is set to true, the density matrix with respect to Bravias lattice vector R accumulates during ionic steps: - nspin = 1: dmrs1_nao.csr; - nspin = 2: dmrs1_nao.csr and dmrs2_nao.csr for the two spin channels. @@ -1905,7 +1904,7 @@ ### out_wfc_pw - **Type**: Integer -- **Availability**: *Output electronic wave functions in plane wave basis, or transform the real-space electronic wave function into plane wave basis (see get_wf option in calculation with NAO basis)* +- **Availability**: *basis_type==pw or (basis_type==lcao and calculation==get_wf)* - **Description**: Whether to output the electronic wavefunction coefficients into files and store them in the folder OUT.${suffix}. The files are named as wf{k}{k-point index}{s}{spin index}{g}{geometry index}{e}{electronic iteration index}{_pw} + {".txt"/".dat"}. Here, the s index refers to spin but the label will not show up for non-spin-polarized calculations, where s1 means spin up channel while s2 means spin down channel, and s4 refers to spinor wave functions that contains both spin channels with spin-orbital coupling or noncollinear calculations enabled. For scf or nscf calculations, g index will not appear, but the g index appears for geometry relaxation and molecular dynamics, where one can use the out_freq_ion command to control. To print out the electroinc wave functions every few SCF iterations, use the out_freq_elec command and the e index will appear in the file name. - 0: no output - 1: (txt format) @@ -1923,7 +1922,7 @@ ### out_wfc_lcao - **Type**: Integer -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Whether to output the electronic wavefunction coefficients into files and store them in the folder OUT.${suffix}. The files are named as wf{s}{spin index}{k(optional)}{k-point index}{g(optional)}{geometry index1}{_nao} + {".txt"/".dat"}. Here, 's' refers to spin, where s1 means spin up channel while s2 means spin down channel, and 's12' refer to spinor wave functions that contains both spin channels with spin-orbital coupling or noncollinear calculations enabled. In addition, if 'gamma_only' is set to 0, then the optinoal k-point sampling index appears with the k-point index attached to the electronic wave function file names. Finally, if out_app_flag is set to false, the file name contains the optional 'g' index for each ionic step that may have different geometries, and if out_app_flag is set to true, the wave functions accumulate during ionic steps. If the out_app_flag is set to false, a new folder named WFC will be created, and the wave function files will be saved into it. - 0: no output - 1: (txt format) @@ -1999,7 +1998,7 @@ ### out_hsk - **Type**: Integer \[Integer\](optional) -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Output the upper triangular part of the Hamiltonian and overlap matrices in reciprocal space for each k-point into files in the directory OUT.${suffix}. The first integer selects the format: - 0: disabled; - 1: text output; the optional second integer controls precision and defaults to 8; @@ -2025,7 +2024,7 @@ ### out_mat_hs - **Type**: Boolean \[Integer\](optional) -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Legacy alias for out_hsk 1, which outputs Hamiltonian and overlap matrices in reciprocal space for each k-point. The optional second integer controls text precision. If both out_hsk and out_mat_hs are present, out_hsk takes precedence. - **Default**: False 8 - **Unit**: Ry @@ -2033,7 +2032,7 @@ ### out_hsr - **Type**: Integer \[Integer\](optional) -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Output Hamiltonian and overlap matrices in real space, indexed by the Bravais lattice vector R, in the directory OUT.${suffix}. The first integer selects the format: - 0: disabled; - 1: text CSR output; the optional second integer controls precision and defaults to 8; @@ -2049,7 +2048,7 @@ ### out_mat_hs2 - **Type**: Boolean \[Integer\](optional) -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Legacy alias for out_hsr 1, which outputs Hamiltonian and overlap matrices in real space indexed by the Bravais lattice vector R. The optional second integer controls text precision. If both out_hsr and out_mat_hs2 are present, out_hsr takes precedence. - **Default**: False 8 - **Unit**: Ry @@ -2057,7 +2056,7 @@ ### out_mat_tk - **Type**: Boolean \[Integer\](optional) -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Whether to print the upper triangular part of the kinetic matrices for each k-point into OUT.${suffix}/tks1ki_nao.txt, where i is the index of k points. One may optionally provide a second parameter to specify the precision. > Note: In the 3.10-LTS version, the file names are data-TR-sparse_SPIN0.csr, etc. @@ -2067,7 +2066,7 @@ ### out_mat_r - **Type**: Boolean \[Integer\](optional) -- **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* +- **Availability**: *basis_type==lcao and gamma_only==0* - **Description**: Whether to print the matrix representation of the position matrix into files named rxrs1_nao.csr, ryrs1_nao.csr, rzrs1_nao.csr in the directory OUT.${suffix}. The optional second parameter controls text output precision. If calculation is set to get_s, the position matrix can be obtained without scf iterations. For more information, please refer to position_matrix.md. > Note: In the 3.10-LTS version, the file name is data-rR-sparse.csr. @@ -2077,7 +2076,7 @@ ### out_mat_t - **Type**: Boolean \[Integer\](optional) -- **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* +- **Availability**: *basis_type==lcao and gamma_only==0* - **Description**: Generate files containing the kinetic energy matrix. The optional second parameter controls text output precision. The format will be the same as the Hamiltonian matrix and overlap matrix as mentioned in out_hsr. The name of the files will be trs1_nao.csr and so on. Also controled by out_freq_ion and out_app_flag. > Note: In the 3.10-LTS version, the file name is data-TR-sparse_SPIN0.csr. @@ -2087,7 +2086,7 @@ ### out_mat_dh - **Type**: Integer -- **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* +- **Availability**: *basis_type==lcao and gamma_only==0* - **Description**: Whether to print files containing the derivatives of the Hamiltonian matrix. The format will be the same as the Hamiltonian matrix and overlap matrix as mentioned in out_hsr. The name of the files will be dhrxs1_nao.csr, dhrys1_nao.csr, dhrzs1_nao.csr and so on. Also controled by out_freq_ion and out_app_flag. Format: <enable> [precision] [iat1 iat2 ...]. The first value (0/1) enables/disables output. The second optional value sets the output precision (default: 8). Starting from the third value, 1-based atom indices can be listed to restrict output to derivatives with respect to those specific atoms only; if no atom indices are given, all atoms are written. @@ -2207,7 +2206,7 @@ ### out_mat_ds - **Type**: Boolean \[Integer\](optional) -- **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* +- **Availability**: *basis_type==lcao and gamma_only==0* - **Description**: Whether to print files containing the derivatives of the overlap matrix. The optional second parameter controls text output precision. The format will be the same as the overlap matrix as mentioned in out_mat_dh. The name of the files will be dsxrs1_nao.csr and so on. Also controled by out_freq_ion and out_app_flag. This feature can be used with calculation get_s. > Note: In the 3.10-LTS version, the file name is data-dSRx-sparse_SPIN0.csr and so on. @@ -2217,7 +2216,7 @@ ### out_mat_xc - **Type**: Boolean -- **Availability**: *Numerical atomic orbital (NAO) and NAO-in-PW basis* +- **Availability**: *basis_type in [lcao, lcao_in_pw]* - **Description**: Whether to print the upper triangular part of the exchange-correlation matrices in Kohn-Sham orbital representation: for each k point into files in the directory OUT.i_nao.txt, where {suffix}/vxc_out.dat. If EXX is calculated, the local and EXX part of band energy will also be printed in OUT.{suffix}/vxc_exx_out.dat, respectively. All the vxc_out.dat files contains 3 integers (nk, nspin, nband) followed by nk*nspin*nband lines of energy Hartree and eV. > Note: In the 3.10-LTS version, the file name is k-$k-Vxc and so on. @@ -2227,7 +2226,7 @@ ### out_mat_xc2 - **Type**: Boolean \[Integer\](optional) -- **Availability**: *Numerical atomic orbital (NAO) basis* +- **Availability**: *basis_type==lcao* - **Description**: Whether to print the exchange-correlation matrices in numerical orbital representation: in CSR format in the directory OUT.${suffix}. The name of the files will be vxcrs1_nao.csr and so on. > Note: In the 3.10-LTS version, the file name is Vxc_R_spin$s and so on. @@ -2237,7 +2236,7 @@ ### out_mat_l - **Type**: Boolean \[Integer\](optional) -- **Availability**: *Numerical atomic orbital (NAO) basis* +- **Availability**: *basis_type==lcao* - **Description**: Whether to print the expectation value of the angular momentum operator , , and in the basis of the localized atomic orbitals. The files are named OUT.{suffix}_Lx.dat, OUT.{suffix}_Ly.dat, and OUT.{suffix}_Lz.dat. The second integer controls the precision of the output. - **Default**: False 8 @@ -2259,14 +2258,14 @@ ### out_eband_terms - **Type**: Boolean -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Whether to print the band energy terms separately in the file OUT.{term}_out.dat. The terms include the kinetic, pseudopotential (local + nonlocal), Hartree and exchange-correlation (including exact exchange if calculated). - **Default**: False ### out_hr_npz - **Type**: Boolean -- **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* +- **Availability**: *basis_type==lcao and gamma_only==0* - **Description**: Whether to print Hamiltonian matrices H(R) in NPZ format as hrs1_nao.npz and, for nspin = 2, hrs2_nao.npz. This feature does not work for gamma-only calculations. - **Default**: False - **Unit**: Ry @@ -2274,7 +2273,7 @@ ### out_hsr_npz - **Type**: Boolean -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Legacy alias for out_hsr 3, writing hrs1_nao.npz, hrs2_nao.npz when needed, and sr_nao.npz. If both out_hsr and out_hsr_npz are present, out_hsr takes precedence. Gamma-only calculations write the folded R = (0, 0, 0) representation. - **Default**: False - **Unit**: Ry @@ -2282,28 +2281,28 @@ ### out_dm_npz - **Type**: Boolean -- **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* +- **Availability**: *basis_type==lcao and gamma_only==0* - **Description**: Whether to print density matrices DM(R) in npz format. This feature does not work for gamma-only calculations. - **Default**: False ### out_mul - **Type**: Boolean -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Whether to print the Mulliken population analysis result into OUT.${suffix}/mulliken.txt. In molecular dynamics calculations, the output frequency is controlled by out_freq_ion. - **Default**: False ### out_app_flag - **Type**: Boolean -- **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* +- **Availability**: *basis_type==lcao and gamma_only==0* - **Description**: Whether to output r(R), H(R), S(R), T(R), dH(R), dS(R), and wfc matrices in an append manner during molecular dynamics calculations. Check input parameters out_mat_r, out_hsr, out_mat_t, out_mat_dh, out_hsk and out_wfc_lcao for more information. - **Default**: true ### out_ndigits - **Type**: Integer -- **Availability**: *out_hsk 1 case presently.* +- **Availability**: *out_hsk==1* - **Description**: Controls the length of decimal part of output data, such as charge density, Hamiltonian matrix, Overlap matrix and so on. - **Default**: 8 @@ -2316,7 +2315,7 @@ ### restart_save - **Type**: Boolean -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Whether to save charge density files per ionic step, which are used to restart calculations. According to the value of read_file_dir: - auto: These files are saved in folder OUT.{read_file_dir}/restart/. @@ -2334,35 +2333,35 @@ ### out_pchg - **Type**: String -- **Availability**: *For both PW and LCAO. When basis_type = lcao, used when calculation = get_pchg.* +- **Availability**: *basis_type==pw or (basis_type==lcao and calculation==get_pchg)* - **Description**: Specifies the electronic states to calculate the charge densities with state index for, using a space-separated string of 0s and 1s. Each digit in the string corresponds to a state, starting from the first state. A 1 indicates that the charge density should be calculated for that state, while a 0 means the state will be ignored. The parameter allows a compact and flexible notation (similar to ocp_set), for example the syntax 1 4*0 5*1 0 is used to denote the selection of states: 1 means calculate for the first state, 4*0 skips the next four states, 5*1 means calculate for the following five states, and the final 0 skips the next state. It's essential that the total count of states does not exceed the total number of states (nbands); otherwise, it results in an error, and the process exits. The input string must contain only numbers and the asterisk (*) for repetition, ensuring correct format and intention of state selection. The outputs comprise multiple .cube files following the naming convention pchgi[state]s[spin]k[kpoint].cube. - **Default**: none ### out_wfc_norm - **Type**: String -- **Availability**: *For both PW and LCAO. When basis_type = lcao, used when calculation = get_wf.* +- **Availability**: *basis_type==pw or (basis_type==lcao and calculation==get_wf)* - **Description**: Specifies the electronic states to calculate the real-space wave function modulus (norm, or known as the envelope function) with state index. The syntax and state selection rules are identical to out_pchg, but the output is the norm of the wave function. The outputs comprise multiple .cube files following the naming convention wfi[state]s[spin]k[kpoint].cube. - **Default**: none ### out_wfc_re_im - **Type**: String -- **Availability**: *For both PW and LCAO. When basis_type = lcao, used when calculation = get_wf.* +- **Availability**: *basis_type==pw or (basis_type==lcao and calculation==get_wf)* - **Description**: Specifies the electronic states to calculate the real and imaginary parts of the wave function with state index. The syntax and state selection rules are identical to out_pchg, but the output contains both the real and imaginary components of the wave function. The outputs comprise multiple .cube files following the naming convention wfi[state]s[spin]k[kpoint][re/im].cube. - **Default**: none ### if_separate_k - **Type**: Boolean -- **Availability**: *For both PW and LCAO. When basis_type = pw, used if out_pchg is set. When basis_type = lcao, used only when calculation = get_pchg and gamma_only = 0.* +- **Availability**: *(basis_type==pw and out_pchg!=none) or (basis_type==lcao and calculation==get_pchg and gamma_only==0)* - **Description**: Specifies whether to write the partial charge densities for all k-points to individual files or merge them. Warning: Enabling symmetry may produce unwanted results due to reduced k-point weights and symmetry operations in real space. Therefore when calculating partial charge densities, if you are not sure what you want exactly, it is strongly recommended to set symmetry = -1. It is noteworthy that your symmetry setting should remain the same as that in the SCF procedure. - **Default**: false ### out_elf - **Type**: Integer \[Integer\](optional) -- **Availability**: *Only for Kohn-Sham DFT and Orbital Free DFT.* +- **Availability**: *esolver_type in [ksdft, ofdft]* - **Description**: Whether to output the electron localization function (ELF) in the folder `OUT.${suffix}`. The files are named as - nspin = 1: - elftot.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i}|^2} - \frac{|\nabla\rho|^2}{8\rho}}{\frac{3}{10}(3\pi^2)^{2/3}\rho^{5/3}}$; @@ -2382,7 +2381,7 @@ ### out_spillage - **Type**: Integer -- **Availability**: *Only for Kohn-Sham DFT with plane-wave basis.* +- **Availability**: *esolver_type==ksdft and basis_type==pw* - **Description**: This output is only intentively needed by the ABACUS numerical atomic orbital generation workflow. This parameter is used to control whether to output the overlap integrals between truncated spherical Bessel functions (TSBFs) and plane-wave basis expanded wavefunctions (named as OVERLAP_Q), and between TSBFs (named as OVERLAP_Sq), also their first order derivatives. The output files are named starting with orb_matrix. A value of 2 would enable the output. - **Default**: 0 @@ -2498,7 +2497,7 @@ ### deepks_out_labels - **Type**: Integer -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Print labels and descriptors for DeePKS in OUT.${suffix}. The names of these files start with "deepks". - 0 : No output. - 1 : Output intermediate files needed during DeePKS training. @@ -2510,21 +2509,21 @@ ### deepks_out_freq_elec - **Type**: Integer -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: When deepks_out_freq_elec is greater than 0, print labels and descriptors for DeePKS in OUT.${suffix}/DeePKS_Labels_Elec per deepks_out_freq_elec electronic iterations, with suffix _e* to distinguish different steps. Often used with deepks_out_labels equals 1. - **Default**: 0 ### deepks_out_base - **Type**: String -- **Availability**: *Numerical atomic orbital basis and deepks_out_freq_elec is greater than 0* +- **Availability**: *basis_type==lcao and deepks_out_freq_elec>0* - **Description**: Print labels and descriptors calculated by base functional ( determined by deepks_out_base ) and target functional ( determined by dft_functional ) for DeePKS in per deepks_out_freq_elec electronic iterations. The SCF process, labels and descriptors output of the target functional are all consistent with those when the target functional is used alone. The only additional output under this configuration is the labels of the base functional. Often used with deepks_out_labels equals 1. - **Default**: None ### deepks_scf - **Type**: Boolean -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: perform self-consistent field iteration in DeePKS method > Note: A trained, traced model file is needed. @@ -2533,7 +2532,7 @@ ### deepks_equiv - **Type**: Boolean -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: whether to use equivariant version of DeePKS > Note: The equivariant version of DeePKS-kit is still under development, so this feature is currently only intended for internal usage. @@ -2542,21 +2541,21 @@ ### deepks_model - **Type**: String -- **Availability**: *Numerical atomic orbital basis and deepks_scf is true* +- **Availability**: *basis_type==lcao and deepks_scf==true* - **Description**: the path of the trained, traced neural network model file generated by deepks-kit - **Default**: None ### bessel_descriptor_lmax - **Type**: Integer -- **Availability**: *gen_bessel calculation* +- **Availability**: *calculation==gen_bessel* - **Description**: the maximum angular momentum of the Bessel functions generated as the projectors in DeePKS - NOte: To generate such projectors, set calculation type to gen_bessel in ABACUS. See also calculation. - **Default**: 2 ### bessel_descriptor_ecut - **Type**: String -- **Availability**: *gen_bessel calculation* +- **Availability**: *calculation==gen_bessel* - **Description**: energy cutoff of Bessel functions - **Default**: same as ecutwfc - **Unit**: Ry @@ -2564,14 +2563,14 @@ ### bessel_descriptor_tolerence - **Type**: Real -- **Availability**: *gen_bessel calculation* +- **Availability**: *calculation==gen_bessel* - **Description**: tolerance for searching the zeros of Bessel functions - **Default**: 1.0e-12 ### bessel_descriptor_rcut - **Type**: Real -- **Availability**: *gen_bessel calculation* +- **Availability**: *calculation==gen_bessel* - **Description**: cutoff radius of Bessel functions - **Default**: 6.0 - **Unit**: Bohr @@ -2579,14 +2578,14 @@ ### bessel_descriptor_smooth - **Type**: Boolean -- **Availability**: *gen_bessel calculation* +- **Availability**: *calculation==gen_bessel* - **Description**: smooth the Bessel functions at radius cutoff - **Default**: False ### bessel_descriptor_sigma - **Type**: Real -- **Availability**: *gen_bessel calculation* +- **Availability**: *calculation==gen_bessel* - **Description**: smooth parameter at the cutoff radius of projectors - **Default**: 0.1 - **Unit**: Bohr @@ -2594,7 +2593,7 @@ ### deepks_bandgap - **Type**: Integer -- **Availability**: *Numerical atomic orbital basis and deepks_scf is true* +- **Availability**: *basis_type==lcao and deepks_scf==true* - **Description**: include bandgap label for DeePKS training - 0: Don't include bandgap label - 1: Include target bandgap label (see deepks_band_range for more details) @@ -2605,7 +2604,7 @@ ### deepks_band_range - **Type**: Integer*2 -- **Availability**: *Numerical atomic orbital basis, deepks_scf is true, and deepks_bandgap is 1 or 2* +- **Availability**: *basis_type==lcao and deepks_scf==true and deepks_bandgap in [1, 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. - 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. @@ -2614,7 +2613,7 @@ ### deepks_v_delta - **Type**: Integer -- **Availability**: *Numerical atomic orbital basis* +- **Availability**: *basis_type==lcao* - **Description**: Include V_delta/V_delta_R (Hamiltonian in k/real space) label for DeePKS training. When deepks_out_labels is true and deepks_v_delta > 0 (k space), ABACUS will output deepks_hbase.npy, deepks_vdelta.npy and deepks_htot.npy(htot=hbase+vdelta). When deepks_out_labels is true and deepks_v_delta < 0 (real space), ABACUS will output deepks_hrtot.csr, deepks_hrdelta.csr. Some more files output for different settings. NOTICE: To match the unit Normally used in DeePKS, the unit of Hamiltonian in k space is Hartree. However, currently in R space the unit is still Ry. - deepks_v_delta = 1: deepks_vdpre.npy, which is used to calculate V_delta during DeePKS training. - deepks_v_delta = 2: deepks_phialpha.npy and deepks_gevdm.npy, which can be used to calculate deepks_vdpre.npy. A recommanded method for memory saving. @@ -2637,7 +2636,7 @@ ### of_kinetic - **Type**: String -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Kinetic energy functional type: - tf: Thomas-Fermi (TF) functional - vw: von Weizsacker (vW) functional @@ -2654,7 +2653,7 @@ ### of_method - **Type**: String -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: The optimization method used in OFDFT. - cg1: Polak-Ribiere. Standard CG algorithm. - cg2: Hager-Zhang (generally faster than cg1). @@ -2664,7 +2663,7 @@ ### of_conv - **Type**: String -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Criterion used to check the convergence of OFDFT. - energy: Total energy changes less than of_tole. - potential: The norm of potential is less than of_tolp. @@ -2674,7 +2673,7 @@ ### of_tole - **Type**: Real -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Tolerance of the energy change for determining the convergence. - **Default**: 2e-6 - **Unit**: Ry @@ -2682,7 +2681,7 @@ ### of_tolp - **Type**: Real -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Tolerance of potential for determining the convergence. - **Default**: 1e-5 - **Unit**: Ry @@ -2690,40 +2689,40 @@ ### of_tf_weight - **Type**: Real -- **Availability**: *OFDFT with of_kinetic=tf, tf+, wt, ext-wt, xwm* +- **Availability**: *esolver_type==ofdft and of_kinetic in [tf, tf+, wt, ext-wt, xwm]* - **Description**: Weight of TF KEDF (kinetic energy density functional). - **Default**: 1.0 ### of_vw_weight - **Type**: Real -- **Availability**: *OFDFT with of_kinetic=vw, tf+, wt, ext-wt, lkt, xwm* +- **Availability**: *esolver_type==ofdft and of_kinetic in [vw, tf+, wt, ext-wt, lkt, xwm]* - **Description**: Weight of vW KEDF (kinetic energy density functional). - **Default**: 1.0 ### of_wt_alpha - **Type**: Real -- **Availability**: *OFDFT with of_kinetic=wt, ext-wt* +- **Availability**: *esolver_type==ofdft and of_kinetic in [wt, ext-wt]* - **Description**: Parameter alpha of WT KEDF (kinetic energy density functional). ### of_wt_beta - **Type**: Real -- **Availability**: *OFDFT with of_kinetic=wt, ext-wt* +- **Availability**: *esolver_type==ofdft and of_kinetic in [wt, ext-wt]* - **Description**: Parameter beta of WT KEDF (kinetic energy density functional). ### of_extwt_kappa - **Type**: Real -- **Availability**: *OFDFT with of_kinetic=ext-wt* +- **Availability**: *esolver_type==ofdft and of_kinetic==ext-wt* - **Description**: Parameter kappa for EXT-WT KEDF. - **Default**: 1.0 / (2.0 * std::pow(4./3., 1./3.) - 1.0) ### of_wt_rho0 - **Type**: Real -- **Availability**: *OFDFT with of_kinetic=wt* +- **Availability**: *esolver_type==ofdft and of_kinetic==wt* - **Description**: The average density of system. - **Default**: 0.0 - **Unit**: Bohr^-3 @@ -2731,7 +2730,7 @@ ### of_hold_rho0 - **Type**: Boolean -- **Availability**: *OFDFT with of_kinetic=wt* +- **Availability**: *esolver_type==ofdft and of_kinetic==wt* - **Description**: Whether to fix the average density rho0. - True: rho0 will be fixed even if the volume of system has changed, it will be set to True automatically if of_wt_rho0 is not zero. - False: rho0 will change if volume of system has changed. @@ -2740,28 +2739,28 @@ ### of_lkt_a - **Type**: Real -- **Availability**: *OFDFT with of_kinetic=lkt* +- **Availability**: *esolver_type==ofdft and of_kinetic==lkt* - **Description**: Parameter a of LKT KEDF (kinetic energy density functional). - **Default**: 1.3 ### of_xwm_rho_ref - **Type**: Real -- **Availability**: *OFDFT with of_kinetic=xwm* +- **Availability**: *esolver_type==ofdft and of_kinetic==xwm* - **Description**: Reference charge density for XWM kinetic energy functional. If set to 0, the program will use average charge density. - **Default**: 0.0 ### of_xwm_kappa - **Type**: Real -- **Availability**: *OFDFT with of_kinetic=xwm* +- **Availability**: *esolver_type==ofdft and of_kinetic==xwm* - **Description**: Parameter for XWM kinetic energy functional. See PHYSICAL REVIEW B 100, 205132 (2019) for optimal values. - **Default**: 0.0 ### of_read_kernel - **Type**: Boolean -- **Availability**: *OFDFT with of_kinetic=wt* +- **Availability**: *esolver_type==ofdft and of_kinetic==wt* - **Description**: Whether to read in the kernel file. - True: The kernel of WT KEDF (kinetic energy density functional) will be filled from the file specified by of_kernel_file. - False: The kernel of WT KEDF (kinetic energy density functional) will be filled from formula. @@ -2770,14 +2769,14 @@ ### of_kernel_file - **Type**: String -- **Availability**: *OFDFT with of_read_kernel=True* +- **Availability**: *esolver_type==ofdft and of_read_kernel==true* - **Description**: The name of WT kernel file. - **Default**: WTkernel.txt ### of_full_pw - **Type**: Boolean -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Whether to use full planewaves. - True: Ecut will be ignored while collecting planewaves, so that all planewaves will be used in FFT. - False: Only use the planewaves inside ecut, the same as KSDFT. @@ -2786,7 +2785,7 @@ ### of_full_pw_dim - **Type**: Integer -- **Availability**: *OFDFT with of_full_pw = True* +- **Availability**: *esolver_type==ofdft and of_full_pw==true* - **Description**: Specify the parity of FFT dimensions. - 0: either odd or even. - 1: odd only. @@ -2802,14 +2801,14 @@ ### of_ml_gene_data - **Type**: Boolean -- **Availability**: *Used only for KSDFT with plane wave basis* +- **Availability**: *esolver_type==ksdft and basis_type==pw* - **Description**: Controls the generation of machine learning training data. When enabled, training data in .npy format will be saved in the directory OUT.${suffix}/. - **Default**: False ### of_ml_device - **Type**: String -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Run Neural Network on GPU or CPU. - cpu: CPU - gpu: GPU @@ -2818,7 +2817,7 @@ ### of_ml_feg - **Type**: Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: The method to incorporate the Free Electron Gas (FEG) limit. - 0: Do not incorporate the FEG limit. - 1: Incorporate the FEG limit by translation. @@ -2828,14 +2827,14 @@ ### of_ml_nkernel - **Type**: Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Number of kernel functions. - **Default**: 1 ### of_ml_kernel - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the type of the i-th kernel function. - 1: Wang-Teter kernel function. - 2: Modified Yukawa function, and alpha is specified by of_ml_yukawa_alpha. @@ -2845,168 +2844,168 @@ ### of_ml_kernel_scaling - **Type**: Vector of Real -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the RECIPROCAL of scaling parameter of the i-th kernel function. - **Default**: 1.0 ### of_ml_yukawa_alpha - **Type**: Vector of Real -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the parameter alpha of i-th kernel function. ONLY used for Yukawa kernel function. - **Default**: 1.0 ### of_ml_kernel_file - **Type**: Vector of String -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the file containing the i-th kernel function. ONLY used for TKK. - **Default**: none ### of_ml_gamma - **Type**: Boolean -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Local descriptor: gamma = (rho / rho0)^(1/3). - **Default**: False ### of_ml_p - **Type**: Boolean -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Semi-local descriptor: p = |nabla rho|^2 / [2 (3 pi^2)^(1/3) rho^(4/3)]^2. - **Default**: False ### of_ml_q - **Type**: Boolean -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Semi-local descriptor: q = nabla^2 rho / [4 (3 pi^2)^(2/3) rho^(5/3)]. - **Default**: False ### of_ml_tanhp - **Type**: Boolean -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Semi-local descriptor: tanhp = tanh(chi_p * p). - **Default**: False ### of_ml_tanhq - **Type**: Boolean -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Semi-local descriptor: tanhq = tanh(chi_q * q). - **Default**: False ### of_ml_chi_p - **Type**: Real -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Hyperparameter chi_p: tanhp = tanh(chi_p * p). - **Default**: 1.0 ### of_ml_chi_q - **Type**: Real -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Hyperparameter chi_q: tanhq = tanh(chi_q * q). - **Default**: 1.0 ### of_ml_gammanl - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor gammanl defined by the i-th kernel function. - **Default**: 0 ### of_ml_pnl - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor pnl defined by the i-th kernel function. - **Default**: 0 ### of_ml_qnl - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor qnl defined by the i-th kernel function. - **Default**: 0 ### of_ml_xi - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor xi defined by the i-th kernel function. - **Default**: 0 ### of_ml_tanhxi - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhxi defined by the i-th kernel function. - **Default**: 0 ### of_ml_tanhxi_nl - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhxi_nl defined by the i-th kernel function. - **Default**: 0 ### of_ml_tanh_pnl - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanh_pnl defined by the i-th kernel function. - **Default**: 0 ### of_ml_tanh_qnl - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanh_qnl defined by the i-th kernel function. - **Default**: 0 ### of_ml_tanhp_nl - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhp_nl defined by the i-th kernel function. - **Default**: 0 ### of_ml_tanhq_nl - **Type**: Vector of Integer -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhq_nl defined by the i-th kernel function. - **Default**: 0 ### of_ml_chi_xi - **Type**: Vector of Real -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the hyperparameter chi_xi of non-local descriptor tanhxi defined by the i-th kernel function. - **Default**: 1.0 ### of_ml_chi_pnl - **Type**: Vector of Real -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the hyperparameter chi_pnl of non-local descriptor tanh_pnl defined by the i-th kernel function. - **Default**: 1.0 ### of_ml_chi_qnl - **Type**: Vector of Real -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the hyperparameter chi_qnl of non-local descriptor tanh_qnl defined by the i-th kernel function. - **Default**: 1.0 ### of_ml_local_test - **Type**: Boolean -- **Availability**: *OFDFT* +- **Availability**: *esolver_type==ofdft* - **Description**: FOR TEST. Read in the density, and output the F and Pauli potential. - **Default**: False @@ -3023,7 +3022,7 @@ ### of_cd - **Type**: Boolean -- **Availability**: *TDOFDFT* +- **Availability**: *esolver_type==tdofdft* - **Description**: Added the current dependent(CD) potential. (https://doi.org/10.1103/PhysRevB.98.144302) - True: Added the CD potential. - False: Not added the CD potential. @@ -3032,7 +3031,7 @@ ### of_mcd_alpha - **Type**: Real -- **Availability**: *TDOFDFT* +- **Availability**: *esolver_type==tdofdft* - **Description**: The value of the parameter alpha in modified CD potential method. mCDPotential=alpha*CDPotential (proposed in paper PhysRevB.98.144302) - **Default**: 1.0 @@ -3051,7 +3050,7 @@ ### dip_cor_flag - **Type**: Boolean -- **Availability**: *With dip_cor_flag = True and efield_flag = True.* +- **Availability**: *dip_cor_flag==true and efield_flag==true* - **Description**: Added a dipole correction to the bare ionic potential. - True: A dipole correction is also added to the bare ionic potential. - False: A dipole correction is not added to the bare ionic potential. @@ -3062,7 +3061,7 @@ ### efield_dir - **Type**: Integer -- **Availability**: *with efield_flag = True.* +- **Availability**: *efield_flag==true* - **Description**: The direction of the electric field or dipole correction is parallel to the reciprocal lattice vector, so the potential is constant in planes defined by FFT grid points, efield_dir can set to 0, 1 or 2. - 0: parallel to the first reciprocal lattice vector - 1: parallel to the second reciprocal lattice vector @@ -3072,21 +3071,21 @@ ### efield_pos_max - **Type**: Real -- **Availability**: *with efield_flag = True.* +- **Availability**: *efield_flag==true* - **Description**: Position of the maximum of the saw-like potential along crystal axis efield_dir, within the unit cell, 0 <= efield_pos_max < 1. - **Default**: Autoset to center of vacuum - width of vacuum / 20 ### efield_pos_dec - **Type**: Real -- **Availability**: *with efield_flag = True.* +- **Availability**: *efield_flag==true* - **Description**: Zone in the unit cell where the saw-like potential decreases, 0 < efield_pos_dec < 1. - **Default**: Autoset to width of vacuum / 10 ### efield_amp - **Type**: Real -- **Availability**: *with efield_flag = True.* +- **Availability**: *efield_flag==true* - **Description**: Amplitude of the electric field. The saw-like potential increases with slope efield_amp in the region from efield_pos_max+efield_pos_dec-1) to (efield_pos_max), then decreases until (efield_pos_max+efield_pos_dec), in units of the crystal vector efield_dir. > Note: The change of slope of this potential must be located in the empty region, or else unphysical forces will result. @@ -3304,7 +3303,7 @@ ### exx_symmetry_realspace - **Type**: Boolean -- **Availability**: *symmetry==1 and exx calculation (dft_fuctional==hse/hf/pbe0/scan0 or rpa==True)* +- **Availability**: *symmetry==1 and (dft_functional in [hse, hf, pbe0, scan0] or rpa==true)* - **Description**: - False: only rotate k-space density matrix D(k) from irreducible k-points to accelerate diagonalization - True: rotate both D(k) and Hexx(R) to accelerate both diagonalization and EXX calculation - **Default**: True @@ -3322,7 +3321,7 @@ ### exxace - **Type**: Boolean -- **Availability**: *exx_separate_loop==True.* +- **Availability**: *exx_separate_loop==true* - **Description**: Whether to use the ACE method (https://doi.org/10.1021/acs.jctc.6b00092) to accelerate the calculation the Fock exchange matrix. Should be set to true most of the time. - True: Use the ACE method to calculate the Fock exchange operator. - False: Use the traditional method to calculate the Fock exchange operator. @@ -3589,21 +3588,21 @@ ### dp_rescaling - **Type**: Real -- **Availability**: *esolver_type = dp.* +- **Availability**: *esolver_type==dp* - **Description**: Rescaling factor to use a temperature-dependent DP. Energy, stress and force calculated by DP will be multiplied by this factor. - **Default**: 1.0 ### dp_fparam - **Type**: Real -- **Availability**: *esolver_type = dp.* +- **Availability**: *esolver_type==dp* - **Description**: The frame parameter for dp potential. The array size is dim_fparam, then all frames are assumed to be provided with the same fparam. - **Default**: {} ### dp_aparam - **Type**: Real -- **Availability**: *esolver_type = dp.* +- **Availability**: *esolver_type==dp* - **Description**: The atomic parameter for dp potential. The array size can be (1) natoms x dim_aparam, then all frames are assumed to be provided with the same aparam; (2) dim_aparam, then all frames and atoms are assumed to be provided with the same aparam. - **Default**: {} @@ -3652,7 +3651,7 @@ ### md_csvr_tau - **Type**: Real -- **Availability**: *md_thermostat = csvr* +- **Availability**: *md_thermostat==csvr* - **Description**: The characteristic time scale for the CSVR (Canonical Sampling through Velocity Rescaling) thermostat. Larger values give weaker coupling, smaller values give stronger coupling. Recommended value: 100 * md_dt. - **Default**: 100.0 - **Unit**: fs @@ -3740,14 +3739,14 @@ ### yukawa_lambda - **Type**: Real -- **Availability**: *DFT+U with yukawa_potential = True.* +- **Availability**: *dft_plus_u==1 and yukawa_potential==true* - **Description**: The screen length of Yukawa potential. If left to default, the screen length will be calculated as an average of the entire system. It's better to stick to the default setting unless there is a very good reason. - **Default**: Calculated on the fly. ### uramping - **Type**: Real -- **Availability**: *DFT+U calculations with mixing_restart > 0.* +- **Availability**: *dft_plus_u==1 and mixing_restart>0* - **Description**: Once uramping > 0.15 eV. DFT+U calculations will start SCF with U = 0 eV, namely normal LDA/PBE calculations. Once SCF restarts when drho<mixing_restart, U value will increase by uramping eV. SCF will repeat above calcuations until U values reach target defined in hubbard_u. As for uramping=1.0 eV, the recommendations of mixing_restart is around 5e-4. - **Default**: -1.0. - **Unit**: eV @@ -3766,7 +3765,7 @@ ### onsite_radius - **Type**: Real -- **Availability**: *dft_plus_u is set to 1* +- **Availability**: *dft_plus_u==1* - **Description**: - 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**: 3.0 @@ -3791,7 +3790,7 @@ ### sc_thr - **Type**: Real -- **Availability**: *sc_mag_switch is true* +- **Availability**: *sc_mag_switch==true* - **Description**: Convergence criterion of spin-constrained iteration (RMS) in uB - **Default**: 1.0e-6 - **Unit**: uB @@ -3799,21 +3798,21 @@ ### nsc - **Type**: Integer -- **Availability**: *sc_mag_switch is true* +- **Availability**: *sc_mag_switch==true* - **Description**: Maximal number of spin-constrained iteration - **Default**: 100 ### nsc_min - **Type**: Integer -- **Availability**: *sc_mag_switch is true* +- **Availability**: *sc_mag_switch==true* - **Description**: Minimum number of spin-constrained iteration - **Default**: 2 ### alpha_trial - **Type**: Real -- **Availability**: *sc_mag_switch is true* +- **Availability**: *sc_mag_switch==true* - **Description**: Initial trial step size for lambda in eV/uB^2 - **Default**: 0.01 - **Unit**: eV/uB^2 @@ -3821,7 +3820,7 @@ ### sccut - **Type**: Real -- **Availability**: *sc_mag_switch is true* +- **Availability**: *sc_mag_switch==true* - **Description**: Maximal step size for lambda in eV/uB - **Default**: 3.0 - **Unit**: eV/uB @@ -3829,21 +3828,21 @@ ### sc_drop_thr - **Type**: Real -- **Availability**: *sc_mag_switch is true* +- **Availability**: *sc_mag_switch==true* - **Description**: Convergence criterion ratio of lambda iteration in Spin-constrained DFT - **Default**: 1.0e-2 ### sc_scf_thr - **Type**: Real -- **Availability**: *sc_mag_switch is true* +- **Availability**: *sc_mag_switch==true* - **Description**: Density error threshold for inner loop of spin-constrained SCF - **Default**: 1.0e-4 ### sc_direction_only - **Type**: Boolean -- **Availability**: *sc_mag_switch is true* +- **Availability**: *sc_mag_switch==true* - **Description**: When true, only the direction of the magnetic moment is constrained to the target direction, while the magnitude is allowed to vary freely. This is useful for studying magnetic anisotropy or when the magnitude of the moment is determined by the electronic structure rather than an external constraint. When false (default), both the direction and magnitude of the magnetic moment are constrained to the target values. @@ -3852,7 +3851,7 @@ ### sc_lambda_strategy - **Type**: String -- **Availability**: *sc_mag_switch is true* +- **Availability**: *sc_mag_switch==true* - **Description**: Lambda update strategy for spin-constrained DFT: - bfgs: BFGS quasi-Newton method - linear_response: linear response (Scheme B) @@ -3864,7 +3863,7 @@ ### sc_scan_lambda_start - **Type**: Float -- **Availability**: *sc_lambda_strategy is linear_scan* +- **Availability**: *sc_lambda_strategy==linear_scan* - **Description**: Starting lambda value for linear_scan strategy. Only used when sc_lambda_strategy=linear_scan. - **Default**: 0.0 - **Unit**: eV/uB @@ -3872,7 +3871,7 @@ ### sc_scan_lambda_end - **Type**: Float -- **Availability**: *sc_lambda_strategy is linear_scan* +- **Availability**: *sc_lambda_strategy==linear_scan* - **Description**: Ending lambda value for linear_scan strategy. Only used when sc_lambda_strategy=linear_scan. - **Default**: 1.0 - **Unit**: eV/uB @@ -3880,7 +3879,7 @@ ### sc_scan_steps - **Type**: Integer -- **Availability**: *sc_lambda_strategy is linear_scan* +- **Availability**: *sc_lambda_strategy==linear_scan* - **Description**: Number of lambda values to scan. Only used when sc_lambda_strategy=linear_scan. - **Default**: 20 @@ -3904,7 +3903,7 @@ ### vdw_d4_xc - **Type**: String -- **Availability**: *vdw_method is set to d4* +- **Availability**: *vdw_method==d4* - **Description**: Functional name used to load DFT-D4 damping parameters from the DFT-D4 library. If set to default, ABACUS infers the functional name from dft_functional or pseudopotential metadata. - **Default**: default @@ -3912,7 +3911,7 @@ ### vdw_d4_model - **Type**: String -- **Availability**: *vdw_method is set to d4* +- **Availability**: *vdw_method==d4* - **Description**: DFT-D4 dispersion model used by the external DFT-D4 library. Available options are: @@ -3923,38 +3922,38 @@ ### vdw_s6 - **Type**: String -- **Availability**: *vdw_method is set to d2, d3_0, or d3_bj* +- **Availability**: *vdw_method in [d2, d3_0, d3_bj]* - **Description**: This scale factor is used to optimize the interaction energy deviations in van der Waals (vdW) corrected calculations. The recommended values of this parameter are dependent on the chosen vdW correction method and the DFT functional being used. For DFT-D2, the recommended values are 0.75 (PBE), 1.2 (BLYP), 1.05 (B-P86), 1.0 (TPSS), and 1.05 (B3LYP). If not set, will use values of PBE functional. For DFT-D3, recommended values with different DFT functionals can be found on the here. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value. ### vdw_s8 - **Type**: String -- **Availability**: *vdw_method is set to d3_0 or d3_bj* +- **Availability**: *vdw_method in [d3_0, d3_bj]* - **Description**: This scale factor is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the webpage. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value. ### vdw_a1 - **Type**: String -- **Availability**: *vdw_method is set to d3_0 or d3_bj* +- **Availability**: *vdw_method in [d3_0, d3_bj]* - **Description**: This damping function parameter is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the webpage. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value. ### vdw_a2 - **Type**: String -- **Availability**: *vdw_method is set to d3_0 or d3_bj* +- **Availability**: *vdw_method in [d3_0, d3_bj]* - **Description**: This damping function parameter is only relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the webpage. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value. ### vdw_d - **Type**: Real -- **Availability**: *vdw_method is set to d2* +- **Availability**: *vdw_method==d2* - **Description**: Controls the damping rate of the damping function in the DFT-D2 method. - **Default**: 20 ### vdw_abc - **Type**: Boolean -- **Availability**: *vdw_method is set to d3_0 or d3_bj* +- **Availability**: *vdw_method in [d3_0, d3_bj]* - **Description**: Determines whether three-body terms are calculated for DFT-D3 methods. - True: ABACUS will calculate the three-body term. - False: The three-body term is not included. @@ -3963,7 +3962,7 @@ ### vdw_c6_file - **Type**: String -- **Availability**: *vdw_method is set to d2* +- **Availability**: *vdw_method==d2* - **Description**: Specifies the name of the file containing parameters for each element when using the D2 method. If not set, ABACUS uses the default parameters (Jnm6/mol) stored in the program. To manually set the parameters, provide a file containing the parameters. An example is given by: H 0.1 Si 9.0 @@ -3974,7 +3973,7 @@ ### vdw_c6_unit - **Type**: String -- **Availability**: *vdw_C6_file is not default* +- **Availability**: *vdw_c6_file!=default* - **Description**: Specifies the unit of the provided parameters in the D2 method. Available options are: - Jnm6/mol (J nm^6/mol) - eVA (eV Angstrom) @@ -3983,7 +3982,7 @@ ### vdw_r0_file - **Type**: String -- **Availability**: *vdw_method is set to d2* +- **Availability**: *vdw_method==d2* - **Description**: Specifies the name of the file containing parameters for each element when using the D2 method. If not set, ABACUS uses the default parameters (Angstrom) stored in the program. To manually set the parameters, provide a file containing the parameters. An example is given by: Li 1.0 Cl 2.0 @@ -3994,7 +3993,7 @@ ### vdw_r0_unit - **Type**: String -- **Availability**: *vdw_R0_file is not default* +- **Availability**: *vdw_r0_file!=default* - **Description**: Specifies the unit for the parameters in the D2 method when manually set by the user. Available options are: - A (Angstrom) - Bohr @@ -4011,14 +4010,14 @@ ### vdw_cutoff_radius - **Type**: String -- **Availability**: *vdw_cutoff_type is set to radius* +- **Availability**: *vdw_cutoff_type==radius* - **Description**: Defines the radius of the cutoff sphere when vdw_cutoff_type is set to radius. The default values depend on the chosen vdw_method. - **Unit**: defined by vdw_radius_unit (default Bohr) ### vdw_radius_unit - **Type**: String -- **Availability**: *vdw_cutoff_type is set to radius* +- **Availability**: *vdw_cutoff_type==radius* - **Description**: Specify the unit of vdw_cutoff_radius. Available options are: - A(Angstrom) - Bohr @@ -4027,14 +4026,14 @@ ### vdw_cutoff_period - **Type**: Integer Integer Integer -- **Availability**: *vdw_cutoff_type is set to period* +- **Availability**: *vdw_cutoff_type==period* - **Description**: The three integers supplied here explicitly specify the extent of the supercell in the directions of the three basis lattice vectors. - **Default**: 3 3 3 ### vdw_cn_thr - **Type**: Real -- **Availability**: *vdw_method is set to d3_0, d3_bj, or d4* +- **Availability**: *vdw_method in [d3_0, d3_bj, d4]* - **Description**: The cutoff radius when calculating coordination numbers. - **Default**: 40 - **Unit**: defined by vdw_cn_thr_unit (default: Bohr) @@ -4585,21 +4584,21 @@ ### cal_cond - **Type**: Boolean -- **Availability**: *basis_type = pw* +- **Availability**: *basis_type==pw* - **Description**: Whether to calculate electronic conductivities. - **Default**: False ### cond_che_thr - **Type**: Real -- **Availability**: *esolver_type = sdft* +- **Availability**: *esolver_type==sdft* - **Description**: Control the error of Chebyshev expansions for conductivities. - **Default**: 1e-8 ### cond_dw - **Type**: Real -- **Availability**: *basis_type = pw* +- **Availability**: *basis_type==pw* - **Description**: Frequency interval () for frequency-dependent conductivities. - **Default**: 0.1 - **Unit**: eV @@ -4607,7 +4606,7 @@ ### cond_wcut - **Type**: Real -- **Availability**: *basis_type = pw* +- **Availability**: *basis_type==pw* - **Description**: Cutoff frequency for frequency-dependent conductivities. - **Default**: 10.0 - **Unit**: eV @@ -4615,7 +4614,7 @@ ### cond_dt - **Type**: Real -- **Availability**: *basis_type = pw* +- **Availability**: *basis_type==pw* - **Description**: Time interval () to integrate Onsager coefficients. - **Default**: 0.02 - **Unit**: a.u. @@ -4623,7 +4622,7 @@ ### cond_dtbatch - **Type**: Integer -- **Availability**: *esolver_type = sdft* +- **Availability**: *esolver_type==sdft* - **Description**: exp(iH\dt\cond_dtbatch) is expanded with Chebyshev expansion to calculate conductivities. It is faster but costs more memory. - If cond_dtbatch = 0: Autoset this parameter to make expansion orders larger than 100. - **Default**: 0 @@ -4639,7 +4638,7 @@ ### cond_fwhm - **Type**: Real -- **Availability**: *basis_type = pw* +- **Availability**: *basis_type==pw* - **Description**: FWHM for conductivities. For Gaussian smearing, ; for Lorentzian smearing, . - **Default**: 0.4 - **Unit**: eV @@ -4647,7 +4646,7 @@ ### cond_nonlocal - **Type**: Boolean -- **Availability**: *basis_type = pw* +- **Availability**: *basis_type==pw* - **Description**: Whether to consider nonlocal potential correction when calculating velocity matrix . - True: . - False: . @@ -4666,7 +4665,7 @@ ### eb_k - **Type**: Real -- **Availability**: *imp_sol is true.* +- **Availability**: *imp_sol==true* - **Description**: The relative permittivity of the bulk solvent, 80 for water - **Default**: 80 @@ -4881,7 +4880,7 @@ ### aims_nbasis - **Type**: A number(ntype) of Integers -- **Availability**: *ri_hartree_benchmark = aims* +- **Availability**: *ri_hartree_benchmark==aims* - **Description**: Atomic basis set size for each atom type (with the same order as in STRU) in FHI-aims. - **Default**: {} (empty list, where ABACUS use its own basis set size) diff --git a/docs/developers_guide/agent_governance.md b/docs/developers_guide/agent_governance.md index 71e7657b64..b8fb2fa7ef 100644 --- a/docs/developers_guide/agent_governance.md +++ b/docs/developers_guide/agent_governance.md @@ -220,6 +220,10 @@ or parsing behavior should include both: - `docs/parameters.yaml` - `docs/advanced/input_files/input-main.md` +These files are generated artifacts, not additional sources of truth. Update +the C++ `Input_Item` registrations and regenerate both files; do not edit the +YAML or Markdown output by hand. + If the diff touches parameter internals but does not change user-visible INPUT behavior, the PR should state why no documentation update is required. Missing documentation updates trigger a governance warning (not a block), but maintainers diff --git a/docs/parameters.yaml b/docs/parameters.yaml index 0c2494dee3..dd8e4f7bf8 100644 --- a/docs/parameters.yaml +++ b/docs/parameters.yaml @@ -203,7 +203,7 @@ parameters: * 1: a memory saving technique will be used for many k point calculations. default_value: "0" unit: "" - availability: Used only for nscf calculations with plane wave basis set. + availability: calculation==nscf and basis_type==pw - name: cal_stress category: System variables type: Boolean @@ -220,7 +220,7 @@ parameters: * >0: it specifies the number of processes used for carrying out diagonalization. Must be less than or equal to total number of MPI processes. default_value: "0" unit: "" - availability: Used only for plane wave basis set. + availability: basis_type==pw - name: nbspline category: System variables type: Integer @@ -286,7 +286,7 @@ parameters: * double: double precision default_value: double unit: "" - availability: Used only for plane wave basis set. + availability: basis_type==pw - name: gint_precision category: System variables type: String @@ -297,7 +297,7 @@ parameters: * mix: mixed precision, starting from single precision and switching to double precision when the SCF residual becomes small enough default_value: double unit: "" - availability: Used only for LCAO basis set. + availability: basis_type==lcao - name: timer_enable_nvtx category: System variables type: Boolean @@ -417,7 +417,7 @@ parameters: Specify the random seed to initialize wave functions. Only positive integers are available. default_value: "0" unit: "" - availability: Only used for plane wave basis. + availability: basis_type==pw - name: diag_subspace category: Plane wave related variables type: Integer @@ -512,7 +512,7 @@ parameters: If restart_save is set to true and an electronic iteration is finished, calculations can be restarted from the charge density file, which are saved in the former calculation. default_value: "False" unit: "" - availability: Used only when numerical atomic orbitals are employed as basis set. + availability: basis_type==lcao - name: basis_type category: Electronic structure type: String @@ -760,7 +760,7 @@ parameters: At n-th iteration which is calculated by drho= 0.0" + availability: "mixing_restart>=0" - name: mixing_gg0 category: Electronic structure type: Real @@ -802,7 +802,7 @@ parameters: * >0: Angle mixing for the modulus with mixing_angle=1.0 default_value: "-10.0" unit: "" - availability: Only relevant for non-colinear calculations nspin=4. + availability: nspin==4 - name: mixing_tau category: Electronic structure type: Boolean @@ -812,7 +812,7 @@ parameters: * False: The kinetic energy density will not be mixed. default_value: "False" unit: "" - availability: Only relevant for meta-GGA calculations. + availability: "" - name: mixing_dftu category: Electronic structure type: Boolean @@ -822,7 +822,7 @@ parameters: * False: The occupation matrices will not be mixed. default_value: "False" unit: "" - availability: Only relevant for DFT+U calculations. + availability: dft_plus_u==1 - name: gamma_only category: Electronic structure type: Boolean @@ -834,7 +834,7 @@ parameters: Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure to turn off gamma_only for multi-k calculations. default_value: "0" unit: "" - availability: Only used in localized orbitals set + availability: basis_type==lcao - name: scf_nmax category: Electronic structure type: Integer @@ -951,7 +951,7 @@ parameters: Use case: When experimental or high-level theoretical results suggest that the SOC effect is weaker or stronger than what full-relativistic pseudopotentials predict, you can adjust this parameter to match the target behavior. default_value: "1.0" unit: "" - availability: Only works when lspinorb=true + availability: lspinorb==true - name: dfthalf_type category: Electronic structure type: Integer @@ -985,7 +985,7 @@ parameters: If TRUE, the wavefunctions at k-point will be initialized from the converged wavefunctions at the nearest k-point, which can speed up the SCF convergence. Only works for PW basis. default_value: "false" unit: "" - availability: Used only for plane wave basis set. + availability: basis_type==pw - name: pw_diag_nmax category: Plane wave related variables type: Integer @@ -993,7 +993,7 @@ parameters: Only useful when you use ks_solver = cg/dav/dav_subspace/bpcg. It indicates the maximal iteration number for cg/david/dav_subspace/bpcg method. default_value: "50" unit: "" - availability: "basis_type==pw, ks_solver==cg/dav/dav_subspace/bpcg" + availability: "basis_type==pw and ks_solver in [cg, dav, dav_subspace, bpcg]" - name: pw_diag_ndim category: Plane wave related variables type: Integer @@ -1180,7 +1180,7 @@ parameters: The paramether controls the size of the first conjugate gradient step. A smaller value means the first step along a new CG direction is smaller. This might be helpful for large systems, where it is safer to take a smaller initial step to prevent the collapse of the whole configuration. default_value: "0.5" unit: "" - availability: Only used when relax_method is cg 2 + availability: "relax_method in [cg 2]" - name: relax_nmax category: Geometry relaxation type: Integer @@ -1196,7 +1196,7 @@ parameters: When relax_method is set to cg_bfgs, a mixed algorithm of conjugate gradient (CG) and Broyden–Fletcher–Goldfarb–Shanno (BFGS) is used. The ions first move according to the CG method, then switch to the BFGS method when the maximum force on atoms is reduced below this threshold. default_value: "0.5" unit: eV/Angstrom - availability: Only used when relax_method is cg_bfgs + availability: relax_method==cg_bfgs - name: force_thr category: Geometry relaxation type: Real @@ -1228,7 +1228,7 @@ parameters: Controls the Wolfe condition for the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm used in geometry relaxation. This parameter sets the sufficient decrease condition (c1 in Wolfe conditions). For more information, see Phys. Chem. Chem. Phys., 2000, 2, 2177. default_value: "0.01" unit: "" - availability: Only used when relax_method is bfgs or cg_bfgs + availability: "relax_method in [bfgs, cg_bfgs]" - name: relax_bfgs_w2 category: Geometry relaxation type: Real @@ -1236,7 +1236,7 @@ parameters: Controls the Wolfe condition for the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm used in geometry relaxation. This parameter sets the curvature condition (c2 in Wolfe conditions). For more information, see Phys. Chem. Chem. Phys., 2000, 2, 2177. default_value: "0.5" unit: "" - availability: Only used when relax_method is bfgs or cg_bfgs + availability: "relax_method in [bfgs, cg_bfgs]" - name: relax_bfgs_rmax category: Geometry relaxation type: Real @@ -1244,7 +1244,7 @@ parameters: Maximum allowed total displacement of all atoms during geometry optimization. The sum of atomic displacements can increase during optimization steps but cannot exceed this value. default_value: "0.8" unit: Bohr - availability: Only used when relax_method is bfgs or cg_bfgs + availability: "relax_method in [bfgs, cg_bfgs]" - name: relax_bfgs_rmin category: Geometry relaxation type: Real @@ -1252,7 +1252,7 @@ parameters: Minimum allowed total displacement of all atoms. When the total atomic displacement falls below this value and force convergence is not achieved, the calculation will terminate. Note: This parameter is not used in the default BFGS algorithm (relax_method = bfgs 2 or bfgs). default_value: "1e-5" unit: Bohr - availability: Only used when relax_method is bfgs 1 (traditional BFGS) + availability: "relax_method in [bfgs 1]" - name: relax_bfgs_init category: Geometry relaxation type: Real @@ -1260,7 +1260,7 @@ parameters: Initial total displacement of all atoms in the first BFGS step. This sets the scale for the initial movement. default_value: "0.5" unit: Bohr - availability: Only used when relax_method is bfgs or cg_bfgs + availability: "relax_method in [bfgs, cg_bfgs]" - name: stress_thr category: Geometry relaxation type: Real @@ -1316,7 +1316,7 @@ parameters: [NOTE] For VASP users, see the ISIF correspondence table in the geometry optimization documentation. default_value: None unit: "" - availability: Only used when calculation is set to cell-relax + availability: calculation==cell-relax - name: fixed_ibrav category: Geometry relaxation type: Boolean @@ -1327,7 +1327,7 @@ parameters: [NOTE] Note: it is possible to use fixed_ibrav with fixed_axes, but please make sure you know what you are doing. For example, if we are doing relaxation of a simple cubic lattice (latname = "sc"), and we use fixed_ibrav along with fixed_axes = "volume", then the cell is never allowed to move and as a result, the relaxation never converges. When both are used, fixed_ibrav is applied first, then fixed_axes = "volume" rescaling is applied. default_value: "False" unit: "" - availability: Only used with relax_method = cg 2. A specific latname must be provided. + availability: "relax_method in [cg 2] and latname!=none" - name: fixed_atoms category: Geometry relaxation type: Boolean @@ -1619,7 +1619,7 @@ parameters: Rescaling factor to use a temperature-dependent DP. Energy, stress and force calculated by DP will be multiplied by this factor. default_value: "1.0" unit: "" - availability: esolver_type = dp. + availability: esolver_type==dp - name: dp_fparam category: Molecular dynamics type: Real @@ -1627,7 +1627,7 @@ parameters: The frame parameter for dp potential. The array size is dim_fparam, then all frames are assumed to be provided with the same fparam. default_value: "{}" unit: "" - availability: esolver_type = dp. + availability: esolver_type==dp - name: dp_aparam category: Molecular dynamics type: Real @@ -1635,7 +1635,7 @@ parameters: The atomic parameter for dp potential. The array size can be (1) natoms x dim_aparam, then all frames are assumed to be provided with the same aparam; (2) dim_aparam, then all frames and atoms are assumed to be provided with the same aparam. default_value: "{}" unit: "" - availability: esolver_type = dp. + availability: esolver_type==dp - name: msst_direction category: Molecular dynamics type: Integer @@ -1694,7 +1694,7 @@ parameters: The characteristic time scale for the CSVR (Canonical Sampling through Velocity Rescaling) thermostat. Larger values give weaker coupling, smaller values give stronger coupling. Recommended value: 100 * md_dt. default_value: "100.0" unit: fs - availability: md_thermostat = csvr + availability: md_thermostat==csvr - name: md_tolerance category: Molecular dynamics type: Real @@ -1752,7 +1752,7 @@ parameters: * cpn5: CPN5 KEDF (automatically sets ml parameters) default_value: wt unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_method category: "OFDFT: orbital free density functional theory" type: String @@ -1763,7 +1763,7 @@ parameters: * tn: Truncated Newton algorithm. default_value: tn unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_conv category: "OFDFT: orbital free density functional theory" type: String @@ -1774,7 +1774,7 @@ parameters: * both: Both energy and potential must satisfy the convergence criterion. default_value: energy unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_tole category: "OFDFT: orbital free density functional theory" type: Real @@ -1782,7 +1782,7 @@ parameters: Tolerance of the energy change for determining the convergence. default_value: "2e-6" unit: Ry - availability: OFDFT + availability: esolver_type==ofdft - name: of_tolp category: "OFDFT: orbital free density functional theory" type: Real @@ -1790,7 +1790,7 @@ parameters: Tolerance of potential for determining the convergence. default_value: "1e-5" unit: Ry - availability: OFDFT + availability: esolver_type==ofdft - name: of_tf_weight category: "OFDFT: orbital free density functional theory" type: Real @@ -1798,7 +1798,7 @@ parameters: Weight of TF KEDF (kinetic energy density functional). default_value: "1.0" unit: "" - availability: "OFDFT with of_kinetic=tf, tf+, wt, ext-wt, xwm" + availability: "esolver_type==ofdft and of_kinetic in [tf, tf+, wt, ext-wt, xwm]" - name: of_vw_weight category: "OFDFT: orbital free density functional theory" type: Real @@ -1806,7 +1806,7 @@ parameters: Weight of vW KEDF (kinetic energy density functional). default_value: "1.0" unit: "" - availability: "OFDFT with of_kinetic=vw, tf+, wt, ext-wt, lkt, xwm" + availability: "esolver_type==ofdft and of_kinetic in [vw, tf+, wt, ext-wt, lkt, xwm]" - name: of_wt_alpha category: "OFDFT: orbital free density functional theory" type: Real @@ -1814,7 +1814,7 @@ parameters: Parameter alpha of WT KEDF (kinetic energy density functional). default_value: "" unit: "" - availability: "OFDFT with of_kinetic=wt, ext-wt" + availability: "esolver_type==ofdft and of_kinetic in [wt, ext-wt]" - name: of_wt_beta category: "OFDFT: orbital free density functional theory" type: Real @@ -1822,7 +1822,7 @@ parameters: Parameter beta of WT KEDF (kinetic energy density functional). default_value: "" unit: "" - availability: "OFDFT with of_kinetic=wt, ext-wt" + availability: "esolver_type==ofdft and of_kinetic in [wt, ext-wt]" - name: of_extwt_kappa category: "OFDFT: orbital free density functional theory" type: Real @@ -1830,7 +1830,7 @@ parameters: Parameter kappa for EXT-WT KEDF. default_value: "1.0 / (2.0 * std::pow(4./3., 1./3.) - 1.0)" unit: "" - availability: OFDFT with of_kinetic=ext-wt + availability: esolver_type==ofdft and of_kinetic==ext-wt - name: of_wt_rho0 category: "OFDFT: orbital free density functional theory" type: Real @@ -1838,7 +1838,7 @@ parameters: The average density of system. default_value: "0.0" unit: Bohr^-3 - availability: OFDFT with of_kinetic=wt + availability: esolver_type==ofdft and of_kinetic==wt - name: of_hold_rho0 category: "OFDFT: orbital free density functional theory" type: Boolean @@ -1848,7 +1848,7 @@ parameters: * False: rho0 will change if volume of system has changed. default_value: "False" unit: "" - availability: OFDFT with of_kinetic=wt + availability: esolver_type==ofdft and of_kinetic==wt - name: of_lkt_a category: "OFDFT: orbital free density functional theory" type: Real @@ -1856,7 +1856,7 @@ parameters: Parameter a of LKT KEDF (kinetic energy density functional). default_value: "1.3" unit: "" - availability: OFDFT with of_kinetic=lkt + availability: esolver_type==ofdft and of_kinetic==lkt - name: of_xwm_rho_ref category: "OFDFT: orbital free density functional theory" type: Real @@ -1864,7 +1864,7 @@ parameters: Reference charge density for XWM kinetic energy functional. If set to 0, the program will use average charge density. default_value: "0.0" unit: "" - availability: OFDFT with of_kinetic=xwm + availability: esolver_type==ofdft and of_kinetic==xwm - name: of_xwm_kappa category: "OFDFT: orbital free density functional theory" type: Real @@ -1872,7 +1872,7 @@ parameters: Parameter for XWM kinetic energy functional. See PHYSICAL REVIEW B 100, 205132 (2019) for optimal values. default_value: "0.0" unit: "" - availability: OFDFT with of_kinetic=xwm + availability: esolver_type==ofdft and of_kinetic==xwm - name: of_read_kernel category: "OFDFT: orbital free density functional theory" type: Boolean @@ -1882,7 +1882,7 @@ parameters: * False: The kernel of WT KEDF (kinetic energy density functional) will be filled from formula. default_value: "False" unit: "" - availability: OFDFT with of_kinetic=wt + availability: esolver_type==ofdft and of_kinetic==wt - name: of_kernel_file category: "OFDFT: orbital free density functional theory" type: String @@ -1890,7 +1890,7 @@ parameters: The name of WT kernel file. default_value: WTkernel.txt unit: "" - availability: OFDFT with of_read_kernel=True + availability: esolver_type==ofdft and of_read_kernel==true - name: of_full_pw category: "OFDFT: orbital free density functional theory" type: Boolean @@ -1900,7 +1900,7 @@ parameters: * False: Only use the planewaves inside ecut, the same as KSDFT. default_value: "True" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_full_pw_dim category: "OFDFT: orbital free density functional theory" type: Integer @@ -1913,7 +1913,7 @@ parameters: Note: Even dimensions may cause slight errors in FFT. It should be ignorable in ofdft calculation, but it may make Cardinal B-spline interpolation unstable, so please set of_full_pw_dim = 1 if nbspline != -1. default_value: "0" unit: "" - availability: OFDFT with of_full_pw = True + availability: esolver_type==ofdft and of_full_pw==true - name: of_ml_gene_data category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Boolean @@ -1921,7 +1921,7 @@ parameters: Controls the generation of machine learning training data. When enabled, training data in .npy format will be saved in the directory OUT.${suffix}/. default_value: "False" unit: "" - availability: Used only for KSDFT with plane wave basis + availability: esolver_type==ksdft and basis_type==pw - name: of_ml_device category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: String @@ -1931,7 +1931,7 @@ parameters: * gpu: GPU default_value: cpu unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_feg category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Integer @@ -1942,7 +1942,7 @@ parameters: * 3: Incorporate the FEG limit by nonlinear transformation using softplus function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_nkernel category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Integer @@ -1950,7 +1950,7 @@ parameters: Number of kernel functions. default_value: "1" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_kernel category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -1961,7 +1961,7 @@ parameters: * 3: Truncated kinetic kernel (TKK), the file containing TKK is specified by of_ml_kernel_file. default_value: "1" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_kernel_scaling category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Real @@ -1969,7 +1969,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the RECIPROCAL of scaling parameter of the i-th kernel function. default_value: "1.0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_yukawa_alpha category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Real @@ -1977,7 +1977,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the parameter alpha of i-th kernel function. ONLY used for Yukawa kernel function. default_value: "1.0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_kernel_file category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of String @@ -1985,7 +1985,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the file containing the i-th kernel function. ONLY used for TKK. default_value: none unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_gamma category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Boolean @@ -1993,7 +1993,7 @@ parameters: Local descriptor: gamma = (rho / rho0)^(1/3). default_value: "False" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_p category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Boolean @@ -2001,7 +2001,7 @@ parameters: Semi-local descriptor: p = |nabla rho|^2 / [2 (3 pi^2)^(1/3) rho^(4/3)]^2. default_value: "False" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_q category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Boolean @@ -2009,7 +2009,7 @@ parameters: Semi-local descriptor: q = nabla^2 rho / [4 (3 pi^2)^(2/3) rho^(5/3)]. default_value: "False" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_tanhp category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Boolean @@ -2017,7 +2017,7 @@ parameters: Semi-local descriptor: tanhp = tanh(chi_p * p). default_value: "False" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_tanhq category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Boolean @@ -2025,7 +2025,7 @@ parameters: Semi-local descriptor: tanhq = tanh(chi_q * q). default_value: "False" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_chi_p category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Real @@ -2033,7 +2033,7 @@ parameters: Hyperparameter chi_p: tanhp = tanh(chi_p * p). default_value: "1.0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_chi_q category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Real @@ -2041,7 +2041,7 @@ parameters: Hyperparameter chi_q: tanhq = tanh(chi_q * q). default_value: "1.0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_gammanl category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -2049,7 +2049,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor gammanl defined by the i-th kernel function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_pnl category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -2057,7 +2057,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor pnl defined by the i-th kernel function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_qnl category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -2065,7 +2065,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor qnl defined by the i-th kernel function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_xi category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -2073,7 +2073,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor xi defined by the i-th kernel function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_tanhxi category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -2081,7 +2081,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhxi defined by the i-th kernel function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_tanhxi_nl category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -2089,7 +2089,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhxi_nl defined by the i-th kernel function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_tanh_pnl category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -2097,7 +2097,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanh_pnl defined by the i-th kernel function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_tanh_qnl category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -2105,7 +2105,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanh_qnl defined by the i-th kernel function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_tanhp_nl category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -2113,7 +2113,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhp_nl defined by the i-th kernel function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_tanhq_nl category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Integer @@ -2121,7 +2121,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhq_nl defined by the i-th kernel function. default_value: "0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_chi_xi category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Real @@ -2129,7 +2129,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the hyperparameter chi_xi of non-local descriptor tanhxi defined by the i-th kernel function. default_value: "1.0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_chi_pnl category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Real @@ -2137,7 +2137,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the hyperparameter chi_pnl of non-local descriptor tanh_pnl defined by the i-th kernel function. default_value: "1.0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_chi_qnl category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Vector of Real @@ -2145,7 +2145,7 @@ parameters: Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the hyperparameter chi_qnl of non-local descriptor tanh_qnl defined by the i-th kernel function. default_value: "1.0" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: of_ml_local_test category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Boolean @@ -2153,7 +2153,7 @@ parameters: FOR TEST. Read in the density, and output the F and Pauli potential. default_value: "False" unit: "" - availability: OFDFT + availability: esolver_type==ofdft - name: ml_exx category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" type: Boolean @@ -2172,7 +2172,7 @@ parameters: * other: use 2 default_value: "2" unit: "" - availability: esolver_type = sdft + availability: esolver_type==sdft - name: nbands_sto category: Electronic structure (SDFT) type: Integer or string @@ -2183,7 +2183,7 @@ parameters: * all: All complete basis sets are used to replace stochastic orbitals with the Chebyshev method (CT), resulting in the same results as KSDFT without stochastic errors. default_value: "256" unit: "" - availability: esolver_type = sdft + availability: esolver_type==sdft - name: nche_sto category: Electronic structure (SDFT) type: Integer @@ -2191,7 +2191,7 @@ parameters: Chebyshev expansion orders for stochastic DFT. default_value: "100" unit: "" - availability: esolver_type = sdft + availability: esolver_type==sdft - name: emin_sto category: Electronic structure (SDFT) type: Real @@ -2199,7 +2199,7 @@ parameters: Trial energy to guess the lower bound of eigen energies of the Hamiltonian Operator. default_value: "0.0" unit: Ry - availability: esolver_type = sdft + availability: esolver_type==sdft - name: emax_sto category: Electronic structure (SDFT) type: Real @@ -2207,7 +2207,7 @@ parameters: Trial energy to guess the upper bound of eigen energies of the Hamiltonian Operator. default_value: "0.0" unit: Ry - availability: esolver_type = sdft + availability: esolver_type==sdft - name: seed_sto category: Electronic structure (SDFT) type: Integer @@ -2219,7 +2219,7 @@ parameters: * -1: the seed is decided by time(NULL). default_value: "0" unit: "" - availability: esolver_type = sdft + availability: esolver_type==sdft - name: initsto_ecut category: Electronic structure (SDFT) type: Real @@ -2227,7 +2227,7 @@ parameters: Stochastic wave functions are initialized in a large box generated by "4*initsto_ecut". initsto_ecut should be larger than ecutwfc. In this method, SDFT results are the same when using different cores. Besides, coefficients of the same G are the same when ecutwfc is rising to initsto_ecut. If it is smaller than ecutwfc, it will be turned off. default_value: "0.0" unit: Ry - availability: esolver_type = sdft + availability: esolver_type==sdft - name: initsto_freq category: Electronic structure (SDFT) type: Integer @@ -2237,7 +2237,7 @@ parameters: * 0: Never change stochastic orbitals. default_value: "0" unit: "" - availability: esolver_type = sdft + availability: esolver_type==sdft - name: npart_sto category: Electronic structure (SDFT) type: Integer @@ -2245,7 +2245,7 @@ parameters: Make memory cost to 1/npart_sto times of the previous one when running the post process of SDFT like DOS or conductivities. default_value: "1" unit: "" - availability: method_sto = 2 and out_dos = 1 or cal_cond = True + availability: (method_sto==2 and out_dos==1) or cal_cond==true - name: deepks_out_labels category: DeePKS type: Integer @@ -2258,7 +2258,7 @@ parameters: [NOTE] When deepks_out_labels equals 1, the path of a numerical descriptor (an orb file) is needed to be specified under the NUMERICAL_DESCRIPTOR tag in the STRU file. This is not needed when deepks_out_labels equals 2. default_value: "0" unit: "" - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: deepks_out_freq_elec category: DeePKS type: Integer @@ -2266,7 +2266,7 @@ parameters: When deepks_out_freq_elec is greater than 0, print labels and descriptors for DeePKS in OUT.${suffix}/DeePKS_Labels_Elec per deepks_out_freq_elec electronic iterations, with suffix _e* to distinguish different steps. Often used with deepks_out_labels equals 1. default_value: "0" unit: "" - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: deepks_out_base category: DeePKS type: String @@ -2274,7 +2274,7 @@ parameters: Print labels and descriptors calculated by base functional ( determined by deepks_out_base ) and target functional ( determined by dft_functional ) for DeePKS in per deepks_out_freq_elec electronic iterations. The SCF process, labels and descriptors output of the target functional are all consistent with those when the target functional is used alone. The only additional output under this configuration is the labels of the base functional. Often used with deepks_out_labels equals 1. default_value: None unit: "" - availability: Numerical atomic orbital basis and deepks_out_freq_elec is greater than 0 + availability: "basis_type==lcao and deepks_out_freq_elec>0" - name: deepks_scf category: DeePKS type: Boolean @@ -2284,7 +2284,7 @@ parameters: [NOTE] A trained, traced model file is needed. default_value: "False" unit: "" - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: deepks_equiv category: DeePKS type: Boolean @@ -2294,7 +2294,7 @@ parameters: [NOTE] The equivariant version of DeePKS-kit is still under development, so this feature is currently only intended for internal usage. default_value: "False" unit: "" - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: deepks_model category: DeePKS type: String @@ -2302,7 +2302,7 @@ parameters: the path of the trained, traced neural network model file generated by deepks-kit default_value: None unit: "" - availability: Numerical atomic orbital basis and deepks_scf is true + availability: basis_type==lcao and deepks_scf==true - name: bessel_descriptor_lmax category: DeePKS type: Integer @@ -2310,7 +2310,7 @@ parameters: the maximum angular momentum of the Bessel functions generated as the projectors in DeePKS - NOte: To generate such projectors, set calculation type to gen_bessel in ABACUS. See also calculation. default_value: "2" unit: "" - availability: gen_bessel calculation + availability: calculation==gen_bessel - name: bessel_descriptor_ecut category: DeePKS type: String @@ -2318,7 +2318,7 @@ parameters: energy cutoff of Bessel functions default_value: same as ecutwfc unit: Ry - availability: gen_bessel calculation + availability: calculation==gen_bessel - name: bessel_descriptor_tolerence category: DeePKS type: Real @@ -2326,7 +2326,7 @@ parameters: tolerance for searching the zeros of Bessel functions default_value: "1.0e-12" unit: "" - availability: gen_bessel calculation + availability: calculation==gen_bessel - name: bessel_descriptor_rcut category: DeePKS type: Real @@ -2334,7 +2334,7 @@ parameters: cutoff radius of Bessel functions default_value: "6.0" unit: Bohr - availability: gen_bessel calculation + availability: calculation==gen_bessel - name: bessel_descriptor_smooth category: DeePKS type: Boolean @@ -2342,7 +2342,7 @@ parameters: smooth the Bessel functions at radius cutoff default_value: "False" unit: "" - availability: gen_bessel calculation + availability: calculation==gen_bessel - name: bessel_descriptor_sigma category: DeePKS type: Real @@ -2350,7 +2350,7 @@ parameters: smooth parameter at the cutoff radius of projectors default_value: "0.1" unit: Bohr - availability: gen_bessel calculation + availability: calculation==gen_bessel - name: deepks_bandgap category: DeePKS type: Integer @@ -2362,7 +2362,7 @@ parameters: * 3: Used for systems containing H atoms. Here HOMO is defined as the max occupation except H atoms and the bandgap label is the energy between HOMO and (HOMO + 1) default_value: "0" unit: "" - availability: Numerical atomic orbital basis and deepks_scf is true + availability: basis_type==lcao and deepks_scf==true - name: deepks_band_range category: DeePKS type: "Integer*2" @@ -2372,7 +2372,7 @@ parameters: * 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. default_value: "-1 0" unit: "" - availability: "Numerical atomic orbital basis, deepks_scf is true, and deepks_bandgap is 1 or 2" + availability: "basis_type==lcao and deepks_scf==true and deepks_bandgap in [1, 2]" - name: deepks_v_delta category: DeePKS type: Integer @@ -2384,7 +2384,7 @@ parameters: * deepks_v_delta = -2: deepks_phialpha_r.npy and deepks_gevdm.npy, which can be used to calculate deepks_vdrpre.npy. A recommanded method for memory saving. default_value: "0" unit: "" - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: deepks_out_unittest category: DeePKS type: Boolean @@ -2758,7 +2758,7 @@ parameters: * False: Not added the CD potential. default_value: "False" unit: "" - availability: TDOFDFT + availability: esolver_type==tdofdft - name: of_mcd_alpha category: "TDOFDFT: time dependent orbital free density functional theory" type: Real @@ -2766,7 +2766,7 @@ parameters: The value of the parameter alpha in modified CD potential method. mCDPotential=alpha*CDPotential (proposed in paper PhysRevB.98.144302) default_value: "1.0" unit: "" - availability: TDOFDFT + availability: esolver_type==tdofdft - name: xc_kernel category: Linear Response TDDFT (Under Development Feature) type: String @@ -2984,7 +2984,7 @@ parameters: * In 3.10-LTS, the corresponding keyword is out_dm, and the output files are SPIN1_DM and SPIN2_DM, etc. default_value: "False" unit: "" - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: out_dmr category: Output information type: "Boolean \\[Integer\\](optional)" @@ -2996,7 +2996,7 @@ parameters: [NOTE] In the 3.10-LTS version, the parameter is named out_dm1, and the file names are data-DMR-sparse_SPIN0.csr and data-DMR-sparse_SPIN1.csr, etc. default_value: "False" unit: "" - availability: Numerical atomic orbital basis (multi-k points) + availability: basis_type==lcao and gamma_only==0 - name: out_wfc_pw category: Output information type: Integer @@ -3015,7 +3015,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file names are WAVEFUNC1.dat, WAVEFUNC2.dat, etc. default_value: "0" unit: "" - availability: "Output electronic wave functions in plane wave basis, or transform the real-space electronic wave function into plane wave basis (see get_wf option in calculation with NAO basis)" + availability: basis_type==pw or (basis_type==lcao and calculation==get_wf) - name: out_wfc_lcao category: Output information type: Integer @@ -3036,7 +3036,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file names are WFC_NAO_GAMMA1_ION1.txt and WFC_NAO_K1_ION1.txt, etc. default_value: "0" unit: "" - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: out_dos category: Output information type: Integer @@ -3129,7 +3129,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file names are data-0-H and data-0-S, etc. default_value: 0 8 unit: Ry - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: out_mat_hs category: Output information type: "Boolean \\[Integer\\](optional)" @@ -3137,7 +3137,7 @@ parameters: Legacy alias for out_hsk 1, which outputs Hamiltonian and overlap matrices in reciprocal space for each k-point. The optional second integer controls text precision. If both out_hsk and out_mat_hs are present, out_hsk takes precedence. default_value: False 8 unit: Ry - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: out_hsr category: Output information type: "Integer \\[Integer\\](optional)" @@ -3153,7 +3153,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file names are data-HR-sparse_SPIN0.csr and data-SR-sparse_SPIN0.csr, etc. default_value: 0 8 unit: Ry - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: out_mat_hs2 category: Output information type: "Boolean \\[Integer\\](optional)" @@ -3161,7 +3161,7 @@ parameters: Legacy alias for out_hsr 1, which outputs Hamiltonian and overlap matrices in real space indexed by the Bravais lattice vector R. The optional second integer controls text precision. If both out_hsr and out_mat_hs2 are present, out_hsr takes precedence. default_value: False 8 unit: Ry - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: out_mat_tk category: Output information type: "Boolean \\[Integer\\](optional)" @@ -3171,7 +3171,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file names are data-TR-sparse_SPIN0.csr, etc. default_value: "False [8]" unit: Ry - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: out_mat_r category: Output information type: "Boolean \\[Integer\\](optional)" @@ -3181,7 +3181,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file name is data-rR-sparse.csr. default_value: False 8 unit: Bohr - availability: Numerical atomic orbital basis (not gamma-only algorithm) + availability: basis_type==lcao and gamma_only==0 - name: out_mat_t category: Output information type: "Boolean \\[Integer\\](optional)" @@ -3191,7 +3191,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file name is data-TR-sparse_SPIN0.csr. default_value: False 8 unit: Ry - availability: Numerical atomic orbital basis (not gamma-only algorithm) + availability: basis_type==lcao and gamma_only==0 - name: out_mat_dh category: Output information type: Integer @@ -3203,7 +3203,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file name is data-dHRx-sparse_SPIN0.csr and so on. default_value: 0 8 unit: Ry/Bohr - availability: Numerical atomic orbital basis (not gamma-only algorithm) + availability: basis_type==lcao and gamma_only==0 - name: out_mat_dh_t category: Output information type: Integer @@ -3333,7 +3333,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file name is data-dSRx-sparse_SPIN0.csr and so on. default_value: False 8 unit: Ry/Bohr - availability: Numerical atomic orbital basis (not gamma-only algorithm) + availability: basis_type==lcao and gamma_only==0 - name: out_mat_xc category: Output information type: Boolean @@ -3343,7 +3343,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file name is k-$k-Vxc and so on. default_value: "False" unit: Ry - availability: Numerical atomic orbital (NAO) and NAO-in-PW basis + availability: "basis_type in [lcao, lcao_in_pw]" - name: out_mat_xc2 category: Output information type: "Boolean \\[Integer\\](optional)" @@ -3353,7 +3353,7 @@ parameters: [NOTE] In the 3.10-LTS version, the file name is Vxc_R_spin$s and so on. default_value: False 8 unit: Ry - availability: Numerical atomic orbital (NAO) basis + availability: basis_type==lcao - name: out_mat_l category: Output information type: "Boolean \\[Integer\\](optional)" @@ -3361,7 +3361,7 @@ parameters: Whether to print the expectation value of the angular momentum operator , , and in the basis of the localized atomic orbitals. The files are named OUT.{suffix}_Lx.dat, OUT.{suffix}_Ly.dat, and OUT.{suffix}_Lz.dat. The second integer controls the precision of the output. default_value: False 8 unit: "" - availability: Numerical atomic orbital (NAO) basis + availability: basis_type==lcao - name: out_xc_r category: Output information type: "Integer \\[Integer\\](optional)" @@ -3386,7 +3386,7 @@ parameters: Whether to print the band energy terms separately in the file OUT.{term}_out.dat. The terms include the kinetic, pseudopotential (local + nonlocal), Hartree and exchange-correlation (including exact exchange if calculated). default_value: "False" unit: "" - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: out_hr_npz category: Output information type: Boolean @@ -3394,7 +3394,7 @@ parameters: Whether to print Hamiltonian matrices H(R) in NPZ format as hrs1_nao.npz and, for nspin = 2, hrs2_nao.npz. This feature does not work for gamma-only calculations. default_value: "False" unit: Ry - availability: Numerical atomic orbital basis (not gamma-only algorithm) + availability: basis_type==lcao and gamma_only==0 - name: out_hsr_npz category: Output information type: Boolean @@ -3402,7 +3402,7 @@ parameters: Legacy alias for out_hsr 3, writing hrs1_nao.npz, hrs2_nao.npz when needed, and sr_nao.npz. If both out_hsr and out_hsr_npz are present, out_hsr takes precedence. Gamma-only calculations write the folded R = (0, 0, 0) representation. default_value: "False" unit: Ry - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: out_dm_npz category: Output information type: Boolean @@ -3410,7 +3410,7 @@ parameters: Whether to print density matrices DM(R) in npz format. This feature does not work for gamma-only calculations. default_value: "False" unit: "" - availability: Numerical atomic orbital basis (not gamma-only algorithm) + availability: basis_type==lcao and gamma_only==0 - name: out_mul category: Output information type: Boolean @@ -3418,7 +3418,7 @@ parameters: Whether to print the Mulliken population analysis result into OUT.${suffix}/mulliken.txt. In molecular dynamics calculations, the output frequency is controlled by out_freq_ion. default_value: "False" unit: "" - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: out_app_flag category: Output information type: Boolean @@ -3426,7 +3426,7 @@ parameters: Whether to output r(R), H(R), S(R), T(R), dH(R), dS(R), and wfc matrices in an append manner during molecular dynamics calculations. Check input parameters out_mat_r, out_hsr, out_mat_t, out_mat_dh, out_hsk and out_wfc_lcao for more information. default_value: "true" unit: "" - availability: Numerical atomic orbital basis (not gamma-only algorithm) + availability: basis_type==lcao and gamma_only==0 - name: out_ndigits category: Output information type: Integer @@ -3434,7 +3434,7 @@ parameters: Controls the length of decimal part of output data, such as charge density, Hamiltonian matrix, Overlap matrix and so on. default_value: "8" unit: "" - availability: out_hsk 1 case presently. + availability: out_hsk==1 - name: out_element_info category: Output information type: Boolean @@ -3453,7 +3453,7 @@ parameters: If EXX(exact exchange) is calculated (i.e. dft_fuctional==hse/hf/pbe0/scan0 or rpa==True), the Hexx(R) files for each processor will also be saved in the above folder, which can be read in EXX calculation with restart_load==True. default_value: "False" unit: "" - availability: Numerical atomic orbital basis + availability: basis_type==lcao - name: rpa category: Output information type: Boolean @@ -3471,7 +3471,7 @@ parameters: Specifies the electronic states to calculate the charge densities with state index for, using a space-separated string of 0s and 1s. Each digit in the string corresponds to a state, starting from the first state. A 1 indicates that the charge density should be calculated for that state, while a 0 means the state will be ignored. The parameter allows a compact and flexible notation (similar to ocp_set), for example the syntax 1 4*0 5*1 0 is used to denote the selection of states: 1 means calculate for the first state, 4*0 skips the next four states, 5*1 means calculate for the following five states, and the final 0 skips the next state. It's essential that the total count of states does not exceed the total number of states (nbands); otherwise, it results in an error, and the process exits. The input string must contain only numbers and the asterisk (*) for repetition, ensuring correct format and intention of state selection. The outputs comprise multiple .cube files following the naming convention pchgi[state]s[spin]k[kpoint].cube. default_value: none unit: "" - availability: "For both PW and LCAO. When basis_type = lcao, used when calculation = get_pchg." + availability: basis_type==pw or (basis_type==lcao and calculation==get_pchg) - name: out_wfc_norm category: Output information type: String @@ -3479,7 +3479,7 @@ parameters: Specifies the electronic states to calculate the real-space wave function modulus (norm, or known as the envelope function) with state index. The syntax and state selection rules are identical to out_pchg, but the output is the norm of the wave function. The outputs comprise multiple .cube files following the naming convention wfi[state]s[spin]k[kpoint].cube. default_value: none unit: "" - availability: "For both PW and LCAO. When basis_type = lcao, used when calculation = get_wf." + availability: basis_type==pw or (basis_type==lcao and calculation==get_wf) - name: out_wfc_re_im category: Output information type: String @@ -3487,7 +3487,7 @@ parameters: Specifies the electronic states to calculate the real and imaginary parts of the wave function with state index. The syntax and state selection rules are identical to out_pchg, but the output contains both the real and imaginary components of the wave function. The outputs comprise multiple .cube files following the naming convention wfi[state]s[spin]k[kpoint][re/im].cube. default_value: none unit: "" - availability: "For both PW and LCAO. When basis_type = lcao, used when calculation = get_wf." + availability: basis_type==pw or (basis_type==lcao and calculation==get_wf) - name: if_separate_k category: Output information type: Boolean @@ -3495,7 +3495,7 @@ parameters: Specifies whether to write the partial charge densities for all k-points to individual files or merge them. Warning: Enabling symmetry may produce unwanted results due to reduced k-point weights and symmetry operations in real space. Therefore when calculating partial charge densities, if you are not sure what you want exactly, it is strongly recommended to set symmetry = -1. It is noteworthy that your symmetry setting should remain the same as that in the SCF procedure. default_value: "false" unit: "" - availability: "For both PW and LCAO. When basis_type = pw, used if out_pchg is set. When basis_type = lcao, used only when calculation = get_pchg and gamma_only = 0." + availability: "(basis_type==pw and out_pchg!=none) or (basis_type==lcao and calculation==get_pchg and gamma_only==0)" - name: out_elf category: Output information type: "Integer \\[Integer\\](optional)" @@ -3516,7 +3516,7 @@ parameters: In molecular dynamics calculations, the output frequency is controlled by out_freq_ion. default_value: 0 3 unit: "" - availability: Only for Kohn-Sham DFT and Orbital Free DFT. + availability: "esolver_type in [ksdft, ofdft]" - name: out_spillage category: Output information type: Integer @@ -3524,7 +3524,7 @@ parameters: This output is only intentively needed by the ABACUS numerical atomic orbital generation workflow. This parameter is used to control whether to output the overlap integrals between truncated spherical Bessel functions (TSBFs) and plane-wave basis expanded wavefunctions (named as OVERLAP_Q), and between TSBFs (named as OVERLAP_Sq), also their first order derivatives. The output files are named starting with orb_matrix. A value of 2 would enable the output. default_value: "0" unit: "" - availability: Only for Kohn-Sham DFT with plane-wave basis. + availability: esolver_type==ksdft and basis_type==pw - name: out_dipole category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" type: Boolean @@ -3591,7 +3591,7 @@ parameters: The directory to save the spillage files. default_value: "\"./\"" unit: "" - availability: Used only for plane wave basis set. + availability: basis_type==pw - name: dos_edelta_ev category: Density of states type: Real @@ -3669,7 +3669,7 @@ parameters: Whether to calculate electronic conductivities. default_value: "False" unit: "" - availability: basis_type = pw + availability: basis_type==pw - name: cond_che_thr category: Electronic conductivities type: Real @@ -3677,7 +3677,7 @@ parameters: Control the error of Chebyshev expansions for conductivities. default_value: "1e-8" unit: "" - availability: esolver_type = sdft + availability: esolver_type==sdft - name: cond_dw category: Electronic conductivities type: Real @@ -3685,7 +3685,7 @@ parameters: Frequency interval () for frequency-dependent conductivities. default_value: "0.1" unit: eV - availability: basis_type = pw + availability: basis_type==pw - name: cond_wcut category: Electronic conductivities type: Real @@ -3693,7 +3693,7 @@ parameters: Cutoff frequency for frequency-dependent conductivities. default_value: "10.0" unit: eV - availability: basis_type = pw + availability: basis_type==pw - name: cond_dt category: Electronic conductivities type: Real @@ -3701,7 +3701,7 @@ parameters: Time interval () to integrate Onsager coefficients. default_value: "0.02" unit: a.u. - availability: basis_type = pw + availability: basis_type==pw - name: cond_dtbatch category: Electronic conductivities type: Integer @@ -3710,7 +3710,7 @@ parameters: * If cond_dtbatch = 0: Autoset this parameter to make expansion orders larger than 100. default_value: "0" unit: "" - availability: esolver_type = sdft + availability: esolver_type==sdft - name: cond_smear category: Electronic conductivities type: Integer @@ -3728,7 +3728,7 @@ parameters: FWHM for conductivities. For Gaussian smearing, ; for Lorentzian smearing, . default_value: "0.4" unit: eV - availability: basis_type = pw + availability: basis_type==pw - name: cond_nonlocal category: Electronic conductivities type: Boolean @@ -3738,7 +3738,7 @@ parameters: * False: . default_value: "True" unit: "" - availability: basis_type = pw + availability: basis_type==pw - name: berry_phase category: Berry phase and wannier90 interface type: Boolean @@ -3869,7 +3869,7 @@ parameters: [NOTE] Note: If you do not want any electric field, the parameter efield_amp should be set to zero. This should ONLY be used in a slab geometry for surface calculations, with the discontinuity FALLING IN THE EMPTY SPACE. default_value: "False" unit: "" - availability: With dip_cor_flag = True and efield_flag = True. + availability: dip_cor_flag==true and efield_flag==true - name: efield_dir category: Electric field and dipole correction type: Integer @@ -3880,7 +3880,7 @@ parameters: * 2: parallel to the third reciprocal lattice vector default_value: "2" unit: "" - availability: with efield_flag = True. + availability: efield_flag==true - name: efield_pos_max category: Electric field and dipole correction type: Real @@ -3888,7 +3888,7 @@ parameters: Position of the maximum of the saw-like potential along crystal axis efield_dir, within the unit cell, 0 <= efield_pos_max < 1. default_value: Autoset to center of vacuum - width of vacuum / 20 unit: "" - availability: with efield_flag = True. + availability: efield_flag==true - name: efield_pos_dec category: Electric field and dipole correction type: Real @@ -3896,7 +3896,7 @@ parameters: Zone in the unit cell where the saw-like potential decreases, 0 < efield_pos_dec < 1. default_value: Autoset to width of vacuum / 10 unit: "" - availability: with efield_flag = True. + availability: efield_flag==true - name: efield_amp category: Electric field and dipole correction type: Real @@ -3906,7 +3906,7 @@ parameters: [NOTE] Note: The change of slope of this potential must be located in the empty region, or else unphysical forces will result. default_value: "0.0" unit: "a.u., 1 a.u. = 51.4220632*10^10 V/m." - availability: with efield_flag = True. + availability: efield_flag==true - name: gate_flag category: Gate field (compensating charge) type: Boolean @@ -3974,7 +3974,7 @@ parameters: The relative permittivity of the bulk solvent, 80 for water default_value: "80" unit: "" - availability: imp_sol is true. + availability: imp_sol==true - name: tau category: Implicit solvation model type: Real @@ -4022,7 +4022,7 @@ parameters: If set to default, ABACUS infers the functional name from dft_functional or pseudopotential metadata. default_value: default unit: "" - availability: vdw_method is set to d4 + availability: vdw_method==d4 - name: vdw_d4_model category: vdW correction type: String @@ -4033,7 +4033,7 @@ parameters: * d4s: smooth D4S model default_value: "d4" unit: "" - availability: vdw_method is set to d4 + availability: vdw_method==d4 - name: vdw_s6 category: vdW correction type: String @@ -4041,7 +4041,7 @@ parameters: This scale factor is used to optimize the interaction energy deviations in van der Waals (vdW) corrected calculations. The recommended values of this parameter are dependent on the chosen vdW correction method and the DFT functional being used. For DFT-D2, the recommended values are 0.75 (PBE), 1.2 (BLYP), 1.05 (B-P86), 1.0 (TPSS), and 1.05 (B3LYP). If not set, will use values of PBE functional. For DFT-D3, recommended values with different DFT functionals can be found on the here. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value. default_value: "" unit: "" - availability: "vdw_method is set to d2, d3_0, or d3_bj" + availability: "vdw_method in [d2, d3_0, d3_bj]" - name: vdw_s8 category: vdW correction type: String @@ -4049,7 +4049,7 @@ parameters: This scale factor is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the webpage. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value. default_value: "" unit: "" - availability: vdw_method is set to d3_0 or d3_bj + availability: "vdw_method in [d3_0, d3_bj]" - name: vdw_a1 category: vdW correction type: String @@ -4057,7 +4057,7 @@ parameters: This damping function parameter is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the webpage. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value. default_value: "" unit: "" - availability: vdw_method is set to d3_0 or d3_bj + availability: "vdw_method in [d3_0, d3_bj]" - name: vdw_a2 category: vdW correction type: String @@ -4065,7 +4065,7 @@ parameters: This damping function parameter is only relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the webpage. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value. default_value: "" unit: "" - availability: vdw_method is set to d3_0 or d3_bj + availability: "vdw_method in [d3_0, d3_bj]" - name: vdw_d category: vdW correction type: Real @@ -4073,7 +4073,7 @@ parameters: Controls the damping rate of the damping function in the DFT-D2 method. default_value: "20" unit: "" - availability: vdw_method is set to d2 + availability: vdw_method==d2 - name: vdw_abc category: vdW correction type: Boolean @@ -4083,7 +4083,7 @@ parameters: * False: The three-body term is not included. default_value: "False" unit: "" - availability: vdw_method is set to d3_0 or d3_bj + availability: "vdw_method in [d3_0, d3_bj]" - name: vdw_c6_file category: vdW correction type: String @@ -4095,7 +4095,7 @@ parameters: Namely, each line contains the element name and the corresponding parameter. default_value: default unit: "" - availability: vdw_method is set to d2 + availability: vdw_method==d2 - name: vdw_c6_unit category: vdW correction type: String @@ -4105,7 +4105,7 @@ parameters: * eVA (eV Angstrom) default_value: Jnm6/mol unit: "" - availability: vdw_C6_file is not default + availability: "vdw_c6_file!=default" - name: vdw_r0_file category: vdW correction type: String @@ -4117,7 +4117,7 @@ parameters: Namely, each line contains the element name and the corresponding parameter. default_value: default unit: "" - availability: vdw_method is set to d2 + availability: vdw_method==d2 - name: vdw_r0_unit category: vdW correction type: String @@ -4127,7 +4127,7 @@ parameters: * Bohr default_value: "A" unit: "" - availability: vdw_R0_file is not default + availability: "vdw_r0_file!=default" - name: vdw_cutoff_type category: vdW correction type: String @@ -4145,7 +4145,7 @@ parameters: Defines the radius of the cutoff sphere when vdw_cutoff_type is set to radius. The default values depend on the chosen vdw_method. default_value: "" unit: defined by vdw_radius_unit (default Bohr) - availability: vdw_cutoff_type is set to radius + availability: vdw_cutoff_type==radius - name: vdw_radius_unit category: vdW correction type: String @@ -4155,7 +4155,7 @@ parameters: * Bohr default_value: Bohr unit: "" - availability: vdw_cutoff_type is set to radius + availability: vdw_cutoff_type==radius - name: vdw_cutoff_period category: vdW correction type: Integer Integer Integer @@ -4163,7 +4163,7 @@ parameters: The three integers supplied here explicitly specify the extent of the supercell in the directions of the three basis lattice vectors. default_value: 3 3 3 unit: "" - availability: vdw_cutoff_type is set to period + availability: vdw_cutoff_type==period - name: vdw_cn_thr category: vdW correction type: Real @@ -4171,7 +4171,7 @@ parameters: The cutoff radius when calculating coordination numbers. default_value: "40" unit: "defined by vdw_cn_thr_unit (default: Bohr)" - availability: "vdw_method is set to d3_0, d3_bj, or d4" + availability: "vdw_method in [d3_0, d3_bj, d4]" - name: vdw_cn_thr_unit category: vdW correction type: String @@ -4378,7 +4378,7 @@ parameters: * True: rotate both D(k) and Hexx(R) to accelerate both diagonalization and EXX calculation default_value: "True" unit: "" - availability: symmetry==1 and exx calculation (dft_fuctional==hse/hf/pbe0/scan0 or rpa==True) + availability: "symmetry==1 and (dft_functional in [hse, hf, pbe0, scan0] or rpa==true)" - name: out_ri_cv category: Exact Exchange (LCAO) type: Boolean @@ -4445,7 +4445,7 @@ parameters: The screen length of Yukawa potential. If left to default, the screen length will be calculated as an average of the entire system. It's better to stick to the default setting unless there is a very good reason. default_value: Calculated on the fly. unit: "" - availability: DFT+U with yukawa_potential = True. + availability: dft_plus_u==1 and yukawa_potential==true - name: uramping category: DFT+U correction type: Real @@ -4453,7 +4453,7 @@ parameters: Once uramping > 0.15 eV. DFT+U calculations will start SCF with U = 0 eV, namely normal LDA/PBE calculations. Once SCF restarts when drho 0." + availability: "dft_plus_u==1 and mixing_restart>0" - name: omc category: DFT+U correction type: Integer @@ -4475,7 +4475,7 @@ parameters: * 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 + availability: dft_plus_u==1 - name: sc_mag_switch category: Spin-Constrained DFT type: Boolean @@ -4499,7 +4499,7 @@ parameters: Convergence criterion of spin-constrained iteration (RMS) in uB default_value: "1.0e-6" unit: uB - availability: sc_mag_switch is true + availability: sc_mag_switch==true - name: nsc category: Spin-Constrained DFT type: Integer @@ -4507,7 +4507,7 @@ parameters: Maximal number of spin-constrained iteration default_value: "100" unit: "" - availability: sc_mag_switch is true + availability: sc_mag_switch==true - name: nsc_min category: Spin-Constrained DFT type: Integer @@ -4515,7 +4515,7 @@ parameters: Minimum number of spin-constrained iteration default_value: "2" unit: "" - availability: sc_mag_switch is true + availability: sc_mag_switch==true - name: alpha_trial category: Spin-Constrained DFT type: Real @@ -4523,7 +4523,7 @@ parameters: Initial trial step size for lambda in eV/uB^2 default_value: "0.01" unit: eV/uB^2 - availability: sc_mag_switch is true + availability: sc_mag_switch==true - name: sccut category: Spin-Constrained DFT type: Real @@ -4531,7 +4531,7 @@ parameters: Maximal step size for lambda in eV/uB default_value: "3.0" unit: eV/uB - availability: sc_mag_switch is true + availability: sc_mag_switch==true - name: sc_drop_thr category: Spin-Constrained DFT type: Real @@ -4539,7 +4539,7 @@ parameters: Convergence criterion ratio of lambda iteration in Spin-constrained DFT default_value: "1.0e-2" unit: "" - availability: sc_mag_switch is true + availability: sc_mag_switch==true - name: sc_scf_thr category: Spin-Constrained DFT type: Real @@ -4547,7 +4547,7 @@ parameters: Density error threshold for inner loop of spin-constrained SCF default_value: "1.0e-4" unit: "" - availability: sc_mag_switch is true + availability: sc_mag_switch==true - name: sc_direction_only category: Spin-Constrained DFT type: Boolean @@ -4557,7 +4557,7 @@ parameters: When false (default), both the direction and magnitude of the magnetic moment are constrained to the target values. default_value: "False" unit: "" - availability: sc_mag_switch is true + availability: sc_mag_switch==true - name: sc_lambda_strategy category: Spin-Constrained DFT type: String @@ -4570,7 +4570,7 @@ parameters: * linear_scan: linear sweep of lambda for testing magnetic moment response default_value: bfgs unit: "" - availability: sc_mag_switch is true + availability: sc_mag_switch==true - name: sc_scan_lambda_start category: Spin-Constrained DFT type: Float @@ -4578,7 +4578,7 @@ parameters: Starting lambda value for linear_scan strategy. Only used when sc_lambda_strategy=linear_scan. default_value: "0.0" unit: eV/uB - availability: sc_lambda_strategy is linear_scan + availability: sc_lambda_strategy==linear_scan - name: sc_scan_lambda_end category: Spin-Constrained DFT type: Float @@ -4586,7 +4586,7 @@ parameters: Ending lambda value for linear_scan strategy. Only used when sc_lambda_strategy=linear_scan. default_value: "1.0" unit: eV/uB - availability: sc_lambda_strategy is linear_scan + availability: sc_lambda_strategy==linear_scan - name: sc_scan_steps category: Spin-Constrained DFT type: Integer @@ -4594,7 +4594,7 @@ parameters: Number of lambda values to scan. Only used when sc_lambda_strategy=linear_scan. default_value: "20" unit: "" - availability: sc_lambda_strategy is linear_scan + availability: sc_lambda_strategy==linear_scan - name: qo_switch category: Quasiatomic Orbital (QO) analysis type: Boolean @@ -4934,7 +4934,7 @@ parameters: Atomic basis set size for each atom type (with the same order as in STRU) in FHI-aims. default_value: "{} (empty list, where ABACUS use its own basis set size)" unit: "" - availability: ri_hartree_benchmark = aims + availability: ri_hartree_benchmark==aims - name: rdmft category: Reduced Density Matrix Functional Theory type: Boolean @@ -4960,7 +4960,7 @@ parameters: * False: Use the traditional method to calculate the Fock exchange operator. default_value: "True" unit: "" - availability: exx_separate_loop==True. + availability: exx_separate_loop==true - name: exx_gamma_extrapolation category: Exact Exchange (PW) type: Boolean diff --git a/source/source_io/CMakeLists.txt b/source/source_io/CMakeLists.txt index ddd5c56f1a..b9ec8c4979 100644 --- a/source/source_io/CMakeLists.txt +++ b/source/source_io/CMakeLists.txt @@ -117,6 +117,7 @@ add_library( module_parameter/read_input_item_exx_dftu.cpp module_parameter/read_input_item_other.cpp module_parameter/read_input_item_output.cpp + module_parameter/availability.cpp module_parameter/read_input.cpp module_parameter/read_set_globalv.cpp ) diff --git a/source/source_io/input_help.cpp b/source/source_io/input_help.cpp index a53392d5fb..9681f71784 100644 --- a/source/source_io/input_help.cpp +++ b/source/source_io/input_help.cpp @@ -370,7 +370,7 @@ void ParameterHelp::build_registry() { meta.description = item.description; meta.default_value = item.default_value; meta.unit = item.unit; - meta.availability = item.availability; + meta.availability = item.get_availability(); // Pre-compute lowercase name for fast fuzzy matching meta.name_lowercase = to_lowercase(item.label); @@ -505,7 +505,7 @@ void ParameterHelp::generate_yaml(std::ostream& os) { os << " default_value: " << yaml_quote_if_needed(item.default_value) << "\n"; os << " unit: " << yaml_quote_if_needed(item.unit) << "\n"; - os << " availability: " << yaml_quote_if_needed(item.availability) << "\n"; + os << " availability: " << yaml_quote_if_needed(item.get_availability()) << "\n"; } } diff --git a/source/source_io/module_parameter/availability.cpp b/source/source_io/module_parameter/availability.cpp new file mode 100644 index 0000000000..8258a7ad87 --- /dev/null +++ b/source/source_io/module_parameter/availability.cpp @@ -0,0 +1,380 @@ +#include "source_io/module_parameter/availability.h" + +#include +#include +#include + +namespace ModuleIO +{ +namespace +{ + +bool is_identifier_start(const char c) +{ + return std::isalpha(static_cast(c)) != 0; +} + +bool is_identifier_char(const char c) +{ + return std::isalnum(static_cast(c)) != 0 || c == '_'; +} + +std::string trim_copy(const std::string& value) +{ + std::size_t begin = 0; + std::size_t end = value.size(); + while (begin < end && std::isspace(static_cast(value[begin]))) + { + ++begin; + } + while (end > begin && std::isspace(static_cast(value[end - 1]))) + { + --end; + } + return value.substr(begin, end - begin); +} + +std::vector split_slash_values(const std::string& value) +{ + std::vector values; + std::size_t begin = 0; + while (begin <= value.size()) + { + const std::size_t slash = value.find('/', begin); + const std::string part = trim_copy(value.substr( + begin, slash == std::string::npos ? std::string::npos : slash - begin)); + if (part.empty()) + { + return {}; + } + values.push_back(part); + if (slash == std::string::npos) + { + break; + } + begin = slash + 1; + } + return values; +} + +class AvailabilityParser +{ + public: + explicit AvailabilityParser(const std::string& text) : text_(text) {} + + AvailabilityExpr parse() + { + if (at_end()) + { + return AvailabilityExpr(); + } + skip_space(); + if (at_end()) + { + fail("expected parameter identifier"); + } + + AvailabilityExpr result = parse_or(); + skip_space(); + if (!at_end()) + { + fail("unexpected token"); + } + return result; + } + + private: + const std::string& text_; + std::size_t pos_ = 0; + + bool at_end() const + { + return pos_ == text_.size(); + } + + void skip_space() + { + while (!at_end() && std::isspace(static_cast(text_[pos_]))) + { + ++pos_; + } + } + + [[noreturn]] void fail(const std::string& message) const + { + throw std::invalid_argument("Invalid availability expression at column " + + std::to_string(pos_ + 1) + ": " + message + + " in '" + text_ + "'"); + } + + bool consume_char(const char expected) + { + skip_space(); + if (!at_end() && text_[pos_] == expected) + { + ++pos_; + return true; + } + return false; + } + + bool consume_keyword(const char* keyword) + { + skip_space(); + const std::size_t length = std::char_traits::length(keyword); + if (text_.compare(pos_, length, keyword) != 0) + { + return false; + } + const std::size_t end = pos_ + length; + if ((pos_ > 0 && is_identifier_char(text_[pos_ - 1])) + || (end < text_.size() && is_identifier_char(text_[end]))) + { + return false; + } + pos_ = end; + return true; + } + + std::string parse_identifier() + { + skip_space(); + if (at_end() || !is_identifier_start(text_[pos_])) + { + fail("expected parameter identifier"); + } + const std::size_t begin = pos_++; + while (!at_end() && is_identifier_char(text_[pos_])) + { + ++pos_; + } + return text_.substr(begin, pos_ - begin); + } + + std::string parse_scalar_value() + { + skip_space(); + const std::size_t begin = pos_; + while (!at_end() && !std::isspace(static_cast(text_[pos_])) + && text_[pos_] != '(' && text_[pos_] != ')' && text_[pos_] != '[' + && text_[pos_] != ']' && text_[pos_] != ',') + { + if (text_[pos_] == '=' || text_[pos_] == '<' || text_[pos_] == '>' + || text_[pos_] == '!') + { + fail("invalid character in value"); + } + ++pos_; + } + if (begin == pos_) + { + fail("expected value"); + } + return text_.substr(begin, pos_ - begin); + } + + std::string parse_list_value() + { + skip_space(); + const std::size_t begin = pos_; + while (!at_end() && text_[pos_] != ',' && text_[pos_] != ']') + { + if (text_[pos_] == '[' || text_[pos_] == '(' || text_[pos_] == ')' + || text_[pos_] == '=' || text_[pos_] == '<' || text_[pos_] == '>' + || text_[pos_] == '!') + { + fail("invalid character in list value"); + } + ++pos_; + } + const std::string value = trim_copy(text_.substr(begin, pos_ - begin)); + if (value.empty()) + { + fail("expected non-empty list value"); + } + return value; + } + + AvailabilityExpr parse_condition() + { + AvailabilityExpr result; + result.condition.param = parse_identifier(); + skip_space(); + + static const char* comparison_ops[] = {"==", "!=", ">=", "<=", ">", "<"}; + for (const char* op : comparison_ops) + { + const std::size_t length = std::char_traits::length(op); + if (text_.compare(pos_, length, op) == 0) + { + pos_ += length; + result.condition.op = op; + const std::string value = parse_scalar_value(); + if (std::string(op) == "==") + { + result.condition.values = split_slash_values(value); + } + else + { + result.condition.values.push_back(value); + } + if (result.condition.values.empty()) + { + fail("expected value"); + } + return result; + } + } + + if (consume_keyword("contains")) + { + result.condition.op = "contains"; + result.condition.values.push_back(parse_scalar_value()); + return result; + } + + if (consume_keyword("in")) + { + if (!consume_char('[')) + { + fail("expected '[' after 'in'"); + } + result.condition.op = "in"; + result.condition.values.push_back(parse_list_value()); + while (consume_char(',')) + { + result.condition.values.push_back(parse_list_value()); + } + if (!consume_char(']')) + { + fail("expected ']' after list"); + } + return result; + } + + fail("expected comparison operator"); + } + + AvailabilityExpr parse_primary() + { + skip_space(); + if (consume_char('(')) + { + AvailabilityExpr result = parse_or(); + if (!consume_char(')')) + { + fail("expected ')' after grouped expression"); + } + return result; + } + return parse_condition(); + } + + AvailabilityExpr parse_and() + { + AvailabilityExpr result = parse_primary(); + std::vector children; + children.push_back(result); + while (true) + { + if (!consume_keyword("and") && !consume_char(',')) + { + break; + } + children.push_back(parse_primary()); + } + if (children.size() == 1) + { + return result; + } + AvailabilityExpr node; + node.op = "and"; + node.children = std::move(children); + return node; + } + + AvailabilityExpr parse_or() + { + AvailabilityExpr result = parse_and(); + std::vector children; + children.push_back(result); + while (consume_keyword("or")) + { + children.push_back(parse_and()); + } + if (children.size() == 1) + { + return result; + } + AvailabilityExpr node; + node.op = "or"; + node.children = std::move(children); + return node; + } +}; + +} // namespace + +std::string AvailabilityCondition::to_string() const +{ + if (values.empty()) + { + return {}; + } + if (op == "in") + { + std::string result = param + " in ["; + for (std::size_t i = 0; i < values.size(); ++i) + { + if (i) + { + result += ", "; + } + result += values[i]; + } + return result + "]"; + } + if (op == "contains") + { + return param + " contains " + values[0]; + } + std::string result = param + op + values[0]; + for (std::size_t i = 1; i < values.size(); ++i) + { + result += "/" + values[i]; + } + return result; +} + +std::string AvailabilityExpr::to_string() const +{ + if (is_leaf()) + { + return condition.to_string(); + } + const std::string separator = op == "or" ? " or " : " and "; + std::string result; + for (std::size_t i = 0; i < children.size(); ++i) + { + if (i) + { + result += separator; + } + if (children[i].is_leaf()) + { + result += children[i].to_string(); + } + else + { + result += "(" + children[i].to_string() + ")"; + } + } + return result; +} + +AvailabilityExpr parse_availability(const std::string& raw) +{ + return AvailabilityParser(raw).parse(); +} + +} // namespace ModuleIO diff --git a/source/source_io/module_parameter/availability.h b/source/source_io/module_parameter/availability.h new file mode 100644 index 0000000000..0f017f92a2 --- /dev/null +++ b/source/source_io/module_parameter/availability.h @@ -0,0 +1,48 @@ +#ifndef AVAILABILITY_H +#define AVAILABILITY_H + +#include +#include + +namespace ModuleIO +{ + +/// A single condition `param op values` (e.g. `basis_type==lcao` or +/// `vdw_method in [d2, d3_0]`). +struct AvailabilityCondition +{ + std::string param; ///< parameter identifier + std::string op; ///< ==, !=, >, >=, <, <=, "in" or "contains" + std::vector values; ///< one value for comparisons, several for "in" + + std::string to_string() const; +}; + +/// Boolean expression tree. A leaf holds a single condition; a non-leaf node +/// holds `op` ("and"|"or") and `children`. +struct AvailabilityExpr +{ + std::string op; ///< "" (leaf) | "and" | "or" + AvailabilityCondition condition; ///< valid when leaf + std::vector children; ///< valid when non-leaf + + bool is_leaf() const + { + return op.empty(); + } + + std::string to_string() const; +}; + +/// Parse an availability string into its boolean-expression tree. +/// +/// Accepts the canonical grammar (`param==value`, `param in [a, b]`, the +/// comparison operators ==, !=, >, >=, <, <=, `and`/`or`/`,` combinators and +/// `(...)` grouping). An empty string yields an empty (always-available) +/// expression. Non-empty input that is not consumed by this grammar throws +/// std::invalid_argument. +AvailabilityExpr parse_availability(const std::string& raw); + +} // namespace ModuleIO + +#endif // AVAILABILITY_H diff --git a/source/source_io/module_parameter/input_item.h b/source/source_io/module_parameter/input_item.h index ed07d04f83..96cd5fe49f 100644 --- a/source/source_io/module_parameter/input_item.h +++ b/source/source_io/module_parameter/input_item.h @@ -7,6 +7,7 @@ #include #include "source_io/module_parameter/parameter.h" +#include "source_io/module_parameter/availability.h" namespace ModuleIO { class Input_Item @@ -30,7 +31,8 @@ class Input_Item description = item.description; default_value = item.default_value; unit = item.unit; - availability = item.availability; + availability_ = item.availability_; + availability_expr_ = item.availability_expr_; annotation = item.annotation; read_value = item.read_value; check_value = item.check_value; @@ -48,7 +50,24 @@ class Input_Item std::string description; ///< full description (supports multi-line, lists, notes) std::string default_value; ///< default value as string std::string unit; ///< unit of measurement (empty if none) - std::string availability; ///< availability conditions (empty if always) + /// Set and validate the canonical availability expression. An empty value + /// means that the item is always available. + void set_availability(const std::string& value) + { + const AvailabilityExpr parsed = parse_availability(value); + availability_expr_ = parsed; + availability_ = parsed.to_string(); + } + + const std::string& get_availability() const + { + return availability_; + } + + const AvailabilityExpr& get_availability_expr() const + { + return availability_expr_; + } bool is_read() const ///< check if the input item is read { @@ -74,7 +93,11 @@ class Input_Item /// get final_value function for output INPUT file std::function get_final_value = nullptr; // ====== !!! Do not add any more functions here. ====== + + private: + std::string availability_; ///< canonical availability string + AvailabilityExpr availability_expr_; ///< parsed condition tree }; } // namespace ModuleIO -#endif // INPUT_ITEM_H \ No newline at end of file +#endif // INPUT_ITEM_H diff --git a/source/source_io/module_parameter/read_input_item_deepks.cpp b/source/source_io/module_parameter/read_input_item_deepks.cpp index e1eac18e4b..335523ad26 100644 --- a/source/source_io/module_parameter/read_input_item_deepks.cpp +++ b/source/source_io/module_parameter/read_input_item_deepks.cpp @@ -23,7 +23,7 @@ void ReadInput::item_deepks() [NOTE] When deepks_out_labels equals 1, the path of a numerical descriptor (an orb file) is needed to be specified under the NUMERICAL_DESCRIPTOR tag in the STRU file. This is not needed when deepks_out_labels equals 2.)"; item.default_value = "0"; item.unit = ""; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); read_sync_int(input.deepks_out_labels); this->add_item(item); } @@ -35,7 +35,7 @@ void ReadInput::item_deepks() item.description = "When deepks_out_freq_elec is greater than 0, print labels and descriptors for DeePKS in OUT.${suffix}/DeePKS_Labels_Elec per deepks_out_freq_elec electronic iterations, with suffix _e* to distinguish different steps. Often used with deepks_out_labels equals 1."; item.default_value = "0"; item.unit = ""; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); read_sync_int(input.deepks_out_freq_elec); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.deepks_out_freq_elec < 0) @@ -57,7 +57,7 @@ void ReadInput::item_deepks() item.description = "Print labels and descriptors calculated by base functional ( determined by deepks_out_base ) and target functional ( determined by dft_functional ) for DeePKS in per deepks_out_freq_elec electronic iterations. The SCF process, labels and descriptors output of the target functional are all consistent with those when the target functional is used alone. The only additional output under this configuration is the labels of the base functional. Often used with deepks_out_labels equals 1."; item.default_value = "None"; item.unit = ""; - item.availability = "Numerical atomic orbital basis and deepks_out_freq_elec is greater than 0"; + item.set_availability("basis_type==lcao and deepks_out_freq_elec>0"); read_sync_string(input.deepks_out_base); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.deepks_out_base != "none" && para.input.deepks_out_labels == 0) @@ -80,7 +80,7 @@ void ReadInput::item_deepks() "\n\n[NOTE] A trained, traced model file is needed."; item.default_value = "False"; item.unit = ""; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); read_sync_bool(input.deepks_scf); item.check_value = [](const Input_Item& item, const Parameter& para) { #ifndef __MLALGO @@ -107,7 +107,7 @@ void ReadInput::item_deepks() "so this feature is currently only intended for internal usage."; item.default_value = "False"; item.unit = ""; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); read_sync_bool(input.deepks_equiv); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.deepks_equiv && para.input.deepks_bandgap) @@ -125,7 +125,7 @@ void ReadInput::item_deepks() item.description = "the path of the trained, traced neural network model file generated by deepks-kit"; item.default_value = "None"; item.unit = ""; - item.availability = "Numerical atomic orbital basis and deepks_scf is true"; + item.set_availability("basis_type==lcao and deepks_scf==true"); read_sync_string(input.deepks_model); this->add_item(item); } @@ -137,7 +137,7 @@ void ReadInput::item_deepks() item.description = "the maximum angular momentum of the Bessel functions generated as the projectors in DeePKS - NOte: To generate such projectors, set calculation type to gen_bessel in ABACUS. See also calculation."; item.default_value = "2"; item.unit = ""; - item.availability = "gen_bessel calculation"; + item.set_availability("calculation==gen_bessel"); read_sync_int(input.bessel_descriptor_lmax); this->add_item(item); } @@ -149,7 +149,7 @@ void ReadInput::item_deepks() item.description = "energy cutoff of Bessel functions"; item.default_value = "same as ecutwfc"; item.unit = "Ry"; - item.availability = "gen_bessel calculation"; + item.set_availability("calculation==gen_bessel"); read_sync_string(input.bessel_descriptor_ecut); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.bessel_descriptor_ecut == "default") @@ -173,7 +173,7 @@ void ReadInput::item_deepks() item.description = "tolerance for searching the zeros of Bessel functions"; item.default_value = "1.0e-12"; item.unit = ""; - item.availability = "gen_bessel calculation"; + item.set_availability("calculation==gen_bessel"); read_sync_double(input.bessel_descriptor_tolerence); this->add_item(item); } @@ -185,7 +185,7 @@ void ReadInput::item_deepks() item.description = "cutoff radius of Bessel functions"; item.default_value = "6.0"; item.unit = "Bohr"; - item.availability = "gen_bessel calculation"; + item.set_availability("calculation==gen_bessel"); read_sync_double(input.bessel_descriptor_rcut); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.bessel_descriptor_rcut < 0) @@ -203,7 +203,7 @@ void ReadInput::item_deepks() item.description = "smooth the Bessel functions at radius cutoff"; item.default_value = "False"; item.unit = ""; - item.availability = "gen_bessel calculation"; + item.set_availability("calculation==gen_bessel"); read_sync_bool(input.bessel_descriptor_smooth); this->add_item(item); } @@ -215,7 +215,7 @@ void ReadInput::item_deepks() item.description = "smooth parameter at the cutoff radius of projectors"; item.default_value = "0.1"; item.unit = "Bohr"; - item.availability = "gen_bessel calculation"; + item.set_availability("calculation==gen_bessel"); read_sync_double(input.bessel_descriptor_sigma); this->add_item(item); } @@ -231,7 +231,7 @@ void ReadInput::item_deepks() * 3: Used for systems containing H atoms. Here HOMO is defined as the max occupation except H atoms and the bandgap label is the energy between HOMO and (HOMO + 1))"; item.default_value = "0"; item.unit = ""; - item.availability = "Numerical atomic orbital basis and deepks_scf is true"; + item.set_availability("basis_type==lcao and deepks_scf==true"); read_sync_int(input.deepks_bandgap); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.deepks_bandgap < 0 || para.input.deepks_bandgap > 3) @@ -251,7 +251,7 @@ void ReadInput::item_deepks() * 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.)"; item.default_value = "-1 0"; item.unit = ""; - item.availability = "Numerical atomic orbital basis, deepks_scf is true, and deepks_bandgap is 1 or 2"; + item.set_availability("basis_type==lcao and deepks_scf==true and deepks_bandgap in [1, 2]"); item.read_value = [](const Input_Item& item, Parameter& para) { para.input.deepks_band_range[0] = std::stod(item.str_values[0]); para.input.deepks_band_range[1] = std::stod(item.str_values[1]); @@ -295,7 +295,7 @@ void ReadInput::item_deepks() * deepks_v_delta = -2: deepks_phialpha_r.npy and deepks_gevdm.npy, which can be used to calculate deepks_vdrpre.npy. A recommanded method for memory saving.)"; item.default_value = "0"; item.unit = ""; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); read_sync_int(input.deepks_v_delta); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.deepks_v_delta < -2 || para.input.deepks_v_delta > 2) @@ -316,7 +316,6 @@ void ReadInput::item_deepks() "When set to 1, ABACUS needs to be run with only 1 process."; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.deepks_out_unittest); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.deepks_out_unittest) diff --git a/source/source_io/module_parameter/read_input_item_elec_stru.cpp b/source/source_io/module_parameter/read_input_item_elec_stru.cpp index 147292ce37..8f480ccd75 100644 --- a/source/source_io/module_parameter/read_input_item_elec_stru.cpp +++ b/source/source_io/module_parameter/read_input_item_elec_stru.cpp @@ -21,7 +21,6 @@ void ReadInput::item_elec_stru() * lcao_in_pw: Expand the localized atomic set in plane-wave basis, non-self-consistent field calculation not tested.)"; item.default_value = "pw"; item.unit = ""; - item.availability = ""; read_sync_string(input.basis_type); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.towannier90) @@ -79,7 +78,6 @@ Then the user has to correct the input file and restart the calculation.)"; - scalapack_gvx (if compiling option `ENABLE_ELPA` has not been set and compiling option `ENABLE_MPI` has been set) - cusolver (if compiling option `USE_CUDA` has been set))"; item.unit = ""; - item.availability = ""; read_sync_string(input.ks_solver); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.ks_solver == "default") @@ -246,7 +244,6 @@ Then the user has to correct the input file and restart the calculation.)"; item.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."; item.default_value = ""; item.unit = ""; - item.availability = ""; read_sync_int(input.nbands); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.nbands < 0) @@ -265,7 +262,6 @@ Then the user has to correct the input file and restart the calculation.)"; * >0.0: this denotes the total number of electrons in the system. Must be less than 2*nbands.)"; item.default_value = "0.0"; item.unit = ""; - item.availability = ""; item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.nelec < 0) { @@ -287,7 +283,6 @@ Then the user has to correct the input file and restart the calculation.)"; item.description = "The total number of electrons will be calculated by nelec+nelec_delta."; item.default_value = "0.0"; item.unit = ""; - item.availability = ""; read_sync_double(input.nelec_delta); this->add_item(item); } @@ -301,7 +296,6 @@ Then the user has to correct the input file and restart the calculation.)"; * >0.0: The different number of electrons between spin-up and spin-down channels. The range of value must be in [-nelec ~ nelec]. It is one type of constrainted DFT method, two Fermi energies will be calculated.)"; item.default_value = "0.0"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.nupdown = doublevalue; para.sys.two_fermi = (doublevalue != 0.0); @@ -343,7 +337,6 @@ Then the user has to correct the input file and restart the calculation.)"; The other way is only available when compiling with LIBXC, and it allows for supplying exchange-correlation functionals as combinations of LIBXC keywords for functional components, joined by a plus sign, for example, dft_functional='LDA_X_1D_EXPONENTIAL+LDA_C_1D_CSC'.)"; item.default_value = "Used the same as DFT functional as specified in the pseudopotential files."; item.unit = ""; - item.availability = ""; read_sync_string(input.dft_functional); this->add_item(item); } @@ -355,7 +348,6 @@ The other way is only available when compiling with LIBXC, and it allows for sup item.description = "Specifies temperature when using temperature-dependent XC functionals (KSDT and so on)."; item.default_value = "0.0"; item.unit = "Ry"; - item.availability = ""; read_sync_double(input.xc_temperature); this->add_item(item); } @@ -370,7 +362,6 @@ The other way is only available when compiling with LIBXC, and it allows for sup "Presently this feature can only support parameterization on one exchange functional."; item.default_value = ""; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.xc_exch_ext.resize(item.get_size()); std::transform(item.str_values.begin(), item.str_values.end(), @@ -418,7 +409,6 @@ The other way is only available when compiling with LIBXC, and it allows for sup "Presently this feature can only support parameterization on one correlation functional."; item.default_value = ""; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.xc_corr_ext.resize(item.get_size()); std::transform(item.str_values.begin(), item.str_values.end(), @@ -463,7 +453,6 @@ The other way is only available when compiling with LIBXC, and it allows for sup item.description = "Cut-off of radial integration for pseudopotentials."; item.default_value = "15"; item.unit = "Bohr"; - item.availability = ""; read_sync_double(input.pseudo_rcut); this->add_item(item); } @@ -477,7 +466,6 @@ The other way is only available when compiling with LIBXC, and it allows for sup * 1: Use the mesh that is consistent with quantum espresso)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_bool(input.pseudo_mesh); this->add_item(item); } @@ -492,7 +480,6 @@ The other way is only available when compiling with LIBXC, and it allows for sup * 4: Noncollinear or spin-orbit calculations. Set nspin to 4 explicitly when noncolin or lspinorb is enabled.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.nspin); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.nspin != 1 && para.input.nspin != 2 && para.input.nspin != 4) @@ -520,7 +507,6 @@ The other way is only available when compiling with LIBXC, and it allows for sup * fd: Fermi-Dirac smearing method: and smearing_sigma below is the temperature (in Ry).)"; item.default_value = "gauss"; item.unit = ""; - item.availability = ""; read_sync_string(input.smearing_method); item.check_value = [](const Input_Item& item, const Parameter& para) { const std::vector methods = {"gauss", "gaussian", @@ -544,7 +530,6 @@ The other way is only available when compiling with LIBXC, and it allows for sup item.description = "Energy range for smearing."; item.default_value = "0.015"; item.unit = "Ry"; - item.availability = ""; read_sync_double(input.smearing_sigma); this->add_item(item); } @@ -558,7 +543,6 @@ The other way is only available when compiling with LIBXC, and it allows for sup item.description = "Energy range for smearing, smearing_sigma = 1/2 kB smearing_sigma_temp."; item.default_value = "2 * smearing_sigma / kB."; item.unit = "K"; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.smearing_sigma = 3.166815e-6 * doublevalue; }; // only to set smearing_sigma, so no need to write to output INPUT file @@ -578,7 +562,6 @@ The other way is only available when compiling with LIBXC, and it allows for sup In general, the convergence of the Broyden method is slightly faster than that of the Pulay method.)"; item.default_value = "broyden"; item.unit = ""; - item.availability = ""; read_sync_string(input.mixing_mode); this->add_item(item); } @@ -599,7 +582,6 @@ Note: For low-dimensional large systems, the setup of mixing_beta=0.1, mixing_nd For spin-polarized calculations (nspin=2 or nspin=4) that are difficult to converge, try reducing both mixing_beta and mixing_beta_mag simultaneously, e.g., mixing_beta=0.1 and mixing_beta_mag=0.1 or lower.)"; item.default_value = "0.8 for nspin=1, 0.4 for nspin=2 and nspin=4."; item.unit = ""; - item.availability = ""; read_sync_double(input.mixing_beta); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.mixing_beta < 0.0) @@ -635,7 +617,6 @@ If SCF convergence is difficult with spin polarization (nspin=2 or nspin=4), try item.default_value = "4*mixing_beta, but the maximum value is 1.6."; item.unit = ""; - item.availability = ""; read_sync_double(input.mixing_beta_mag); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.mixing_beta_mag < 0.0) @@ -665,7 +646,6 @@ If SCF convergence is difficult with spin polarization (nspin=2 or nspin=4), try For systems that are difficult to converge, one could try increasing the value of 'mixing_ndim' to enhance the stability of the self-consistent field (SCF) calculation.)"; item.default_value = "8"; item.unit = ""; - item.availability = ""; read_sync_int(input.mixing_ndim); this->add_item(item); } @@ -677,7 +657,6 @@ For systems that are difficult to converge, one could try increasing the value o item.description = "If the density difference between input and output drho is smaller than mixing_restart, SCF will restart at next step which means SCF will restart by using output charge density from perivos iteration as input charge density directly, and start a new mixing. Notice that mixing_restart will only take effect once in one SCF."; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_double(input.mixing_restart); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.sc_mag_switch == 1) @@ -702,7 +681,7 @@ For systems that are difficult to converge, one could try increasing the value o item.description = "At n-th iteration which is calculated by drho=0"); read_sync_bool(input.mixing_dmr); this->add_item(item); } @@ -718,7 +697,6 @@ For systems that are difficult to converge, one could try increasing the value o For systems that are difficult to converge, particularly metallic systems, enabling Kerker scaling may aid in achieving convergence.)"; item.default_value = "1.0"; item.unit = ""; - item.availability = ""; read_sync_double(input.mixing_gg0); this->add_item(item); } @@ -732,7 +710,6 @@ For systems that are difficult to converge, particularly metallic systems, enabl The magnetic-density Kerker preconditioner is bypassed when mixing_beta_mag <= 0.1, so mixing_gg0_mag has no effect in that regime. It is also unavailable when the charge-density Kerker preconditioner itself is bypassed.)"; item.default_value = "0.0"; item.unit = ""; - item.availability = ""; read_sync_double(input.mixing_gg0_mag); this->add_item(item); } @@ -746,7 +723,6 @@ The magnetic-density Kerker preconditioner is bypassed when mixing_beta_mag <= 0 In the current implementation, the automatic bypass thresholds are fixed independently of mixing_gg0_min: charge-density Kerker is bypassed when mixing_beta <= 0.1, and magnetic-density Kerker is bypassed when mixing_beta_mag <= 0.1. Changing mixing_gg0_min does not change these thresholds or re-enable Kerker.)"; item.default_value = "0.1"; item.unit = ""; - item.availability = ""; read_sync_double(input.mixing_gg0_min); this->add_item(item); } @@ -760,7 +736,7 @@ In the current implementation, the automatic bypass thresholds are fixed indepen * >0: Angle mixing for the modulus with mixing_angle=1.0)"; item.default_value = "-10.0"; item.unit = ""; - item.availability = "Only relevant for non-colinear calculations nspin=4."; + item.set_availability("nspin==4"); read_sync_double(input.mixing_angle); this->add_item(item); } @@ -774,7 +750,6 @@ In the current implementation, the automatic bypass thresholds are fixed indepen * False: The kinetic energy density will not be mixed.)"; item.default_value = "False"; item.unit = ""; - item.availability = "Only relevant for meta-GGA calculations."; read_sync_bool(input.mixing_tau); this->add_item(item); } @@ -788,7 +763,7 @@ In the current implementation, the automatic bypass thresholds are fixed indepen * False: The occupation matrices will not be mixed.)"; item.default_value = "False"; item.unit = ""; - item.availability = "Only relevant for DFT+U calculations."; + item.set_availability("dft_plus_u==1"); read_sync_bool(input.mixing_dftu); this->add_item(item); } @@ -805,7 +780,7 @@ In the current implementation, the automatic bypass thresholds are fixed indepen Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure to turn off gamma_only for multi-k calculations.)"; item.default_value = "0"; item.unit = ""; - item.availability = "Only used in localized orbitals set"; + item.set_availability("basis_type==lcao"); read_sync_bool(input.gamma_only); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.basis_type == "pw" && para.input.gamma_only) @@ -841,7 +816,6 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure item.description = "This variable indicates the maximal iteration number for electronic iterations."; item.default_value = "100"; item.unit = ""; - item.availability = ""; read_sync_int(input.scf_nmax); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.calculation == "nscf") @@ -859,7 +833,6 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure item.description = "It's the density threshold for electronic iteration. It represents the charge density error between two sequential densities from electronic iterations. Usually for local orbitals, usually 1e-6 may be accurate enough."; item.default_value = "1.0e-9 (plane-wave basis), or 1.0e-7 (localized atomic orbital basis)."; item.unit = "Ry if scf_thr_type=1, dimensionless if scf_thr_type=2"; - item.availability = ""; read_sync_double(input.scf_thr); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.scf_thr == -1.0) @@ -893,7 +866,6 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure item.description = "It's the energy threshold for electronic iteration. It represents the total energy error between two sequential densities from electronic iterations."; item.default_value = "-1.0. If the user does not set this parameter, it will not take effect."; item.unit = "eV"; - item.availability = ""; read_sync_double(input.scf_ene_thr); this->add_item(item); } @@ -908,7 +880,6 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure * 2: the criterion is defined in real space, where is the number of electron, which is used in SCF of LCAO with unit dimensionless.)"; item.default_value = "1 (plane-wave basis), or 2 (localized atomic orbital basis)."; item.unit = ""; - item.availability = ""; read_sync_int(input.scf_thr_type); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.scf_thr_type == -1) @@ -936,7 +907,6 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure * 1: If the calculated slope is larger than scf_os_thr, stop the SCF.)"; item.default_value = "false"; item.unit = ""; - item.availability = ""; read_sync_bool(input.scf_os_stop); this->add_item(item); } @@ -948,7 +918,6 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure item.description = "The slope threshold to determine if the SCF is stuck in a charge density oscillation. If the calculated slope is larger than scf_os_thr, stop the SCF."; item.default_value = "-0.01"; item.unit = ""; - item.availability = ""; read_sync_double(input.scf_os_thr); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.scf_os_thr >= 0) @@ -966,7 +935,6 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure item.description = "To determine the number of old iterations' drho used in slope calculations."; item.default_value = "mixing_ndim"; item.unit = ""; - item.availability = ""; read_sync_int(input.scf_os_ndim); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.scf_os_ndim <= 0) // default value @@ -984,7 +952,6 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure item.description = "To determine the number of old iterations to judge oscillation, it occured, more accurate lambda with DeltaSpin method would be calculated, only for PW base."; item.default_value = "5"; item.unit = ""; - item.availability = ""; read_sync_int(input.sc_os_ndim); this->add_item(item); } @@ -1002,7 +969,6 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure * Common Error: "no soc upf used for lspinorb calculation" - ensure you are using full-relativistic pseudopotentials)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.lspinorb); this->add_item(item); } @@ -1025,7 +991,6 @@ Note: If gamma_only is set to 1, the KPT file will be overwritten. So make sure * noncolin=1, lspinorb=1: Both non-collinear magnetism and SOC)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.noncolin); this->add_item(item); } @@ -1044,7 +1009,7 @@ soc_lambda, which has value range [0.0, 1.0], is used to modulate SOC effect: Use case: When experimental or high-level theoretical results suggest that the SOC effect is weaker or stronger than what full-relativistic pseudopotentials predict, you can adjust this parameter to match the target behavior.)"; item.default_value = "1.0"; item.unit = ""; - item.availability = "Only works when lspinorb=true"; + item.set_availability("lspinorb==true"); read_sync_double(input.soc_lambda); this->add_item(item); } @@ -1056,7 +1021,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "DFT-1/2 type:\n* 0: DFT-1/2 is off.\n* 1: Shell DFT-1/2 method is used."; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.dfthalf_type); this->add_item(item); } @@ -1068,7 +1032,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "Only used when you use ks_solver = cg/dav/dav_subspace/bpcg. It indicates the threshold for the first electronic iteration, from the second iteration the pw_diag_thr will be updated automatically. For nscf calculations with planewave basis set, pw_diag_thr should be <= 1e-3."; item.default_value = "0.01"; item.unit = ""; - item.availability = ""; read_sync_double(input.pw_diag_thr); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.calculation == "get_s" && para.input.basis_type == "pw") @@ -1089,7 +1052,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "If TRUE, the smooth threshold strategy, which applies a larger threshold (10e-5) for the empty states, will be implemented in the diagonalization methods. (This strategy should not affect total energy, forces, and other ground-state properties, but computational efficiency will be improved.) If FALSE, the smooth threshold strategy will not be applied."; item.default_value = "false"; item.unit = ""; - item.availability = ""; read_sync_bool(input.diago_smooth_ethr); this->add_item(item); } @@ -1101,7 +1063,7 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "If TRUE, the wavefunctions at k-point will be initialized from the converged wavefunctions at the nearest k-point, which can speed up the SCF convergence. Only works for PW basis."; item.default_value = "false"; item.unit = ""; - item.availability = "Used only for plane wave basis set."; + item.set_availability("basis_type==pw"); read_sync_bool(input.use_k_continuity); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.use_k_continuity && para.input.basis_type != "pw") { @@ -1130,7 +1092,7 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "Only useful when you use ks_solver = cg/dav/dav_subspace/bpcg. It indicates the maximal iteration number for cg/david/dav_subspace/bpcg method."; item.default_value = "50"; item.unit = ""; - item.availability = "basis_type==pw, ks_solver==cg/dav/dav_subspace/bpcg"; + item.set_availability("basis_type==pw and ks_solver in [cg, dav, dav_subspace, bpcg]"); read_sync_int(input.pw_diag_nmax); this->add_item(item); } @@ -1142,7 +1104,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "Only useful when you use ks_solver = dav or ks_solver = dav_subspace. It indicates dimension of workspace(number of wavefunction packets, at least 2 needed) for the Davidson method. A larger value may yield a smaller number of iterations in the algorithm but uses more memory and more CPU time in subspace diagonalization."; item.default_value = "4"; item.unit = ""; - item.availability = ""; read_sync_int(input.pw_diag_ndim); this->add_item(item); } @@ -1154,7 +1115,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "Preconditioner type for conjugate gradient diagonalization method."; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.diago_cg_prec); this->add_item(item); } @@ -1168,7 +1128,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "In LCAO calculations, the Hamiltonian and overlap matrices are distributed across 2D processor grid. This parameter controls the 2D block size for distribution."; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.nb2d); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.nb2d < 0) @@ -1186,7 +1145,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "If not equals to 2, then the maximum l channels on LCAO is set to lmaxmax. If 2, then the number of l channels will be read from the LCAO data sets. Normally no input should be supplied for this variable so that it is kept as its default."; item.default_value = "2."; item.unit = ""; - item.availability = ""; read_sync_int(input.lmaxmax); this->add_item(item); } @@ -1198,7 +1156,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "Energy cutoff (in Ry) for two-center integrals in LCAO. The two-center integration table are obtained via a k space integral whose upper limit is about sqrt(lcao_ecut)."; item.default_value = "ecutwfc"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.lcao_ecut == 0 && para.input.basis_type == "lcao") { @@ -1217,7 +1174,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "the interval of k points for two-center integrals. The two-center integration table are obtained via a k space integral on a uniform grid with spacing lcao_dk."; item.default_value = "0.01"; item.unit = "Bohr"; - item.availability = ""; read_sync_double(input.lcao_dk); this->add_item(item); } @@ -1229,7 +1185,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "r spacing of the integration table of two-center integrals."; item.default_value = "0.01"; item.unit = "Bohr"; - item.availability = ""; read_sync_double(input.lcao_dr); this->add_item(item); } @@ -1241,7 +1196,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "Maximum distance for the two-center integration table."; item.default_value = "30"; item.unit = "Bohr"; - item.availability = ""; read_sync_double(input.lcao_rmax); this->add_item(item); } @@ -1253,7 +1207,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "Searching radius in finding the neighbouring atoms. By default the radius will be automatically determined by the cutoffs of orbitals and nonlocal beta projectors."; item.default_value = "-1"; item.unit = "Bohr"; - item.availability = ""; read_sync_double(input.search_radius); this->add_item(item); } @@ -1265,7 +1218,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "In the matrix operation of grid integral, bx/by/bz grids (in x, y, z directions) are treated as a whole as a matrix element. A different value will affect the calculation speed. The default is 0, which means abacus will automatically calculate these values."; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.bx); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.bx > 10) @@ -1292,7 +1244,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "In the matrix operation of grid integral, bx/by/bz grids (in x, y, z directions) are treated as a whole as a matrix element. A different value will affect the calculation speed. The default is 0, which means abacus will automatically calculate these values."; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.by); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.by > 10) @@ -1310,7 +1261,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "In the matrix operation of grid integral, bx/by/bz grids (in x, y, z directions) are treated as a whole as a matrix element. A different value will affect the calculation speed. The default is 0, which means abacus will automatically calculate these values."; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.bz); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.bz > 10) @@ -1328,7 +1278,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "Number of threads used in one elpa calculation.\n\nIf the number is below 0 or 0 or beyond the max number of threads, all elpa calculation will be using all mpi threads"; item.default_value = "-1"; item.unit = ""; - item.availability = ""; read_sync_int(input.elpa_num_thread); this->add_item(item); } @@ -1340,7 +1289,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "The number of CUDA streams used in LCAO calculations with GPU acceleration."; item.default_value = "4"; item.unit = ""; - item.availability = ""; read_sync_int(input.nstream); this->add_item(item); } @@ -1352,7 +1300,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "\"Energy cutoff\" (in Ry) of spherical Bessel functions. The number of spherical Bessel functions that constitute the radial parts of NAOs is determined by sqrt(bessel_nao_ecut)*bessel_nao_rcut/."; item.default_value = "ecutwfc"; item.unit = ""; - item.availability = ""; read_sync_string(input.bessel_nao_ecut); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.bessel_nao_ecut == "default") @@ -1376,7 +1323,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "Tolerance when searching for the zeros of spherical Bessel functions."; item.default_value = "1.0e-12"; item.unit = ""; - item.availability = ""; read_sync_double(input.bessel_nao_tolerence); this->add_item(item); } @@ -1388,7 +1334,6 @@ Use case: When experimental or high-level theoretical results suggest that the S 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 = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); for (int i = 0; i < count; i++) @@ -1416,7 +1361,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "If True, NAOs will be smoothed near the cutoff radius. See bessel_nao_rcut and bessel_nao_sigma for parameters."; item.default_value = "True"; item.unit = ""; - item.availability = ""; read_sync_bool(input.bessel_nao_smooth); this->add_item(item); } @@ -1428,7 +1372,6 @@ Use case: When experimental or high-level theoretical results suggest that the S item.description = "Smoothing range (in Bohr). See also bessel_nao_smooth."; item.default_value = "0.1"; item.unit = ""; - item.availability = ""; read_sync_double(input.bessel_nao_sigma); this->add_item(item); } diff --git a/source/source_io/module_parameter/read_input_item_exx_dftu.cpp b/source/source_io/module_parameter/read_input_item_exx_dftu.cpp index e4e2d4f4ec..08a2669ff7 100644 --- a/source/source_io/module_parameter/read_input_item_exx_dftu.cpp +++ b/source/source_io/module_parameter/read_input_item_exx_dftu.cpp @@ -18,7 +18,6 @@ void ReadInput::item_exx() 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 = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.exx_fock_alpha = item.str_values; @@ -67,7 +66,6 @@ void ReadInput::item_exx() item.description = R"(Fraction 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 = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.exx_erfc_alpha = item.str_values; @@ -117,7 +115,6 @@ void ReadInput::item_exx() 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 = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.exx_erfc_omega = item.str_values; @@ -173,7 +170,6 @@ void ReadInput::item_exx() * True: A two-step method is employed, i.e. in the inner iterations, density matrix is updated, while in the outer iterations, is calculated based on density matrix that converges in the inner iteration.)"; item.default_value = "True"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.esolver_type == "tddft" && para.input.exx_separate_loop) { @@ -193,7 +189,7 @@ void ReadInput::item_exx() item.description = "The maximal iteration number of the outer-loop, where the Fock exchange is calculated"; item.default_value = "100"; item.unit = ""; - item.availability = "exx_separate_loop==1"; + item.set_availability("exx_separate_loop==1"); read_sync_int(input.exx_hybrid_step); item.check_value = [](const Input_Item& item, const Parameter& para) { @@ -212,7 +208,7 @@ void ReadInput::item_exx() item.description = "Mixing parameter for densty matrix in each iteration of the outer-loop"; item.default_value = "1.0"; item.unit = ""; - item.availability = "exx_separate_loop==1"; + item.set_availability("exx_separate_loop==1"); read_sync_double(input.exx_mixing_beta); this->add_item(item); } @@ -226,7 +222,7 @@ void ReadInput::item_exx() 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 = ""; - item.availability = "basis_type==lcao_in_pw"; + item.set_availability("basis_type==lcao_in_pw"); item.read_value = [](const Input_Item& item, Parameter& para) { para.input.exx_fock_lambda = item.str_values; @@ -249,7 +245,6 @@ void ReadInput::item_exx() item.description = "To accelerate the evaluation of four-center integrals (), the product of atomic orbitals are expanded in the basis of auxiliary basis functions (ABF): . The size of the ABF (i.e. number of ) is reduced using principal component analysis. When a large PCA threshold is used, the number of ABF will be reduced, hence the calculation becomes faster. However, this comes at the cost of computational accuracy. A relatively safe choice of the value is 1e-4."; item.default_value = "1E-4"; item.unit = ""; - item.availability = ""; read_sync_double(input.exx_pca_threshold); this->add_item(item); } @@ -261,7 +256,6 @@ void ReadInput::item_exx() item.description = "See also the entry exx_pca_threshold. Smaller components (less than exx_c_threshold) of the matrix are neglected to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1e-4."; item.default_value = "1E-4"; item.unit = ""; - item.availability = ""; read_sync_double(input.exx_c_threshold); this->add_item(item); } @@ -273,7 +267,6 @@ void ReadInput::item_exx() item.description = "By default, the Coulomb matrix inversion required for obtaining LRI coefficients is performed using LU decomposition. However, this approach may suffer from numerical instabilities when a large set of auxiliary basis functions (ABFs) is employed. When exx_cs_inv_thr > 0, the inversion is instead carried out via matrix diagonalization. Eigenvalues smaller than exx_cs_inv_thr are discarded to improve numerical stability. A relatively safe and commonly recommended value is 1e-5."; item.default_value = "-1"; item.unit = ""; - item.availability = ""; read_sync_double(input.exx_cs_inv_thr); this->add_item(item); } @@ -285,7 +278,6 @@ void ReadInput::item_exx() item.description = "See also the entry exx_pca_threshold. With the approximation , the four-center integral in Fock exchange is expressed as , where is a double-center integral. Smaller values of the V matrix can be truncated to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 0, i.e. no truncation."; item.default_value = "1E-1"; item.unit = ""; - item.availability = ""; read_sync_double(input.exx_v_threshold); this->add_item(item); } @@ -297,7 +289,6 @@ void ReadInput::item_exx() item.description = "The Fock exchange can be expressed as where D is the density matrix. Smaller values of the density matrix can be truncated to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1e-4."; item.default_value = "1E-4"; item.unit = ""; - item.availability = ""; read_sync_double(input.exx_dm_threshold); this->add_item(item); } @@ -309,7 +300,6 @@ void ReadInput::item_exx() item.description = "See also the entry exx_pca_threshold. is used in force. Smaller components (less than exx_c_grad_threshold) of the matrix are neglected to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1e-4."; item.default_value = "1E-4"; item.unit = ""; - item.availability = ""; read_sync_double(input.exx_c_grad_threshold); this->add_item(item); } @@ -321,7 +311,6 @@ void ReadInput::item_exx() item.description = "See also the entry exx_pca_threshold. With the approximation , the four-center integral in Fock exchange is expressed as , where is a double-center integral. is used in force. Smaller values of the V matrix can be truncated to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 0, i.e. no truncation."; item.default_value = "1E-1"; item.unit = ""; - item.availability = ""; read_sync_double(input.exx_v_grad_threshold); this->add_item(item); } @@ -333,7 +322,6 @@ void ReadInput::item_exx() item.description = "See also the entry exx_pca_threshold. is used in stress. Smaller components (less than exx_c_grad_r_threshold) of the matrix are neglected to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 1e-4."; item.default_value = "1E-4"; item.unit = ""; - item.availability = ""; read_sync_double(input.exx_c_grad_r_threshold); this->add_item(item); } @@ -345,7 +333,6 @@ void ReadInput::item_exx() item.description = "See also the entry exx_pca_threshold. With the approximation , the four-center integral in Fock exchange is expressed as , where is a double-center integral. is used in force and stress. Smaller values of the V matrix can be truncated to accelerate calculation. The larger the threshold is, the faster the calculation and the lower the accuracy. A relatively safe choice of the value is 0, i.e. no truncation."; item.default_value = "1E-1"; item.unit = ""; - item.availability = ""; read_sync_double(input.exx_v_grad_r_threshold); this->add_item(item); } @@ -359,7 +346,6 @@ void ReadInput::item_exx() item.description = "This parameter determines how many times larger the radial mesh required for calculating Columb potential is to that of atomic orbitals. The value should be larger than 0. Reducing this value can effectively increase the speed of self-consistent calculations using hybrid functionals."; item.default_value = ""; item.unit = ""; - item.availability = ""; read_sync_string(input.exx_ccp_rmesh_times); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.exx_ccp_rmesh_times == "default") @@ -411,7 +397,7 @@ void ReadInput::item_exx() item.description = "The maximum l of the spherical Bessel functions, when the radial part of opt-ABFs are generated as linear combinations of spherical Bessel functions. A reasonable choice is 2."; item.default_value = "0"; item.unit = ""; - item.availability = "calculation==gen_opt_abfs"; + item.set_availability("calculation==gen_opt_abfs"); read_sync_int(input.exx_opt_orb_lmax); this->add_item(item); } @@ -423,7 +409,7 @@ void ReadInput::item_exx() item.description = "The cut-off of plane wave expansion, when the plane wave basis is used to optimize the radial ABFs. A reasonable choice is 60."; item.default_value = "0"; item.unit = "Ry"; - item.availability = "calculation==gen_opt_abfs"; + item.set_availability("calculation==gen_opt_abfs"); read_sync_double(input.exx_opt_orb_ecut); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.exx_opt_orb_ecut < 0) @@ -442,7 +428,7 @@ void ReadInput::item_exx() item.description = "The threshold when solving for the zeros of spherical Bessel functions. A reasonable choice is 1e-12."; item.default_value = "1E-12"; item.unit = ""; - item.availability = "calculation==gen_opt_abfs"; + item.set_availability("calculation==gen_opt_abfs"); read_sync_double(input.exx_opt_orb_tolerence); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.exx_opt_orb_tolerence < 0) @@ -461,7 +447,6 @@ void ReadInput::item_exx() * False: Enforce LibRI to use complex data type. Setting it to True can effectively improve the speed of self-consistent calculations with hybrid functionals.)"; item.default_value = "depends on the gamma_only option"; item.unit = ""; - item.availability = ""; read_sync_string(input.exx_real_number); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.exx_real_number == "default") @@ -487,7 +472,6 @@ void ReadInput::item_exx() * revised_spencer: see Phys. Rev. Mater. 5, 013807 (2021). Set the scheme of Coulomb singularity correction.)"; item.default_value = "default"; item.unit = ""; - item.availability = ""; read_sync_string(input.exx_singularity_correction); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.exx_singularity_correction == "default") @@ -526,7 +510,6 @@ void ReadInput::item_exx() item.description = "How many times larger the radial mesh required is to that of atomic orbitals in the postprocess calculation of the bare Coulomb matrix for RPA, GW, etc."; item.default_value = "10"; item.unit = ""; - item.availability = ""; read_sync_double(input.rpa_ccp_rmesh_times); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.rpa_ccp_rmesh_times < 1) @@ -545,7 +528,7 @@ void ReadInput::item_exx() * True: rotate both D(k) and Hexx(R) to accelerate both diagonalization and EXX calculation)"; item.default_value = "True"; item.unit = ""; - item.availability = "symmetry==1 and exx calculation (dft_fuctional==hse/hf/pbe0/scan0 or rpa==True)"; + item.set_availability("symmetry==1 and (dft_functional in [hse, hf, pbe0, scan0] or rpa==true)"); read_sync_bool(input.exx_symmetry_realspace); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.symmetry != "1") { para.input.exx_symmetry_realspace = false; } @@ -560,7 +543,6 @@ void ReadInput::item_exx() item.description = "Whether to output the coefficient tensor C(R) and ABFs-representation Coulomb matrix V(R) for each atom pair and cell in real space."; item.default_value = "false"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_ri_cv); this->add_item(item); } @@ -618,7 +600,6 @@ void ReadInput::item_dftu() * 0: Do not calculate plus U correction.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.dft_plus_u); item.reset_value = [](const Input_Item& item, Parameter& para) { bool all_minus1 = true; @@ -659,7 +640,7 @@ void ReadInput::item_dftu() item.description = "Whether to enable DFT+DMFT calculation. True: DFT+DMFT; False: standard DFT calculation."; item.default_value = "False"; item.unit = ""; - item.availability = "basis_type==lcao"; + item.set_availability("basis_type==lcao"); read_sync_bool(input.dft_plus_dmft); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.basis_type != "lcao" && para.input.dft_plus_dmft) @@ -682,7 +663,6 @@ void ReadInput::item_dftu() * 3: For f-electron orbits, the plus U correction is needed.)"; item.default_value = "-1"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); for (int i = 0; i < count; i++) @@ -723,7 +703,6 @@ void ReadInput::item_dftu() [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.)"; item.default_value = "0.0"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); for (int i = 0; i < count; i++) @@ -765,7 +744,6 @@ void ReadInput::item_dftu() * False: hubbard_u does need to be specified.)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; item.check_value = [](const Input_Item& item, const Parameter& para) { if (!item.is_read()) { return; } if (para.inp.yukawa_potential && para.globalv.uramping > 0.01) @@ -787,7 +765,7 @@ void ReadInput::item_dftu() item.description = "The screen length of Yukawa potential. If left to default, the screen length will be calculated as an average of the entire system. It's better to stick to the default setting unless there is a very good reason."; item.default_value = "Calculated on the fly."; item.unit = ""; - item.availability = "DFT+U with yukawa_potential = True."; + item.set_availability("dft_plus_u==1 and yukawa_potential==true"); read_sync_double(input.yukawa_lambda); this->add_item(item); } @@ -799,7 +777,7 @@ void ReadInput::item_dftu() item.description = "Once uramping > 0.15 eV. DFT+U calculations will start SCF with U = 0 eV, namely normal LDA/PBE calculations. Once SCF restarts when drho0"); item.read_value = [](const Input_Item& item, Parameter& para) { para.input.uramping_eV = doublevalue; para.sys.uramping = para.input.uramping_eV / ModuleBase::Ry_to_eV; @@ -840,7 +818,6 @@ void ReadInput::item_dftu() [NOTE] The easiest way to create dm_onsite_ini.txt is to run a DFT+U calculation with out_chg=1, look for a file named dm_onsite.txt in the OUT.prefix directory, copy and rename it to dm_onsite_ini.txt. The file dm_onsite_ini.txt should be placed in the directory specified by read_file_dir. The format of the file is rather straight-forward.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.omc); this->add_item(item); } @@ -853,7 +830,7 @@ void ReadInput::item_dftu() * 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"; + item.set_availability("dft_plus_u==1"); read_sync_double(input.onsite_radius); item.reset_value = [](const Input_Item& item, Parameter& para) { if ((para.input.dft_plus_u == 1 || para.input.sc_mag_switch) && para.input.onsite_radius == 0.0) diff --git a/source/source_io/module_parameter/read_input_item_md.cpp b/source/source_io/module_parameter/read_input_item_md.cpp index ac9054cc11..ab54c3f026 100644 --- a/source/source_io/module_parameter/read_input_item_md.cpp +++ b/source/source_io/module_parameter/read_input_item_md.cpp @@ -25,7 +25,6 @@ void ReadInput::item_md() * msst: MSST method, see msst_direction, msst_vel, msst_qmass, msst_vis, msst_tscale in detail.)"; item.default_value = "nvt"; item.unit = ""; - item.availability = ""; read_sync_string(input.mdp.md_type); this->add_item(item); } @@ -37,7 +36,6 @@ void ReadInput::item_md() item.description = "The total number of molecular dynamics steps."; item.default_value = "10"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.mdp.md_nstep == 0 && para.input.esolver_type != "tddft") { @@ -56,7 +54,6 @@ void ReadInput::item_md() item.description = "The time step used in molecular dynamics calculations."; item.default_value = "1.0"; item.unit = "fs"; - item.availability = ""; item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.mdp.md_dt < 0) { ModuleBase::WARNING_QUIT("ReadInput", "time interval of MD calculation should be positive"); @@ -87,7 +84,6 @@ void ReadInput::item_md() * csvr: Canonical Sampling through Velocity Rescaling, see md_csvr_tau in detail.)"; item.default_value = "nhc"; item.unit = ""; - item.availability = ""; read_sync_string(input.mdp.md_thermostat); this->add_item(item); } @@ -105,7 +101,6 @@ If md_tfirst is set to a positive value and init_vel is true simultaneously, ple Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or less than zero, md_tlast is set to md_tfirst. If md_tlast is set to be different from md_tfirst, ABACUS will automatically change the temperature from md_tfirst to md_tlast.)"; item.default_value = "No default"; item.unit = "K"; - item.availability = ""; read_sync_double(input.mdp.md_tfirst); this->add_item(item); } @@ -123,7 +118,6 @@ If md_tfirst is set to a positive value and init_vel is true simultaneously, ple Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or less than zero, md_tlast is set to md_tfirst. If md_tlast is set to be different from md_tfirst, ABACUS will automatically change the temperature from md_tfirst to md_tlast.)"; item.default_value = "No default"; item.unit = "K"; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.mdp.md_tlast < 0) { @@ -143,7 +137,6 @@ Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or * 2: FFT grids change per step. This level is suitable for cases where the variation of the volume and shape is large, such as the MSST method. However, accuracy comes at the cost of efficiency.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.calculation != "md") { @@ -168,7 +161,6 @@ Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or * False: ABACUS will start molecular dynamics calculations normally from the first step.)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.mdp.md_restart); this->add_item(item); } @@ -180,7 +172,6 @@ Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or item.description = "The output frequency of OUT.{suffix}/STRIU/, which are used to restart molecular dynamics calculations, see md_restart in detail."; item.default_value = "5"; item.unit = ""; - item.availability = ""; read_sync_int(input.mdp.md_restartfreq); this->add_item(item); } @@ -192,7 +183,6 @@ Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or item.description = "The output frequency of OUT.${suffix}/MD_dump in molecular dynamics calculations, which including the information of lattices and atoms."; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.mdp.md_dumpfreq); this->add_item(item); } @@ -204,7 +194,6 @@ Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or item.description = "Whether to output atomic forces into the file OUT.${suffix}/MD_dump."; item.default_value = "True"; item.unit = ""; - item.availability = ""; read_sync_bool(input.mdp.dump_force); this->add_item(item); } @@ -216,7 +205,6 @@ Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or item.description = "Whether to output atomic velocities into the file OUT.${suffix}/MD_dump."; item.default_value = "True"; item.unit = ""; - item.availability = ""; read_sync_bool(input.mdp.dump_vel); this->add_item(item); } @@ -228,7 +216,6 @@ Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or item.description = "Whether to output lattice virials into the file OUT.${suffix}/MD_dump."; item.default_value = "True"; item.unit = ""; - item.availability = ""; read_sync_bool(input.mdp.dump_virial); this->add_item(item); } @@ -242,7 +229,6 @@ Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or * >= 0: The function srand(md_seed) is called.)"; item.default_value = "-1"; item.unit = ""; - item.availability = ""; read_sync_int(input.mdp.md_seed); this->add_item(item); } @@ -256,7 +242,6 @@ Note that md_tlast is only used in NVT/NPT simulations. If md_tlast is unset or Note: It is a system-dependent empirical parameter, ranging from 1/(40*md_dt) to 1/(100*md_dt). An improper choice might lead to the failure of jobs.)"; item.default_value = "1/40/md_dt"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.mdp.md_tfreq == 0 && para.input.calculation == "md") { @@ -274,7 +259,6 @@ Note: It is a system-dependent empirical parameter, ranging from 1/(40*md_dt) to item.description = "Number of thermostats coupled with the particles in the NVT/NPT ensemble based on the Nose-Hoover style non-Hamiltonian equations of motion."; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.mdp.md_tchain); this->add_item(item); } @@ -288,7 +272,6 @@ Note: It is a system-dependent empirical parameter, ranging from 1/(40*md_dt) to * 2: FFT grids change per step. This level is suitable for cases where the variation of the volume and shape is large, such as the MSST method. However, accuracy comes at the cost of efficiency.)"; item.default_value = "iso"; item.unit = ""; - item.availability = ""; read_sync_string(input.mdp.md_pmode); this->add_item(item); } @@ -300,7 +283,6 @@ Note: It is a system-dependent empirical parameter, ranging from 1/(40*md_dt) to item.description = "Construct a reference cell bigger than the initial cell. The reference cell has to be large enough so that the lattice vectors of the fluctuating cell do not exceed the reference lattice vectors during MD. Typically, 1.02 ~ 1.10 is sufficient. However, the cell fluctuations depend on the specific system and thermodynamic conditions. So users must test for a proper choice. This parameters should be used in conjunction with erf_ecut, erf_height, and erf_sigma."; item.default_value = "1.0"; item.unit = ""; - item.availability = ""; read_sync_double(input.ref_cell_factor); this->add_item(item); } @@ -317,7 +299,6 @@ Note: It is a system-dependent empirical parameter, ranging from 1/(40*md_dt) to * yz: Lattice vectors y and z scale proportionally.)"; item.default_value = "none"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.mdp.md_pmode == "iso") { @@ -335,7 +316,6 @@ Note: It is a system-dependent empirical parameter, ranging from 1/(40*md_dt) to item.description = "The target pressure used in NPT ensemble simulations, the default value of md_plast is md_pfirst. If md_plast is set to be different from md_pfirst, ABACUS will automatically change the target pressure from md_pfirst to md_plast."; item.default_value = "-1.0"; item.unit = "kbar"; - item.availability = ""; read_sync_double(input.mdp.md_pfirst); this->add_item(item); } @@ -347,7 +327,6 @@ Note: It is a system-dependent empirical parameter, ranging from 1/(40*md_dt) to item.description = "The target pressure used in NPT ensemble simulations, the default value of md_plast is md_pfirst. If md_plast is set to be different from md_pfirst, ABACUS will automatically change the target pressure from md_pfirst to md_plast."; item.default_value = "-1.0"; item.unit = "kbar"; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (!item.is_read()) { // no md_plast in INPUT para.input.mdp.md_plast = para.input.mdp.md_pfirst; @@ -367,7 +346,6 @@ Note: It is a system-dependent empirical parameter, ranging from 1/(40*md_dt) to Note: It is a system-dependent empirical parameter. An improper choice might lead to the failure of jobs.)"; item.default_value = "1/400/md_dt"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.mdp.md_pfreq == 0 && para.input.calculation == "md") { @@ -385,7 +363,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The number of thermostats coupled with the barostat in the NPT ensemble based on the Nose-Hoover style non-Hamiltonian equations of motion."; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.mdp.md_pchain); this->add_item(item); } @@ -397,7 +374,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The Lennard-Jones potential between two atoms equals: $\\sigma_k\\sigma(i,j)$"; item.default_value = "2"; item.unit = ""; - item.availability = ""; item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.esolver_type == "lj" && para.input.mdp.lj_rule != 1 && para.input.mdp.lj_rule != 2) { @@ -415,7 +391,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "It True, the LJ potential is shifted by a constant such that it is zero at the cut-off distance."; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.mdp.lj_eshift); this->add_item(item); } @@ -427,7 +402,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "Cut-off radius for Leonard Jones potential, beyond which the interaction will be neglected. It can be a single value, which means that all pairs of atoms types share the same cut-off radius. Otherwise, it should be a multiple-component vector, containing values, see details in lj_rule."; item.default_value = "No default"; item.unit = "Angstrom"; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); para.input.mdp.lj_rcut.resize(count); @@ -464,7 +438,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The vector representing the matrix for Leonard Jones potential. See details in lj_rule."; item.default_value = "No default"; item.unit = "eV"; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); para.input.mdp.lj_epsilon.resize(count); @@ -494,7 +467,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The vector representing the matrix for Leonard Jones potential. See details in lj_rule."; item.default_value = "No default"; item.unit = "Angstrom"; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); para.input.mdp.lj_sigma.resize(count); @@ -524,7 +496,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The filename of DP/NEP potential files, see md.md in detail."; item.default_value = "graph.pb"; item.unit = ""; - item.availability = ""; read_sync_string(input.mdp.pot_file); this->add_item(item); } @@ -536,7 +507,7 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "Rescaling factor to use a temperature-dependent DP. Energy, stress and force calculated by DP will be multiplied by this factor."; item.default_value = "1.0"; item.unit = ""; - item.availability = "esolver_type = dp."; + item.set_availability("esolver_type==dp"); read_sync_double(input.mdp.dp_rescaling); this->add_item(item); } @@ -548,7 +519,7 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The frame parameter for dp potential. The array size is dim_fparam, then all frames are assumed to be provided with the same fparam."; item.default_value = "{}"; item.unit = ""; - item.availability = "esolver_type = dp."; + item.set_availability("esolver_type==dp"); item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); para.input.mdp.dp_fparam.resize(count); @@ -568,7 +539,7 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The atomic parameter for dp potential. The array size can be (1) natoms x dim_aparam, then all frames are assumed to be provided with the same aparam; (2) dim_aparam, then all frames and atoms are assumed to be provided with the same aparam."; item.default_value = "{}"; item.unit = ""; - item.availability = "esolver_type = dp."; + item.set_availability("esolver_type==dp"); item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); para.input.mdp.dp_aparam.resize(count); @@ -591,7 +562,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea * 2: z direction)"; item.default_value = "2"; item.unit = ""; - item.availability = ""; read_sync_int(input.mdp.msst_direction); this->add_item(item); } @@ -603,7 +573,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The velocity of the shock wave in the MSST method."; item.default_value = "0.0"; item.unit = "Angstrom/fs"; - item.availability = ""; read_sync_double(input.mdp.msst_vel); this->add_item(item); } @@ -615,7 +584,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "Artificial viscosity in the MSST method."; item.default_value = "0.0"; item.unit = "g/(mol*Angstrom*fs)"; - item.availability = ""; read_sync_double(input.mdp.msst_vis); this->add_item(item); } @@ -627,7 +595,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The reduction percentage of the initial temperature used to compress volume in the MSST method."; item.default_value = "0.01"; item.unit = ""; - item.availability = ""; read_sync_double(input.mdp.msst_tscale); this->add_item(item); } @@ -639,7 +606,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "Inertia of the extended system variable. You should set a number larger than 0."; item.default_value = "No default"; item.unit = ""; - item.availability = ""; item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.mdp.msst_qmass <= 0) { @@ -658,7 +624,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The damping parameter used to add fictitious force in the Langevin method."; item.default_value = "1.0"; item.unit = "fs"; - item.availability = ""; read_sync_double(input.mdp.md_damp); this->add_item(item); } @@ -672,7 +637,7 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea "stronger coupling. Recommended value: 100 * md_dt."; item.default_value = "100.0"; item.unit = "fs"; - item.availability = "md_thermostat = csvr"; + item.set_availability("md_thermostat==csvr"); read_sync_double(input.mdp.md_csvr_tau); this->add_item(item); } @@ -684,7 +649,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The temperature tolerance for velocity rescaling. Velocities are rescaled if the current and target temperature differ more than md_tolerance."; item.default_value = "100.0"; item.unit = "K"; - item.availability = ""; read_sync_double(input.mdp.md_tolerance); this->add_item(item); } @@ -698,7 +662,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea * Rescale_v: Every md_nraise steps the current temperature is rescaled to the target temperature.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.mdp.md_nraise); this->add_item(item); } @@ -716,7 +679,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea [NOTE] Only works with LCAO basis and molecular dynamics calculations. Requires atomic velocities. Output starts from the second MD step (istep > 0).)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "cal_syns needs at least 1 value"); @@ -738,7 +700,6 @@ Note: It is a system-dependent empirical parameter. An improper choice might lea item.description = "The maximum displacement of all atoms in one step. This parameter is useful when cal_syns = True."; item.default_value = "0.01"; item.unit = "bohr"; - item.availability = ""; read_sync_double(input.dmax); this->add_item(item); } diff --git a/source/source_io/module_parameter/read_input_item_model.cpp b/source/source_io/module_parameter/read_input_item_model.cpp index 2b29a9b5ec..1040b4b700 100644 --- a/source/source_io/module_parameter/read_input_item_model.cpp +++ b/source/source_io/module_parameter/read_input_item_model.cpp @@ -20,7 +20,6 @@ void ReadInput::item_model() * False: Not added the electric field.)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.efield_flag); this->add_item(item); } @@ -36,7 +35,7 @@ void ReadInput::item_model() [NOTE] Note: If you do not want any electric field, the parameter efield_amp should be set to zero. This should ONLY be used in a slab geometry for surface calculations, with the discontinuity FALLING IN THE EMPTY SPACE.)"; item.default_value = "False"; item.unit = ""; - item.availability = "With dip_cor_flag = True and efield_flag = True."; + item.set_availability("dip_cor_flag==true and efield_flag==true"); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.dip_cor_flag && !para.input.efield_flag) { @@ -57,7 +56,7 @@ void ReadInput::item_model() * 2: parallel to the third reciprocal lattice vector)"; item.default_value = "2"; item.unit = ""; - item.availability = "with efield_flag = True."; + item.set_availability("efield_flag==true"); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.gate_flag && para.input.efield_flag && !para.input.dip_cor_flag) { @@ -78,7 +77,7 @@ void ReadInput::item_model() item.description = "Position of the maximum of the saw-like potential along crystal axis efield_dir, within the unit cell, 0 <= efield_pos_max < 1."; item.default_value = "Autoset to center of vacuum - width of vacuum / 20"; item.unit = ""; - item.availability = "with efield_flag = True."; + item.set_availability("efield_flag==true"); read_sync_double(input.efield_pos_max); this->add_item(item); } @@ -90,7 +89,7 @@ void ReadInput::item_model() item.description = "Zone in the unit cell where the saw-like potential decreases, 0 < efield_pos_dec < 1."; item.default_value = "Autoset to width of vacuum / 10"; item.unit = ""; - item.availability = "with efield_flag = True."; + item.set_availability("efield_flag==true"); read_sync_double(input.efield_pos_dec); this->add_item(item); } @@ -104,7 +103,7 @@ void ReadInput::item_model() [NOTE] Note: The change of slope of this potential must be located in the empty region, or else unphysical forces will result.)"; item.default_value = "0.0"; item.unit = "a.u., 1 a.u. = 51.4220632*10^10 V/m."; - item.availability = "with efield_flag = True."; + item.set_availability("efield_flag==true"); read_sync_double(input.efield_amp); this->add_item(item); } @@ -120,7 +119,6 @@ void ReadInput::item_model() * false: No compensating charge is added.)"; item.default_value = "false"; item.unit = ""; - item.availability = ""; read_sync_bool(input.gate_flag); this->add_item(item); } @@ -132,7 +130,6 @@ void ReadInput::item_model() item.description = "Position of the charged plate in the unit cell"; item.default_value = "0.5"; item.unit = "Unit cell size"; - item.availability = ""; read_sync_double(input.zgate); this->add_item(item); } @@ -147,7 +144,6 @@ void ReadInput::item_model() * false: No potential barrier is added.)"; item.default_value = "false"; item.unit = ""; - item.availability = ""; read_sync_bool(input.block); this->add_item(item); } @@ -159,7 +155,6 @@ void ReadInput::item_model() item.description = "Lower beginning of the potential barrier"; item.default_value = "0.45"; item.unit = "Unit cell size"; - item.availability = ""; read_sync_double(input.block_down); this->add_item(item); } @@ -171,7 +166,6 @@ void ReadInput::item_model() item.description = "Upper beginning of the potential barrier"; item.default_value = "0.55"; item.unit = "Unit cell size"; - item.availability = ""; read_sync_double(input.block_up); this->add_item(item); } @@ -183,7 +177,6 @@ void ReadInput::item_model() item.description = "Height of the potential barrier"; item.default_value = "0.1"; item.unit = "Rydberg"; - item.availability = ""; read_sync_double(input.block_height); this->add_item(item); } @@ -197,7 +190,6 @@ void ReadInput::item_model() item.description = "Calculate implicit solvation correction"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.imp_sol); this->add_item(item); } @@ -209,7 +201,7 @@ void ReadInput::item_model() item.description = "The relative permittivity of the bulk solvent, 80 for water"; item.default_value = "80"; item.unit = ""; - item.availability = "imp_sol is true."; + item.set_availability("imp_sol==true"); read_sync_double(input.eb_k); this->add_item(item); } @@ -221,7 +213,6 @@ void ReadInput::item_model() item.description = "The effective surface tension parameter that describes the cavitation, the dispersion, and the repulsion interaction between the solute and the solvent which are not captured by the electrostatic terms"; item.default_value = "1.0798e-05"; item.unit = ""; - item.availability = ""; read_sync_double(input.tau); this->add_item(item); } @@ -233,7 +224,6 @@ void ReadInput::item_model() item.description = "The width of the diffuse cavity that is implicitly determined by the electronic structure of the solute"; item.default_value = "0.6"; item.unit = ""; - item.availability = ""; read_sync_double(input.sigma_k); this->add_item(item); } @@ -245,7 +235,6 @@ void ReadInput::item_model() item.description = "The value of the electron density at which the dielectric cavity forms"; item.default_value = "0.00037"; item.unit = ""; - item.availability = ""; read_sync_double(input.nc_k); this->add_item(item); } @@ -266,7 +255,6 @@ void ReadInput::item_model() [NOTE] ABACUS supports automatic setting of DFT-D3 parameters for common functionals. To benefit from this feature, please specify the parameter dft_functional explicitly, otherwise the autoset procedure will crash. If not satisfied with the built-in parameters, any manual setting on vdw_s6, vdw_s8, vdw_a1 and vdw_a2 will overwrite the automatic values.)"; item.default_value = "none"; item.unit = ""; - item.availability = ""; read_sync_string(input.vdw_method); this->add_item(item); } @@ -279,7 +267,7 @@ void ReadInput::item_model() If set to default, ABACUS infers the functional name from dft_functional or pseudopotential metadata.)"; item.default_value = "default"; item.unit = ""; - item.availability = "vdw_method is set to d4"; + item.set_availability("vdw_method==d4"); read_sync_string(input.vdw_d4_xc); this->add_item(item); } @@ -294,7 +282,7 @@ Available options are: * d4s: smooth D4S model)"; item.default_value = "d4"; item.unit = ""; - item.availability = "vdw_method is set to d4"; + item.set_availability("vdw_method==d4"); read_sync_string(input.vdw_d4_model); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.vdw_d4_model != "d4" && para.input.vdw_d4_model != "d4s" @@ -313,7 +301,7 @@ Available options are: item.description = "This scale factor is used to optimize the interaction energy deviations in van der Waals (vdW) corrected calculations. The recommended values of this parameter are dependent on the chosen vdW correction method and the DFT functional being used. For DFT-D2, the recommended values are 0.75 (PBE), 1.2 (BLYP), 1.05 (B-P86), 1.0 (TPSS), and 1.05 (B3LYP). If not set, will use values of PBE functional. For DFT-D3, recommended values with different DFT functionals can be found on the here. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value."; item.default_value = ""; item.unit = ""; - item.availability = "vdw_method is set to d2, d3_0, or d3_bj"; + item.set_availability("vdw_method in [d2, d3_0, d3_bj]"); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.vdw_s6 == "default") { @@ -338,7 +326,7 @@ Available options are: item.description = "This scale factor is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the webpage. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value."; item.default_value = ""; item.unit = ""; - item.availability = "vdw_method is set to d3_0 or d3_bj"; + item.set_availability("vdw_method in [d3_0, d3_bj]"); item.reset_value = [](const Input_Item& item, Parameter& para) { // if (para.input.vdw_s8 == "default") // { @@ -363,7 +351,7 @@ Available options are: item.description = "This damping function parameter is relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the webpage. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value."; item.default_value = ""; item.unit = ""; - item.availability = "vdw_method is set to d3_0 or d3_bj"; + item.set_availability("vdw_method in [d3_0, d3_bj]"); item.reset_value = [](const Input_Item& item, Parameter& para) { // if (para.input.vdw_a1 == "default") // { @@ -388,7 +376,7 @@ Available options are: item.description = "This damping function parameter is only relevant for D3(0) and D3(BJ) van der Waals (vdW) correction methods. The recommended values of this parameter with different DFT functionals can be found on the webpage. If not set, will search in ABACUS built-in dataset based on the dft_functional keywords. User set value will overwrite the searched value."; item.default_value = ""; item.unit = ""; - item.availability = "vdw_method is set to d3_0 or d3_bj"; + item.set_availability("vdw_method in [d3_0, d3_bj]"); item.reset_value = [](const Input_Item& item, Parameter& para) { // if (para.input.vdw_a2 == "default") // { @@ -413,7 +401,7 @@ Available options are: item.description = "Controls the damping rate of the damping function in the DFT-D2 method."; item.default_value = "20"; item.unit = ""; - item.availability = "vdw_method is set to d2"; + item.set_availability("vdw_method==d2"); read_sync_double(input.vdw_d); this->add_item(item); } @@ -427,7 +415,7 @@ Available options are: * False: The three-body term is not included.)"; item.default_value = "False"; item.unit = ""; - item.availability = "vdw_method is set to d3_0 or d3_bj"; + item.set_availability("vdw_method in [d3_0, d3_bj]"); read_sync_bool(input.vdw_abc); this->add_item(item); } @@ -443,7 +431,7 @@ H 0.1 Si 9.0 Namely, each line contains the element name and the corresponding parameter.)"; item.default_value = "default"; item.unit = ""; - item.availability = "vdw_method is set to d2"; + item.set_availability("vdw_method==d2"); read_sync_string(input.vdw_C6_file); this->add_item(item); } @@ -457,7 +445,7 @@ Namely, each line contains the element name and the corresponding parameter.)"; * eVA (eV Angstrom))"; item.default_value = "Jnm6/mol"; item.unit = ""; - item.availability = "vdw_C6_file is not default"; + item.set_availability("vdw_c6_file!=default"); read_sync_string(input.vdw_C6_unit); item.check_value = [](const Input_Item& item, const Parameter& para) { if ((para.input.vdw_C6_unit != "Jnm6/mol") && (para.input.vdw_C6_unit != "eVA6")) @@ -479,7 +467,7 @@ Li 1.0 Cl 2.0 Namely, each line contains the element name and the corresponding parameter.)"; item.default_value = "default"; item.unit = ""; - item.availability = "vdw_method is set to d2"; + item.set_availability("vdw_method==d2"); read_sync_string(input.vdw_R0_file); this->add_item(item); } @@ -493,7 +481,7 @@ Namely, each line contains the element name and the corresponding parameter.)"; * Bohr)"; item.default_value = "A"; item.unit = ""; - item.availability = "vdw_R0_file is not default"; + item.set_availability("vdw_r0_file!=default"); read_sync_string(input.vdw_R0_unit); item.check_value = [](const Input_Item& item, const Parameter& para) { if ((para.input.vdw_R0_unit != "A") && (para.input.vdw_R0_unit != "Bohr")) @@ -513,7 +501,6 @@ Namely, each line contains the element name and the corresponding parameter.)"; * period: The extent of the supercell is explicitly specified using the vdw_cutoff_period keyword.)"; item.default_value = "radius"; item.unit = ""; - item.availability = ""; item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.vdw_cutoff_type != "radius" && para.input.vdw_cutoff_type != "period") { @@ -531,7 +518,7 @@ Namely, each line contains the element name and the corresponding parameter.)"; item.description = "Defines the radius of the cutoff sphere when vdw_cutoff_type is set to radius. The default values depend on the chosen vdw_method."; item.default_value = ""; item.unit = "defined by vdw_radius_unit (default Bohr)"; - item.availability = "vdw_cutoff_type is set to radius"; + item.set_availability("vdw_cutoff_type==radius"); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.vdw_cutoff_radius == "default") { @@ -575,7 +562,7 @@ Namely, each line contains the element name and the corresponding parameter.)"; * Bohr)"; item.default_value = "Bohr"; item.unit = ""; - item.availability = "vdw_cutoff_type is set to radius"; + item.set_availability("vdw_cutoff_type==radius"); read_sync_string(input.vdw_radius_unit); item.check_value = [](const Input_Item& item, const Parameter& para) { if ((para.input.vdw_radius_unit != "A") && (para.input.vdw_radius_unit != "Bohr")) @@ -593,7 +580,7 @@ Namely, each line contains the element name and the corresponding parameter.)"; item.description = "The three integers supplied here explicitly specify the extent of the supercell in the directions of the three basis lattice vectors."; item.default_value = "3 3 3"; item.unit = ""; - item.availability = "vdw_cutoff_type is set to period"; + item.set_availability("vdw_cutoff_type==period"); item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); if (count == 3) @@ -632,7 +619,7 @@ Namely, each line contains the element name and the corresponding parameter.)"; item.description = "The cutoff radius when calculating coordination numbers."; item.default_value = "40"; item.unit = "defined by vdw_cn_thr_unit (default: Bohr)"; - item.availability = "vdw_method is set to d3_0, d3_bj, or d4"; + item.set_availability("vdw_method in [d3_0, d3_bj, d4]"); item.reset_value = [](const Input_Item& item, Parameter& para) { if (!item.is_read() && para.input.vdw_method == "d4") { @@ -659,7 +646,6 @@ Namely, each line contains the element name and the corresponding parameter.)"; * Bohr)"; item.default_value = "Bohr"; item.unit = ""; - item.availability = ""; read_sync_string(input.vdw_cn_thr_unit); item.check_value = [](const Input_Item& item, const Parameter& para) { if ((para.input.vdw_cn_thr_unit != "A") && (para.input.vdw_cn_thr_unit != "Bohr")) diff --git a/source/source_io/module_parameter/read_input_item_ofdft.cpp b/source/source_io/module_parameter/read_input_item_ofdft.cpp index 46647a7bed..a84f7d52b8 100644 --- a/source/source_io/module_parameter/read_input_item_ofdft.cpp +++ b/source/source_io/module_parameter/read_input_item_ofdft.cpp @@ -28,7 +28,7 @@ void ReadInput::item_ofdft() * cpn5: CPN5 KEDF (automatically sets ml parameters))"; item.default_value = "wt"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.check_value = [](const Input_Item& item, const Parameter& para) { #ifndef __MLALGO if (para.input.of_kinetic == "ml" || para.input.of_kinetic == "mpn" || para.input.of_kinetic == "cpn5") @@ -124,7 +124,7 @@ void ReadInput::item_ofdft() * tn: Truncated Newton algorithm.)"; item.default_value = "tn"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_string(input.of_method); this->add_item(item); } @@ -139,7 +139,7 @@ void ReadInput::item_ofdft() * both: Both energy and potential must satisfy the convergence criterion.)"; item.default_value = "energy"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_string(input.of_conv); this->add_item(item); } @@ -152,7 +152,7 @@ void ReadInput::item_ofdft() item.description = "Tolerance of the energy change for determining the convergence."; item.default_value = "2e-6"; item.unit = "Ry"; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_double(input.of_tole); this->add_item(item); } @@ -165,7 +165,7 @@ void ReadInput::item_ofdft() item.description = "Tolerance of potential for determining the convergence."; item.default_value = "1e-5"; item.unit = "Ry"; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_double(input.of_tolp); this->add_item(item); } @@ -177,7 +177,7 @@ void ReadInput::item_ofdft() item.description = "Weight of TF KEDF (kinetic energy density functional)."; item.default_value = "1.0"; item.unit = ""; - item.availability = "OFDFT with of_kinetic=tf, tf+, wt, ext-wt, xwm"; + item.set_availability("esolver_type==ofdft and of_kinetic in [tf, tf+, wt, ext-wt, xwm]"); read_sync_double(input.of_tf_weight); this->add_item(item); } @@ -189,7 +189,7 @@ void ReadInput::item_ofdft() item.description = "Weight of vW KEDF (kinetic energy density functional)."; item.default_value = "1.0"; item.unit = ""; - item.availability = "OFDFT with of_kinetic=vw, tf+, wt, ext-wt, lkt, xwm"; + item.set_availability("esolver_type==ofdft and of_kinetic in [vw, tf+, wt, ext-wt, lkt, xwm]"); read_sync_double(input.of_vw_weight); this->add_item(item); } @@ -201,7 +201,7 @@ void ReadInput::item_ofdft() item.description = "Parameter alpha of WT KEDF (kinetic energy density functional)."; item.default_value = ""; item.unit = ""; - item.availability = "OFDFT with of_kinetic=wt, ext-wt"; + item.set_availability("esolver_type==ofdft and of_kinetic in [wt, ext-wt]"); read_sync_double(input.of_wt_alpha); this->add_item(item); } @@ -213,7 +213,7 @@ void ReadInput::item_ofdft() item.description = "Parameter beta of WT KEDF (kinetic energy density functional)."; item.default_value = ""; item.unit = ""; - item.availability = "OFDFT with of_kinetic=wt, ext-wt"; + item.set_availability("esolver_type==ofdft and of_kinetic in [wt, ext-wt]"); read_sync_double(input.of_wt_beta); this->add_item(item); } @@ -225,7 +225,7 @@ void ReadInput::item_ofdft() item.description = "Parameter kappa for EXT-WT KEDF."; item.default_value = "1.0 / (2.0 * std::pow(4./3., 1./3.) - 1.0)"; item.unit = ""; - item.availability = "OFDFT with of_kinetic=ext-wt"; + item.set_availability("esolver_type==ofdft and of_kinetic==ext-wt"); read_sync_double(input.of_extwt_kappa); this->add_item(item); } @@ -237,7 +237,7 @@ void ReadInput::item_ofdft() item.description = "The average density of system."; item.default_value = "0.0"; item.unit = "Bohr^-3"; - item.availability = "OFDFT with of_kinetic=wt"; + item.set_availability("esolver_type==ofdft and of_kinetic==wt"); read_sync_double(input.of_wt_rho0); this->add_item(item); } @@ -253,7 +253,7 @@ void ReadInput::item_ofdft() * False: rho0 will change if volume of system has changed.)"; item.default_value = "False"; item.unit = ""; - item.availability = "OFDFT with of_kinetic=wt"; + item.set_availability("esolver_type==ofdft and of_kinetic==wt"); read_sync_bool(input.of_hold_rho0); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.of_wt_rho0 != 0) @@ -271,7 +271,7 @@ void ReadInput::item_ofdft() item.description = "Parameter a of LKT KEDF (kinetic energy density functional)."; item.default_value = "1.3"; item.unit = ""; - item.availability = "OFDFT with of_kinetic=lkt"; + item.set_availability("esolver_type==ofdft and of_kinetic==lkt"); read_sync_double(input.of_lkt_a); this->add_item(item); } @@ -283,7 +283,7 @@ void ReadInput::item_ofdft() item.description = "Reference charge density for XWM kinetic energy functional. If set to 0, the program will use average charge density."; item.default_value = "0.0"; item.unit = ""; - item.availability = "OFDFT with of_kinetic=xwm"; + item.set_availability("esolver_type==ofdft and of_kinetic==xwm"); read_sync_double(input.of_xwm_rho_ref); this->add_item(item); } @@ -295,7 +295,7 @@ void ReadInput::item_ofdft() item.description = "Parameter for XWM kinetic energy functional. See PHYSICAL REVIEW B 100, 205132 (2019) for optimal values."; item.default_value = "0.0"; item.unit = ""; - item.availability = "OFDFT with of_kinetic=xwm"; + item.set_availability("esolver_type==ofdft and of_kinetic==xwm"); read_sync_double(input.of_xwm_kappa); this->add_item(item); } @@ -311,7 +311,7 @@ void ReadInput::item_ofdft() * False: The kernel of WT KEDF (kinetic energy density functional) will be filled from formula.)"; item.default_value = "False"; item.unit = ""; - item.availability = "OFDFT with of_kinetic=wt"; + item.set_availability("esolver_type==ofdft and of_kinetic==wt"); read_sync_bool(input.of_read_kernel); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.of_kinetic != "wt") @@ -329,7 +329,7 @@ void ReadInput::item_ofdft() item.description = "The name of WT kernel file."; item.default_value = "WTkernel.txt"; item.unit = ""; - item.availability = "OFDFT with of_read_kernel=True"; + item.set_availability("esolver_type==ofdft and of_read_kernel==true"); read_sync_string(input.of_kernel_file); this->add_item(item); } @@ -344,7 +344,7 @@ void ReadInput::item_ofdft() * False: Only use the planewaves inside ecut, the same as KSDFT.)"; item.default_value = "True"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_bool(input.of_full_pw); this->add_item(item); } @@ -363,7 +363,7 @@ void ReadInput::item_ofdft() Note: Even dimensions may cause slight errors in FFT. It should be ignorable in ofdft calculation, but it may make Cardinal B-spline interpolation unstable, so please set of_full_pw_dim = 1 if nbspline != -1.)"; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT with of_full_pw = True"; + item.set_availability("esolver_type==ofdft and of_full_pw==true"); read_sync_int(input.of_full_pw_dim); item.reset_value = [](const Input_Item& item, Parameter& para) { if (!para.input.of_full_pw) @@ -381,7 +381,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Controls the generation of machine learning training data. When enabled, training data in .npy format will be saved in the directory OUT.${suffix}/."; item.default_value = "False"; item.unit = ""; - item.availability = "Used only for KSDFT with plane wave basis"; + item.set_availability("esolver_type==ksdft and basis_type==pw"); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.of_ml_gene_data && (para.input.esolver_type != "ksdft" || para.input.basis_type != "pw" || GlobalV::NPROC != 1)) @@ -404,7 +404,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in * gpu: GPU)"; item.default_value = "cpu"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_string(input.of_ml_device); this->add_item(item); } @@ -419,7 +419,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in * 3: Incorporate the FEG limit by nonlinear transformation using softplus function.)"; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_int(input.of_ml_feg); this->add_item(item); } @@ -431,7 +431,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Number of kernel functions."; item.default_value = "1"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.of_ml_nkernel > 0) { @@ -469,7 +469,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in * 3: Truncated kinetic kernel (TKK), the file containing TKK is specified by of_ml_kernel_file.)"; item.default_value = "1"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_kernel); }; @@ -484,7 +484,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the RECIPROCAL of scaling parameter of the i-th kernel function."; item.default_value = "1.0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_kernel_scaling); }; @@ -499,7 +499,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the parameter alpha of i-th kernel function. ONLY used for Yukawa kernel function."; item.default_value = "1.0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_yukawa_alpha); }; @@ -514,7 +514,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the file containing the i-th kernel function. ONLY used for TKK."; item.default_value = "none"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); for (int i = 0; i < count; i++) @@ -533,7 +533,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Local descriptor: gamma = (rho / rho0)^(1/3)."; item.default_value = "False"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_bool(input.of_ml_gamma); this->add_item(item); } @@ -545,7 +545,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Semi-local descriptor: p = |nabla rho|^2 / [2 (3 pi^2)^(1/3) rho^(4/3)]^2."; item.default_value = "False"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_bool(input.of_ml_p); this->add_item(item); } @@ -557,7 +557,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Semi-local descriptor: q = nabla^2 rho / [4 (3 pi^2)^(2/3) rho^(5/3)]."; item.default_value = "False"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_bool(input.of_ml_q); this->add_item(item); } @@ -569,7 +569,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Semi-local descriptor: tanhp = tanh(chi_p * p)."; item.default_value = "False"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_bool(input.of_ml_tanhp); this->add_item(item); } @@ -581,7 +581,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Semi-local descriptor: tanhq = tanh(chi_q * q)."; item.default_value = "False"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_bool(input.of_ml_tanhq); this->add_item(item); } @@ -593,7 +593,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Hyperparameter chi_p: tanhp = tanh(chi_p * p)."; item.default_value = "1.0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_double(input.of_ml_chi_p); this->add_item(item); } @@ -605,7 +605,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Hyperparameter chi_q: tanhq = tanh(chi_q * q)."; item.default_value = "1.0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_double(input.of_ml_chi_q); this->add_item(item); } @@ -617,7 +617,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor gammanl defined by the i-th kernel function."; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_gammanl); }; @@ -632,7 +632,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor pnl defined by the i-th kernel function."; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_pnl); }; @@ -647,7 +647,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor qnl defined by the i-th kernel function."; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_qnl); }; @@ -662,7 +662,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor xi defined by the i-th kernel function."; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_xi); }; @@ -677,7 +677,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhxi defined by the i-th kernel function."; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_tanhxi); }; @@ -692,7 +692,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhxi_nl defined by the i-th kernel function."; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_tanhxi_nl); }; @@ -707,7 +707,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanh_pnl defined by the i-th kernel function."; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_tanh_pnl); }; @@ -722,7 +722,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanh_qnl defined by the i-th kernel function."; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_tanh_qnl); }; @@ -737,7 +737,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhp_nl defined by the i-th kernel function."; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_tanhp_nl); }; @@ -752,7 +752,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element controls the non-local descriptor tanhq_nl defined by the i-th kernel function."; item.default_value = "0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_tanhq_nl); }; @@ -767,7 +767,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the hyperparameter chi_xi of non-local descriptor tanhxi defined by the i-th kernel function."; item.default_value = "1.0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_chi_xi); }; @@ -782,7 +782,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the hyperparameter chi_pnl of non-local descriptor tanh_pnl defined by the i-th kernel function."; item.default_value = "1.0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_chi_pnl); }; @@ -797,7 +797,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Containing nkernel (see of_ml_nkernel) elements. The i-th element specifies the hyperparameter chi_qnl of non-local descriptor tanh_qnl defined by the i-th kernel function."; item.default_value = "1.0"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.of_ml_chi_qnl); }; @@ -812,7 +812,7 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "FOR TEST. Read in the density, and output the F and Pauli potential."; item.default_value = "False"; item.unit = ""; - item.availability = "OFDFT"; + item.set_availability("esolver_type==ofdft"); read_sync_bool(input.of_ml_local_test); this->add_item(item); } @@ -824,7 +824,6 @@ Note: Even dimensions may cause slight errors in FFT. It should be ignorable in item.description = "Whether to use machine learning based exact exchange (ML-EXX)."; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.ml_exx); this->add_item(item); } diff --git a/source/source_io/module_parameter/read_input_item_other.cpp b/source/source_io/module_parameter/read_input_item_other.cpp index 99aeda824b..321167b63e 100644 --- a/source/source_io/module_parameter/read_input_item_other.cpp +++ b/source/source_io/module_parameter/read_input_item_other.cpp @@ -23,7 +23,6 @@ void ReadInput::item_others() item.description = "Switch to control spin-constrained DFT calculation"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.sc_mag_switch); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.sc_mag_switch) @@ -44,7 +43,6 @@ void ReadInput::item_others() item.description = "Switch to control gradient break condition in spin-constrained DFT"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.decay_grad_switch); this->add_item(item); } @@ -56,7 +54,7 @@ void ReadInput::item_others() item.description = "Convergence criterion of spin-constrained iteration (RMS) in uB"; item.default_value = "1.0e-6"; item.unit = "uB"; - item.availability = "sc_mag_switch is true"; + item.set_availability("sc_mag_switch==true"); read_sync_double(input.sc_thr); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.sc_thr < 0) @@ -74,7 +72,7 @@ void ReadInput::item_others() item.description = "Maximal number of spin-constrained iteration"; item.default_value = "100"; item.unit = ""; - item.availability = "sc_mag_switch is true"; + item.set_availability("sc_mag_switch==true"); read_sync_int(input.nsc); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.nsc <= 0) @@ -92,7 +90,7 @@ void ReadInput::item_others() item.description = "Minimum number of spin-constrained iteration"; item.default_value = "2"; item.unit = ""; - item.availability = "sc_mag_switch is true"; + item.set_availability("sc_mag_switch==true"); read_sync_int(input.nsc_min); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.nsc_min <= 0) @@ -110,7 +108,7 @@ void ReadInput::item_others() item.description = "Initial trial step size for lambda in eV/uB^2"; item.default_value = "0.01"; item.unit = "eV/uB^2"; - item.availability = "sc_mag_switch is true"; + item.set_availability("sc_mag_switch==true"); read_sync_double(input.alpha_trial); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.alpha_trial <= 0) @@ -128,7 +126,7 @@ void ReadInput::item_others() item.description = "Maximal step size for lambda in eV/uB"; item.default_value = "3.0"; item.unit = "eV/uB"; - item.availability = "sc_mag_switch is true"; + item.set_availability("sc_mag_switch==true"); read_sync_double(input.sccut); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.sccut <= 0) @@ -146,7 +144,7 @@ void ReadInput::item_others() item.description = "Convergence criterion ratio of lambda iteration in Spin-constrained DFT"; item.default_value = "1.0e-2"; item.unit = ""; - item.availability = "sc_mag_switch is true"; + item.set_availability("sc_mag_switch==true"); read_sync_double(input.sc_drop_thr); this->add_item(item); } @@ -158,7 +156,7 @@ void ReadInput::item_others() item.description = "Density error threshold for inner loop of spin-constrained SCF"; item.default_value = "1.0e-4"; item.unit = ""; - item.availability = "sc_mag_switch is true"; + item.set_availability("sc_mag_switch==true"); read_sync_double(input.sc_scf_thr); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.sc_scf_thr <= 0.0) @@ -178,7 +176,7 @@ void ReadInput::item_others() When false (default), both the direction and magnitude of the magnetic moment are constrained to the target values.)"; item.default_value = "False"; item.unit = ""; - item.availability = "sc_mag_switch is true"; + item.set_availability("sc_mag_switch==true"); read_sync_bool(input.sc_direction_only); this->add_item(item); } @@ -195,7 +193,7 @@ When false (default), both the direction and magnitude of the magnetic moment ar * linear_scan: linear sweep of lambda for testing magnetic moment response)"; item.default_value = "bfgs"; item.unit = ""; - item.availability = "sc_mag_switch is true"; + item.set_availability("sc_mag_switch==true"); read_sync_string(input.sc_lambda_strategy); item.check_value = [](const Input_Item& item, const Parameter& para) { const std::vector valid = {"bfgs", "bfgs2", "linear_response", "augmented_lagrangian", "hybrid_delayed", "linear_scan"}; @@ -214,7 +212,7 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Starting lambda value for linear_scan strategy. Only used when sc_lambda_strategy=linear_scan."; item.default_value = "0.0"; item.unit = "eV/uB"; - item.availability = "sc_lambda_strategy is linear_scan"; + item.set_availability("sc_lambda_strategy==linear_scan"); read_sync_double(input.sc_scan_lambda_start); this->add_item(item); } @@ -226,7 +224,7 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Ending lambda value for linear_scan strategy. Only used when sc_lambda_strategy=linear_scan."; item.default_value = "1.0"; item.unit = "eV/uB"; - item.availability = "sc_lambda_strategy is linear_scan"; + item.set_availability("sc_lambda_strategy==linear_scan"); read_sync_double(input.sc_scan_lambda_end); this->add_item(item); } @@ -238,7 +236,7 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Number of lambda values to scan. Only used when sc_lambda_strategy=linear_scan."; item.default_value = "20"; item.unit = ""; - item.availability = "sc_lambda_strategy is linear_scan"; + item.set_availability("sc_lambda_strategy==linear_scan"); read_sync_int(input.sc_scan_steps); this->add_item(item); } @@ -252,7 +250,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Whether to let ABACUS output QO analysis required files"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.qo_switch); this->add_item(item); } @@ -268,7 +265,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar * szv: single-zeta valence basis)"; item.default_value = "szv"; item.unit = ""; - item.availability = ""; read_sync_string(input.qo_basis); this->add_item(item); } @@ -280,7 +276,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar 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 = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); for (int i = 0; i < count; i++) @@ -328,7 +323,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar 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"; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); for (int i = 0; i < count; i++) @@ -385,7 +379,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "The convergence threshold determining the cutoff of generated orbital. Lower threshold will yield orbital with larger cutoff radius."; item.default_value = "1.0e-6"; item.unit = ""; - item.availability = ""; read_sync_double(input.qo_thr); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.qo_thr > 1e-6) @@ -407,7 +400,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "The number of poles used in the pole expansion method, should be a even number."; item.default_value = "40"; item.unit = ""; - item.availability = ""; read_sync_int(input.pexsi_npole); this->add_item(item); } @@ -420,7 +412,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Whether inertia counting is used at the very beginning."; item.default_value = "True"; item.unit = ""; - item.availability = ""; read_sync_bool(input.pexsi_inertia); this->add_item(item); } @@ -433,7 +424,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Maximum number of PEXSI iterations after each inertia counting procedure."; item.default_value = "80"; item.unit = ""; - item.availability = ""; read_sync_int(input.pexsi_nmax); this->add_item(item); } @@ -445,7 +435,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Whether to construct PSelInv communication pattern."; item.default_value = "True"; item.unit = ""; - item.availability = ""; read_sync_bool(input.pexsi_comm); this->add_item(item); } @@ -458,7 +447,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Whether to use symmetric storage space used by the Selected Inversion algorithm for symmetric matrices."; item.default_value = "True"; item.unit = ""; - item.availability = ""; read_sync_bool(input.pexsi_storage); this->add_item(item); } @@ -470,7 +458,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Ordering strategy for factorization and selected inversion. 0: Parallel ordering using ParMETIS, 1: Sequential ordering using METIS, 2: Multiple minimum degree ordering"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.pexsi_ordering); this->add_item(item); } @@ -483,7 +470,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Row permutation strategy for factorization and selected inversion, 0: No row permutation, 1: Make the diagonal entry of the matrix larger than the off-diagonal entries."; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.pexsi_row_ordering); this->add_item(item); } @@ -495,7 +481,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Number of processors for PARMETIS. Only used if pexsi_ordering == 0."; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.pexsi_nproc); this->add_item(item); } @@ -507,7 +492,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Whether the matrix is symmetric."; item.default_value = "True"; item.unit = ""; - item.availability = ""; read_sync_bool(input.pexsi_symm); this->add_item(item); } @@ -519,7 +503,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Whether to factorize the transpose of the matrix."; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.pexsi_trans); this->add_item(item); } @@ -532,7 +515,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "The pole expansion method to be used. 1 for Cauchy Contour Integral method, 2 for Moussa optimized method."; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.pexsi_method); this->add_item(item); } @@ -544,7 +526,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "The point parallelizaion of PEXSI. Recommend two points parallelization."; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.pexsi_nproc_pole); this->add_item(item); } @@ -556,7 +537,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Temperature in Fermi-Dirac distribution, in Ry, should have the same effect as the smearing sigma when smearing method is set to Fermi-Dirac."; item.default_value = "0.015"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_temp); this->add_item(item); } @@ -568,7 +548,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Spectral gap, this can be set to be 0 in most cases."; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_gap); this->add_item(item); } @@ -580,7 +559,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Upper bound for the spectral radius of S^{-1}H."; item.default_value = "20"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_delta_e); this->add_item(item); } @@ -592,7 +570,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Initial guess of lower bound for mu."; item.default_value = "-10"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_mu_lower); this->add_item(item); } @@ -604,7 +581,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Initial guess of upper bound for mu."; item.default_value = "10"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_mu_upper); this->add_item(item); } @@ -616,7 +592,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Initial guess for mu (for the solver)."; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_mu); this->add_item(item); } @@ -629,7 +604,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Stopping criterion in terms of the chemical potential for the inertia counting procedure."; item.default_value = "0.05"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_mu_thr); this->add_item(item); } @@ -643,7 +617,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "If the chemical potential is not in the initial interval, the interval is expanded by this value."; item.default_value = "0.3"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_mu_expand); this->add_item(item); } @@ -656,7 +629,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Safe guard criterion in terms of the chemical potential to reinvoke the inertia counting procedure."; item.default_value = "0.2"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_mu_guard); this->add_item(item); } @@ -670,7 +642,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Stopping criterion of the PEXSI iteration in terms of the number of electrons compared to numElectronExact."; item.default_value = "0.001"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_elec_thr); this->add_item(item); } @@ -683,7 +654,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "if the absolute value of CCS matrix element is less than this value, it will be considered as zero."; item.default_value = "1e-10"; item.unit = ""; - item.availability = ""; read_sync_double(input.pexsi_zero_thr); this->add_item(item); } @@ -697,7 +667,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Whether to print information into individual logs from all ranks in an MPI run.\n* True: Information from each rank will be written into individual files named OUT.{calculation}_{suffix}/running_${calculation}.log."; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_alllog); this->add_item(item); } @@ -709,7 +678,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Debugging flag for developers"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.nurse); this->add_item(item); } @@ -723,7 +691,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar * 1: Yes.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_bool(input.t_in_h); this->add_item(item); } @@ -737,7 +704,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar * 1: Yes.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_bool(input.vl_in_h); this->add_item(item); } @@ -751,7 +717,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar * 1: Yes.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_bool(input.vnl_in_h); this->add_item(item); } @@ -765,7 +730,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar * 1: Yes.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_bool(input.vh_in_h); this->add_item(item); } @@ -779,7 +743,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar * 1: Yes.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_bool(input.vion_in_h); this->add_item(item); } @@ -793,7 +756,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar * 1: Yes.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_bool(input.test_force); this->add_item(item); } @@ -807,7 +769,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar * 1: Yes.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_bool(input.test_stress); this->add_item(item); } @@ -821,7 +782,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar * 1: Yes.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_bool(input.test_skip_ewald); this->add_item(item); } @@ -833,7 +793,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Whether to use the RI approximation for the Hartree term in LR-TDDFT for benchmark (with FHI-aims/ABACUS read-in style)"; item.default_value = "none"; item.unit = ""; - item.availability = ""; read_sync_string(input.ri_hartree_benchmark); this->add_item(item); } @@ -845,7 +804,7 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Atomic basis set size for each atom type (with the same order as in STRU) in FHI-aims."; item.default_value = "{} (empty list, where ABACUS use its own basis set size)"; item.unit = ""; - item.availability = "ri_hartree_benchmark = aims"; + item.set_availability("ri_hartree_benchmark==aims"); item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); for (int i = 0; i < count; i++) @@ -866,7 +825,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Whether to perform rdmft calculation (reduced density matrix funcional theory)"; item.default_value = "false"; item.unit = ""; - item.availability = ""; read_sync_bool(input.rdmft); this->add_item(item); item.check_value = [](const Input_Item& item, const Parameter& para) { @@ -885,7 +843,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "The alpha parameter of power-functional(or other exx-type/hybrid functionals) which used in RDMFT, g(occ_number) = occ_number^alpha"; item.default_value = "0.656"; item.unit = ""; - item.availability = ""; read_sync_double(input.rdmft_power_alpha); item.reset_value = [](const Input_Item& item, Parameter& para) { if( para.input.dft_functional == "hf" || para.input.dft_functional == "pbe0" ) @@ -917,7 +874,7 @@ When false (default), both the direction and magnitude of the magnetic moment ar * False: Use the traditional method to calculate the Fock exchange operator.)"; item.default_value = "True"; item.unit = ""; - item.availability = "exx_separate_loop==True."; + item.set_availability("exx_separate_loop==true"); read_sync_bool(input.exxace); this->add_item(item); } @@ -929,7 +886,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "Whether to use the gamma point extrapolation method to calculate the Fock exchange operator. See https://doi.org/10.1103/PhysRevB.79.205114 for details. Should be set to true most of the time."; item.default_value = "True"; item.unit = ""; - item.availability = ""; read_sync_bool(input.exx_gamma_extrapolation); this->add_item(item); } @@ -941,7 +897,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "The energy cutoff for EXX (Fock) exchange operator in plane wave basis calculations. Reducing ecutexx below ecutrho may significantly accelerate EXX computations. This speed improvement comes with a reduced numerical accuracy in the exchange energy calculation."; item.default_value = "same as ecutrho"; item.unit = "Ry"; - item.availability = ""; read_sync_double(input.ecutexx); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.ecutexx < 0) @@ -962,7 +917,6 @@ When false (default), both the direction and magnitude of the magnetic moment ar * density: if the change of charge density difference between two successive outer loop iterations is seen as converged according to scf_thr, then the outer loop is seen as converged.)"; item.default_value = "density"; item.unit = ""; - item.availability = ""; read_sync_string(input.exx_thr_type); item.check_value = [](const Input_Item& item, const Parameter& para) { std::string thr_type = para.input.exx_thr_type; @@ -982,7 +936,7 @@ When false (default), both the direction and magnitude of the magnetic moment ar item.description = "The threshold for the change of exact exchange energy to judge convergence of the outer loop in the separate loop EXX calculation."; item.default_value = "1e-5"; item.unit = "Ry"; - item.availability = "exx_thr_type==energy"; + item.set_availability("exx_thr_type==energy"); read_sync_double(input.exx_ene_thr); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.exx_ene_thr <= 0) diff --git a/source/source_io/module_parameter/read_input_item_output.cpp b/source/source_io/module_parameter/read_input_item_output.cpp index 15868d0eb4..990c9aace8 100644 --- a/source/source_io/module_parameter/read_input_item_output.cpp +++ b/source/source_io/module_parameter/read_input_item_output.cpp @@ -19,7 +19,6 @@ void ReadInput::item_output() "\n\n[NOTE] In RT-TDDFT calculations, this parameter is inactive; output frequency is instead controlled by out_freq_td."; item.default_value = "0"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.out_freq_ion <= 0) { @@ -38,7 +37,6 @@ void ReadInput::item_output() "\n\n[NOTE] This parameter is only active in RT-TDDFT mode (esolver_type = tddft). It has no effect in ground-state calculations."; item.default_value = "0"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.out_freq_td <= 0) { @@ -56,7 +54,6 @@ void ReadInput::item_output() item.description = "Output the charge density (only binary format, controlled by out_chg), wavefunction (controlled by out_wfc_pw) per out_freq_elec electronic iterations. Note that they are always output when converged or reach the maximum iterations scf_nmax."; item.default_value = "scf_nmax"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.out_freq_elec <= 0) { @@ -102,7 +99,6 @@ In molecular dynamics simulations, the output frequency is controlled by out_fre [NOTE] In the 3.10-LTS version, the file names are SPIN1_CHG.cube and SPIN1_CHG_INI.cube, etc.)"; item.default_value = "0 3"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_chg needs at least 1 value"); @@ -151,7 +147,6 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr [NOTE] In the 3.10-LTS version, the file names are SPIN1_POT.cube and SPIN1_POT_INI.cube, etc.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_pot needs at least 1 value"); @@ -191,7 +186,7 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr * In 3.10-LTS, the corresponding keyword is out_dm, and the output files are SPIN1_DM and SPIN2_DM, etc.)"; item.default_value = "False"; item.unit = ""; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_dmk needs at least 1 value"); @@ -222,7 +217,7 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr [NOTE] In the 3.10-LTS version, the parameter is named out_dm1, and the file names are data-DMR-sparse_SPIN0.csr and data-DMR-sparse_SPIN1.csr, etc.)"; item.default_value = "False"; item.unit = ""; - item.availability = "Numerical atomic orbital basis (multi-k points)"; + item.set_availability("basis_type==lcao and gamma_only==0"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_dmr needs at least 1 value"); @@ -267,7 +262,7 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr [NOTE] In the 3.10-LTS version, the file names are WAVEFUNC1.dat, WAVEFUNC2.dat, etc.)"; item.default_value = "0"; item.unit = ""; - item.availability = "Output electronic wave functions in plane wave basis, or transform the real-space electronic wave function into plane wave basis (see get_wf option in calculation with NAO basis)"; + item.set_availability("basis_type==pw or (basis_type==lcao and calculation==get_wf)"); read_sync_int(input.out_wfc_pw); this->add_item(item); } @@ -292,7 +287,7 @@ Also controled by out_freq_ion and out_app_flag. [NOTE] In the 3.10-LTS version, the file names are WFC_NAO_GAMMA1_ION1.txt and WFC_NAO_K1_ION1.txt, etc.)"; item.default_value = "0"; item.unit = ""; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); read_sync_int(input.out_wfc_lcao); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.qo_switch) @@ -326,7 +321,6 @@ Also controled by out_freq_ion and out_app_flag. * 3: output the Fermi surface file (fermi.bxsf) in BXSF format that can be visualized by XCrySDen)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.out_dos); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.calculation == "get_wf" || para.input.calculation == "get_pchg") @@ -362,7 +356,6 @@ Also controled by out_freq_ion and out_app_flag. * 3: output both two LDOS modes above.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count != 1 && count != 2) @@ -392,7 +385,6 @@ Also controled by out_freq_ion and out_app_flag. * For more information, refer to the band.md)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count != 1 && count != 2) @@ -419,7 +411,6 @@ Also controled by out_freq_ion and out_app_flag. item.description = "Whether to output the projected band structure. For more information, refer to the band.md"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_proj_band); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.calculation == "get_wf" || para.input.calculation == "get_pchg") @@ -447,7 +438,6 @@ Also controled by out_freq_ion and out_app_flag. "[NOTE] For backward compatibility, true/false (case insensitive) are accepted and converted to 1/0."; item.default_value = "1"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { const std::string val = FmtCore::lower(item.str_values[0]); if (val == "true" || val == "t" || val == "yes" || val == "y" || val == "on" || val == ".true.") @@ -511,7 +501,6 @@ Also controled by out_freq_ion and out_app_flag. * m: molecular dynamics level, which does not print some information for simplicity.)"; item.default_value = "ie"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.out_level = strvalue; para.sys.out_md_control = true; @@ -551,7 +540,7 @@ When out_app_flag is false, g followed by the one-based ionic-step index is inse [NOTE] In the 3.10-LTS version, the file names are data-0-H and data-0-S, etc.)"; item.default_value = "0 8"; item.unit = "Ry"; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1 || count > 2) @@ -594,7 +583,7 @@ When out_app_flag is false, g followed by the one-based ionic-step index is inse item.description = "Legacy alias for out_hsk 1, which outputs Hamiltonian and overlap matrices in reciprocal space for each k-point. The optional second integer controls text precision. If both out_hsk and out_mat_hs are present, out_hsk takes precedence."; item.default_value = "False 8"; item.unit = "Ry"; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_mat_hs needs at least 1 value"); @@ -622,7 +611,7 @@ For multi-k calculations, the output contains the individual real-space blocks s [NOTE] In the 3.10-LTS version, the file names are data-HR-sparse_SPIN0.csr and data-SR-sparse_SPIN0.csr, etc.)"; item.default_value = "0 8"; item.unit = "Ry"; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1 || count > 2) @@ -674,7 +663,7 @@ For multi-k calculations, the output contains the individual real-space blocks s item.description = "Legacy alias for out_hsr 1, which outputs Hamiltonian and overlap matrices in real space indexed by the Bravais lattice vector R. The optional second integer controls text precision. If both out_hsr and out_mat_hs2 are present, out_hsr takes precedence."; item.default_value = "False 8"; item.unit = "Ry"; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_mat_hs2 needs at least 1 value"); @@ -695,7 +684,7 @@ For multi-k calculations, the output contains the individual real-space blocks s "\n\n[NOTE] In the 3.10-LTS version, the file names are data-TR-sparse_SPIN0.csr, etc."; item.default_value = "False [8]"; item.unit = "Ry"; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_mat_tk needs at least 1 value"); @@ -717,7 +706,7 @@ For multi-k calculations, the output contains the individual real-space blocks s "\n\n[NOTE] In the 3.10-LTS version, the file name is data-rR-sparse.csr."; item.default_value = "False 8"; item.unit = "Bohr"; - item.availability = "Numerical atomic orbital basis (not gamma-only algorithm)"; + item.set_availability("basis_type==lcao and gamma_only==0"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_mat_r needs at least 1 value"); @@ -756,7 +745,7 @@ For multi-k calculations, the output contains the individual real-space blocks s "\n\n[NOTE] In the 3.10-LTS version, the file name is data-TR-sparse_SPIN0.csr."; item.default_value = "False 8"; item.unit = "Ry"; - item.availability = "Numerical atomic orbital basis (not gamma-only algorithm)"; + item.set_availability("basis_type==lcao and gamma_only==0"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_mat_t needs at least 1 value"); @@ -785,7 +774,7 @@ For multi-k calculations, the output contains the individual real-space blocks s "\n\n[NOTE] In the 3.10-LTS version, the file name is data-dHRx-sparse_SPIN0.csr and so on."; item.default_value = "0 8"; item.unit = "Ry/Bohr"; - item.availability = "Numerical atomic orbital basis (not gamma-only algorithm)"; + item.set_availability("basis_type==lcao and gamma_only==0"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_mat_dh needs at least 1 value"); @@ -1184,7 +1173,7 @@ For multi-k calculations, the output contains the individual real-space blocks s "\n\n[NOTE] In the 3.10-LTS version, the file name is data-dSRx-sparse_SPIN0.csr and so on."; item.default_value = "False 8"; item.unit = "Ry/Bohr"; - item.availability = "Numerical atomic orbital basis (not gamma-only algorithm)"; + item.set_availability("basis_type==lcao and gamma_only==0"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_mat_ds needs at least 1 value"); @@ -1218,7 +1207,7 @@ For multi-k calculations, the output contains the individual real-space blocks s "\n\n[NOTE] In the 3.10-LTS version, the file name is k-$k-Vxc and so on."; item.default_value = "False"; item.unit = "Ry"; - item.availability = "Numerical atomic orbital (NAO) and NAO-in-PW basis"; + item.set_availability("basis_type in [lcao, lcao_in_pw]"); read_sync_bool(input.out_mat_xc); this->add_item(item); } @@ -1231,7 +1220,7 @@ For multi-k calculations, the output contains the individual real-space blocks s "\n\n[NOTE] In the 3.10-LTS version, the file name is Vxc_R_spin$s and so on."; item.default_value = "False 8"; item.unit = "Ry"; - item.availability = "Numerical atomic orbital (NAO) basis"; + item.set_availability("basis_type==lcao"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_mat_xc2 needs at least 1 value"); @@ -1258,7 +1247,7 @@ For multi-k calculations, the output contains the individual real-space blocks s item.description = "Whether to print the expectation value of the angular momentum operator , , and in the basis of the localized atomic orbitals. The files are named OUT.{suffix}_Lx.dat, OUT.{suffix}_Ly.dat, and OUT.{suffix}_Lz.dat. The second integer controls the precision of the output."; item.default_value = "False 8"; item.unit = ""; - item.availability = "Numerical atomic orbital (NAO) basis"; + item.set_availability("basis_type==lcao"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count < 1) ModuleBase::WARNING_QUIT("ReadInput", "out_mat_l needs at least 1 value"); @@ -1288,7 +1277,6 @@ The second integer controls the precision of the charge density output, if not g The circle order of the charge density on real space grids is: x is the outer loop, then y and finally z (z is moving fastest).)"; item.default_value = "-1 3"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count >= 1) @@ -1320,7 +1308,7 @@ The circle order of the charge density on real space grids is: x is the outer lo item.description = "Whether to print the band energy terms separately in the file OUT.{term}_out.dat. The terms include the kinetic, pseudopotential (local + nonlocal), Hartree and exchange-correlation (including exact exchange if calculated)."; item.default_value = "False"; item.unit = ""; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); read_sync_bool(input.out_eband_terms); this->add_item(item); } @@ -1332,7 +1320,7 @@ The circle order of the charge density on real space grids is: x is the outer lo item.description = "Whether to print Hamiltonian matrices H(R) in NPZ format as hrs1_nao.npz and, for nspin = 2, hrs2_nao.npz. This feature does not work for gamma-only calculations."; item.default_value = "False"; item.unit = "Ry"; - item.availability = "Numerical atomic orbital basis (not gamma-only algorithm)"; + item.set_availability("basis_type==lcao and gamma_only==0"); read_sync_bool(input.out_hr_npz); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.out_hr_npz) @@ -1354,7 +1342,7 @@ The circle order of the charge density on real space grids is: x is the outer lo item.description = "Legacy alias for out_hsr 3, writing hrs1_nao.npz, hrs2_nao.npz when needed, and sr_nao.npz. If both out_hsr and out_hsr_npz are present, out_hsr takes precedence. Gamma-only calculations write the folded R = (0, 0, 0) representation."; item.default_value = "False"; item.unit = "Ry"; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); item.read_value = [](const Input_Item& item, Parameter& para) { para.input.out_hsr_npz = assume_as_boolean(item.str_values[0]); }; @@ -1378,7 +1366,7 @@ The circle order of the charge density on real space grids is: x is the outer lo item.description = "Whether to print density matrices DM(R) in npz format. This feature does not work for gamma-only calculations."; item.default_value = "False"; item.unit = ""; - item.availability = "Numerical atomic orbital basis (not gamma-only algorithm)"; + item.set_availability("basis_type==lcao and gamma_only==0"); read_sync_bool(input.out_dm_npz); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.out_dm_npz) @@ -1400,7 +1388,7 @@ The circle order of the charge density on real space grids is: x is the outer lo item.description = "Whether to print the Mulliken population analysis result into OUT.${suffix}/mulliken.txt. In molecular dynamics calculations, the output frequency is controlled by out_freq_ion."; item.default_value = "False"; item.unit = ""; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); read_sync_bool(input.out_mul); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.basis_type == "pw" && para.input.out_mul) @@ -1419,7 +1407,7 @@ The circle order of the charge density on real space grids is: x is the outer lo item.description = "Whether to output r(R), H(R), S(R), T(R), dH(R), dS(R), and wfc matrices in an append manner during molecular dynamics calculations. Check input parameters out_mat_r, out_hsr, out_mat_t, out_mat_dh, out_hsk and out_wfc_lcao for more information."; item.default_value = "true"; item.unit = ""; - item.availability = "Numerical atomic orbital basis (not gamma-only algorithm)"; + item.set_availability("basis_type==lcao and gamma_only==0"); read_sync_bool(input.out_app_flag); this->add_item(item); } @@ -1431,7 +1419,7 @@ The circle order of the charge density on real space grids is: x is the outer lo item.description = "Controls the length of decimal part of output data, such as charge density, Hamiltonian matrix, Overlap matrix and so on."; item.default_value = "8"; item.unit = ""; - item.availability = "out_hsk 1 case presently."; + item.set_availability("out_hsk==1"); read_sync_int(input.out_ndigits); this->add_item(item); } @@ -1443,7 +1431,6 @@ The circle order of the charge density on real space grids is: x is the outer lo item.description = "Whether to print element information into files in the directory OUT.{element_label}, including pseudopotential and orbital information of the element (in atomic Ryberg units)."; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_element_info); this->add_item(item); } @@ -1458,7 +1445,7 @@ The circle order of the charge density on real space grids is: x is the outer lo If EXX(exact exchange) is calculated (i.e. dft_fuctional==hse/hf/pbe0/scan0 or rpa==True), the Hexx(R) files for each processor will also be saved in the above folder, which can be read in EXX calculation with restart_load==True.)"; item.default_value = "False"; item.unit = ""; - item.availability = "Numerical atomic orbital basis"; + item.set_availability("basis_type==lcao"); read_sync_bool(input.restart_save); this->add_item(item); } @@ -1474,7 +1461,6 @@ If EXX(exact exchange) is calculated (i.e. dft_fuctional==hse/hf/pbe0/scan0 or r "irreducible_sector.txt, symrot_k.txt and symrot_R.txt."; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.rpa); this->add_item(item); } @@ -1486,7 +1472,7 @@ If EXX(exact exchange) is calculated (i.e. dft_fuctional==hse/hf/pbe0/scan0 or r item.description = R"(Specifies the electronic states to calculate the charge densities with state index for, using a space-separated string of 0s and 1s. Each digit in the string corresponds to a state, starting from the first state. A 1 indicates that the charge density should be calculated for that state, while a 0 means the state will be ignored. The parameter allows a compact and flexible notation (similar to ocp_set), for example the syntax 1 4*0 5*1 0 is used to denote the selection of states: 1 means calculate for the first state, 4*0 skips the next four states, 5*1 means calculate for the following five states, and the final 0 skips the next state. It's essential that the total count of states does not exceed the total number of states (nbands); otherwise, it results in an error, and the process exits. The input string must contain only numbers and the asterisk (*) for repetition, ensuring correct format and intention of state selection. The outputs comprise multiple .cube files following the naming convention pchgi[state]s[spin]k[kpoint].cube.)"; item.default_value = "none"; item.unit = ""; - item.availability = "For both PW and LCAO. When basis_type = lcao, used when calculation = get_pchg."; + item.set_availability("basis_type==pw or (basis_type==lcao and calculation==get_pchg)"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.out_pchg); }; item.get_final_value = [](Input_Item& item, const Parameter& para) { @@ -1506,7 +1492,7 @@ If EXX(exact exchange) is calculated (i.e. dft_fuctional==hse/hf/pbe0/scan0 or r item.description = "Specifies the electronic states to calculate the real-space wave function modulus (norm, or known as the envelope function) with state index. The syntax and state selection rules are identical to out_pchg, but the output is the norm of the wave function. The outputs comprise multiple .cube files following the naming convention wfi[state]s[spin]k[kpoint].cube."; item.default_value = "none"; item.unit = ""; - item.availability = "For both PW and LCAO. When basis_type = lcao, used when calculation = get_wf."; + item.set_availability("basis_type==pw or (basis_type==lcao and calculation==get_wf)"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.out_wfc_norm); }; @@ -1527,7 +1513,7 @@ If EXX(exact exchange) is calculated (i.e. dft_fuctional==hse/hf/pbe0/scan0 or r item.description = "Specifies the electronic states to calculate the real and imaginary parts of the wave function with state index. The syntax and state selection rules are identical to out_pchg, but the output contains both the real and imaginary components of the wave function. The outputs comprise multiple .cube files following the naming convention wfi[state]s[spin]k[kpoint][re/im].cube."; item.default_value = "none"; item.unit = ""; - item.availability = "For both PW and LCAO. When basis_type = lcao, used when calculation = get_wf."; + item.set_availability("basis_type==pw or (basis_type==lcao and calculation==get_wf)"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.out_wfc_re_im); }; @@ -1549,7 +1535,7 @@ If EXX(exact exchange) is calculated (i.e. dft_fuctional==hse/hf/pbe0/scan0 or r item.description = "Specifies whether to write the partial charge densities for all k-points to individual files or merge them. Warning: Enabling symmetry may produce unwanted results due to reduced k-point weights and symmetry operations in real space. Therefore when calculating partial charge densities, if you are not sure what you want exactly, it is strongly recommended to set symmetry = -1. It is noteworthy that your symmetry setting should remain the same as that in the SCF procedure."; item.default_value = "false"; item.unit = ""; - item.availability = "For both PW and LCAO. When basis_type = pw, used if out_pchg is set. When basis_type = lcao, used only when calculation = get_pchg and gamma_only = 0."; + item.set_availability("(basis_type==pw and out_pchg!=none) or (basis_type==lcao and calculation==get_pchg and gamma_only==0)"); read_sync_bool(input.if_separate_k); this->add_item(item); } @@ -1575,7 +1561,7 @@ The second integer controls the precision of the kinetic energy density output, In molecular dynamics calculations, the output frequency is controlled by out_freq_ion.)"; item.default_value = "0 3"; item.unit = ""; - item.availability = "Only for Kohn-Sham DFT and Orbital Free DFT."; + item.set_availability("esolver_type in [ksdft, ofdft]"); item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count >= 1) @@ -1605,7 +1591,7 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr item.description = "This output is only intentively needed by the ABACUS numerical atomic orbital generation workflow. This parameter is used to control whether to output the overlap integrals between truncated spherical Bessel functions (TSBFs) and plane-wave basis expanded wavefunctions (named as OVERLAP_Q), and between TSBFs (named as OVERLAP_Sq), also their first order derivatives. The output files are named starting with orb_matrix. A value of 2 would enable the output."; item.default_value = "0"; item.unit = ""; - item.availability = "Only for Kohn-Sham DFT with plane-wave basis."; + item.set_availability("esolver_type==ksdft and basis_type==pw"); read_sync_int(input.out_spillage); this->add_item(item); } @@ -1619,7 +1605,6 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr * False: Do not output the electric dipole information.)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_dipole); this->add_item(item); } @@ -1634,7 +1619,7 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr * 2: Use the full Hamiltonian to construct the generalized velocity matrix in a nonorthogonal NAO basis, $\widetilde{v}_{\alpha}=\partial_{\alpha}H+\mathrm{i}HS^{-1}\mathcal{R}_{\alpha}-\mathrm{i}\mathcal{R}_{\alpha}S^{-1}H-HS^{-1}\partial_{\alpha}S$. This includes all contributions available in the real-space Hamiltonian matrix when enabled. This method is more general but more expensive. The total current is written to OUT.{suffix}/current_tot_comm.txt.)"; item.default_value = "0"; item.unit = ""; - item.availability = "basis_type==lcao and esolver_type==tddft"; + item.set_availability("basis_type==lcao and esolver_type==tddft"); read_sync_int(input.out_current); this->add_item(item); } @@ -1648,7 +1633,7 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr * False: Output only current_tot.txt for out_current=1 or current_tot_comm.txt for out_current=2.)"; item.default_value = "False"; item.unit = ""; - item.availability = "basis_type==lcao and esolver_type==tddft and out_current>0"; + item.set_availability("basis_type==lcao and esolver_type==tddft and out_current>0"); read_sync_bool(input.out_current_k); this->add_item(item); } @@ -1662,7 +1647,7 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr * False: Do not output electric-field values.)"; item.default_value = "False"; item.unit = ""; - item.availability = "esolver_type==tddft and td_vext==true"; + item.set_availability("esolver_type==tddft and td_vext==true"); read_sync_bool(input.out_efield); this->add_item(item); } @@ -1676,7 +1661,7 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr * False: Do not output the vector potential.)"; item.default_value = "False"; item.unit = ""; - item.availability = "basis_type==lcao and esolver_type==tddft"; + item.set_availability("basis_type==lcao and esolver_type==tddft"); read_sync_bool(input.out_vecpot); this->add_item(item); } @@ -1692,7 +1677,6 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr item.description = "Whether to print the matrix representation of symmetry operation to running log file. If the first value is given as 1, then all matrix representations will be printed. The second optional parameter controls the precision (number of digits) to print, default is 3, which is enough for a quick check."; item.default_value = "1 3"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count >= 1) @@ -1722,7 +1706,7 @@ In molecular dynamics calculations, the output frequency is controlled by out_fr item.description = "The directory to save the spillage files."; item.default_value = "\"./\""; item.unit = ""; - item.availability = "Used only for plane wave basis set."; + item.set_availability("basis_type==pw"); read_sync_string(input.spillage_outdir); this->add_item(item); } diff --git a/source/source_io/module_parameter/read_input_item_postprocess.cpp b/source/source_io/module_parameter/read_input_item_postprocess.cpp index aad6f47a85..46ffb74d80 100644 --- a/source/source_io/module_parameter/read_input_item_postprocess.cpp +++ b/source/source_io/module_parameter/read_input_item_postprocess.cpp @@ -17,7 +17,6 @@ void ReadInput::item_postprocess() item.description = "The step size in writing Density of States (DOS)"; item.default_value = "0.01"; item.unit = "eV"; - item.availability = ""; read_sync_double(input.dos_edelta_ev); this->add_item(item); } @@ -29,7 +28,6 @@ void ReadInput::item_postprocess() item.description = "The width of the Gaussian factor when obtaining smeared Density of States (DOS)"; item.default_value = "0.07"; item.unit = "eV"; - item.availability = ""; read_sync_double(input.dos_sigma); this->add_item(item); } @@ -41,7 +39,6 @@ void ReadInput::item_postprocess() item.description = "Defines the energy range of DOS output as (emax-emin)*(1+dos_scale), centered at (emax+emin)/2. This parameter will be used when dos_emin and dos_emax are not set."; item.default_value = "0.01"; item.unit = "eV"; - item.availability = ""; read_sync_double(input.dos_scale); this->add_item(item); } @@ -55,7 +52,6 @@ void ReadInput::item_postprocess() * If set, "dos_scale" will be ignored.)"; item.default_value = "Minimal eigenenergy of"; item.unit = "eV"; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.dos_emin_ev = doublevalue; para.sys.dos_setemin = true; @@ -73,7 +69,6 @@ void ReadInput::item_postprocess() * If set, "dos_scale" will be ignored.)"; item.default_value = "Maximal eigenenergy of"; item.unit = "eV"; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.dos_emax_ev = doublevalue; para.sys.dos_setemax = true; @@ -90,7 +85,6 @@ void ReadInput::item_postprocess() item.description = "The order of Chebyshev expansions when using Stochastic Density Functional Theory (SDFT) to calculate DOS."; item.default_value = "100"; item.unit = ""; - item.availability = ""; read_sync_int(input.dos_nche); this->add_item(item); } @@ -106,7 +100,6 @@ void ReadInput::item_postprocess() * The third parameter determines the total number of voltage points)"; item.default_value = "1.0"; item.unit = "V"; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count != 1 && count != 3) @@ -138,7 +131,6 @@ void ReadInput::item_postprocess() item.description = "Specify the path of the three-dimensional space and display LDOS in the form of a two-dimensional color chart, see details in out_ldos. The first three paramenters are the direct coordinates of the start point, the next three paramenters are the direct coordinates of the end point, and the final one is the number of points along the path, whose default is 100."; item.default_value = "0.0 0.0 0.0 0.0 0.0 1.0 100"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { const size_t count = item.get_size(); if (count != 6 && count != 7) @@ -170,7 +162,7 @@ void ReadInput::item_postprocess() item.description = "Whether to calculate electronic conductivities."; item.default_value = "False"; item.unit = ""; - item.availability = "basis_type = pw"; + item.set_availability("basis_type==pw"); read_sync_bool(input.cal_cond); this->add_item(item); } @@ -182,7 +174,7 @@ void ReadInput::item_postprocess() item.description = "Control the error of Chebyshev expansions for conductivities."; item.default_value = "1e-8"; item.unit = ""; - item.availability = "esolver_type = sdft"; + item.set_availability("esolver_type==sdft"); read_sync_double(input.cond_che_thr); this->add_item(item); } @@ -194,7 +186,7 @@ void ReadInput::item_postprocess() item.description = "Frequency interval () for frequency-dependent conductivities."; item.default_value = "0.1"; item.unit = "eV"; - item.availability = "basis_type = pw"; + item.set_availability("basis_type==pw"); read_sync_double(input.cond_dw); this->add_item(item); } @@ -206,7 +198,7 @@ void ReadInput::item_postprocess() item.description = "Cutoff frequency for frequency-dependent conductivities."; item.default_value = "10.0"; item.unit = "eV"; - item.availability = "basis_type = pw"; + item.set_availability("basis_type==pw"); read_sync_double(input.cond_wcut); this->add_item(item); } @@ -218,7 +210,7 @@ void ReadInput::item_postprocess() item.description = "Time interval () to integrate Onsager coefficients."; item.default_value = "0.02"; item.unit = "a.u."; - item.availability = "basis_type = pw"; + item.set_availability("basis_type==pw"); read_sync_double(input.cond_dt); this->add_item(item); } @@ -231,7 +223,7 @@ void ReadInput::item_postprocess() * If cond_dtbatch = 0: Autoset this parameter to make expansion orders larger than 100.)"; item.default_value = "0"; item.unit = ""; - item.availability = "esolver_type = sdft"; + item.set_availability("esolver_type==sdft"); read_sync_int(input.cond_dtbatch); this->add_item(item); } @@ -245,7 +237,6 @@ void ReadInput::item_postprocess() * 2: Lorentzian smearing)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.cond_smear); this->add_item(item); } @@ -257,7 +248,7 @@ void ReadInput::item_postprocess() item.description = "FWHM for conductivities. For Gaussian smearing, ; for Lorentzian smearing, ."; item.default_value = "0.4"; item.unit = "eV"; - item.availability = "basis_type = pw"; + item.set_availability("basis_type==pw"); read_sync_double(input.cond_fwhm); this->add_item(item); } @@ -271,7 +262,7 @@ void ReadInput::item_postprocess() * False: .)"; item.default_value = "True"; item.unit = ""; - item.availability = "basis_type = pw"; + item.set_availability("basis_type==pw"); read_sync_bool(input.cond_nonlocal); this->add_item(item); } @@ -293,7 +284,6 @@ void ReadInput::item_postprocess() * false: Do not calculate Berry phase.)"; item.default_value = "false"; item.unit = ""; - item.availability = ""; read_sync_bool(input.berry_phase); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.berry_phase) @@ -332,7 +322,6 @@ void ReadInput::item_postprocess() * 3: Calculate the polarization in the direction of the lattice vector a_3 defined in the STRU file.)"; item.default_value = "3"; item.unit = ""; - item.availability = ""; read_sync_int(input.gdir); this->add_item(item); } @@ -346,7 +335,6 @@ void ReadInput::item_postprocess() * 0: Do not generate files for the Wannier90 code.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_bool(input.towannier90); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.towannier90) @@ -376,7 +364,6 @@ void ReadInput::item_postprocess() item.description = "The file name generated when running \"wannier90 -pp ...\" command"; item.default_value = "seedname.nnkp"; item.unit = ""; - item.availability = ""; read_sync_string(input.nnkpfile); this->add_item(item); } @@ -390,7 +377,6 @@ void ReadInput::item_postprocess() * 2: The overlap between atomic orbitals is calculated using grid integration. The radial grid points are generated using the Gauss-Legendre method, while the spherical grid points are generated using the Lebedev-Laikov method.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { /* Developer's notes: on the repair of lcao_in_pw @@ -424,7 +410,6 @@ void ReadInput::item_postprocess() * down: Calculate spin down for the Wannier function.)"; item.default_value = "up"; item.unit = ""; - item.availability = ""; read_sync_string(input.wannier_spin); this->add_item(item); } @@ -438,7 +423,6 @@ void ReadInput::item_postprocess() * 1: write the "*.mmn" file.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_wannier_mmn); this->add_item(item); } @@ -452,7 +436,6 @@ void ReadInput::item_postprocess() * 1: write the "*.amn" file.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_wannier_amn); this->add_item(item); } @@ -466,7 +449,6 @@ void ReadInput::item_postprocess() * 1: write the "*.eig" file.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_wannier_eig); this->add_item(item); } @@ -480,7 +462,6 @@ void ReadInput::item_postprocess() * 1: write the "UNK.*" file.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_wannier_unk); this->add_item(item); } @@ -494,7 +475,6 @@ void ReadInput::item_postprocess() * 1: write the "UNK.*" file in ASCII format (text file format).)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_wannier_wvfn_formatted); this->add_item(item); } diff --git a/source/source_io/module_parameter/read_input_item_relax.cpp b/source/source_io/module_parameter/read_input_item_relax.cpp index b038674551..9377fde0e0 100644 --- a/source/source_io/module_parameter/read_input_item_relax.cpp +++ b/source/source_io/module_parameter/read_input_item_relax.cpp @@ -72,7 +72,6 @@ The second element is not accepted by other methods. [NOTE] In the 3.10-LTS version, the type of this parameter is std::string. It can be set to "cg", "bfgs", "cg_bfgs", "bfgs_trad", "lbfgs", "sd", "fire".)"; item.default_value = "cg 2"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.relax_method = parse_relax_method(item.str_values); }; @@ -87,7 +86,7 @@ The second element is not accepted by other methods. item.description = "The paramether controls the size of the first conjugate gradient step. A smaller value means the first step along a new CG direction is smaller. This might be helpful for large systems, where it is safer to take a smaller initial step to prevent the collapse of the whole configuration."; item.default_value = "0.5"; item.unit = ""; - item.availability = "Only used when relax_method is cg 2"; + item.set_availability("relax_method in [cg 2]"); read_sync_double(input.relax_scale_force); this->add_item(item); } @@ -99,7 +98,6 @@ The second element is not accepted by other methods. item.description = "The maximal number of ionic iteration steps. If set to 0, the code performs a quick \"dry run\", stopping just after initialization. This is useful to check for input correctness and to have the summary printed."; item.default_value = "1 for SCF, 50 for relax and cell-relax calcualtions"; item.unit = ""; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { const std::string& calculation = para.input.calculation; const std::vector singlelist @@ -130,7 +128,7 @@ The second element is not accepted by other methods. item.description = "When relax_method is set to cg_bfgs, a mixed algorithm of conjugate gradient (CG) and Broyden–Fletcher–Goldfarb–Shanno (BFGS) is used. The ions first move according to the CG method, then switch to the BFGS method when the maximum force on atoms is reduced below this threshold."; item.default_value = "0.5"; item.unit = "eV/Angstrom"; - item.availability = "Only used when relax_method is cg_bfgs"; + item.set_availability("relax_method==cg_bfgs"); read_sync_double(input.relax_cg_thr); this->add_item(item); } @@ -142,7 +140,6 @@ The second element is not accepted by other methods. item.description = "Threshold of the force convergence. The threshold is compared with the largest force among all of the atoms. The recommended value for using atomic orbitals is 0.04 eV/Angstrom (0.0016 Ry/Bohr). The parameter is equivalent to force_thr_ev except for the unit, you can choose either you like."; item.default_value = "0.001"; item.unit = "Ry/Bohr (25.7112 eV/Angstrom)"; - item.availability = ""; // read_sync_double(input.force_thr); item.read_value = [](const Input_Item& item, Parameter& para) { para.input.force_thr = doublevalue; }; item.reset_value = [](const Input_Item& item, Parameter& para) { @@ -173,7 +170,6 @@ The second element is not accepted by other methods. item.description = "Threshold of the force convergence. The threshold is compared with the largest force among all of the atoms. The recommended value for using atomic orbitals is 0.04 eV/Angstrom (0.0016 Ry/Bohr). The parameter is equivalent to force_thr except for the unit. You may choose either you like."; item.default_value = "0.0257112"; item.unit = "eV/Angstrom (0.03889 Ry/Bohr)"; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { para.input.force_thr_ev = doublevalue; }; sync_double(input.force_thr_ev); this->add_item(item); @@ -186,7 +182,6 @@ The second element is not accepted by other methods. item.description = "The atomic forces that are smaller than force_zero_out will be treated as zero."; item.default_value = "0.0"; item.unit = "eV/Angstrom"; - item.availability = ""; read_sync_double(input.force_zero_out); this->add_item(item); } @@ -198,7 +193,7 @@ The second element is not accepted by other methods. item.description = "Controls the Wolfe condition for the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm used in geometry relaxation. This parameter sets the sufficient decrease condition (c1 in Wolfe conditions). For more information, see Phys. Chem. Chem. Phys., 2000, 2, 2177."; item.default_value = "0.01"; item.unit = ""; - item.availability = "Only used when relax_method is bfgs or cg_bfgs"; + item.set_availability("relax_method in [bfgs, cg_bfgs]"); read_sync_double(input.relax_bfgs_w1); this->add_item(item); } @@ -210,7 +205,7 @@ The second element is not accepted by other methods. item.description = "Controls the Wolfe condition for the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm used in geometry relaxation. This parameter sets the curvature condition (c2 in Wolfe conditions). For more information, see Phys. Chem. Chem. Phys., 2000, 2, 2177."; item.default_value = "0.5"; item.unit = ""; - item.availability = "Only used when relax_method is bfgs or cg_bfgs"; + item.set_availability("relax_method in [bfgs, cg_bfgs]"); read_sync_double(input.relax_bfgs_w2); this->add_item(item); } @@ -222,7 +217,7 @@ The second element is not accepted by other methods. item.description = "Maximum allowed total displacement of all atoms during geometry optimization. The sum of atomic displacements can increase during optimization steps but cannot exceed this value."; item.default_value = "0.8"; item.unit = "Bohr"; - item.availability = "Only used when relax_method is bfgs or cg_bfgs"; + item.set_availability("relax_method in [bfgs, cg_bfgs]"); read_sync_double(input.relax_bfgs_rmax); this->add_item(item); } @@ -234,7 +229,7 @@ The second element is not accepted by other methods. item.description = "Minimum allowed total displacement of all atoms. When the total atomic displacement falls below this value and force convergence is not achieved, the calculation will terminate. Note: This parameter is not used in the default BFGS algorithm (relax_method = bfgs 2 or bfgs)."; item.default_value = "1e-5"; item.unit = "Bohr"; - item.availability = "Only used when relax_method is bfgs 1 (traditional BFGS)"; + item.set_availability("relax_method in [bfgs 1]"); read_sync_double(input.relax_bfgs_rmin); this->add_item(item); } @@ -246,7 +241,7 @@ The second element is not accepted by other methods. item.description = "Initial total displacement of all atoms in the first BFGS step. This sets the scale for the initial movement."; item.default_value = "0.5"; item.unit = "Bohr"; - item.availability = "Only used when relax_method is bfgs or cg_bfgs"; + item.set_availability("relax_method in [bfgs, cg_bfgs]"); read_sync_double(input.relax_bfgs_init); this->add_item(item); } @@ -258,7 +253,6 @@ The second element is not accepted by other methods. item.description = "The threshold of the stress convergence. The threshold is compared with the largest component of the stress tensor."; item.default_value = "0.5"; item.unit = "kbar"; - item.availability = ""; read_sync_double(input.stress_thr); this->add_item(item); } @@ -270,7 +264,6 @@ The second element is not accepted by other methods. item.description = "The external pressures along three axes. Positive input value is taken as compressive stress."; item.default_value = "0"; item.unit = "kbar"; - item.availability = ""; read_sync_double(input.press1); this->add_item(item); } @@ -282,7 +275,6 @@ The second element is not accepted by other methods. item.description = "The external pressures along three axes. Positive input value is taken as compressive stress."; item.default_value = "0"; item.unit = "kbar"; - item.availability = ""; read_sync_double(input.press2); this->add_item(item); } @@ -294,7 +286,6 @@ The second element is not accepted by other methods. item.description = "The external pressures along three axes. Positive input value is taken as compressive stress."; item.default_value = "0"; item.unit = "kbar"; - item.availability = ""; read_sync_double(input.press3); this->add_item(item); } @@ -322,7 +313,7 @@ With relax_method set to cg 1, bfgs, lbfgs, sd, or cg_bfgs, None and a, b, c, ab [NOTE] For VASP users, see the ISIF correspondence table in the geometry optimization documentation.)"; item.default_value = "None"; item.unit = ""; - item.availability = "Only used when calculation is set to cell-relax"; + item.set_availability("calculation==cell-relax"); read_sync_string(input.fixed_axes); item.check_value = [](const Input_Item& item, const Parameter& para) { if ((para.input.fixed_axes == "shape" || para.input.fixed_axes == "volume") @@ -344,7 +335,7 @@ With relax_method set to cg 1, bfgs, lbfgs, sd, or cg_bfgs, None and a, b, c, ab [NOTE] Note: it is possible to use fixed_ibrav with fixed_axes, but please make sure you know what you are doing. For example, if we are doing relaxation of a simple cubic lattice (latname = "sc"), and we use fixed_ibrav along with fixed_axes = "volume", then the cell is never allowed to move and as a result, the relaxation never converges. When both are used, fixed_ibrav is applied first, then fixed_axes = "volume" rescaling is applied.)"; item.default_value = "False"; item.unit = ""; - item.availability = "Only used with relax_method = cg 2. A specific latname must be provided."; + item.set_availability("relax_method in [cg 2] and latname!=none"); read_sync_bool(input.fixed_ibrav); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.fixed_ibrav && !para.input.uses_simultaneous_relaxation()) @@ -368,7 +359,6 @@ With relax_method set to cg 1, bfgs, lbfgs, sd, or cg_bfgs, None and a, b, c, ab * False: No restrictions are exerted on positions of all atoms. However, users can still fix certain components of certain atoms by using the m keyword in STRU file. For the latter option, check the end of this instruction.)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.fixed_atoms); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.fixed_atoms && para.input.calculation == "relax") diff --git a/source/source_io/module_parameter/read_input_item_sdft.cpp b/source/source_io/module_parameter/read_input_item_sdft.cpp index 2df4f2d661..800e923881 100644 --- a/source/source_io/module_parameter/read_input_item_sdft.cpp +++ b/source/source_io/module_parameter/read_input_item_sdft.cpp @@ -22,7 +22,7 @@ void ReadInput::item_sdft() * other: use 2)"; item.default_value = "2"; item.unit = ""; - item.availability = "esolver_type = sdft"; + item.set_availability("esolver_type==sdft"); read_sync_int(input.method_sto); item.check_value = [](const Input_Item& item, const Parameter& para) { if (para.input.method_sto != 1 && para.input.method_sto != 2) @@ -43,7 +43,7 @@ void ReadInput::item_sdft() * all: All complete basis sets are used to replace stochastic orbitals with the Chebyshev method (CT), resulting in the same results as KSDFT without stochastic errors.)"; item.default_value = "256"; item.unit = ""; - item.availability = "esolver_type = sdft"; + item.set_availability("esolver_type==sdft"); item.read_value = [](const Input_Item& item, Parameter& para) { std::string nbandsto_str = strvalue; if (nbandsto_str != "all") @@ -97,7 +97,7 @@ void ReadInput::item_sdft() item.description = "Chebyshev expansion orders for stochastic DFT."; item.default_value = "100"; item.unit = ""; - item.availability = "esolver_type = sdft"; + item.set_availability("esolver_type==sdft"); read_sync_int(input.nche_sto); this->add_item(item); } @@ -110,7 +110,7 @@ void ReadInput::item_sdft() item.description = "Trial energy to guess the lower bound of eigen energies of the Hamiltonian Operator."; item.default_value = "0.0"; item.unit = "Ry"; - item.availability = "esolver_type = sdft"; + item.set_availability("esolver_type==sdft"); read_sync_double(input.emin_sto); this->add_item(item); } @@ -123,7 +123,7 @@ void ReadInput::item_sdft() item.description = "Trial energy to guess the upper bound of eigen energies of the Hamiltonian Operator."; item.default_value = "0.0"; item.unit = "Ry"; - item.availability = "esolver_type = sdft"; + item.set_availability("esolver_type==sdft"); read_sync_double(input.emax_sto); this->add_item(item); } @@ -139,7 +139,7 @@ void ReadInput::item_sdft() * -1: the seed is decided by time(NULL).)"; item.default_value = "0"; item.unit = ""; - item.availability = "esolver_type = sdft"; + item.set_availability("esolver_type==sdft"); read_sync_int(input.seed_sto); this->add_item(item); } @@ -151,7 +151,7 @@ void ReadInput::item_sdft() item.description = R"(Stochastic wave functions are initialized in a large box generated by "4*initsto_ecut". initsto_ecut should be larger than ecutwfc. In this method, SDFT results are the same when using different cores. Besides, coefficients of the same G are the same when ecutwfc is rising to initsto_ecut. If it is smaller than ecutwfc, it will be turned off.)"; item.default_value = "0.0"; item.unit = "Ry"; - item.availability = "esolver_type = sdft"; + item.set_availability("esolver_type==sdft"); read_sync_double(input.initsto_ecut); this->add_item(item); } @@ -165,7 +165,7 @@ void ReadInput::item_sdft() * 0: Never change stochastic orbitals.)"; item.default_value = "0"; item.unit = ""; - item.availability = "esolver_type = sdft"; + item.set_availability("esolver_type==sdft"); read_sync_int(input.initsto_freq); this->add_item(item); } @@ -177,7 +177,7 @@ void ReadInput::item_sdft() item.description = "Make memory cost to 1/npart_sto times of the previous one when running the post process of SDFT like DOS or conductivities."; item.default_value = "1"; item.unit = ""; - item.availability = "method_sto = 2 and out_dos = 1 or cal_cond = True"; + item.set_availability("(method_sto==2 and out_dos==1) or cal_cond==true"); read_sync_int(input.npart_sto); this->add_item(item); } diff --git a/source/source_io/module_parameter/read_input_item_system.cpp b/source/source_io/module_parameter/read_input_item_system.cpp index 68a066637f..53936ebda8 100644 --- a/source/source_io/module_parameter/read_input_item_system.cpp +++ b/source/source_io/module_parameter/read_input_item_system.cpp @@ -258,7 +258,7 @@ void ReadInput::item_system() "* False: quit with an error message\n" "* True: automatically set symmetry to 0 and continue running without symmetry analysis"; item.default_value = "True"; - item.availability = "symmetry==1"; + item.set_availability("symmetry==1"); read_sync_bool(input.symmetry_autoclose); this->add_item(item); } @@ -545,7 +545,7 @@ Available options are: * 0: no memory saving techniques are used. * 1: a memory saving technique will be used for many k point calculations.)"; item.default_value = "0"; - item.availability = "Used only for nscf calculations with plane wave basis set."; + item.set_availability("calculation==nscf and basis_type==pw"); read_sync_int(input.mem_saver); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.mem_saver == 1) @@ -591,7 +591,7 @@ Available options are: item.description = R"(* 0: it will be set to the number of MPI processes. * >0: it specifies the number of processes used for carrying out diagonalization. Must be less than or equal to total number of MPI processes.)"; item.default_value = "0"; - item.availability = "Used only for plane wave basis set."; + item.set_availability("basis_type==pw"); read_sync_int(input.diago_proc); item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.diago_proc == 0) @@ -771,7 +771,7 @@ Available options are: * single: single precision * double: double precision)"; item.default_value = "double"; - item.availability = "Used only for plane wave basis set."; + item.set_availability("basis_type==pw"); read_sync_string(input.precision); item.check_value = [](const Input_Item& item, const Parameter& para) { std::vector avail_list = {"single", "double"}; @@ -809,7 +809,7 @@ Available options are: * double: double precision * mix: mixed precision, starting from single precision and switching to double precision when the SCF residual becomes small enough)"; item.default_value = "double"; - item.availability = "Used only for LCAO basis set."; + item.set_availability("basis_type==lcao"); read_sync_string(input.gint_precision); item.check_value = [](const Input_Item& item, const Parameter& para) { std::vector avail_list = {"single", "double", "mix"}; @@ -1162,7 +1162,7 @@ Available options are: item.type = "Integer"; item.description = "Specify the random seed to initialize wave functions. Only positive integers are available."; item.default_value = "0"; - item.availability = "Only used for plane wave basis."; + item.set_availability("basis_type==pw"); read_sync_int(input.pw_seed); this->add_item(item); } @@ -1323,7 +1323,7 @@ Available options are: item.description = "If restart_save is set to true and an electronic iteration is finished, calculations can be " "restarted from the charge density file, which are saved in the former calculation."; item.default_value = "False"; - item.availability = "Used only when numerical atomic orbitals are employed as basis set."; + item.set_availability("basis_type==lcao"); read_sync_bool(input.restart_load); this->add_item(item); } diff --git a/source/source_io/module_parameter/read_input_item_tddft.cpp b/source/source_io/module_parameter/read_input_item_tddft.cpp index 50f10eccef..1d82c219ca 100644 --- a/source/source_io/module_parameter/read_input_item_tddft.cpp +++ b/source/source_io/module_parameter/read_input_item_tddft.cpp @@ -162,7 +162,6 @@ void ReadInput::item_rt_tddft() item.description = "The number of electronic propagation steps between two ionic steps."; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.estep_per_md); this->add_item(item); } @@ -175,7 +174,6 @@ void ReadInput::item_rt_tddft() item.description = R"(The time step used for electronic propagation. If td_dt is not specified, it is set to md_dt / estep_per_md. If td_dt is specified explicitly, md_dt is reset to td_dt * estep_per_md.)"; item.default_value = "md_dt / estep_per_md"; item.unit = "fs"; - item.availability = ""; item.reset_value = [](const Input_Item& item, Parameter& para) { if (para.input.td_dt == -1.0) { @@ -196,7 +194,6 @@ void ReadInput::item_rt_tddft() * 1: Use the ground-state eigenvalue-weighted expression $\mathrm{EDM}_{\mu\nu,\boldsymbol{k}}=\sum_i w_{i\boldsymbol{k}}\epsilon_{i\boldsymbol{k}}C_{\mu i,\boldsymbol{k}}C_{\nu i,\boldsymbol{k}}^*$. This expression is deprecated for RT-TDDFT and is generally not valid when the propagated wave functions are not Hamiltonian eigenstates.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.td_edm); this->add_item(item); } @@ -210,7 +207,6 @@ void ReadInput::item_rt_tddft() * $\geqslant 0$: Print an element when either $\left|\operatorname{Re}E_{ij}\right|$ or $\left|\operatorname{Im}E_{ij}\right|$ is greater than or equal to td_print_eij.)"; item.default_value = "-1"; item.unit = "Ry"; - item.availability = ""; read_sync_double(input.td_print_eij); this->add_item(item); } @@ -228,7 +224,6 @@ void ReadInput::item_rt_tddft() [NOTE] GPU execution currently supports only method 0 in both single-GPU and multi-GPU solver configurations. CPU execution supports methods 0 through 3.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.propagator); this->add_item(item); } @@ -242,7 +237,6 @@ void ReadInput::item_rt_tddft() * False: No external electric field.)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.td_vext); this->add_item(item); } @@ -257,7 +251,6 @@ void ReadInput::item_rt_tddft() * 3: The external field direction is along the z-axis.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_vext_dire); }; @@ -275,7 +268,6 @@ void ReadInput::item_rt_tddft() * 2: Hybrid gauge. See J. Chem. Theory Comput. 2025, 21, 3335-3341 for more information.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.td_stype); this->add_item(item); } @@ -296,7 +288,6 @@ The formulas below use Hartree atomic units. For every ordinary input frequency In the velocity and hybrid gauges, ABACUS obtains the vector potential actually used in propagation by Simpson integration of the selected electric fields, including the supersine field, so a residual at the numerical-quadrature accuracy scale may remain.)"; item.default_value = "0"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_ttype); }; @@ -312,7 +303,6 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(First electronic step at which the time-dependent electric field is active. The interval from td_tstart through td_tend includes both endpoints. On each active step $n$, the velocity and hybrid gauges integrate the field over $[n\Delta t,(n+1)\Delta t]$, where $\Delta t=\mathtt{td\_dt}$.)"; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.td_tstart); this->add_item(item); } @@ -324,7 +314,6 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Last electronic step at which the time-dependent electric field is active. The interval from td_tstart through td_tend includes both endpoints. On each active step $n$, the velocity and hybrid gauges integrate the field over $[n\Delta t,(n+1)\Delta t]$, where $\Delta t=\mathtt{td\_dt}$.)"; item.default_value = "1000"; item.unit = ""; - item.availability = ""; read_sync_int(input.td_tend); this->add_item(item); } @@ -336,7 +325,6 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Lower fractional-coordinate cutoff for the periodic spatial modulation used in the length gauge. Let $c_1=\mathtt{td\_lcut1}$, $c_2=\mathtt{td\_lcut2}$, $D=c_2-c_1$, and $G=c_1+1-c_2$. For a fractional coordinate $x$, the field factor is $\eta(x)=1$ when $c_1\leqslant x\lt c_2$ and $\eta(x)=-D/G$ elsewhere. The reversed outer interval makes the potential periodic and continuous and gives the field zero cell average.)"; item.default_value = "0.05"; item.unit = ""; - item.availability = ""; read_sync_double(input.td_lcut1); this->add_item(item); } @@ -348,7 +336,6 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Upper fractional-coordinate cutoff for the periodic spatial modulation used in the length gauge. Let $c_1=\mathtt{td\_lcut1}$, $c_2=\mathtt{td\_lcut2}$, $D=c_2-c_1$, and $G=c_1+1-c_2$. For a fractional coordinate $x$, the field factor is $\eta(x)=1$ when $c_1\leqslant x\lt c_2$ and $\eta(x)=-D/G$ elsewhere. The reversed outer interval makes the potential periodic and continuous and gives the field zero cell average.)"; item.default_value = "0.95"; item.unit = ""; - item.availability = ""; read_sync_double(input.td_lcut2); this->add_item(item); } @@ -360,7 +347,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Ordinary frequency $f$ in the Gaussian-pulse formula, with $\omega=2\pi f$. Supply exactly one value for each td_ttype 0 occurrence, in occurrence order.)"; item.default_value = "22.13"; item.unit = "1/fs"; - item.availability = "td_ttype contains 0"; + item.set_availability("td_ttype contains 0"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_gauss_freq); }; @@ -375,7 +362,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Carrier phase $\varphi$ in the Gaussian-pulse formula. Supply exactly one value for each td_ttype 0 occurrence, in occurrence order.)"; item.default_value = "0.0"; item.unit = "rad"; - item.availability = "td_ttype contains 0"; + item.set_availability("td_ttype contains 0"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_gauss_phase); }; @@ -390,7 +377,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Nonzero standard deviation $\sigma$ of the Gaussian envelope. Supply exactly one value for each td_ttype 0 occurrence, in occurrence order.)"; item.default_value = "30.0"; item.unit = "fs"; - item.availability = "td_ttype contains 0"; + item.set_availability("td_ttype contains 0"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_gauss_sigma); }; @@ -405,7 +392,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Electronic-step position of the Gaussian center, which defines $t_0=\mathtt{td\_gauss\_t0}\Delta t$. Supply exactly one value for each td_ttype 0 occurrence, in occurrence order.)"; item.default_value = "100"; item.unit = ""; - item.availability = "td_ttype contains 0"; + item.set_availability("td_ttype contains 0"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_gauss_t0); }; @@ -420,7 +407,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Electric-field scale $E_0$ in the Gaussian-pulse formula. Supply exactly one value for each td_ttype 0 occurrence, in occurrence order.)"; item.default_value = "0.25"; item.unit = "V/Angstrom"; - item.availability = "td_ttype contains 0"; + item.set_availability("td_ttype contains 0"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_gauss_amp); }; @@ -435,7 +422,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Ordinary carrier frequency $f$ in the trapezoid-pulse formula, with $\omega=2\pi f$. Supply exactly one value for each td_ttype 1 occurrence, in occurrence order.)"; item.default_value = "1.60"; item.unit = "1/fs"; - item.availability = "td_ttype contains 1"; + item.set_availability("td_ttype contains 1"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trape_freq); }; @@ -450,7 +437,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Carrier phase $\varphi$ in the trapezoid-pulse formula. Supply exactly one value for each td_ttype 1 occurrence, in occurrence order.)"; item.default_value = "0.0"; item.unit = "rad"; - item.availability = "td_ttype contains 1"; + item.set_availability("td_ttype contains 1"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trape_phase); }; @@ -465,7 +452,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Electronic step defining the end of the linear rise, $t_1=\mathtt{td\_trape\_t1}\Delta t$. Each field must satisfy td_trape_t1 <= td_trape_t2 <= td_trape_t3. Supply exactly one value for each td_ttype 1 occurrence, in occurrence order.)"; item.default_value = "1875"; item.unit = ""; - item.availability = "td_ttype contains 1"; + item.set_availability("td_ttype contains 1"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trape_t1); }; @@ -480,7 +467,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Electronic step defining the end of the plateau, $t_2=\mathtt{td\_trape\_t2}\Delta t$. Each field must satisfy td_trape_t1 <= td_trape_t2 <= td_trape_t3. Supply exactly one value for each td_ttype 1 occurrence, in occurrence order.)"; item.default_value = "5625"; item.unit = ""; - item.availability = "td_ttype contains 1"; + item.set_availability("td_ttype contains 1"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trape_t2); }; @@ -495,7 +482,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Electronic step defining the end of the linear fall, $t_3=\mathtt{td\_trape\_t3}\Delta t$. Each field must satisfy td_trape_t1 <= td_trape_t2 <= td_trape_t3. Supply exactly one value for each td_ttype 1 occurrence, in occurrence order.)"; item.default_value = "7500"; item.unit = ""; - item.availability = "td_ttype contains 1"; + item.set_availability("td_ttype contains 1"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trape_t3); }; @@ -510,7 +497,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Electric-field scale $E_0$ in the trapezoid-pulse formula. Supply exactly one value for each td_ttype 1 occurrence, in occurrence order.)"; item.default_value = "2.74"; item.unit = "V/Angstrom"; - item.availability = "td_ttype contains 1"; + item.set_availability("td_ttype contains 1"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trape_amp); }; @@ -525,7 +512,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(First ordinary frequency $f_1$ in the trigonometric-pulse formula, with $\omega_1=2\pi f_1$. Supply exactly one value for each td_ttype 2 occurrence, in occurrence order.)"; item.default_value = "1.164656"; item.unit = "1/fs"; - item.availability = "td_ttype contains 2"; + item.set_availability("td_ttype contains 2"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trigo_freq1); }; @@ -540,7 +527,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Second ordinary frequency $f_2$ in the trigonometric-pulse formula, with $\omega_2=2\pi f_2$. Supply exactly one value for each td_ttype 2 occurrence, in occurrence order.)"; item.default_value = "0.029116"; item.unit = "1/fs"; - item.availability = "td_ttype contains 2"; + item.set_availability("td_ttype contains 2"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trigo_freq2); }; @@ -555,7 +542,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Carrier phase $\varphi_1$ in the cosine factor of the trigonometric-pulse formula. Supply exactly one value for each td_ttype 2 occurrence, in occurrence order.)"; item.default_value = "0.0"; item.unit = "rad"; - item.availability = "td_ttype contains 2"; + item.set_availability("td_ttype contains 2"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trigo_phase1); }; @@ -570,7 +557,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Envelope phase $\varphi_2$ in the sine-squared factor of the trigonometric-pulse formula. Supply exactly one value for each td_ttype 2 occurrence, in occurrence order.)"; item.default_value = "0.0"; item.unit = "rad"; - item.availability = "td_ttype contains 2"; + item.set_availability("td_ttype contains 2"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trigo_phase2); }; @@ -585,7 +572,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Electric-field scale $E_0$ in the trigonometric-pulse formula. Supply exactly one value for each td_ttype 2 occurrence, in occurrence order.)"; item.default_value = "2.74"; item.unit = "V/Angstrom"; - item.availability = "td_ttype contains 2"; + item.set_availability("td_ttype contains 2"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_trigo_amp); }; @@ -600,7 +587,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Electronic switch step $n_0$ in the Heaviside-pulse definition. The field is $E_0$ for $n\lt n_0$ and zero for $n\geqslant n_0$. Supply exactly one value for each td_ttype 3 occurrence, in occurrence order.)"; item.default_value = "100"; item.unit = ""; - item.availability = "td_ttype contains 3"; + item.set_availability("td_ttype contains 3"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_heavi_t0); }; @@ -615,7 +602,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Electric-field scale $E_0$ in the Heaviside-pulse definition. Supply exactly one value for each td_ttype 3 occurrence, in occurrence order.)"; item.default_value = "1.0"; item.unit = "V/Angstrom"; - item.availability = "td_ttype contains 3"; + item.set_availability("td_ttype contains 3"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_heavi_amp); }; @@ -630,7 +617,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Carrier electric-field scale $E_0$ of each supersine pulse. This is not a normalization of the complete waveform maximum, because the envelope-derivative term also contributes. Supply exactly one value for each td_ttype 4 occurrence, in occurrence order.)"; item.default_value = "0.27"; item.unit = "V/Angstrom"; - item.availability = "td_ttype contains 4"; + item.set_availability("td_ttype contains 4"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_supsine_amp); }; @@ -645,7 +632,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Nonzero ordinary carrier frequency $f$ of each supersine pulse, with $\omega=2\pi f$. Supply exactly one value for each td_ttype 4 occurrence, in occurrence order.)"; item.default_value = "0.18737028625"; item.unit = "1/fs"; - item.availability = "td_ttype contains 4"; + item.set_availability("td_ttype contains 4"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_supsine_freq); }; @@ -660,7 +647,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Electric-field carrier phase $\varphi$ at the center of each supersine envelope. A value of 0 places a cosine carrier maximum at the envelope center. Supply exactly one value for each td_ttype 4 occurrence, in occurrence order.)"; item.default_value = "0.0"; item.unit = "rad"; - item.availability = "td_ttype contains 4"; + item.set_availability("td_ttype contains 4"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_supsine_phase); }; @@ -675,7 +662,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Dimensionless shape parameter $\sigma$ of each supersine envelope. It must satisfy $0\lt\sigma\lt\pi/2$ so that the electric field approaches zero at the pulse boundaries. Supply exactly one value for each td_ttype 4 occurrence, in occurrence order.)"; item.default_value = "0.75"; item.unit = ""; - item.availability = "td_ttype contains 4"; + item.set_availability("td_ttype contains 4"); item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.td_supsine_sigma); }; @@ -690,7 +677,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Integer electronic step at the left, exactly zero boundary of each supersine pulse, defining $t_{\mathrm{s}}=\mathtt{td\_supsine\_tstart}\Delta t$. Supply exactly one integer or default token for each td_ttype 4 occurrence, in occurrence order; each default token inherits td_tstart. The complete pulse support must lie inside the inclusive global td_tstart to td_tend interval; hard truncation of a supersine pulse is rejected.)"; item.default_value = "default"; item.unit = ""; - item.availability = "td_ttype contains 4"; + item.set_availability("td_ttype contains 4"); item.reset_value = [](const Input_Item& item, Parameter& para) { para.input.td_supsine_tstart = parse_supersine_steps(item, para.input.td_tstart); }; @@ -708,7 +695,7 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually item.description = R"(Integer electronic step at the right, exactly zero boundary of each supersine pulse, defining $t_{\mathrm{e}}=\mathtt{td\_supsine\_tend}\Delta t$. Supply exactly one integer or default token for each td_ttype 4 occurrence, in occurrence order; each default token inherits td_tend. The complete pulse support must lie inside the inclusive global td_tstart to td_tend interval; hard truncation of a supersine pulse is rejected.)"; item.default_value = "default"; item.unit = ""; - item.availability = "td_ttype contains 4"; + item.set_availability("td_ttype contains 4"); item.reset_value = [](const Input_Item& item, Parameter& para) { para.input.td_supsine_tend = parse_supersine_steps(item, para.input.td_tend); }; @@ -728,7 +715,6 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually * False: Obtain the vector potential by integrating the configured electric field.)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.init_vecpot_file); this->add_item(item); } @@ -742,7 +728,6 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually * False: Keep the occupations determined by the initial SCF.)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.ocp); this->add_item(item); } @@ -757,7 +742,6 @@ In the velocity and hybrid gauges, ABACUS obtains the vector potential actually * The sum of all weights must equal nelec; otherwise the calculation terminates with an error.)"; item.default_value = "None"; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { parse_expression(item.str_values, para.input.ocp_kb); }; @@ -787,7 +771,7 @@ void ReadInput::item_tdofdft() * False: Not added the CD potential.)"; item.default_value = "False"; item.unit = ""; - item.availability = "TDOFDFT"; + item.set_availability("esolver_type==tdofdft"); read_sync_bool(input.of_cd); this->add_item(item); } @@ -799,7 +783,7 @@ void ReadInput::item_tdofdft() item.description = "The value of the parameter alpha in modified CD potential method. mCDPotential=alpha*CDPotential (proposed in paper PhysRevB.98.144302)"; item.default_value = "1.0"; item.unit = ""; - item.availability = "TDOFDFT"; + item.set_availability("esolver_type==tdofdft"); read_sync_double(input.of_mCD_alpha); this->add_item(item); } @@ -817,7 +801,6 @@ void ReadInput::item_lr_tddft() item.description = "The exchange-correlation kernel used in the calculation. Currently supported: RPA, LDA, PBE, HSE, HF."; item.default_value = "LDA"; item.unit = ""; - item.availability = ""; read_sync_string(input.xc_kernel); this->add_item(item); } @@ -832,7 +815,6 @@ void ReadInput::item_lr_tddft() * "from_charge_file": Calculate fxc from the charge density read from the provided files. The following words should be the paths of ".cube" files, where the first nspin files will be read in.)"; item.default_value = "\"default\""; item.unit = ""; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); auto& ifxc = para.input.lr_init_xc_kernel; @@ -855,7 +837,6 @@ void ReadInput::item_lr_tddft() * spectrum: Calculate absorption spectrum only without solving Casida equation.)"; item.default_value = "dav"; item.unit = ""; - item.availability = ""; read_sync_string(input.lr_solver); this->add_item(item); } @@ -867,7 +848,6 @@ void ReadInput::item_lr_tddft() item.description = "The convergence threshold of iterative diagonalization solver for LR-TDDFT. It is a pure-math number with the same meaning as pw_diag_thr, but since the Casida equation is a one-shot eigenvalue problem, it is also the convergence threshold of LR-TDDFT."; item.default_value = "1e-2"; item.unit = ""; - item.availability = ""; read_sync_double(input.lr_thr); this->add_item(item); } @@ -880,7 +860,6 @@ void ReadInput::item_lr_tddft() * Note: If the value is illegal ( > nelec/2 or <= 0), it will be autoset to nelec/2.)"; item.default_value = "nband"; item.unit = ""; - item.availability = ""; read_sync_int(input.nocc); item.reset_value = [](const Input_Item& item, Parameter& para) { const int nocc_default = std::max(static_cast(para.input.nelec + 1) / 2, para.input.nbands); @@ -896,7 +875,6 @@ void ReadInput::item_lr_tddft() item.description = "The number of virtual orbitals (starting from LUMO) used in the LR-TDDFT calculation."; item.default_value = "1"; item.unit = ""; - item.availability = ""; read_sync_int(input.nvirt); this->add_item(item); } @@ -909,7 +887,6 @@ void ReadInput::item_lr_tddft() item.description = "The number of 2-particle states to be solved."; item.default_value = "0"; item.unit = ""; - item.availability = ""; read_sync_int(input.lr_nstates); this->add_item(item); } @@ -923,7 +900,6 @@ void ReadInput::item_lr_tddft() * False: Use unrestricted LR-TDDFT only when the system is open-shell.)"; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.lr_unrestricted); this->add_item(item); } @@ -935,7 +911,6 @@ void ReadInput::item_lr_tddft() item.description = "The range of the wavelength for the absorption spectrum calculation."; item.default_value = "0.0 0.0"; item.unit = "nm"; - item.availability = ""; item.read_value = [](const Input_Item& item, Parameter& para) { size_t count = item.get_size(); for (int i = 0; i < count; i++) @@ -954,7 +929,6 @@ void ReadInput::item_lr_tddft() item.description = "Whether to output the eigenstates (excitation energy) and eigenvectors (excitation amplitude) of the LR-TDDFT calculation. The output files are OUT.{suffix}/Excitation_Amplitude_${processor_rank}.dat."; item.default_value = "False"; item.unit = ""; - item.availability = ""; read_sync_bool(input.out_wfc_lr); this->add_item(item); } @@ -966,7 +940,6 @@ void ReadInput::item_lr_tddft() item.description = "Whether to use length or velocity gauge to calculate the absorption spectrum in LR-TDDFT."; item.default_value = "length"; item.unit = ""; - item.availability = ""; read_sync_string(input.abs_gauge); this->add_item(item); } @@ -978,7 +951,6 @@ void ReadInput::item_lr_tddft() item.description = "The broadening factor for the absorption spectrum calculation."; item.default_value = "0.01"; item.unit = ""; - item.availability = ""; read_sync_double(input.abs_broadening); this->add_item(item); } diff --git a/source/source_io/test_serial/CMakeLists.txt b/source/source_io/test_serial/CMakeLists.txt index a985cc7eef..24a7f95150 100644 --- a/source/source_io/test_serial/CMakeLists.txt +++ b/source/source_io/test_serial/CMakeLists.txt @@ -21,6 +21,7 @@ add_library( ../module_parameter/read_input_item_output.cpp ../module_parameter/read_input.cpp ../module_parameter/read_set_globalv.cpp + ../module_parameter/availability.cpp ) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/support DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) @@ -39,6 +40,15 @@ AddTest( SOURCES read_input_item_test.cpp ) +# The availability parser is dependency-free (standard library only). It does +# not need libs such as `base`/`device`, so this target intentionally links only +# the gtest/gmock/linalg closure that AddTest adds automatically. +AddTest( + TARGET MODULE_IO_availability_serial + SOURCES availability_test.cpp + ../module_parameter/availability.cpp +) + AddTest( TARGET MODULE_IO_read_input_tool SOURCES read_input_tool_test.cpp diff --git a/source/source_io/test_serial/availability_test.cpp b/source/source_io/test_serial/availability_test.cpp new file mode 100644 index 0000000000..2870dbfefa --- /dev/null +++ b/source/source_io/test_serial/availability_test.cpp @@ -0,0 +1,118 @@ +/// Unit tests for the INPUT availability parser. +/// +/// availability.{h,cpp} is dependency-free (only the C++ standard library), so +/// this test exercises the actual parser used by Input_Item directly. +#include "source_io/module_parameter/availability.h" +#include "source_io/module_parameter/input_item.h" + +#include "gtest/gtest.h" + +#include + +namespace ModuleIO +{ + +TEST(AvailabilityParser, LeafEqualityRoundTrip) +{ + const AvailabilityExpr e = parse_availability("basis_type==pw"); + EXPECT_TRUE(e.is_leaf()); + EXPECT_EQ(e.condition.param, "basis_type"); + EXPECT_EQ(e.condition.op, "=="); + EXPECT_EQ(e.condition.values, (std::vector{"pw"})); + EXPECT_EQ(e.to_string(), "basis_type==pw"); +} + +TEST(AvailabilityParser, InListRoundTrip) +{ + const AvailabilityExpr e = parse_availability("vdw_method in [d2, d3_0]"); + EXPECT_TRUE(e.is_leaf()); + EXPECT_EQ(e.condition.op, "in"); + EXPECT_EQ(e.condition.values, (std::vector{"d2", "d3_0"})); + EXPECT_EQ(e.to_string(), "vdw_method in [d2, d3_0]"); +} + +TEST(AvailabilityParser, ContainsVectorSemantics) +{ + // td_ttype is a Vector; "contains 2" is containment and must stay distinct + // from scalar membership "in [2]". + const AvailabilityExpr e = parse_availability("td_ttype contains 2"); + EXPECT_TRUE(e.is_leaf()); + EXPECT_EQ(e.condition.op, "contains"); + EXPECT_EQ(e.condition.values, (std::vector{"2"})); + EXPECT_EQ(e.to_string(), "td_ttype contains 2"); +} + +TEST(AvailabilityParser, AndGroup) +{ + const AvailabilityExpr e = parse_availability("basis_type==lcao and esolver_type==tddft"); + EXPECT_FALSE(e.is_leaf()); + EXPECT_EQ(e.op, "and"); + ASSERT_EQ(e.children.size(), 2u); + EXPECT_TRUE(e.children[0].is_leaf()); + EXPECT_EQ(e.children[0].condition.param, "basis_type"); + EXPECT_TRUE(e.children[1].is_leaf()); + EXPECT_EQ(e.children[1].condition.param, "esolver_type"); + EXPECT_EQ(e.to_string(), "basis_type==lcao and esolver_type==tddft"); +} + +TEST(AvailabilityParser, ParenthesisedOrNesting) +{ + // "and" binds tighter than "or"; the grouped "(A or B)" stays a sub-tree. + const AvailabilityExpr e = parse_availability( + "symmetry==1 and (dft_functional in [hse, hf] or rpa==true)"); + EXPECT_FALSE(e.is_leaf()); + EXPECT_EQ(e.op, "and"); + ASSERT_EQ(e.children.size(), 2u); + EXPECT_TRUE(e.children[0].is_leaf()); + EXPECT_EQ(e.children[0].condition.param, "symmetry"); + const AvailabilityExpr& or_node = e.children[1]; + EXPECT_FALSE(or_node.is_leaf()); + EXPECT_EQ(or_node.op, "or"); + ASSERT_EQ(or_node.children.size(), 2u); + EXPECT_EQ(or_node.children[0].condition.param, "dft_functional"); + EXPECT_EQ(or_node.children[1].condition.param, "rpa"); + EXPECT_EQ(e.to_string(), + "symmetry==1 and (dft_functional in [hse, hf] or rpa==true)"); +} + +TEST(AvailabilityParser, EmptyIsAlwaysAvailable) +{ + const AvailabilityExpr e = parse_availability(""); + EXPECT_TRUE(e.is_leaf()); + EXPECT_TRUE(e.condition.param.empty()); +} + +TEST(AvailabilityParser, InvalidExpressionsAreRejected) +{ + const char* invalid_expressions[] = { + "Only used for plane wave basis.", + " ", + "and", + " or", + "basis_type==pw or", + "a and", + " and basis_type==pw", + "basis_type==lcao and esolver_type==tddft or ", + "basis_type==pw==lcao", + "basis_type==pw)", + "(basis_type==pw", + }; + for (const char* s : invalid_expressions) + { + EXPECT_THROW(parse_availability(s), std::invalid_argument) << s; + } +} + +TEST(AvailabilityParser, SetterRejectsInvalidInputWithoutChangingState) +{ + Input_Item item("example"); + item.set_availability("basis_type==pw"); + EXPECT_EQ(item.get_availability(), "basis_type==pw"); + EXPECT_EQ(item.get_availability_expr().to_string(), "basis_type==pw"); + + EXPECT_THROW(item.set_availability("basis_type==pw and"), std::invalid_argument); + EXPECT_EQ(item.get_availability(), "basis_type==pw"); + EXPECT_EQ(item.get_availability_expr().to_string(), "basis_type==pw"); +} + +} // namespace ModuleIO