From 2ee94ed28040b0e0bf492800ca35b958160fe938 Mon Sep 17 00:00:00 2001 From: Bonan Zhu Date: Sun, 12 Jul 2026 13:49:09 +0800 Subject: [PATCH 1/6] docs: regenerate input parameters in RTD build --- .readthedocs.yaml | 34 ++++ docs/advanced/input_files/input-main.md | 259 +++++++++++++++--------- docs/generate_input_main.py | 12 +- docs/parameters.yaml | 158 +++++++++++---- 4 files changed, 327 insertions(+), 136 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index db95d725eba..8c8d52898d1 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,6 +9,40 @@ build: os: ubuntu-22.04 tools: python: "3.11" + apt_packages: + - build-essential + - cmake + - gfortran + - git + - libfftw3-dev + - liblapack-dev + - libopenblas-dev + - ninja-build + - pkg-config + jobs: + pre_build: + - > + cmake -S . -B build-rtd-docs -G Ninja + -DCMAKE_BUILD_TYPE=Release + -DENABLE_MPI=OFF + -DENABLE_LCAO=OFF + -DUSE_OPENMP=OFF + -DUSE_ELPA=OFF + -DUSE_CUDA=OFF + -DUSE_ROCM=OFF + -DBUILD_TESTING=OFF + -DENABLE_LIBXC=OFF + -DENABLE_LIBRI=OFF + -DENABLE_DFTD4=OFF + -DENABLE_RAPIDJSON=OFF + -DENABLE_MLALGO=OFF + -DENABLE_FLOAT_FFTW=OFF + -DENABLE_CNPY=OFF + -DCOMMIT_INFO=OFF + -DGIT_SUBMODULE=OFF + -DMKLROOT=OFF + - cmake --build build-rtd-docs --target abacus_pw_ser --parallel 2 + - ./build-rtd-docs/abacus_pw_ser --generate-parameters-yaml > docs/parameters.yaml # Build documentation in the "docs/" directory with Sphinx sphinx: diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index d1b5622bdd6..9ab47c87ed3 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -17,6 +17,7 @@ - [kpar](#kpar) - [bndpar](#bndpar) - [latname](#latname) + - [assume\_isolated](#assume_isolated) - [init\_wfc](#init_wfc) - [init\_chg](#init_chg) - [init\_vel](#init_vel) @@ -25,6 +26,8 @@ - [diago\_proc](#diago_proc) - [nbspline](#nbspline) - [kspacing](#kspacing) + - [koffset](#koffset) + - [kmesh\_type](#kmesh_type) - [min\_dist\_coef](#min_dist_coef) - [device](#device) - [precision](#precision) @@ -306,8 +309,6 @@ - [exx\_pca\_threshold](#exx_pca_threshold) - [exx\_c\_threshold](#exx_c_threshold) - [exx\_cs\_inv\_thr](#exx_cs_inv_thr) - - [shrink\_abfs\_pca\_thr](#shrink_abfs_pca_thr) - - [shrink\_lu\_inv\_thr](#shrink_lu_inv_thr) - [exx\_v\_threshold](#exx_v_threshold) - [exx\_dm\_threshold](#exx_dm_threshold) - [exx\_c\_grad\_threshold](#exx_c_grad_threshold) @@ -323,10 +324,6 @@ - [rpa\_ccp\_rmesh\_times](#rpa_ccp_rmesh_times) - [exx\_symmetry\_realspace](#exx_symmetry_realspace) - [out\_ri\_cv](#out_ri_cv) - - [out\_unshrinked\_v](#out_unshrinked_v) - - [exx\_coul\_moment](#exx_coul_moment) - - [exx\_rotate\_abfs](#exx_rotate_abfs) - - [exx\_multip\_moments\_threshold](#exx_multip_moments_threshold) - [Exact Exchange (PW)](#exact-exchange-pw) - [exxace](#exxace) - [exx\_gamma\_extrapolation](#exx_gamma_extrapolation) @@ -393,11 +390,15 @@ - [sc\_thr](#sc_thr) - [nsc](#nsc) - [nsc\_min](#nsc_min) - - [sc\_scf\_nmin](#sc_scf_nmin) - [alpha\_trial](#alpha_trial) - [sccut](#sccut) - [sc\_drop\_thr](#sc_drop_thr) - [sc\_scf\_thr](#sc_scf_thr) + - [sc\_direction\_only](#sc_direction_only) + - [sc\_lambda\_strategy](#sc_lambda_strategy) + - [sc\_scan\_lambda\_start](#sc_scan_lambda_start) + - [sc\_scan\_lambda\_end](#sc_scan_lambda_end) + - [sc\_scan\_steps](#sc_scan_steps) - [vdW correction](#vdw-correction) - [vdw\_method](#vdw_method) - [vdw\_d4\_xc](#vdw_d4_xc) @@ -665,6 +666,19 @@ - triclinic: triclinic - **Default**: none +### assume_isolated + +- **Type**: String +- **Description**: Used to perform a calculation assuming an isolated system in a 3D supercell. + + Available options are: + + - none: regular periodic calculation without isolated-system correction. + - makov-payne, m-p, mp: compute the Makov-Payne correction to the total energy and estimate a corrected vacuum level for eigenvalue alignment. This option is available only for cubic lattices (latname = sc, fcc, or bcc). + + Theory: G. Makov and M. C. Payne, Phys. Rev. B 51, 4014 (1995). +- **Default**: none + ### init_wfc - **Type**: String @@ -739,6 +753,18 @@ > Note: If gamma_only is set to be true, kspacing is invalid. - **Default**: 0.0 +### koffset + +- **Type**: Vector of Real (3 values) +- **Description**: Set offsets for automatic k-point mesh generated by kspacing, in each reciprocal direction. This parameter is only effective when kspacing > 0.0 and gamma_only is false. +- **Default**: 0.0 0.0 0.0 + +### kmesh_type + +- **Type**: String +- **Description**: Set mesh type used for automatic k-point mesh generated by kspacing. Available options are gamma and mp. This parameter is only effective when kspacing > 0.0 and gamma_only is false. +- **Default**: gamma + ### min_dist_coef - **Type**: Real @@ -770,7 +796,7 @@ ### gint_precision - **Type**: String -- **Availability**: *Used only for LCAO basis set on CPU.* +- **Availability**: *Used only for LCAO basis set.* - **Description**: Specifies the precision when performing grid integral in LCAO calculations. - single: single precision - double: double precision @@ -1115,7 +1141,7 @@ - cg: The conjugate-gradient (CG) method. - bpcg: The BPCG method, which is a block-parallel Conjugate Gradient (CG) method, typically exhibits higher acceleration in a GPU environment. - dav: The Davidson algorithm. - - dav_subspace: The Davidson algorithm without orthogonalization operation, this method is the most recommended for efficiency. pw_diag_ndim can be set to 2 for this method. + - dav_subspace: The Davidson algorithm without orthogonalization operation, this method is the most recommended for efficiency. `pw_diag_ndim` can be set to 2 for this method. For numerical atomic orbitals basis, @@ -1124,13 +1150,20 @@ - scalapack_gvx: Use Scalapack to diagonalize the Hamiltonian. - cusolver: Use CUSOLVER to diagonalize the Hamiltonian, at least one GPU is needed. - cusolvermp: Use CUSOLVER to diagonalize the Hamiltonian, supporting multi-GPU devices. Note that you should set the number of MPI processes equal to the number of GPUs. - - elpa: The ELPA solver supports both CPU and GPU. By setting the device to GPU, you can launch the ELPA solver with GPU acceleration (provided that you have installed a GPU-supported version of ELPA, which requires you to manually compile and install ELPA, and the ABACUS should be compiled with -DUSE_ELPA=ON and -DUSE_CUDA=ON). The ELPA solver also supports multi-GPU acceleration. + - elpa: The ELPA solver supports both CPU and GPU. By setting the `device` to GPU, you can launch the ELPA solver with GPU acceleration (provided that you have installed a GPU-supported version of ELPA, which requires you to manually compile and install ELPA, and the ABACUS should be compiled with -DUSE_ELPA=ON and -DUSE_CUDA=ON). The ELPA solver also supports multi-GPU acceleration. - If you set ks_solver=genelpa for basis_type=pw, the program will stop with an error message: + If you set ks_solver=`genelpa` for basis_type=`pw`, the program will stop with an error message: ``text genelpa can not be used with plane wave basis. `` Then the user has to correct the input file and restart the calculation. +- **Default**: + - PW basis: cg. + - LCAO basis: + - genelpa (if compiling option `USE_ELPA` has been set) + - lapack (if compiling option `ENABLE_MPI` has not been set) + - scalapack_gvx (if compiling option `USE_ELPA` has not been set and compiling option `ENABLE_MPI` has been set) + - cusolver (if compiling option `USE_CUDA` has been set) ### nbands @@ -1367,14 +1400,14 @@ ### scf_thr - **Type**: Real -- **Description**: It's the density threshold for electronic iteration. It represents the charge density error between two sequential densities from electronic iterations. This criterion is always enabled. If `scf_ene_thr` is set, its total-energy criterion is applied as an additional convergence check only after the charge-density criterion (`scf_thr`) has been satisfied, and only from the second SCF iteration onward (`iter > 1`). For local-orbital calculations, 1e-6 is usually accurate enough. +- **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. - **Default**: 1.0e-9 (plane-wave basis), or 1.0e-7 (localized atomic orbital basis). - **Unit**: Ry if scf_thr_type=1, dimensionless if scf_thr_type=2 ### scf_ene_thr - **Type**: Real -- **Description**: It's the energy threshold for electronic iteration. The compared quantity is the total-energy difference evaluated from the charge densities before and after the `Hpsi` operation in one SCF step. It is not the same as the screen-output `EDIFF`, which is the energy difference before `Hpsi` and after charge mixing (i.e., across both `Hpsi` and charge-mixing operations). +- **Description**: It's the energy threshold for electronic iteration. It represents the total energy error between two sequential densities from electronic iterations. - **Default**: -1.0. If the user does not set this parameter, it will not take effect. - **Unit**: eV @@ -1778,7 +1811,29 @@ - **Type**: Integer \[Integer\](optional) - **Description**: The first integer controls whether to output the charge density on real space grids: - - 1: Output the charge density (in Bohr^-3) on real space grids into the density files in the folder OUT.{suffix} too, which can be read in NSCF calculation. + - 1: Output the charge density (in Bohr^-3) on real space grids into the density files in the folder `OUT.${suffix}`. The files are named as: + - nspin = 1: `chg.cube`; + - nspin = 2: `chgs1.cube`, and `chgs2.cube`; + - nspin = 4: `chgs1.cube`, `chgs2.cube`, `chgs3.cube`, and `chgs4.cube`; + - When using the Meta-GGA functional, additional files containing the kinetic energy density are also output: + - nspin = 1: `tau.cube`; + - nspin = 2: `taus1.cube`, and `taus2.cube`; + - nspin = 4: `taus1.cube`, `taus2.cube`, `taus3.cube`, and `taus4.cube`; + - 2: On top of 1, also output the initial charge density files. The files are named as: + - out_freq_ion = 0: + - nspin = 1: `chg_ini.cube`; + - nspin = 2: `chgs1_ini.cube` and `chgs2_ini.cube`; + - nspin = 4: `chgs1_ini.cube`, `chgs2_ini.cube`, `chgs3_ini.cube`, and `chgs4_ini.cube`; + - output at every step (overwrite same file) + - out_freq_ion > 0: + - nspin = 1: `chgg{geom_step}_ini.cube` (e.g., `chgg1_ini.cube`); + - nspin = 2: `chgs1g{geom_step}_ini.cube` and `chgs2g{geom_step}_ini.cube`; + - nspin = 4: `chgs1g{geom_step}_ini.cube`, `chgs2g{geom_step}_ini.cube`, `chgs3g{geom_step}_ini.cube`, and `chgs4g{geom_step}_ini.cube`. + - output every out_freq_ion steps + Here, {geom_step} denotes the geometry step index, starting from 1 (geom_step = istep + 1). + - -1: Disable the charge density auto-back-up file `{suffix}-CHARGE-DENSITY.restart`, useful for large systems. + + The second integer controls the precision of the charge density output. If not given, `3` is used as default. For restarting from this file and other high-precision calculations, `10` is recommended. In molecular dynamics simulations, the output frequency is controlled by out_freq_ion. @@ -1794,9 +1849,17 @@ - nspin = 4: pots1.cube, pots2.cube, pots3.cube, and pots4.cube - 2: Output the electrostatic potential on real space grids into OUT.{suffix}/pot_es.cube. The Python script named tools/02_postprocessing/average_pot/aveElecStatPot.py can be used to calculate the average electrostatic potential along the z-axis and outputs it into ElecStaticPot_AVE. Please note that the total local potential refers to the local component of the self-consistent potential, excluding the non-local pseudopotential. The distinction between the local potential and the electrostatic potential is as follows: local potential = electrostatic potential + XC potential. - 3: Apart from 1, also output the total local potential of the initial charge density. The files are named as: - - nspin = 1: pots1_ini.cube; - - nspin = 2: pots1_ini.cube and pots2_ini.cube; - - nspin = 4: pots1_ini.cube, pots2_ini.cube, pots3_ini.cube, and pots4_ini.cube + - out_freq_ion = 0: + - nspin = 1: `pot_ini.cube`; + - nspin = 2: `pots1_ini.cube` and `pots2_ini.cube`; + - nspin = 4: `pots1_ini.cube`, `pots2_ini.cube`, `pots3_ini.cube`, and `pots4_ini.cube`; + - output at every step (overwrite same file) + - out_freq_ion > 0: + - nspin = 1: `potg{geom_step}_ini.cube` (e.g., `potg1_ini.cube`); + - nspin = 2: `pots1g{geom_step}_ini.cube` and `pots2g{geom_step}_ini.cube`; + - nspin = 4: `pots1g{geom_step}_ini.cube`, `pots2g{geom_step}_ini.cube`, `pots3g{geom_step}_ini.cube`, and `pots4g{geom_step}_ini.cube`. + - output every out_freq_ion steps + Here, {geom_step} denotes the geometry step index, starting from 1 (geom_step = istep + 1). The optional second integer controls the output precision. If not provided, the default precision is 8. @@ -1810,19 +1873,18 @@ - **Type**: Boolean \[Integer\](optional) - **Availability**: *Numerical atomic orbital basis* - **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; - - nspin = 2: dms1g1_nao.txt and dms2g1_nao.txt for the two spin channels. - - For multi-k points case: - - nspin = 1 and 4: dmk1g1_nao.txt, dmk2g1_nao.txt, ...; - - nspin = 2: dmk1s1g1_nao.txt... and dmk1s2g1_nao.txt... for the two spin channels. - - Here, g{istep} denotes the geometry/step index in the output file name. - - > Note: Version difference (develop vs 3.10-LTS): - > - > - In develop, out_dmk supports both gamma-only and multi-k-point density-matrix output. - > - In 3.10-LTS, the corresponding keyword is out_dm, and the output files are SPIN1_DM and SPIN2_DM, etc. + - For gamma only case: + - nspin = 1 and 4: dmg1_nao.txt; + - nspin = 2: dms1g1_nao.txt and dms2g1_nao.txt for the two spin channels. + - For multi-k points case: + - nspin = 1 and 4: dmk1g1_nao.txt, dmk2g1_nao.txt, ...; + - nspin = 2: dmk1s1g1_nao.txt... and dmk1s2g1_nao.txt... for the two spin channels. + + Here, g{istep} denotes the geometry/step index in the output file name. + + > Note: Version difference (develop vs 3.10-LTS): + - In develop, out_dmk supports both gamma-only and multi-k-point density-matrix output. + - In 3.10-LTS, the corresponding keyword is out_dm, and the output files are SPIN1_DM and SPIN2_DM, etc. - **Default**: False ### out_dmr @@ -2057,7 +2119,7 @@ - **Type**: Boolean - **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* -- **Description**: Whether to print Hamiltonian matrices H(R) in npz format. The output files are named output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. +- **Description**: Whether to print Hamiltonian matrices H(R) in npz format. This feature does not work for gamma-only calculations. - **Default**: False - **Unit**: Ry @@ -2065,14 +2127,15 @@ - **Type**: Boolean - **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* -- **Description**: Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. The output files are named output_SR.npz, output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. +- **Description**: Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. This feature does not work for gamma-only calculations. - **Default**: False +- **Unit**: Ry ### out_dm_npz - **Type**: Boolean - **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* -- **Description**: Whether to print density matrices DM(R) in npz format. The output files are named output_DM0.npz, output_DM1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. +- **Description**: Whether to print density matrices DM(R) in npz format. This feature does not work for gamma-only calculations. - **Default**: False ### out_mul @@ -2154,12 +2217,14 @@ - **Availability**: *Only for Kohn-Sham DFT and Orbital Free DFT.* - **Description**: Whether to output the electron localization function (ELF) in the folder `OUT.${suffix}`. The files are named as - nspin = 1: - - elf.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}}$; + - 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}}$; - nspin = 2: - - elf1.cube, elf2.cube: ${\rm{ELF}}_\sigma = \frac{1}{1+\chi_\sigma^2}$, $\chi_\sigma = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i,\sigma}|^2} - \frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}$; - - elf.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i,\sigma}{f_i |\nabla\psi_{i,\sigma}|^2} - \sum_{\sigma}{\frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}}{\sum_{\sigma}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}}$; + - elfs1.cube, elfs2.cube: ${\rm{ELF}}_\sigma = \frac{1}{1+\chi_\sigma^2}$, $\chi_\sigma = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i,\sigma}|^2} - \frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}$; + - elftot.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i,\sigma}{f_i |\nabla\psi_{i,\sigma}|^2} - \sum_{\sigma}{\frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}}{\sum_{\sigma}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}}$; - nspin = 4 (noncollinear): - - elf.cube: ELF for total charge density, ${\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}}$ + - elftot.cube: ELF for total charge density, ${\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}}$ + + When `out_freq_ion > 0`, a geometry step suffix `g{#}` is appended to the file names (e.g., `elftotg1.cube`, `elfs1g1.cube`). The second integer controls the precision of the kinetic energy density output, if not given, will use 3 as default. For purpose restarting from this file and other high-precision involved calculation, recommend to use 10. @@ -2429,9 +2494,9 @@ - tf: Thomas-Fermi (TF) functional - vw: von Weizsacker (vW) functional - tf+: TF + vW functional - - wt: Wang-Teter (WT) functional (supports GPU acceleration when device=gpu) - - ext-wt: Extended Wang-Teter (ext-WT) functional - - xwm: Xu-Wang-Ma (XWM) functional + - wt: Wang-Teter (WT) functional + - ext-wt: Extended Wang-Teter functional + - xwm: XWM functional - lkt: Luo-Karasiev-Trickey (LKT) functional - ml: Machine learning KEDF - mpn: MPN KEDF (automatically sets ml parameters) @@ -2505,7 +2570,7 @@ - **Type**: Real - **Availability**: *OFDFT with of_kinetic=ext-wt* - **Description**: Parameter kappa for EXT-WT KEDF. -- **Default**: $\dfrac{1}{2(4/3)^{1/3}-1} \approx 0.832$ +- **Default**: 1.0 / (2.0 * std::pow(4./3., 1./3.) - 1.0) ### of_wt_rho0 @@ -3005,18 +3070,6 @@ - **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. - **Default**: -1 -### shrink_abfs_pca_thr - -- **Type**: Real -- **Description**: Threshold to shrink the auxiliary basis for GW/RPA calculations. -- **Default**: -1 - -### shrink_lu_inv_thr - -- **Type**: Real -- **Description**: Threshold for obtaining the inverse of the overlap matrix by LU decomposition in the auxiliary-basis representation. -- **Default**: 1e-6 - ### exx_v_threshold - **Type**: Real @@ -3114,30 +3167,6 @@ - **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. - **Default**: false -### out_unshrinked_v - -- **Type**: Boolean -- **Description**: Whether to output the large Vq matrix in the unshrinked auxiliary basis. -- **Default**: false - -### exx_coul_moment - -- **Type**: Boolean -- **Description**: Whether to use the moment method for Coulomb calculation. -- **Default**: false - -### exx_rotate_abfs - -- **Type**: Boolean -- **Description**: Whether to rotate the auxiliary basis for Coulomb calculation. -- **Default**: false - -### exx_multip_moments_threshold - -- **Type**: Real -- **Description**: Threshold to screen multipole moments in Coulomb calculation. -- **Default**: 1e-10 - [back to top](#full-list-of-input-keywords) ## Exact Exchange (PW) @@ -3220,7 +3249,6 @@ - berendsen: Berendsen thermostat, see md_nraise in detail. - rescaling: velocity Rescaling method 1, see md_tolerance in detail. - rescale_v: velocity Rescaling method 2, see md_nraise in detail. - - csvr: Canonical Sampling through Velocity Rescaling, see md_csvr_tau in detail. - **Default**: nhc ### md_tfirst @@ -3475,7 +3503,8 @@ ### md_csvr_tau - **Type**: Real -- **Description**: The characteristic time scale for the CSVR (Canonical Sampling through Velocity Rescaling) thermostat. Larger values give weaker coupling (longer relaxation time), smaller values give stronger coupling (shorter relaxation time). Recommended value: 100 * md_dt. +- **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 @@ -3496,9 +3525,13 @@ ### cal_syns -- **Type**: Boolean +- **Type**: Boolean [Integer](optional) - **Description**: Whether to calculate and output asynchronous overlap matrix for Hefei-NAMD interface. When enabled, calculates <phi(t-1)|phi(t)> by computing overlap between basis functions at atomic positions from previous time step and current time step. The overlap is calculated by shifting atom positions backward by velocity x md_dt. Output file: OUT.*/syns_nao.csr in CSR format. + - 0 or false: disable + - 1 or true: enable with default precision (8 digits) + - 1 5: enable with custom precision (5 digits) + > Note: Only works with LCAO basis and molecular dynamics calculations. Requires atomic velocities. Output starts from the second MD step (istep > 0). - **Default**: False @@ -3628,13 +3661,6 @@ - **Description**: Minimum number of spin-constrained iteration - **Default**: 2 -### sc_scf_nmin - -- **Type**: Integer -- **Availability**: *sc_mag_switch is true* -- **Description**: Minimum number of outer scf loop before initializing lambda loop -- **Default**: 2 - ### alpha_trial - **Type**: Real @@ -3665,6 +3691,50 @@ - **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* +- **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. +- **Default**: False + +### sc_lambda_strategy + +- **Type**: String +- **Availability**: *sc_mag_switch is true* +- **Description**: Lambda update strategy for spin-constrained DFT: + - bfgs: BFGS quasi-Newton method + - linear_response: linear response (Scheme B) + - augmented_lagrangian: augmented Lagrangian (Scheme C) + - hybrid_delayed: hybrid delayed update (Scheme D) + - linear_scan: linear sweep of lambda for testing magnetic moment response +- **Default**: bfgs + +### sc_scan_lambda_start + +- **Type**: Float +- **Availability**: *sc_lambda_strategy is linear_scan* +- **Description**: Starting lambda value for linear_scan strategy. Only used when sc_lambda_strategy=linear_scan. +- **Default**: 0.0 +- **Unit**: eV/uB + +### sc_scan_lambda_end + +- **Type**: Float +- **Availability**: *sc_lambda_strategy is linear_scan* +- **Description**: Ending lambda value for linear_scan strategy. Only used when sc_lambda_strategy=linear_scan. +- **Default**: 1.0 +- **Unit**: eV/uB + +### sc_scan_steps + +- **Type**: Integer +- **Availability**: *sc_lambda_strategy is linear_scan* +- **Description**: Number of lambda values to scan. Only used when sc_lambda_strategy=linear_scan. +- **Default**: 20 + [back to top](#full-list-of-input-keywords) ## vdW correction @@ -3680,22 +3750,25 @@ - none: no vdW correction > 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. - - > Note: DFT-D4 support requires ABACUS to be configured with ENABLE_DFTD4=ON and a CMake-installed dftd4 library exporting dftd4-config.cmake. DFT-D4 damping parameters are loaded from the external library. - **Default**: none ### vdw_d4_xc - **Type**: String - **Availability**: *vdw_method is set to d4* -- **Description**: Functional name passed to the DFT-D4 library to load its internal damping parameters. If set to default, ABACUS infers the functional name from dft_functional or pseudopotential metadata. +- **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 ### vdw_d4_model - **Type**: String - **Availability**: *vdw_method is set to d4* -- **Description**: DFT-D4 dispersion model used by the external DFT-D4 library. Available options are d4 for the standard D4 model and d4s for the smooth D4S model. +- **Description**: DFT-D4 dispersion model used by the external DFT-D4 library. + Available options are: + + - d4: standard D4 model + - d4s: smooth D4S model - **Default**: d4 ### vdw_s6 @@ -3790,7 +3863,7 @@ - **Type**: String - **Availability**: *vdw_cutoff_type is set to radius* -- **Description**: Defines the cutoff radius when vdw_cutoff_type is set to radius. The default values depend on the chosen vdw_method. For DFT-D4, this controls the two-body dispersion cutoff, while the three-body cutoff is internally limited to the DFT-D4 default value of 40 Bohr. +- **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 @@ -3813,7 +3886,7 @@ - **Type**: Real - **Availability**: *vdw_method is set to d3_0, d3_bj, or d4* -- **Description**: The cutoff radius when calculating coordination numbers. The default is 40 Bohr for DFT-D3 and 30 Bohr for DFT-D4. +- **Description**: The cutoff radius when calculating coordination numbers. - **Default**: 40 - **Unit**: defined by vdw_cn_thr_unit (default: Bohr) diff --git a/docs/generate_input_main.py b/docs/generate_input_main.py index 16a9e398bbe..4e138034d7f 100644 --- a/docs/generate_input_main.py +++ b/docs/generate_input_main.py @@ -173,8 +173,16 @@ def generate_parameter_markdown(param: Dict[str, str]) -> str: # Default if param.get('default_value', '') != '': - default_text = escape_md_text(str(param['default_value'])) - lines.append(f"- **Default**: {default_text}") + default_text = escape_md_text(str(param['default_value'])).strip('\n') + if '\n' in default_text: + lines.append("- **Default**:") + for line in default_text.split('\n'): + if line.strip(): + lines.append(f" {line}" if not line.startswith(' ') else line) + else: + lines.append("") + else: + lines.append(f"- **Default**: {default_text}") # Unit if param.get('unit', '') != '': diff --git a/docs/parameters.yaml b/docs/parameters.yaml index 02820d175d4..66f9c614321 100644 --- a/docs/parameters.yaml +++ b/docs/parameters.yaml @@ -137,6 +137,20 @@ parameters: default_value: none unit: "" availability: "" + - name: assume_isolated + category: System variables + type: String + description: | + Used to perform a calculation assuming an isolated system in a 3D supercell. + + Available options are: + * none: regular periodic calculation without isolated-system correction. + * makov-payne, m-p, mp: compute the Makov-Payne correction to the total energy and estimate a corrected vacuum level for eigenvalue alignment. This option is available only for cubic lattices (latname = sc, fcc, or bcc). + + Theory: G. Makov and M. C. Payne, Phys. Rev. B 51, 4014 (1995). + default_value: none + unit: "" + availability: "" - name: init_wfc category: System variables type: String @@ -823,7 +837,7 @@ parameters: category: Electronic structure type: Real description: | - It's the density threshold for electronic iteration. It represents the charge density error between two sequential densities from electronic iterations. This criterion is always enabled. If `scf_ene_thr` is set, the total-energy criterion (`scf_ene_thr`) is evaluated conditionally after the charge-density criterion (`scf_thr`) is satisfied, and not on the first iteration. For local-orbital calculations, 1e-6 is usually accurate enough. + 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. default_value: "1.0e-9 (plane-wave basis), or 1.0e-7 (localized atomic orbital basis)." unit: "Ry if scf_thr_type=1, dimensionless if scf_thr_type=2" availability: "" @@ -831,7 +845,7 @@ parameters: category: Electronic structure type: Real description: | - It's the energy threshold for electronic iteration. The compared quantity is the total-energy difference evaluated from the charge densities before and after the `Hpsi` operation in one SCF step. It is not the same as the screen-output `EDIFF`, which is the energy difference before `Hpsi` and after charge mixing (i.e., across both `Hpsi` and charge-mixing operations). + It's the energy threshold for electronic iteration. It represents the total energy error between two sequential densities from electronic iterations. default_value: "-1.0. If the user does not set this parameter, it will not take effect." unit: eV availability: "" @@ -1379,7 +1393,6 @@ parameters: * berendsen: Berendsen thermostat, see md_nraise in detail. * rescaling: velocity Rescaling method 1, see md_tolerance in detail. * rescale_v: velocity Rescaling method 2, see md_nraise in detail. - * csvr: Canonical Sampling through Velocity Rescaling, see md_csvr_tau in detail. default_value: nhc unit: "" availability: "" @@ -2857,7 +2870,18 @@ parameters: - nspin = 1: `tau.cube`; - nspin = 2: `taus1.cube`, and `taus2.cube`; - nspin = 4: `taus1.cube`, `taus2.cube`, `taus3.cube`, and `taus4.cube`; - - 2: On top of 1, also output the initial charge density files with a suffix name as '_ini', such as `taus1_ini.cube`, etc. + - 2: On top of 1, also output the initial charge density files. The files are named as: + - out_freq_ion = 0: + - nspin = 1: `chg_ini.cube`; + - nspin = 2: `chgs1_ini.cube` and `chgs2_ini.cube`; + - nspin = 4: `chgs1_ini.cube`, `chgs2_ini.cube`, `chgs3_ini.cube`, and `chgs4_ini.cube`; + - output at every step (overwrite same file) + - out_freq_ion > 0: + - nspin = 1: `chgg{geom_step}_ini.cube` (e.g., `chgg1_ini.cube`); + - nspin = 2: `chgs1g{geom_step}_ini.cube` and `chgs2g{geom_step}_ini.cube`; + - nspin = 4: `chgs1g{geom_step}_ini.cube`, `chgs2g{geom_step}_ini.cube`, `chgs3g{geom_step}_ini.cube`, and `chgs4g{geom_step}_ini.cube`. + - output every out_freq_ion steps + Here, {geom_step} denotes the geometry step index, starting from 1 (geom_step = istep + 1). - -1: Disable the charge density auto-back-up file `{suffix}-CHARGE-DENSITY.restart`, useful for large systems. The second integer controls the precision of the charge density output. If not given, `3` is used as default. For restarting from this file and other high-precision calculations, `10` is recommended. @@ -2878,9 +2902,17 @@ parameters: * nspin = 4: pots1.cube, pots2.cube, pots3.cube, and pots4.cube * 2: Output the electrostatic potential on real space grids into OUT.{suffix}/pot_es.cube. The Python script named tools/02_postprocessing/average_pot/aveElecStatPot.py can be used to calculate the average electrostatic potential along the z-axis and outputs it into ElecStaticPot_AVE. Please note that the total local potential refers to the local component of the self-consistent potential, excluding the non-local pseudopotential. The distinction between the local potential and the electrostatic potential is as follows: local potential = electrostatic potential + XC potential. * 3: Apart from 1, also output the total local potential of the initial charge density. The files are named as: - * nspin = 1: pots1_ini.cube; - * nspin = 2: pots1_ini.cube and pots2_ini.cube; - * nspin = 4: pots1_ini.cube, pots2_ini.cube, pots3_ini.cube, and pots4_ini.cube + * out_freq_ion = 0: + * nspin = 1: `pot_ini.cube`; + * nspin = 2: `pots1_ini.cube` and `pots2_ini.cube`; + * nspin = 4: `pots1_ini.cube`, `pots2_ini.cube`, `pots3_ini.cube`, and `pots4_ini.cube`; + * output at every step (overwrite same file) + * out_freq_ion > 0: + * nspin = 1: `potg{geom_step}_ini.cube` (e.g., `potg1_ini.cube`); + * nspin = 2: `pots1g{geom_step}_ini.cube` and `pots2g{geom_step}_ini.cube`; + * nspin = 4: `pots1g{geom_step}_ini.cube`, `pots2g{geom_step}_ini.cube`, `pots3g{geom_step}_ini.cube`, and `pots4g{geom_step}_ini.cube`. + * output every out_freq_ion steps + Here, {geom_step} denotes the geometry step index, starting from 1 (geom_step = istep + 1). The optional second integer controls the output precision. If not provided, the default precision is 8. @@ -2895,17 +2927,18 @@ parameters: type: "Boolean \\[Integer\\](optional)" 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; - * nspin = 2: dms1g1_nao.txt and dms2g1_nao.txt for the two spin channels. - * For multi-k points case: - * nspin = 1 and 4: dmk1g1_nao.txt, dmk2g1_nao.txt, ...; - * nspin = 2: dmk1s1g1_nao.txt... and dmk1s2g1_nao.txt... for the two spin channels. - Here, g{istep} denotes the geometry/step index in the output file name. + * For gamma only case: + * nspin = 1 and 4: dmg1_nao.txt; + * nspin = 2: dms1g1_nao.txt and dms2g1_nao.txt for the two spin channels. + * For multi-k points case: + * nspin = 1 and 4: dmk1g1_nao.txt, dmk2g1_nao.txt, ...; + * nspin = 2: dmk1s1g1_nao.txt... and dmk1s2g1_nao.txt... for the two spin channels. + + Here, g{istep} denotes the geometry/step index in the output file name. - [NOTE] Version difference (develop vs 3.10-LTS): - * In develop, out_dmk supports both gamma-only and multi-k-point density-matrix output. - * In 3.10-LTS, the corresponding keyword is out_dm, and the output files are SPIN1_DM and SPIN2_DM, etc. + [NOTE] Version difference (develop vs 3.10-LTS): + * In develop, out_dmk supports both gamma-only and multi-k-point density-matrix output. + * 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 @@ -3160,7 +3193,7 @@ parameters: category: Output information type: Boolean description: | - Whether to print Hamiltonian matrices H(R) in npz format. The output files are named output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. + Whether to print Hamiltonian matrices H(R) in npz format. This feature does not work for gamma-only calculations. default_value: "False" unit: Ry availability: Numerical atomic orbital basis (not gamma-only algorithm) @@ -3168,15 +3201,15 @@ parameters: category: Output information type: Boolean description: | - Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. The output files are named output_SR.npz, output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. + Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. This feature does not work for gamma-only calculations. default_value: "False" - unit: "" + unit: Ry availability: Numerical atomic orbital basis (not gamma-only algorithm) - name: out_dm_npz category: Output information type: Boolean description: | - Whether to print density matrices DM(R) in npz format. The output files are named output_DM0.npz, output_DM1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. + 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) @@ -3271,12 +3304,14 @@ parameters: description: | Whether to output the electron localization function (ELF) in the folder `OUT.${suffix}`. The files are named as * nspin = 1: - * elf.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}}$; + * 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}}$; * nspin = 2: - * elf1.cube, elf2.cube: ${\rm{ELF}}_\sigma = \frac{1}{1+\chi_\sigma^2}$, $\chi_\sigma = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i,\sigma}|^2} - \frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}$; - * elf.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i,\sigma}{f_i |\nabla\psi_{i,\sigma}|^2} - \sum_{\sigma}{\frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}}{\sum_{\sigma}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}}$; + * elfs1.cube, elfs2.cube: ${\rm{ELF}}_\sigma = \frac{1}{1+\chi_\sigma^2}$, $\chi_\sigma = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i,\sigma}|^2} - \frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}$; + * elftot.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i,\sigma}{f_i |\nabla\psi_{i,\sigma}|^2} - \sum_{\sigma}{\frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}}{\sum_{\sigma}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}}$; * nspin = 4 (noncollinear): - * elf.cube: ELF for total charge density, ${\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}}$ + * elftot.cube: ELF for total charge density, ${\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}}$ + + When `out_freq_ion > 0`, a geometry step suffix `g{#}` is appended to the file names (e.g., `elftotg1.cube`, `elfs1g1.cube`). The second integer controls the precision of the kinetic energy density output, if not given, will use 3 as default. For purpose restarting from this file and other high-precision involved calculation, recommend to use 10. @@ -3775,8 +3810,6 @@ parameters: * none: no vdW correction [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. - - [NOTE] DFT-D4 support requires ABACUS to be configured with ENABLE_DFTD4=ON and a CMake-installed dftd4 library exporting `dftd4-config.cmake`. DFT-D4 damping parameters are loaded from the external library. default_value: none unit: "" availability: "" @@ -3784,7 +3817,8 @@ parameters: category: vdW correction type: String description: | - Functional name passed to the DFT-D4 library to load its internal damping parameters. If set to default, ABACUS infers the functional name from dft_functional or pseudopotential metadata. + 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_value: default unit: "" availability: vdw_method is set to d4 @@ -3792,8 +3826,11 @@ parameters: category: vdW correction type: String description: | - DFT-D4 dispersion model used by the external DFT-D4 library. Available options are d4 for the standard D4 model and d4s for the smooth D4S model. - default_value: d4 + DFT-D4 dispersion model used by the external DFT-D4 library. + Available options are: + * d4: standard D4 model + * d4s: smooth D4S model + default_value: "d4" unit: "" availability: vdw_method is set to d4 - name: vdw_s6 @@ -3904,7 +3941,7 @@ parameters: category: vdW correction type: String description: | - Defines the cutoff radius when vdw_cutoff_type is set to radius. The default values depend on the chosen vdw_method. For DFT-D4, this controls the two-body dispersion cutoff, while the three-body cutoff is internally limited to the DFT-D4 default value of 40 Bohr. + 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 @@ -3930,10 +3967,10 @@ parameters: category: vdW correction type: Real description: | - The cutoff radius when calculating coordination numbers. The default is 40 Bohr for DFT-D3 and 30 Bohr for DFT-D4. + 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 is set to d3_0, d3_bj, or d4" - name: vdw_cn_thr_unit category: vdW correction type: String @@ -4278,14 +4315,6 @@ parameters: default_value: "2" unit: "" availability: sc_mag_switch is true - - name: sc_scf_nmin - category: Spin-Constrained DFT - type: Integer - description: | - Minimum number of outer scf loop before initializing lambda loop - default_value: "2" - unit: "" - availability: sc_mag_switch is true - name: alpha_trial category: Spin-Constrained DFT type: Real @@ -4318,6 +4347,53 @@ parameters: default_value: "1.0e-4" unit: "" availability: sc_mag_switch is true + - name: sc_direction_only + category: Spin-Constrained DFT + type: Boolean + 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. + default_value: "False" + unit: "" + availability: sc_mag_switch is true + - name: sc_lambda_strategy + category: Spin-Constrained DFT + type: String + description: | + Lambda update strategy for spin-constrained DFT: + * bfgs: BFGS quasi-Newton method + * linear_response: linear response (Scheme B) + * augmented_lagrangian: augmented Lagrangian (Scheme C) + * hybrid_delayed: hybrid delayed update (Scheme D) + * linear_scan: linear sweep of lambda for testing magnetic moment response + default_value: bfgs + unit: "" + availability: sc_mag_switch is true + - name: sc_scan_lambda_start + category: Spin-Constrained DFT + type: Float + description: | + 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 + - name: sc_scan_lambda_end + category: Spin-Constrained DFT + type: Float + description: | + 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 + - name: sc_scan_steps + category: Spin-Constrained DFT + type: Integer + description: | + 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 - name: qo_switch category: Quasiatomic Orbital (QO) analysis type: Boolean From 4c3d43bf6d8f77bf6109a80e75ac63a0611c5563 Mon Sep 17 00:00:00 2001 From: Bonan Zhu Date: Sun, 12 Jul 2026 14:23:27 +0800 Subject: [PATCH 2/6] docs: preserve generated INPUT metadata --- .readthedocs.yaml | 2 +- docs/advanced/input_files/input-main.md | 49 ++++++++++++++++- docs/parameters.yaml | 55 ++++++++++++++++++- .../read_input_item_exx_dftu.cpp | 36 ++++++++++++ .../module_parameter/read_input_item_md.cpp | 3 +- .../read_input_item_output.cpp | 6 +- 6 files changed, 140 insertions(+), 11 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 8c8d52898d1..6253a4466ef 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -42,7 +42,7 @@ build: -DGIT_SUBMODULE=OFF -DMKLROOT=OFF - cmake --build build-rtd-docs --target abacus_pw_ser --parallel 2 - - ./build-rtd-docs/abacus_pw_ser --generate-parameters-yaml > docs/parameters.yaml + - ./build-rtd-docs/source/abacus_pw_ser --generate-parameters-yaml > docs/parameters.yaml # Build documentation in the "docs/" directory with Sphinx sphinx: diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index a1c0496f93e..1db92d43d7d 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -336,6 +336,12 @@ - [rpa\_ccp\_rmesh\_times](#rpa_ccp_rmesh_times) - [exx\_symmetry\_realspace](#exx_symmetry_realspace) - [out\_ri\_cv](#out_ri_cv) + - [out\_unshrinked\_v](#out_unshrinked_v) + - [exx\_coul\_moment](#exx_coul_moment) + - [exx\_rotate\_abfs](#exx_rotate_abfs) + - [exx\_multip\_moments\_threshold](#exx_multip_moments_threshold) + - [shrink\_abfs\_pca\_thr](#shrink_abfs_pca_thr) + - [shrink\_lu\_inv\_thr](#shrink_lu_inv_thr) - [Exact Exchange (PW)](#exact-exchange-pw) - [exxace](#exxace) - [exx\_gamma\_extrapolation](#exx_gamma_extrapolation) @@ -2247,7 +2253,7 @@ - **Type**: Boolean - **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* -- **Description**: Whether to print Hamiltonian matrices H(R) in npz format. This feature does not work for gamma-only calculations. +- **Description**: Whether to print Hamiltonian matrices H(R) in npz format. The output files are named output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. - **Default**: False - **Unit**: Ry @@ -2255,7 +2261,7 @@ - **Type**: Boolean - **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* -- **Description**: Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. This feature does not work for gamma-only calculations. +- **Description**: Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. The output files are named output_SR.npz, output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. - **Default**: False - **Unit**: Ry @@ -2263,7 +2269,7 @@ - **Type**: Boolean - **Availability**: *Numerical atomic orbital basis (not gamma-only algorithm)* -- **Description**: Whether to print density matrices DM(R) in npz format. This feature does not work for gamma-only calculations. +- **Description**: Whether to print density matrices DM(R) in npz format. The output files are named output_DM0.npz, output_DM1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. - **Default**: False ### out_mul @@ -3295,6 +3301,42 @@ - **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. - **Default**: false +### out_unshrinked_v + +- **Type**: Boolean +- **Description**: Whether to output the large Vq matrix in the unshrinked auxiliary basis. +- **Default**: false + +### exx_coul_moment + +- **Type**: Boolean +- **Description**: Whether to use the moment method for Coulomb calculation. +- **Default**: false + +### exx_rotate_abfs + +- **Type**: Boolean +- **Description**: Whether to rotate the auxiliary basis for Coulomb calculation. +- **Default**: false + +### exx_multip_moments_threshold + +- **Type**: Real +- **Description**: Threshold to screen multipole moments in Coulomb calculation. +- **Default**: 1e-10 + +### shrink_abfs_pca_thr + +- **Type**: Real +- **Description**: Threshold to shrink the auxiliary basis for GW/RPA calculations. +- **Default**: -1 + +### shrink_lu_inv_thr + +- **Type**: Real +- **Description**: Threshold for obtaining the inverse of the overlap matrix by LU decomposition in the auxiliary-basis representation. +- **Default**: 1e-6 + [back to top](#full-list-of-input-keywords) ## Exact Exchange (PW) @@ -3377,6 +3419,7 @@ - berendsen: Berendsen thermostat, see md_nraise in detail. - rescaling: velocity Rescaling method 1, see md_tolerance in detail. - rescale_v: velocity Rescaling method 2, see md_nraise in detail. + - csvr: Canonical Sampling through Velocity Rescaling, see md_csvr_tau in detail. - **Default**: nhc ### md_tfirst diff --git a/docs/parameters.yaml b/docs/parameters.yaml index bcb562fa693..12f6be411a5 100644 --- a/docs/parameters.yaml +++ b/docs/parameters.yaml @@ -1399,6 +1399,7 @@ parameters: * berendsen: Berendsen thermostat, see md_nraise in detail. * rescaling: velocity Rescaling method 1, see md_tolerance in detail. * rescale_v: velocity Rescaling method 2, see md_nraise in detail. + * csvr: Canonical Sampling through Velocity Rescaling, see md_csvr_tau in detail. default_value: nhc unit: "" availability: "" @@ -3321,7 +3322,7 @@ parameters: category: Output information type: Boolean description: | - Whether to print Hamiltonian matrices H(R) in npz format. This feature does not work for gamma-only calculations. + Whether to print Hamiltonian matrices H(R) in npz format. The output files are named output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. default_value: "False" unit: Ry availability: Numerical atomic orbital basis (not gamma-only algorithm) @@ -3329,7 +3330,7 @@ parameters: category: Output information type: Boolean description: | - Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. This feature does not work for gamma-only calculations. + Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. The output files are named output_SR.npz, output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. default_value: "False" unit: Ry availability: Numerical atomic orbital basis (not gamma-only algorithm) @@ -3337,7 +3338,7 @@ parameters: category: Output information type: Boolean description: | - Whether to print density matrices DM(R) in npz format. This feature does not work for gamma-only calculations. + Whether to print density matrices DM(R) in npz format. The output files are named output_DM0.npz, output_DM1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. default_value: "False" unit: "" availability: Numerical atomic orbital basis (not gamma-only algorithm) @@ -4314,6 +4315,54 @@ parameters: default_value: "false" unit: "" availability: "" + - name: out_unshrinked_v + category: Exact Exchange (LCAO) + type: Boolean + description: | + Whether to output the large Vq matrix in the unshrinked auxiliary basis. + default_value: "false" + unit: "" + availability: "" + - name: exx_coul_moment + category: Exact Exchange (LCAO) + type: Boolean + description: | + Whether to use the moment method for Coulomb calculation. + default_value: "false" + unit: "" + availability: "" + - name: exx_rotate_abfs + category: Exact Exchange (LCAO) + type: Boolean + description: | + Whether to rotate the auxiliary basis for Coulomb calculation. + default_value: "false" + unit: "" + availability: "" + - name: exx_multip_moments_threshold + category: Exact Exchange (LCAO) + type: Real + description: | + Threshold to screen multipole moments in Coulomb calculation. + default_value: "1e-10" + unit: "" + availability: "" + - name: shrink_abfs_pca_thr + category: Exact Exchange (LCAO) + type: Real + description: | + Threshold to shrink the auxiliary basis for GW/RPA calculations. + default_value: "-1" + unit: "" + availability: "" + - name: shrink_lu_inv_thr + category: Exact Exchange (LCAO) + type: Real + description: | + Threshold for obtaining the inverse of the overlap matrix by LU decomposition in the auxiliary-basis representation. + default_value: "1e-6" + unit: "" + availability: "" - name: dft_plus_u category: DFT+U correction type: Integer 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 8f5f926a174..85468b18aca 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 @@ -567,36 +567,72 @@ void ReadInput::item_exx() { Input_Item item("out_unshrinked_v"); item.annotation = "whether to output the large Vq matrix in unshrinked auxiliary basis"; + item.category = "Exact Exchange (LCAO)"; + item.type = "Boolean"; + item.description = "Whether to output the large Vq matrix in the unshrinked auxiliary basis."; + item.default_value = "false"; + item.unit = ""; + item.availability = ""; read_sync_bool(input.out_unshrinked_v); this->add_item(item); } { Input_Item item("exx_coul_moment"); item.annotation = "whether to use moment method for Coulomb calculation"; + item.category = "Exact Exchange (LCAO)"; + item.type = "Boolean"; + item.description = "Whether to use the moment method for Coulomb calculation."; + item.default_value = "false"; + item.unit = ""; + item.availability = ""; read_sync_bool(input.exx_coul_moment); this->add_item(item); } { Input_Item item("exx_rotate_abfs"); item.annotation = "whether to rotate auxiliary basis for Coulomb calculation"; + item.category = "Exact Exchange (LCAO)"; + item.type = "Boolean"; + item.description = "Whether to rotate the auxiliary basis for Coulomb calculation."; + item.default_value = "false"; + item.unit = ""; + item.availability = ""; read_sync_bool(input.exx_rotate_abfs); this->add_item(item); } { Input_Item item("exx_multip_moments_threshold"); item.annotation = "threshold to screen multipole moments in Coulomb calculation"; + item.category = "Exact Exchange (LCAO)"; + item.type = "Real"; + item.description = "Threshold to screen multipole moments in Coulomb calculation."; + item.default_value = "1e-10"; + item.unit = ""; + item.availability = ""; read_sync_double(input.exx_multip_moments_threshold); this->add_item(item); } { Input_Item item("shrink_abfs_pca_thr"); item.annotation = "threshold to shrink auxiliary basis for GW/RPA"; + item.category = "Exact Exchange (LCAO)"; + item.type = "Real"; + item.description = "Threshold to shrink the auxiliary basis for GW/RPA calculations."; + item.default_value = "-1"; + item.unit = ""; + item.availability = ""; read_sync_double(input.shrink_abfs_pca_thr); this->add_item(item); } { Input_Item item("shrink_lu_inv_thr"); item.annotation = "threshold to get inverse of overlap matrix by LU decomposition in auxiliary basis representation"; + item.category = "Exact Exchange (LCAO)"; + item.type = "Real"; + item.description = "Threshold for obtaining the inverse of the overlap matrix by LU decomposition in the auxiliary-basis representation."; + item.default_value = "1e-6"; + item.unit = ""; + item.availability = ""; read_sync_double(input.shrink_LU_inv_thr); this->add_item(item); } 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 76d393b438b..ac9054cc119 100644 --- a/source/source_io/module_parameter/read_input_item_md.cpp +++ b/source/source_io/module_parameter/read_input_item_md.cpp @@ -83,7 +83,8 @@ void ReadInput::item_md() * anderson: Anderson thermostat, see md_nraise in detail. * berendsen: Berendsen thermostat, see md_nraise in detail. * rescaling: velocity Rescaling method 1, see md_tolerance in detail. -* rescale_v: velocity Rescaling method 2, see md_nraise in detail.)"; +* rescale_v: velocity Rescaling method 2, see md_nraise in detail. +* csvr: Canonical Sampling through Velocity Rescaling, see md_csvr_tau in detail.)"; item.default_value = "nhc"; item.unit = ""; item.availability = ""; 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 af2ce8c6964..035fdcae1f1 100644 --- a/source/source_io/module_parameter/read_input_item_output.cpp +++ b/source/source_io/module_parameter/read_input_item_output.cpp @@ -1187,7 +1187,7 @@ The circle order of the charge density on real space grids is: x is the outer lo item.annotation = "output H(R) matrix in npz format"; item.category = "Output information"; item.type = "Boolean"; - item.description = "Whether to print Hamiltonian matrices H(R) in npz format. This feature does not work for gamma-only calculations."; + item.description = "Whether to print Hamiltonian matrices H(R) in npz format. The output files are named output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY."; item.default_value = "False"; item.unit = "Ry"; item.availability = "Numerical atomic orbital basis (not gamma-only algorithm)"; @@ -1209,7 +1209,7 @@ The circle order of the charge density on real space grids is: x is the outer lo item.annotation = "output H(R) and S(R) matrices in npz format"; item.category = "Output information"; item.type = "Boolean"; - item.description = "Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. This feature does not work for gamma-only calculations."; + item.description = "Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. The output files are named output_SR.npz, output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY."; item.default_value = "False"; item.unit = "Ry"; item.availability = "Numerical atomic orbital basis (not gamma-only algorithm)"; @@ -1231,7 +1231,7 @@ The circle order of the charge density on real space grids is: x is the outer lo item.annotation = "output DM(R) matrix in npz format"; item.category = "Output information"; item.type = "Boolean"; - item.description = "Whether to print density matrices DM(R) in npz format. This feature does not work for gamma-only calculations."; + item.description = "Whether to print density matrices DM(R) in npz format. The output files are named output_DM0.npz, output_DM1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY."; item.default_value = "False"; item.unit = ""; item.availability = "Numerical atomic orbital basis (not gamma-only algorithm)"; From 003c1a5636f36b23ec5a4a631f8a4c97a20bc043 Mon Sep 17 00:00:00 2001 From: Bonan Zhu Date: Sun, 12 Jul 2026 16:29:13 +0800 Subject: [PATCH 3/6] docs: add local manual build instructions --- docs/README.md | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ docs/conf.py | 2 +- 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 docs/README.md diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000000..29a84ad536f --- /dev/null +++ b/docs/README.md @@ -0,0 +1,106 @@ +# ABACUS Documentation + +These files are the source for the ABACUS manual published on Read the Docs. + +Read the Docs builds a minimal serial ABACUS binary, regenerates +`docs/parameters.yaml` from that binary, and lets Sphinx regenerate +`docs/advanced/input_files/input-main.md` during the documentation build. + +## Build the Manual Locally + +Run the following commands from the repository root. + +1. Create a Python virtual environment with `uv`: + + ```bash + uv venv --python python3 .venv + ``` + +1. Install the documentation requirements: + + ```bash + uv pip install --python .venv/bin/python -r docs/requirements.txt sphinx ninja + ``` + +1. Build the reduced ABACUS executable used for INPUT parameter metadata: + + ```bash + cmake -S . -B build-rtd-docs -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_MPI=OFF \ + -DENABLE_LCAO=OFF \ + -DUSE_OPENMP=OFF \ + -DUSE_ELPA=OFF \ + -DUSE_CUDA=OFF \ + -DUSE_ROCM=OFF \ + -DBUILD_TESTING=OFF \ + -DENABLE_LIBXC=OFF \ + -DENABLE_LIBRI=OFF \ + -DENABLE_DFTD4=OFF \ + -DENABLE_RAPIDJSON=OFF \ + -DENABLE_MLALGO=OFF \ + -DENABLE_FLOAT_FFTW=OFF \ + -DENABLE_CNPY=OFF \ + -DCOMMIT_INFO=OFF \ + -DGIT_SUBMODULE=OFF \ + -DMKLROOT=OFF + cmake --build build-rtd-docs --target abacus_pw_ser --parallel 2 + ``` + +1. Regenerate the INPUT parameter files: + + ```bash + ./build-rtd-docs/source/abacus_pw_ser --generate-parameters-yaml > docs/parameters.yaml + .venv/bin/python docs/generate_input_main.py docs/parameters.yaml \ + --output docs/advanced/input_files/input-main.md + ``` + +1. Build the HTML manual: + + ```bash + .venv/bin/sphinx-build -b html docs build-docs/html + ``` + +1. Open `build-docs/html/index.html` in a browser. + +## INPUT Parameter Reference + +The INPUT parameter reference is generated from metadata registered in +`source/source_io/module_parameter/read_input_item_*.cpp`. + +- `docs/parameters.yaml` is an intermediate YAML dump produced by + `abacus --generate-parameters-yaml`. +- `docs/advanced/input_files/input-main.md` is generated from that YAML file. +- `docs/conf.py` refreshes `input-main.md` automatically when + `docs/parameters.yaml` exists. + +The Read the Docs build no longer depends on a committed `docs/parameters.yaml` +because `.readthedocs.yaml` regenerates it before Sphinx runs. A local Sphinx +build also succeeds without `docs/parameters.yaml` when the checked-in +`input-main.md` is already present, but a fresh INPUT reference still requires +an ABACUS binary. + +For now, keep both generated files in PRs that change INPUT metadata, following +the repository contribution guide. Dropping `docs/parameters.yaml` from version +control is technically possible after the project also updates the contributor +guide and PR template to make the generated-file policy explicit. + +## Optional Read the Docs Container Test + +To smoke-test the Read the Docs environment locally, use the same image as the +hosted build: + +```bash +docker run --rm -v "$PWD:/project" -w /project \ + readthedocs/build:ubuntu-22.04-2024.01.29 \ + /bin/bash -lc 'python -m pip install -r docs/requirements.txt sphinx ninja && + cmake -S . -B build-rtd-docs -G Ninja -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_MPI=OFF -DENABLE_LCAO=OFF -DUSE_OPENMP=OFF -DUSE_ELPA=OFF \ + -DUSE_CUDA=OFF -DUSE_ROCM=OFF -DBUILD_TESTING=OFF \ + -DENABLE_LIBXC=OFF -DENABLE_LIBRI=OFF -DENABLE_DFTD4=OFF \ + -DENABLE_RAPIDJSON=OFF -DENABLE_MLALGO=OFF -DENABLE_FLOAT_FFTW=OFF \ + -DENABLE_CNPY=OFF -DCOMMIT_INFO=OFF -DGIT_SUBMODULE=OFF -DMKLROOT=OFF && + cmake --build build-rtd-docs --target abacus_pw_ser --parallel 2 && + ./build-rtd-docs/source/abacus_pw_ser --generate-parameters-yaml > docs/parameters.yaml && + sphinx-build -b html docs /tmp/abacus-docs-html' +``` diff --git a/docs/conf.py b/docs/conf.py index bf96df8cb7b..101f2609227 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,7 +57,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] +exclude_patterns = ['README.md'] # -- Options for HTML output ------------------------------------------------- From 49f47e2219959f3cfc9ae3c4326498c6b4beca18 Mon Sep 17 00:00:00 2001 From: Bonan Zhu Date: Sun, 12 Jul 2026 17:27:16 +0800 Subject: [PATCH 4/6] docs: generate input reference without checked-in yaml --- .../abacus-governance.instructions.md | 5 +- .github/workflows/test.yml | 13 +- .readthedocs.yaml | 1 - AGENTS.md | 8 +- docs/CONTRIBUTING.md | 24 +- docs/README.md | 57 +- docs/advanced/input_files/input-main.md | 2 +- docs/conf.py | 102 +- docs/developers_guide/agent_governance.md | 6 +- docs/generate_input_main.py | 48 +- docs/parameters.yaml | 4973 ----------------- docs/tests/test_conf_input_docs.py | 73 + 12 files changed, 240 insertions(+), 5072 deletions(-) delete mode 100644 docs/parameters.yaml create mode 100644 docs/tests/test_conf_input_docs.py diff --git a/.github/instructions/abacus-governance.instructions.md b/.github/instructions/abacus-governance.instructions.md index 6e0e09df09e..0a1f2a5a2b8 100644 --- a/.github/instructions/abacus-governance.instructions.md +++ b/.github/instructions/abacus-governance.instructions.md @@ -23,8 +23,9 @@ Apply these instructions when reviewing or changing ABACUS code: - Require LF line endings for text files. `.bat` and `.cmd` files are the CRLF exceptions. - For INPUT parameter behavior changes, require synchronized updates to - `docs/parameters.yaml` and `docs/advanced/input_files/input-main.md`, or a - clear no-update explanation in the PR. + `docs/advanced/input_files/input-main.md`, or a clear no-update explanation + in the PR. The parameter YAML stream is generated transiently and is not stored + in the repository. - Check that new source files are linked through the relevant `CMakeLists.txt` unless the PR explains generated or indirect inclusion. - Keep default C++ changes compatible with the repository C++11 baseline. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee633a76cae..6b141943a62 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,24 +89,17 @@ jobs: ABACUS_BIN=$(find build -name "abacus_*" -type f -executable | head -1) echo "Using binary: ${ABACUS_BIN}" - # Check 1: parameters.yaml matches C++ Input_Item definitions + # Generate transient parameter metadata from C++ Input_Item definitions ${ABACUS_BIN} --generate-parameters-yaml > /tmp/parameters_generated.yaml - if ! diff -q docs/parameters.yaml /tmp/parameters_generated.yaml; then - echo "error: docs/parameters.yaml is out of sync with C++ source" - echo "Fix: ${ABACUS_BIN} --generate-parameters-yaml > docs/parameters.yaml" - diff docs/parameters.yaml /tmp/parameters_generated.yaml || true - exit 1 - fi - echo " parameters.yaml: OK" - # Check 2: input-main.md matches regenerated markdown + # Check: input-main.md matches regenerated markdown pip install -q pyyaml python docs/generate_input_main.py \ /tmp/parameters_generated.yaml \ --output /tmp/input-main-generated.md if ! diff -q docs/advanced/input_files/input-main.md /tmp/input-main-generated.md; then echo "error: input-main.md is out of sync" - echo "Fix: python docs/generate_input_main.py docs/parameters.yaml" + echo "Fix: ${ABACUS_BIN} --generate-parameters-yaml | python docs/generate_input_main.py - --output docs/advanced/input_files/input-main.md" diff docs/advanced/input_files/input-main.md /tmp/input-main-generated.md || true exit 1 fi diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 6253a4466ef..8696b231d8c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -42,7 +42,6 @@ build: -DGIT_SUBMODULE=OFF -DMKLROOT=OFF - cmake --build build-rtd-docs --target abacus_pw_ser --parallel 2 - - ./build-rtd-docs/source/abacus_pw_ser --generate-parameters-yaml > docs/parameters.yaml # Build documentation in the "docs/" directory with Sphinx sphinx: diff --git a/AGENTS.md b/AGENTS.md index e95e177691f..96ad3fac115 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,9 +26,10 @@ rules. Read the complete governance document before making or reviewing changes: - Use LF line endings for text files. Only `.bat` and `.cmd` files may use CRLF. - Keep source file additions deterministic: update the relevant `CMakeLists.txt` or explain why the file is generated or included indirectly. -- INPUT parameter behavior changes must update `docs/parameters.yaml` and +- INPUT parameter behavior changes must update `docs/advanced/input_files/input-main.md`, or the PR must state why no update - is required. + is required. The parameter YAML stream is generated transiently by the ABACUS + binary and is not stored in the repository. - Report the exact verification performed. Do not claim completion without fresh test or check output. @@ -37,8 +38,7 @@ rules. Read the complete governance document before making or reviewing changes: - Core C++ implementation lives under `source/`; source additions must be wired through the relevant `CMakeLists.txt`. - INPUT parsing and help metadata live under `source/source_io/`; user-facing - INPUT docs live in `docs/parameters.yaml` and - `docs/advanced/input_files/input-main.md`. + INPUT docs live in `docs/advanced/input_files/input-main.md`. - Unit tests are colocated under module `test/` directories such as `source/source_md/test/`; integration and workflow tests are selected through CTest labels and patterns. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 5ada0540ef8..1e7f7a2992a 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -174,11 +174,11 @@ 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`. +A checked-in file `docs/advanced/input_files/input-main.md` contains the generated INPUT parameter reference. Sphinx refreshes this file from an ABACUS executable when the executable is available. -### When to Update `docs/parameters.yaml` +### When to Update `input-main.md` -You **must** regenerate `docs/parameters.yaml` whenever you: +You **must** regenerate `docs/advanced/input_files/input-main.md` whenever you: - Add a new INPUT parameter - Remove an existing INPUT parameter @@ -186,25 +186,23 @@ You **must** regenerate `docs/parameters.yaml` whenever you: ### How to Regenerate -After building and installing ABACUS, run: +After building ABACUS, run: ```bash -abacus --generate-parameters-yaml > docs/parameters.yaml +abacus --generate-parameters-yaml \ + | python3 docs/generate_input_main.py - \ + --output docs/advanced/input_files/input-main.md ``` -Then verify the YAML is valid: +You can also let Sphinx refresh the page during a documentation build: ```bash -python3 -c "import yaml; d=yaml.safe_load(open('docs/parameters.yaml')); print(len(d['parameters']), 'parameters')" +ABACUS_BINARY=/path/to/abacus sphinx-build -b html docs build-docs/html ``` -You can also regenerate the markdown documentation locally: +If no ABACUS executable is available, Sphinx emits a warning and continues with the checked-in `input-main.md`, which may not be up to date. -```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 `input-main.md` in your commit when submitting a PR that modifies INPUT parameters. Reviewers should verify the generated documentation matches the C++ source changes. ### Parameter Documentation Format diff --git a/docs/README.md b/docs/README.md index 29a84ad536f..0221bc5816e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,8 +3,8 @@ These files are the source for the ABACUS manual published on Read the Docs. Read the Docs builds a minimal serial ABACUS binary, regenerates -`docs/parameters.yaml` from that binary, and lets Sphinx regenerate -`docs/advanced/input_files/input-main.md` during the documentation build. +`docs/advanced/input_files/input-main.md` from that binary during the +documentation build, and emits a warning if no ABACUS executable is available. ## Build the Manual Locally @@ -47,43 +47,46 @@ Run the following commands from the repository root. cmake --build build-rtd-docs --target abacus_pw_ser --parallel 2 ``` -1. Regenerate the INPUT parameter files: - - ```bash - ./build-rtd-docs/source/abacus_pw_ser --generate-parameters-yaml > docs/parameters.yaml - .venv/bin/python docs/generate_input_main.py docs/parameters.yaml \ - --output docs/advanced/input_files/input-main.md - ``` - 1. Build the HTML manual: ```bash - .venv/bin/sphinx-build -b html docs build-docs/html + ABACUS_BINARY=./build-rtd-docs/source/abacus_pw_ser \ + .venv/bin/sphinx-build -b html docs build-docs/html ``` + If `ABACUS_BINARY` is not set, `docs/conf.py` looks for the Read the Docs + build binary and then for `abacus` or `abacus_pw_ser` on `PATH`. + 1. Open `build-docs/html/index.html` in a browser. +If no ABACUS executable is available, the Sphinx build still continues with the +checked-in `docs/advanced/input_files/input-main.md` and prints a warning that +the INPUT parameter reference may not be up to date. + +## Regenerate Only the INPUT Reference + +To refresh only the generated INPUT reference after building ABACUS: + +```bash +./build-rtd-docs/source/abacus_pw_ser --generate-parameters-yaml \ + | .venv/bin/python docs/generate_input_main.py - \ + --output docs/advanced/input_files/input-main.md +``` + ## INPUT Parameter Reference The INPUT parameter reference is generated from metadata registered in `source/source_io/module_parameter/read_input_item_*.cpp`. -- `docs/parameters.yaml` is an intermediate YAML dump produced by - `abacus --generate-parameters-yaml`. -- `docs/advanced/input_files/input-main.md` is generated from that YAML file. -- `docs/conf.py` refreshes `input-main.md` automatically when - `docs/parameters.yaml` exists. - -The Read the Docs build no longer depends on a committed `docs/parameters.yaml` -because `.readthedocs.yaml` regenerates it before Sphinx runs. A local Sphinx -build also succeeds without `docs/parameters.yaml` when the checked-in -`input-main.md` is already present, but a fresh INPUT reference still requires -an ABACUS binary. +- `abacus --generate-parameters-yaml` produces a transient YAML stream; it is + not stored in the repository. +- `docs/advanced/input_files/input-main.md` is generated from that metadata. +- `docs/conf.py` refreshes `input-main.md` automatically when it can find an + ABACUS executable. -For now, keep both generated files in PRs that change INPUT metadata, following -the repository contribution guide. Dropping `docs/parameters.yaml` from version -control is technically possible after the project also updates the contributor -guide and PR template to make the generated-file policy explicit. +Keep `docs/advanced/input_files/input-main.md` in PRs that change INPUT +metadata. The YAML dump is intentionally transient so there is only one +generated reference file to maintain. ## Optional Read the Docs Container Test @@ -101,6 +104,6 @@ docker run --rm -v "$PWD:/project" -w /project \ -DENABLE_RAPIDJSON=OFF -DENABLE_MLALGO=OFF -DENABLE_FLOAT_FFTW=OFF \ -DENABLE_CNPY=OFF -DCOMMIT_INFO=OFF -DGIT_SUBMODULE=OFF -DMKLROOT=OFF && cmake --build build-rtd-docs --target abacus_pw_ser --parallel 2 && - ./build-rtd-docs/source/abacus_pw_ser --generate-parameters-yaml > docs/parameters.yaml && + export ABACUS_BINARY=./build-rtd-docs/source/abacus_pw_ser && sphinx-build -b html docs /tmp/abacus-docs-html' ``` diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index 1db92d43d7d..34a552343ec 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -1,6 +1,6 @@ # Full List of INPUT Keywords - + diff --git a/docs/conf.py b/docs/conf.py index 101f2609227..6f97f0af117 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -101,30 +101,94 @@ } -# -- Auto-generate INPUT keyword documentation from YAML parameter dump ------ +# -- Auto-generate INPUT keyword documentation from ABACUS metadata ---------- +import shutil +import subprocess +import sys from pathlib import Path -def generate_input_docs(app): - """Auto-generate input-main.md from parameters.yaml before building. - - Workflow: - abacus --generate-parameters-yaml > docs/parameters.yaml - # Then Sphinx calls this hook, which runs generate_input_main.py - """ - docs_dir = Path(__file__).resolve().parent - yaml_path = docs_dir / 'parameters.yaml' - if not yaml_path.exists(): - print(f"Warning: {yaml_path} not found. " - "Run: abacus --generate-parameters-yaml > docs/parameters.yaml") - return - import sys - sys.path.insert(0, str(docs_dir)) - from generate_input_main import generate - generate( - yaml_path=yaml_path, +try: + from sphinx.util import logging as sphinx_logging + logger = sphinx_logging.getLogger(__name__) +except Exception: + logger = None + + +def warn_input_docs(message): + if logger is not None: + logger.warning(message) + else: + print(f"Warning: {message}") + + +def candidate_abacus_binaries(repo_root): + """Return candidate ABACUS binaries for local and Read the Docs builds.""" + env_binary = os.environ.get('ABACUS_BINARY') or os.environ.get('ABACUS_EXECUTABLE') + candidates = [] + if env_binary: + candidates.append(Path(env_binary)) + candidates.extend([ + repo_root / 'build-rtd-docs' / 'source' / 'abacus_pw_ser', + repo_root / 'build-rtd-docs' / 'abacus_pw_ser', + ]) + for binary_name in ['abacus', 'abacus_pw_ser']: + path_binary = shutil.which(binary_name) + if path_binary: + candidates.append(Path(path_binary)) + return candidates + + +def find_abacus_binary(repo_root): + for candidate in candidate_abacus_binaries(repo_root): + if candidate.exists() and os.access(candidate, os.X_OK): + return candidate + return None + + +def refresh_input_docs(docs_dir, abacus_binary=None, warn=warn_input_docs): + """Refresh input-main.md from an ABACUS executable, if one is available.""" + docs_dir = Path(docs_dir) + repo_root = docs_dir.parent + binary = Path(abacus_binary) if abacus_binary else find_abacus_binary(repo_root) + if binary is None or not binary.exists() or not os.access(binary, os.X_OK): + warn( + "ABACUS executable not found; INPUT parameter documentation may not " + "be up to date. Set ABACUS_BINARY=/path/to/abacus or build the " + "reduced documentation binary first." + ) + return False + + env = os.environ.copy() + env.setdefault('OMP_NUM_THREADS', '1') + result = subprocess.run( + [str(binary), '--generate-parameters-yaml'], + cwd=repo_root, + env=env, + text=True, + capture_output=True, + ) + if result.returncode != 0: + detail = result.stderr.strip() or result.stdout.strip() + warn( + "ABACUS could not generate INPUT parameter metadata; documentation " + f"may not be up to date. Command: {binary} --generate-parameters-yaml" + + (f". Output: {detail}" if detail else "") + ) + return False + + sys.path.insert(0, str(Path(__file__).resolve().parent)) + import yaml + from generate_input_main import generate_from_data + generate_from_data( + data=yaml.safe_load(result.stdout), output=docs_dir / 'advanced' / 'input_files' / 'input-main.md', ) + return True + + +def generate_input_docs(app): + refresh_input_docs(Path(__file__).resolve().parent) def setup(app): app.connect('builder-inited', generate_input_docs) diff --git a/docs/developers_guide/agent_governance.md b/docs/developers_guide/agent_governance.md index 8127076cbc6..dd489fd2a55 100644 --- a/docs/developers_guide/agent_governance.md +++ b/docs/developers_guide/agent_governance.md @@ -215,11 +215,13 @@ setup workflows and should be added only through a later governance change. ## INPUT Parameter Changes Changes to parameter metadata, default values, type, availability, description, -or parsing behavior must include both: +or parsing behavior must include: -- `docs/parameters.yaml` - `docs/advanced/input_files/input-main.md` +The parameter YAML stream is generated transiently from the ABACUS binary and +is not stored in the repository. + If the diff touches parameter internals but does not change user-visible INPUT behavior, the PR must state why no documentation update is required. diff --git a/docs/generate_input_main.py b/docs/generate_input_main.py index 4e138034d7f..9b38572b282 100644 --- a/docs/generate_input_main.py +++ b/docs/generate_input_main.py @@ -3,15 +3,12 @@ Generate input-main.md from a YAML parameter dump. Usage: - # Generate YAML first: - abacus --generate-parameters-yaml > docs/parameters.yaml - - # Then generate markdown: - python docs/generate_input_main.py docs/parameters.yaml [--output FILE] + # Generate markdown from an ABACUS parameter YAML dump: + abacus --generate-parameters-yaml | python docs/generate_input_main.py - [--output FILE] Can also be imported from conf.py: - from generate_input_main import generate - generate(yaml_path, output) + from generate_input_main import generate_from_data + generate_from_data(data, output) """ import argparse @@ -240,20 +237,13 @@ def generate_toc(sorted_categories: OrderedDict) -> str: return '\n'.join(lines) -def generate(yaml_path: Path, output: Path, verbose: bool = False): +def generate_from_data(data: Dict, output: Path, verbose: bool = False): """ - Core generation logic. Can be called from conf.py or CLI. + Generate markdown from loaded parameter metadata. """ - yaml_path = Path(yaml_path) output = Path(output) - if not yaml_path.exists(): - raise FileNotFoundError(f"YAML file not found: {yaml_path}") - - with open(yaml_path, 'r') as f: - data = yaml.safe_load(f) - - all_params = data.get('parameters', []) + all_params = (data or {}).get('parameters', []) print(f"Total: {len(all_params)} documented parameters") # Group by category @@ -279,7 +269,7 @@ def generate(yaml_path: Path, output: Path, verbose: bool = False): md_parts = [ "# Full List of INPUT Keywords", "", - "", + "", "", "", "", @@ -301,14 +291,32 @@ def generate(yaml_path: Path, output: Path, verbose: bool = False): print(f"Categories: {len(sorted_categories)}") +def generate(yaml_path: Path, output: Path, verbose: bool = False): + """ + Core generation logic. Can be called from the CLI. + """ + yaml_path = Path(yaml_path) + + if str(yaml_path) == '-': + data = yaml.safe_load(sys.stdin) + else: + if not yaml_path.exists(): + raise FileNotFoundError(f"YAML file not found: {yaml_path}") + + with open(yaml_path, 'r') as f: + data = yaml.safe_load(f) + + generate_from_data(data, output=output, verbose=verbose) + + def main(): parser = argparse.ArgumentParser( description='Generate input-main.md from YAML parameter dump' ) parser.add_argument( 'yaml_file', - type=Path, - help='Path to parameters.yaml (generated by abacus --generate-parameters-yaml)' + type=str, + help='Path to parameter YAML, or - to read from standard input' ) parser.add_argument( '--output', diff --git a/docs/parameters.yaml b/docs/parameters.yaml deleted file mode 100644 index 12f6be411a5..00000000000 --- a/docs/parameters.yaml +++ /dev/null @@ -1,4973 +0,0 @@ -# Auto-generated by: abacus --generate-parameters-yaml -# Do not edit manually. -parameters: - - name: suffix - category: System variables - type: String - description: | - In each run, ABACUS will generate a subdirectory in the working directory. This subdirectory contains all the information of the run. The subdirectory name has the format: OUT.suffix, where the suffix is the name you can pick up for your convenience. - default_value: ABACUS - unit: "" - availability: "" - - name: ntype - category: System variables - type: Integer - description: | - Number of different atom species in the calculation. - default_value: "0" - unit: "" - availability: "" - - name: calculation - category: System variables - type: String - description: | - Specify the type of calculation. - - * scf: perform self-consistent electronic structure calculations - * nscf: perform non-self-consistent electronic structure calculations. A charge density file is required - * relax: perform structure relaxation calculations, the relax_nmax parameter depicts the maximal number of ionic iterations - * cell-relax: perform cell relaxation calculations - * md: perform molecular dynamics simulations - * get_pchg: obtain partial (band-decomposed) charge densities (for LCAO basis only). See out_pchg for more information - * get_wf: obtain real space wave functions (for LCAO basis only). See out_wfc_norm and out_wfc_re_im for more information - * get_s: obtain the overlap matrix formed by localized orbitals (for LCAO basis with multiple k points). the file name is SR.csr with file format being the same as that generated by out_mat_hs2 - * gen_bessel: generates projectors, i.e., a series of Bessel functions, for the DeePKS method (for LCAO basis only) - * gen_opt_abfs: generate opt-ABFs as discussed in this article - * test_memory: obtain a rough estimation of memory consumption for the calculation - * test_neighbour: obtain information of neighboring atoms (for LCAO basis only), please specify a positive search_radius manually - default_value: scf - unit: "" - availability: "" - - name: esolver_type - category: System variables - type: String - description: | - Choose the energy solver. - * ksdft: Kohn-Sham density functional theory - * ofdft: orbital-free density functional theory - * tdofdft: time-dependent orbital-free density functional theory - * sdft: stochastic density functional theory - * tddft: real-time time-dependent density functional theory (RT-TDDFT) - * lj: Leonard Jones potential - * dp: DeeP potential - * nep: Neuroevolution Potential - * ks-lr: Kohn-Sham density functional theory + LR-TDDFT (Under Development Feature) - * lr: LR-TDDFT with given KS orbitals (Under Development Feature) - default_value: ksdft - unit: "" - availability: "" - - name: symmetry - category: System variables - type: String - description: | - Takes value 1, 0 or -1. - * -1: No symmetry will be considered. It is recommended to set -1 for non-colinear + soc calculations, where time reversal symmetry is broken sometimes. - * 0: Only time reversal symmetry would be considered in symmetry operations, which implied k point and -k point would be treated as a single k point with twice the weight. - * 1: Symmetry analysis will be performed to determine the type of Bravais lattice and associated symmetry operations. (point groups, space groups, primitive cells, and irreducible k-points) - - [NOTE] When symmetry is enabled (value 1), k-points are reduced to the irreducible Brillouin zone (IBZ). For explicit k-point lists with custom weights (see KPT file), the custom weights are preserved during symmetry reduction. For Monkhorst-Pack grids, uniform weights are used. - default_value: default - unit: "" - availability: "" - - name: symmetry_prec - category: System variables - type: Real - description: | - The accuracy for symmetry analysis. Typically, the default value is good enough, but if the lattice parameters or atom positions in STRU file are not accurate enough, this value should be enlarged. - [NOTE] Note: if calculation==cell_relax, this value can be dynamically changed corresponding to the variation of accuracy of the lattice parameters and atom positions during the relaxation. - default_value: "1.0e-6" - unit: Bohr - availability: "" - - name: symmetry_autoclose - category: System variables - type: Boolean - description: | - Control how to deal with error in symmetry analysis due to inaccurate lattice parameters or atom positions in STRU file, especially useful when calculation==cell-relax - * False: quit with an error message - * True: automatically set symmetry to 0 and continue running without symmetry analysis - default_value: "True" - unit: "" - availability: symmetry==1 - - name: cal_force - category: System variables - type: Boolean - description: | - If set to True, calculate the force at the end of the electronic iteration. - default_value: "False" - unit: "" - availability: "" - - name: kpar - category: System variables - type: Integer - description: | - Divide all processors into kpar groups, and k points will be distributed among each group. The value taken should be less than or equal to the number of k points as well as the number of MPI processes. - default_value: "1" - unit: "" - availability: "" - - name: bndpar - category: System variables - type: Integer - description: | - Divide all processors into bndpar groups, and bands (only stochastic orbitals now) will be distributed among each group. It should be larger than 0. - default_value: "1" - unit: "" - availability: "" - - name: latname - category: System variables - type: String - description: | - Specifies the type of Bravias lattice. When set to none, the three lattice vectors are supplied explicitly in STRU file. - - Available options are: - * none: free structure - * sc: simple cubic - * fcc: face-centered cubic - * bcc: body-centered cubic - * hexagonal: hexagonal - * trigonal: trigonal - * st: simple tetragonal - * bct: body-centered tetragonal - * so: orthorhombic - * baco: base-centered orthorhombic - * fco: face-centered orthorhombic - * bco: body-centered orthorhombic - * sm: simple monoclinic - * bacm: base-centered monoclinic - * triclinic: triclinic - default_value: none - unit: "" - availability: "" - - name: assume_isolated - category: System variables - type: String - description: | - Used to perform a calculation assuming an isolated system in a 3D supercell. - - Available options are: - * none: regular periodic calculation without isolated-system correction. - * makov-payne, m-p, mp: compute the Makov-Payne correction to the total energy and estimate a corrected vacuum level for eigenvalue alignment. This option is available only for cubic lattices (latname = sc, fcc, or bcc). - - Theory: G. Makov and M. C. Payne, Phys. Rev. B 51, 4014 (1995). - default_value: none - unit: "" - availability: "" - - name: init_wfc - category: System variables - type: String - description: | - The type of the starting wave functions. - - Available options are: - * atomic: from atomic pseudo wave functions. If they are not enough, other wave functions are initialized with random numbers. - * atomic+random: add small random numbers on atomic pseudo-wavefunctions - * file: from binary files wf*.dat, which are output by setting out_wfc_pw to 2. - * random: random numbers - * nao: from numerical atomic orbitals. If they are not enough, other wave functions are initialized with random numbers. - * nao+random: add small random numbers on numerical atomic orbitals - - [NOTE] Only the file option is useful for the lcao basis set, which is mostly used when calculation is set to get_wf and get_pchg. - default_value: atomic - unit: "" - availability: "" - - name: init_chg - category: System variables - type: String - description: | - This variable is used for both plane wave set and localized orbitals set. It indicates the type of starting density. - - * atomic: the density is starting from the summation of the atomic density of single atoms. - * file: the density will be read in from a binary file charge-density.dat first. If it does not exist, the charge density will be read in from cube files. - * wfc: the density will be calculated by wavefunctions and occupations. - * dm: the density will be calculated by real space density matrix(DMR) of LCAO base. - * dm_no_renormalize: same as dm, but the charge density is not renormalized to the number of electrons. - * hr: the real space Hamiltonian matrix(HR) will be read in from file hrs1_nao.csr in directory read_file_dir. - * auto: Abacus first attempts to read the density from a file; if not found, it defaults to using atomic density. - default_value: atomic - unit: "" - availability: "" - - name: init_vel - category: System variables - type: Boolean - description: | - * True: read the atom velocity (atomic unit : 1 a.u. = 21.877 Angstrom/fs) from the atom file (STRU) and determine the initial temperature md_tfirst. If md_tfirst is unset or less than zero, init_vel is autoset to be true. - * False: assign value to atom velocity using Gaussian distributed random numbers. - default_value: "False" - unit: "" - availability: "" - - name: mem_saver - category: System variables - type: Integer - 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. - default_value: "0" - unit: "" - availability: Used only for nscf calculations with plane wave basis set. - - name: cal_stress - category: System variables - type: Boolean - description: | - If set to True, calculate the stress at the end of the electronic iteration. - default_value: "False" - unit: "" - availability: "" - - name: diago_proc - category: System variables - type: Integer - 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_value: "0" - unit: "" - availability: Used only for plane wave basis set. - - name: nbspline - category: System variables - type: Integer - description: | - If set to a natural number, a Cardinal B-spline interpolation will be used to calculate Structure Factor. nbspline represents the order of B-spline basis and a larger one can get more accurate results but cost more. It is turned off by default. - default_value: "-1" - unit: "" - availability: "" - - name: kspacing - category: System variables - type: Vector of Real (1 or 3 values) - description: | - Set the smallest allowed spacing between k points, unit in 1/bohr. It should be larger than 0.0, and suggest smaller than 0.25. When you have set this value > 0.0, then the KPT file is unnecessary. The default value 0.0 means that ABACUS will read the applied KPT file. - - [NOTE] If gamma_only is set to be true, kspacing is invalid. - default_value: "0.0" - unit: "" - availability: "" - - name: koffset - category: System variables - type: Vector of Real (3 values) - description: | - Set offsets for automatic k-point mesh generated by kspacing, in each reciprocal direction. This parameter is only effective when kspacing > 0.0 and gamma_only is false. - default_value: 0.0 0.0 0.0 - unit: "" - availability: "" - - name: kmesh_type - category: System variables - type: String - description: | - Set mesh type used for automatic k-point mesh generated by kspacing. Available options are gamma and mp. This parameter is only effective when kspacing > 0.0 and gamma_only is false. - default_value: gamma - unit: "" - availability: "" - - name: min_dist_coef - category: System variables - type: Real - description: | - A factor related to the allowed minimum distance between two atoms. At the beginning, ABACUS will check the structure, and if the distance of two atoms is shorter than min_dist_coef*(standard covalent bond length), we think this structure is unreasonable. - default_value: "0.2" - unit: "" - availability: "" - - name: device - category: System variables - type: String - description: | - Specifies the computing device for ABACUS. - - Available options are: - * cpu: for CPUs via Intel, AMD, or Other supported CPU devices - * gpu: for GPUs via CUDA or ROCm. - - [NOTE] ks_solver must also be set to the algorithms supported. lcao_in_pw currently does not support gpu. - default_value: cpu - unit: "" - availability: "" - - name: precision - category: System variables - type: String - description: | - Specifies the precision when performing scf calculation. - * single: single precision - * double: double precision - default_value: double - unit: "" - availability: Used only for plane wave basis set. - - name: gint_precision - category: System variables - type: String - description: | - Specifies the precision when performing grid integral in LCAO calculations. - * single: single precision - * double: double precision - * 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. - - name: timer_enable_nvtx - category: System variables - type: Boolean - description: | - Controls whether NVTX profiling labels are emitted by the timer. This feature is only effective on CUDA platforms. - - * True: Enable NVTX profiling labels in the timer. - * False: Disable NVTX profiling labels in the timer. - default_value: "False" - unit: "" - availability: "" - - name: cell_factor - category: System variables - type: Real - description: | - Used in the construction of the pseudopotential tables. For cell-relax calculations, this is automatically set to 2.0. - default_value: "1.2" - unit: "" - availability: "" - - name: dm_to_rho - category: System variables - type: Boolean - description: | - Reads density matrix in npz format and calculates electron density. - default_value: "False" - unit: "" - availability: "" - - name: chg_extrap - category: System variables - type: String - description: | - Charge extrapolation method for MD and relaxation calculations. - default_value: default - unit: "" - availability: "" - - name: ecutwfc - category: Plane wave related variables - type: Real - description: | - Energy cutoff for plane wave functions. Note that even for localized orbitals basis, you still need to setup an energy cutoff for this system. Because our local pseudopotential parts and the related force are calculated from plane wave basis set. - [NOTE] ecutwfc and ecutrho can be set simultaneously. If only one parameter is set, abacus will automatically set another parameter based on the 4-time relationship. - default_value: "50 for PW basis, 100 for LCAO basis" - unit: Ry - availability: "" - - name: ecutrho - category: Plane wave related variables - type: Real - description: | - Energy cutoff for charge density and potential. For norm-conserving pseudopotential you should stick to the default value, you can reduce it by a little but it will introduce noise especially on forces and stress. - default_value: "4*ecutwfc" - unit: Ry - availability: "" - - name: nx - category: Plane wave related variables - type: Integer - description: | - If set to a positive number, specifies the number of FFT grid points in x direction. If set to 0, the number will be calculated from ecutrho. - - [NOTE] You must specify all three dimensions (nx, ny, nz) for this setting to be used. - default_value: "0" - unit: "" - availability: "" - - name: ny - category: Plane wave related variables - type: Integer - description: | - If set to a positive number, specifies the number of FFT grid points in y direction. If set to 0, the number will be calculated from ecutrho. - - [NOTE] You must specify all three dimensions (nx, ny, nz) for this setting to be used. - default_value: "0" - unit: "" - availability: "" - - name: nz - category: Plane wave related variables - type: Integer - description: | - If set to a positive number, specifies the number of FFT grid points in z direction. If set to 0, the number will be calculated from ecutrho. - - [NOTE] You must specify all three dimensions (nx, ny, nz) for this setting to be used. - default_value: "0" - unit: "" - availability: "" - - name: ndx - category: Plane wave related variables - type: Integer - description: | - If set to a positive number, specifies the number of FFT grid points for the dense part of charge density in x direction. If set to 0, the number will be calculated from ecutwfc. - - [NOTE] You must specify all three dimensions (ndx, ndy, ndz) for this setting to be used. These parameters must be used combined with nx, ny, nz. If nx, ny, nz are unset, ndx, ndy, ndz are used as nx, ny, nz. - default_value: "0" - unit: "" - availability: "" - - name: ndy - category: Plane wave related variables - type: Integer - description: | - If set to a positive number, specifies the number of FFT grid points for the dense part of charge density in y direction. If set to 0, the number will be calculated from ecutwfc. - - [NOTE] You must specify all three dimensions (ndx, ndy, ndz) for this setting to be used. These parameters must be used combined with nx, ny, nz. If nx, ny, nz are unset, ndx, ndy, ndz are used as nx, ny, nz. - default_value: "0" - unit: "" - availability: "" - - name: ndz - category: Plane wave related variables - type: Integer - description: | - If set to a positive number, specifies the number of FFT grid points for the dense part of charge density in z direction. If set to 0, the number will be calculated from ecutwfc. - - [NOTE] You must specify all three dimensions (ndx, ndy, ndz) for this setting to be used. These parameters must be used combined with nx, ny, nz. If nx, ny, nz are unset, ndx, ndy, ndz are used as nx, ny, nz. - default_value: "0" - unit: "" - availability: "" - - name: pw_seed - category: Plane wave related variables - type: Integer - description: | - Specify the random seed to initialize wave functions. Only positive integers are available. - default_value: "0" - unit: "" - availability: Only used for plane wave basis. - - name: diag_subspace - category: Plane wave related variables - type: Integer - description: | - The method to diagonalize subspace in dav_subspace method. - * 0: by LAPACK - * 1: by GenELPA - * 2: by ScaLAPACK - default_value: "0" - unit: "" - availability: "" - - name: erf_ecut - category: Plane wave related variables - type: Real - description: | - Used in variable-cell molecular dynamics (or in stress calculation). See erf_sigma for details. - default_value: "0.0" - unit: Ry - availability: "" - - name: fft_mode - category: Plane wave related variables - type: Integer - description: | - Set the mode of FFTW. - * 0: FFTW_ESTIMATE - * 1: FFTW_MEASURE - * 2: FFTW_PATIENT - * 3: FFTW_EXHAUSTIVE - default_value: "0" - unit: "" - availability: "" - - name: erf_height - category: Plane wave related variables - type: Real - description: | - Used in variable-cell molecular dynamics (or in stress calculation). See erf_sigma for details. - default_value: "0.0" - unit: Ry - availability: "" - - name: erf_sigma - category: Plane wave related variables - type: Real - description: | - In order to recover the accuracy of a constant energy cutoff calculation, the kinetic functional is modified, which is used in variable-cell molecular dynamics (or in stress calculation). - default_value: "0.1" - unit: Ry - availability: "" - - name: stru_file - category: Input files - type: String - description: | - The name of the structure file containing various information about atom species, including pseudopotential files, local orbitals files, cell information, atom positions, and whether atoms should be allowed to move. - default_value: STRU - unit: "" - availability: "" - - name: kpoint_file - category: Input files - type: String - description: | - The name of the k-point file that includes the k-point information of Brillouin zone. - default_value: KPT - unit: "" - availability: "" - - name: pseudo_dir - category: Input files - type: String - description: | - The directory of pseudopotential files. This parameter is combined with the pseudopotential filenames in the STRU file to form the complete pseudopotential file paths. - default_value: "\"\"" - unit: "" - availability: "" - - name: orbital_dir - category: Input files - type: String - description: | - The directory to save numerical atomic orbitals. This parameter is combined with orbital filenames in the STRU file to form the complete orbital file paths. - default_value: "\"\"" - unit: "" - availability: "" - - name: read_file_dir - category: Input files - type: String - description: | - Location of files, such as the electron density (chgs1.cube), required as a starting point. - default_value: OUT.$suffix - unit: "" - availability: "" - - name: restart_load - category: Input files - type: Boolean - 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_value: "False" - unit: "" - availability: Used only when numerical atomic orbitals are employed as basis set. - - name: basis_type - category: Electronic structure - type: String - description: | - Choose the basis set. - * pw: Using plane-wave basis set only. - * lcao: Using localized atomic orbital sets. - * lcao_in_pw: Expand the localized atomic set in plane-wave basis, non-self-consistent field calculation not tested. - default_value: pw - unit: "" - availability: "" - - name: ks_solver - category: Electronic structure - type: String - description: | - Choose the diagonalization methods for the Hamiltonian matrix expanded in a certain basis set. - - For plane-wave basis, - - * cg: The conjugate-gradient (CG) method. - * bpcg: The BPCG method, which is a block-parallel Conjugate Gradient (CG) method, typically exhibits higher acceleration in a GPU environment. - * dav: The Davidson algorithm. - * dav_subspace: The Davidson algorithm without orthogonalization operation, this method is the most recommended for efficiency. `pw_diag_ndim` can be set to 2 for this method. - - For numerical atomic orbitals basis, - - * lapack: Use LAPACK to diagonalize the Hamiltonian, only used for serial version - * genelpa: Use GEN-ELPA to diagonalize the Hamiltonian. - * scalapack_gvx: Use Scalapack to diagonalize the Hamiltonian. - * cusolver: Use CUSOLVER to diagonalize the Hamiltonian, at least one GPU is needed. - * cusolvermp: Use CUSOLVER to diagonalize the Hamiltonian, supporting multi-GPU devices. Note that you should set the number of MPI processes equal to the number of GPUs. - * elpa: The ELPA solver supports both CPU and GPU. By setting the `device` to GPU, you can launch the ELPA solver with GPU acceleration (provided that you have installed a GPU-supported version of ELPA, which requires you to manually compile and install ELPA, and the ABACUS should be compiled with -DUSE_ELPA=ON and -DUSE_CUDA=ON). The ELPA solver also supports multi-GPU acceleration. - - If you set ks_solver=`genelpa` for basis_type=`pw`, the program will stop with an error message: - - ``text genelpa can not be used with plane wave basis. `` - - Then the user has to correct the input file and restart the calculation. - default_value: "\n - PW basis: cg.\n - LCAO basis:\n - genelpa (if compiling option `USE_ELPA` has been set)\n - lapack (if compiling option `ENABLE_MPI` has not been set)\n - scalapack_gvx (if compiling option `USE_ELPA` has not been set and compiling option `ENABLE_MPI` has been set)\n - cusolver (if compiling option `USE_CUDA` has been set)" - unit: "" - availability: "" - - name: nbands - category: Electronic structure - type: Integer - description: | - The number of Kohn-Sham orbitals to calculate. It is recommended to setup this value, especially when smearing techniques are utilized, more bands should be included. - default_value: "" - unit: "" - availability: "" - - name: nelec - category: Electronic structure - type: Real - description: | - * 0.0: The total number of electrons will be calculated by the sum of valence electrons (i.e. assuming neutral system). - * >0.0: this denotes the total number of electrons in the system. Must be less than 2*nbands. - default_value: "0.0" - unit: "" - availability: "" - - name: nelec_delta - category: Electronic structure - type: Real - description: | - The total number of electrons will be calculated by nelec+nelec_delta. - default_value: "0.0" - unit: "" - availability: "" - - name: nupdown - category: Electronic structure - type: Real - description: | - * 0.0: no constrain apply to system. - * >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. - default_value: "0.0" - unit: "" - availability: "" - - name: dft_functional - category: Electronic structure - type: String - description: | - In our package, the XC functional can either be set explicitly using the dft_functional keyword in INPUT file. If dft_functional is not specified, ABACUS will use the xc functional indicated in the pseudopotential file. On the other hand, if dft_functional is specified, it will overwrite the functional from pseudopotentials and performs calculation with whichever functional the user prefers. We further offer two ways of supplying exchange-correlation functional. The first is using 'short-hand' names. A complete list of 'short-hand' expressions can be found in the source code. Supported density functionals are: - * LDA functionals - * LDA (equivalent with PZ and SLAPZNOGXNOGC), PWLDA - * GGA functionals - * PBE (equivalent with SLAPWPBXPBC), PBESOL, REVPBE, WC, BLYP, BP(referred to BP86), PW91, HCTH, OLYP, BLYP_LR - * meta-GGA functionals - * SCAN (require LIBXC) - * Hybrid functionals - * PBE0, HF - * If LIBXC is available, additional short-hand names of hybrid functionals are supported: HSE(referred to HSE06), B3LYP, LC_PBE, LC_WPBE, LRC_WPBE, LRC_WPBEH, CAM_PBEH, WP22, CWP22, MULLER (equivalent with POWER) - * Hybrid meta-GGA functionals - * SCAN0 (require LIBXC) - - 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'. - default_value: Used the same as DFT functional as specified in the pseudopotential files. - unit: "" - availability: "" - - name: xc_temperature - category: Electronic structure - type: Real - description: | - Specifies temperature when using temperature-dependent XC functionals (KSDT and so on). - default_value: "0.0" - unit: Ry - availability: "" - - name: xc_exch_ext - category: Electronic structure - type: Integer followed by Real values - description: | - Customized parameterization on the exchange part of XC functional. The first value should be the LibXC ID of the original functional, and latter values are external parameters. Default values are those of Perdew-Burke-Ernzerhof (PBE) functional. For more information on LibXC ID of functionals, please refer to LibXC. For parameters of functionals of interest, please refer to the source code of LibXC, such as PBE functional interface in LibXC: gga_x_pbe.c. - - [NOTE] Solely setting this keyword will take no effect on XC functionals. One should also set dft_functional to the corresponding functional to apply the customized parameterization. Presently this feature can only support parameterization on one exchange functional. - default_value: 101 0.8040 0.2195149727645171 - unit: "" - availability: "" - - name: xc_corr_ext - category: Electronic structure - type: Integer followed by Real values - description: | - Customized parameterization on the correlation part of XC functional. The first value should be the LibXC ID of the original functional, and latter values are external parameters. Default values are those of Perdew-Burke-Ernzerhof (PBE) functional. For more information on LibXC ID of functionals, please refer to LibXC. For parameters of functionals of interest, please refer to the source code of LibXC, such as PBE functional interface in LibXC: gga_c_pbe.c. - - [NOTE] Solely setting this keyword will take no effect on XC functionals. One should also set dft_functional to the corresponding functional to apply the customized parameterization. Presently this feature can only support parameterization on one correlation functional. - default_value: 130 0.06672455060314922 0.031090690869654895034 1.0 - unit: "" - availability: "" - - name: pseudo_rcut - category: Electronic structure - type: Real - description: | - Cut-off of radial integration for pseudopotentials. - default_value: "15" - unit: Bohr - availability: "" - - name: pseudo_mesh - category: Electronic structure - type: Boolean - description: | - * 0: Use a mesh for radial integration of pseudopotentials. - * 1: Use the mesh that is consistent with quantum espresso - default_value: "0" - unit: "" - availability: "" - - name: nspin - category: Electronic structure - type: Integer - description: | - The number of spin components of wave functions. - * 1: Spin degeneracy - * 2: Collinear spin polarized. - * 4: For the case of noncollinear polarized, nspin will be automatically set to 4 without being specified by the user. - default_value: "1" - unit: "" - availability: "" - - name: smearing_method - category: Electronic structure - type: String - description: | - It indicates which occupation and smearing method is used in the calculation. - * fixed: fixed occupations (available for non-coductors only) - * gauss or gaussian: Gaussian smearing method. - * mp: methfessel-paxton smearing method; recommended for metals. - * mp2: 2-nd methfessel-paxton smearing method; recommended for metals. - * mv or cold: marzari-vanderbilt smearing method. - * fd: Fermi-Dirac smearing method: and smearing_sigma below is the temperature (in Ry). - default_value: gauss - unit: "" - availability: "" - - name: smearing_sigma - category: Electronic structure - type: Real - description: | - Energy range for smearing. - default_value: "0.015" - unit: Ry - availability: "" - - name: smearing_sigma_temp - category: Electronic structure - type: Real - description: | - Energy range for smearing, smearing_sigma = 1/2 kB smearing_sigma_temp. - default_value: "2 * smearing_sigma / kB." - unit: K - availability: "" - - name: mixing_type - category: Electronic structure - type: String - description: | - Charge mixing methods. - * plain: Just simple mixing. - * pulay: Standard Pulay method. P. Pulay Chemical Physics Letters, (1980) - * broyden: Simplified modified Broyden method. D.D. Johnson Physical Review B (1988) - - In general, the convergence of the Broyden method is slightly faster than that of the Pulay method. - default_value: broyden - unit: "" - availability: "" - - name: mixing_beta - category: Electronic structure - type: Real - description: | - In general, the formula of charge mixing can be written as rho_new = rho_old + mixing_beta * drho, where rho_new represents the new charge density after charge mixing, rho_old represents the charge density in previous step, drho is obtained through various mixing methods, and mixing_beta is set by this parameter. A lower value of 'mixing_beta' results in less influence of drho on rho_new, making the self-consistent field (SCF) calculation more stable. However, it may require more steps to achieve convergence. We recommend the following options: - * 0.8: nspin=1 - * 0.4: nspin=2 and nspin=4 - * 0: keep charge density unchanged, usually used for restarting with init_chg=file or testing. - * 0.1 or less: if convergence of SCF calculation is difficult to reach, please try 0 < mixing_beta < 0.1. - A progressive tuning strategy might help, for example, 0.4 -> 0.1 -> 0.025. - - Note: For low-dimensional large systems, the setup of mixing_beta=0.1, mixing_ndim=20, and mixing_gg0=1.0 usually works well. - - 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. - default_value: "0.8 for nspin=1, 0.4 for nspin=2 and nspin=4." - unit: "" - availability: "" - - name: mixing_beta_mag - category: Electronic structure - type: Real - description: | - Mixing parameter of magnetic density. - - If SCF convergence is difficult with spin polarization (nspin=2 or nspin=4), try reducing both mixing_beta and mixing_beta_mag simultaneously, e.g., mixing_beta=0.1 and mixing_beta_mag=0.1 or lower. - default_value: "4*mixing_beta, but the maximum value is 1.6." - unit: "" - availability: "" - - name: mixing_ndim - category: Electronic structure - type: Integer - description: | - It indicates the mixing dimensions in Pulay or Broyden. Pulay and Broyden method use the density from previous mixing_ndim steps and do a charge mixing based on this density. - - 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. - default_value: "8" - unit: "" - availability: "" - - name: mixing_restart - category: Electronic structure - type: Real - 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. - default_value: "0" - unit: "" - availability: "" - - name: mixing_dmr - category: Electronic structure - type: Boolean - description: | - At n-th iteration which is calculated by drho= 0.0" - - name: mixing_gg0 - category: Electronic structure - type: Real - description: | - Whether to perfom Kerker scaling for charge density. - * >0: The high frequency wave vectors will be suppressed by multiplying a scaling factor. Setting mixing_gg0 = 1.0 is normally a good starting point. Kerker preconditioner will be automatically turned off if mixing_beta <= 0.1. - * 0: No Kerker scaling is performed. - - For systems that are difficult to converge, particularly metallic systems, enabling Kerker scaling may aid in achieving convergence. - default_value: "1.0" - unit: "" - availability: "" - - name: mixing_gg0_mag - category: Electronic structure - type: Real - description: | - Whether to perfom Kerker preconditioner of magnetic density. Note: we do not recommand to open Kerker preconditioner of magnetic density unless the system is too hard to converge. - default_value: "0.0" - unit: "" - availability: "" - - name: mixing_gg0_min - category: Electronic structure - type: Real - description: | - The minimum kerker coefficient. - default_value: "0.1" - unit: "" - availability: "" - - name: mixing_angle - category: Electronic structure - type: Real - 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 - default_value: "-10.0" - unit: "" - availability: Only relevant for non-colinear calculations nspin=4. - - name: mixing_tau - category: Electronic structure - type: Boolean - 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. - default_value: "False" - unit: "" - availability: Only relevant for meta-GGA calculations. - - name: mixing_dftu - category: Electronic structure - type: Boolean - 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. - default_value: "False" - unit: "" - availability: Only relevant for DFT+U calculations. - - name: gamma_only - category: Electronic structure - type: Boolean - 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. - - 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 - - name: scf_nmax - category: Electronic structure - type: Integer - description: | - This variable indicates the maximal iteration number for electronic iterations. - default_value: "100" - unit: "" - availability: "" - - name: scf_thr - category: Electronic structure - type: Real - 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. - default_value: "1.0e-9 (plane-wave basis), or 1.0e-7 (localized atomic orbital basis)." - unit: "Ry if scf_thr_type=1, dimensionless if scf_thr_type=2" - availability: "" - - name: scf_ene_thr - category: Electronic structure - type: Real - description: | - It's the energy threshold for electronic iteration. It represents the total energy error between two sequential densities from electronic iterations. - default_value: "-1.0. If the user does not set this parameter, it will not take effect." - unit: eV - availability: "" - - name: scf_thr_type - category: Electronic structure - type: Integer - description: | - Choose the calculation method of convergence criterion. - * 1: the criterion is defined in reciprocal space, which is used in SCF of PW basis with unit Ry. - * 2: the criterion is defined in real space, where is the number of electron, which is used in SCF of LCAO with unit dimensionless. - default_value: "1 (plane-wave basis), or 2 (localized atomic orbital basis)." - unit: "" - availability: "" - - name: scf_os_stop - category: Electronic structure - type: Boolean - description: | - For systems that are difficult to converge, the SCF process may exhibit oscillations in charge density, preventing further progress toward the specified convergence criteria and resulting in continuous oscillation until the maximum number of steps is reached; this greatly wastes computational resources. To address this issue, this function allows ABACUS to terminate the SCF process early upon detecting oscillations, thus reducing subsequent meaningless calculations. The detection of oscillations is based on the slope of the logarithm of historical drho values. To this end, Least Squares Method is used to calculate the slope of the logarithmically taken drho for the previous scf_os_ndim iterations. If the calculated slope is larger than scf_os_thr, stop the SCF. - - * 0: The SCF will continue to run regardless of whether there is oscillation or not. - * 1: If the calculated slope is larger than scf_os_thr, stop the SCF. - default_value: "false" - unit: "" - availability: "" - - name: scf_os_thr - category: Electronic structure - type: Real - 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. - default_value: "-0.01" - unit: "" - availability: "" - - name: scf_os_ndim - category: Electronic structure - type: Integer - description: | - To determine the number of old iterations' drho used in slope calculations. - default_value: mixing_ndim - unit: "" - availability: "" - - name: sc_os_ndim - category: Electronic structure - type: Integer - 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. - default_value: "5" - unit: "" - availability: "" - - name: lspinorb - category: Electronic structure - type: Boolean - description: | - Whether to consider spin-orbit coupling (SOC) effect in the calculation. - * True: Consider spin-orbit coupling effect. When enabled: - * nspin is automatically set to 4 (noncollinear spin representation) - * Symmetry is automatically disabled (SOC breaks inversion symmetry) - * Requires full-relativistic pseudopotentials with has_so=true in the UPF header - * False: Do not consider spin-orbit coupling effect. - * Common Error: "no soc upf used for lspinorb calculation" - ensure you are using full-relativistic pseudopotentials - default_value: "False" - unit: "" - availability: "" - - name: noncolin - category: Electronic structure - type: Boolean - description: | - Whether to allow non-collinear magnetic moments, where magnetization can point in arbitrary directions (x, y, z components) rather than being constrained to the z-axis. - * True: Allow non-collinear polarization. When enabled: - * nspin is automatically set to 4 - * Wave function dimension is doubled (npol=2), and the number of occupied states is doubled - * Charge density has 4 components (Pauli spin matrices) - * Cannot be used with gamma_only=true - * Can be combined with lspinorb=true for SOC effects with non-collinear magnetism - * False: Do not allow non-collinear polarization (magnetization constrained to z-axis). - * Relationship with lspinorb: - * noncolin=0, lspinorb=1: SOC with z-axis magnetism only (for non-magnetic materials with SOC) - * noncolin=1, lspinorb=0: Non-collinear magnetism without SOC - * noncolin=1, lspinorb=1: Both non-collinear magnetism and SOC - default_value: "False" - unit: "" - availability: "" - - name: soc_lambda - category: Electronic structure - type: Real - 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: - * soc_lambda 0.0: Scalar-relativistic case (no SOC) - * soc_lambda 1.0: Full-relativistic case (full SOC) - * Intermediate values: Partial-relativistic SOC (interpolation between scalar and full) - - 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 - - name: dfthalf_type - category: Electronic structure - type: Integer - description: | - DFT-1/2 type: - * 0: DFT-1/2 is off. - * 1: Shell DFT-1/2 method is used. - default_value: "0" - unit: "" - availability: "" - - name: pw_diag_thr - category: Plane wave related variables - type: Real - 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. - default_value: "0.01" - unit: "" - availability: "" - - name: diago_smooth_ethr - category: Plane wave related variables - type: Boolean - 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. - default_value: "false" - unit: "" - availability: "" - - name: use_k_continuity - category: Plane wave related variables - type: Boolean - 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_value: "false" - unit: "" - availability: Used only for plane wave basis set. - - name: pw_diag_nmax - category: Plane wave related variables - type: Integer - 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_value: "50" - unit: "" - availability: "basis_type==pw, ks_solver==cg/dav/dav_subspace/bpcg" - - name: pw_diag_ndim - category: Plane wave related variables - type: Integer - 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. - default_value: "4" - unit: "" - availability: "" - - name: diago_cg_prec - category: Plane wave related variables - type: Integer - description: | - Preconditioner type for conjugate gradient diagonalization method. - default_value: "1" - unit: "" - availability: "" - - name: nb2d - category: System variables - type: Integer - description: | - In LCAO calculations, the Hamiltonian and overlap matrices are distributed across 2D processor grid. This parameter controls the 2D block size for distribution. - default_value: "0" - unit: "" - availability: "" - - name: lmaxmax - category: Numerical atomic orbitals related variables - type: Integer - 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. - default_value: "2." - unit: "" - availability: "" - - name: lcao_ecut - category: Numerical atomic orbitals related variables - type: Real - 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). - default_value: ecutwfc - unit: "" - availability: "" - - name: lcao_dk - category: Numerical atomic orbitals related variables - type: Real - 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. - default_value: "0.01" - unit: Bohr - availability: "" - - name: lcao_dr - category: Numerical atomic orbitals related variables - type: Real - description: | - r spacing of the integration table of two-center integrals. - default_value: "0.01" - unit: Bohr - availability: "" - - name: lcao_rmax - category: Numerical atomic orbitals related variables - type: Real - description: | - Maximum distance for the two-center integration table. - default_value: "30" - unit: Bohr - availability: "" - - name: search_radius - category: Numerical atomic orbitals related variables - type: Real - 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. - default_value: "-1" - unit: Bohr - availability: "" - - name: "bx" - category: Numerical atomic orbitals related variables - type: Integer - 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. - default_value: "0" - unit: "" - availability: "" - - name: by - category: Numerical atomic orbitals related variables - type: Integer - 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. - default_value: "0" - unit: "" - availability: "" - - name: bz - category: Numerical atomic orbitals related variables - type: Integer - 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. - default_value: "0" - unit: "" - availability: "" - - name: elpa_num_thread - category: Numerical atomic orbitals related variables - type: Integer - description: | - Number of threads used in one elpa calculation. - - If the number is below 0 or 0 or beyond the max number of threads, all elpa calculation will be using all mpi threads - default_value: "-1" - unit: "" - availability: "" - - name: num_stream - category: Numerical atomic orbitals related variables - type: Integer - description: | - The number of CUDA streams used in LCAO calculations with GPU acceleration. - default_value: "4" - unit: "" - availability: "" - - name: bessel_nao_ecut - category: NAOs - type: String - 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/. - default_value: ecutwfc - unit: "" - availability: "" - - name: bessel_nao_tolerence - category: NAOs - type: Real - description: | - Tolerance when searching for the zeros of spherical Bessel functions. - default_value: "1.0e-12" - unit: "" - availability: "" - - name: bessel_nao_rcut - category: NAOs - type: Vector of Real (N values) - description: | - Cutoff radius (in Bohr) and the common node of spherical Bessel functions used to construct the NAOs. - default_value: "6.0" - unit: "" - availability: "" - - name: bessel_nao_smooth - category: NAOs - type: Boolean - description: | - If True, NAOs will be smoothed near the cutoff radius. See bessel_nao_rcut and bessel_nao_sigma for parameters. - default_value: "True" - unit: "" - availability: "" - - name: bessel_nao_sigma - category: NAOs - type: Real - description: | - Smoothing range (in Bohr). See also bessel_nao_smooth. - default_value: "0.1" - unit: "" - availability: "" - - name: relax_method - category: Geometry relaxation - type: Vector of string - description: | - The methods to do geometry optimization. The available algorithms depend on the relax_new setting. - - First element (algorithm selection): - * cg: Conjugate gradient (CG) algorithm. Available for both relax_new = True (default, simultaneous optimization) and relax_new = False (nested optimization). See relax_new for implementation details. - * bfgs: Broyden–Fletcher–Goldfarb–Shanno (BFGS) quasi-Newton algorithm. Only available when relax_new = False. - * lbfgs: Limited-memory BFGS algorithm, suitable for large systems. Only available when relax_new = False. - * cg_bfgs: Mixed method starting with CG and switching to BFGS when force convergence reaches relax_cg_thr. Only available when relax_new = False. - * sd: Steepest descent algorithm. Only available when relax_new = False. Not recommended for production use. - * fire: Fast Inertial Relaxation Engine method, a molecular-dynamics-based relaxation algorithm. Use by setting calculation to md and md_type to fire. Ionic velocities must be set in STRU file. See fire for details. - - Second element (BFGS variant, only when first element is bfgs): - * 1: Traditional BFGS that updates the Hessian matrix B and then inverts it. - * 2 or omitted: Default BFGS that directly updates the inverse Hessian (recommended). - - [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". - default_value: cg 1 - unit: "" - availability: "" - - name: relax_new - category: Geometry relaxation - type: Boolean - description: | - Controls which implementation of geometry relaxation to use. At the end of 2022, a new implementation of the Conjugate Gradient (CG) method was introduced for relax and cell-relax calculations, while the old implementation was kept for backward compatibility. - - - * True (default): Use the new CG implementation with the following features: - * Simultaneous optimization of ionic positions and cell parameters (for cell-relax) - * Line search algorithm for step size determination - * Only CG algorithm is available (relax_method must be cg) - * Supports advanced cell constraints: fixed_axes = "shape", "volume", "a", "b", "c", etc. - * Supports fixed_ibrav to maintain lattice type - * More efficient for variable-cell relaxation - * Step size controlled by relax_scale_force - - - False: Use the old implementation with the following features: - * Nested optimization procedure: ionic positions optimized first, then cell parameters (for cell-relax) - * Multiple algorithms available: cg, bfgs, lbfgs, sd, cg_bfgs - * Limited cell constraints: only fixed_axes = "volume" is supported - * Traditional approach with separate ionic and cell optimization steps - default_value: "True" - unit: "" - availability: "" - - name: relax_scale_force - category: Geometry relaxation - type: Real - 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_value: "0.5" - unit: "" - availability: Only used when relax_new set to True - - name: relax_nmax - category: Geometry relaxation - type: Integer - 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. - default_value: "1 for SCF, 50 for relax and cell-relax calcualtions" - unit: "" - availability: "" - - name: relax_cg_thr - category: Geometry relaxation - type: Real - 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_value: "0.5" - unit: eV/Angstrom - availability: Only used when relax_new = False and relax_method = cg_bfgs - - name: force_thr - category: Geometry relaxation - type: Real - 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. - default_value: "0.001" - unit: Ry/Bohr (25.7112 eV/Angstrom) - availability: "" - - name: force_thr_ev - category: Geometry relaxation - type: Real - 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. - default_value: "0.0257112" - unit: eV/Angstrom (0.03889 Ry/Bohr) - availability: "" - - name: force_zero_out - category: Geometry relaxation - type: Real - description: | - The atomic forces that are smaller than force_zero_out will be treated as zero. - default_value: "0.0" - unit: eV/Angstrom - availability: "" - - name: relax_bfgs_w1 - category: Geometry relaxation - type: Real - 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_value: "0.01" - unit: "" - availability: Only used when relax_new = False and relax_method is bfgs or cg_bfgs - - name: relax_bfgs_w2 - category: Geometry relaxation - type: Real - 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_value: "0.5" - unit: "" - availability: Only used when relax_new = False and relax_method is bfgs or cg_bfgs - - name: relax_bfgs_rmax - category: Geometry relaxation - type: Real - 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_value: "0.8" - unit: Bohr - availability: Only used when relax_new = False and relax_method is bfgs or cg_bfgs - - name: relax_bfgs_rmin - category: Geometry relaxation - type: Real - 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_value: "1e-5" - unit: Bohr - availability: Only used when relax_new = False and relax_method = bfgs 1 (traditional BFGS) - - name: relax_bfgs_init - category: Geometry relaxation - type: Real - description: | - 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_new = False and relax_method is bfgs or cg_bfgs - - name: stress_thr - category: Geometry relaxation - type: Real - description: | - The threshold of the stress convergence. The threshold is compared with the largest component of the stress tensor. - default_value: "0.5" - unit: kbar - availability: "" - - name: press1 - category: Geometry relaxation - type: Real - description: | - The external pressures along three axes. Positive input value is taken as compressive stress. - default_value: "0" - unit: kbar - availability: "" - - name: press2 - category: Geometry relaxation - type: Real - description: | - The external pressures along three axes. Positive input value is taken as compressive stress. - default_value: "0" - unit: kbar - availability: "" - - name: press3 - category: Geometry relaxation - type: Real - description: | - The external pressures along three axes. Positive input value is taken as compressive stress. - default_value: "0" - unit: kbar - availability: "" - - name: fixed_axes - category: Geometry relaxation - type: String - description: | - Specifies which cell degrees of freedom are fixed during variable-cell relaxation. The available options depend on the relax_new setting: - - When relax_new = True (default), all options are available: - * None: Default; all cell parameters can relax freely - * volume: Relaxation with fixed volume (allows shape changes) - * shape: Fix shape but allow volume changes (hydrostatic pressure only) - * a: Fix the a-axis lattice vector during relaxation - * b: Fix the b-axis lattice vector during relaxation - * c: Fix the c-axis lattice vector during relaxation - * ab: Fix both a and b axes during relaxation - * ac: Fix both a and c axes during relaxation - * bc: Fix both b and c axes during relaxation - - When relax_new = False, all options are now available: - * None: Default; all cell parameters can relax freely - * volume: Relaxation with fixed volume (allows shape changes). Volume is preserved by rescaling the lattice after each update. - * shape: Fix shape but allow volume changes (hydrostatic pressure only). Stress tensor is replaced with isotropic pressure. - * a, b, c, ab, ac, bc: Fix specific lattice vectors. Gradients for fixed vectors are set to zero. - - [NOTE] For VASP users, see the ISIF correspondence table in the geometry optimization documentation. Both implementations now support all constraint types. - default_value: None - unit: "" - availability: Only used when calculation is set to cell-relax - - name: fixed_ibrav - category: Geometry relaxation - type: Boolean - 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 - - [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: Can be used with both relax_new = True and relax_new = False. A specific latname must be provided. - - name: fixed_atoms - category: Geometry relaxation - type: Boolean - description: | - * True: The direct coordinates of atoms will be preserved during variable-cell relaxation. - * 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. - default_value: "False" - unit: "" - availability: "" - - name: md_type - category: Molecular dynamics - type: String - description: | - Control the algorithm to integrate the equation of motion for molecular dynamics (MD), see md.md in detail. - - * fire: a MD-based relaxation algorithm, named fast inertial relaxation engine. - * nve: NVE ensemble with velocity Verlet algorithm. - * nvt: NVT ensemble, see md_thermostat in detail. - * npt: Nose-Hoover style NPT ensemble, see md_pmode in detail. - * langevin: NVT ensemble with Langevin thermostat, see md_damp in detail. - * msst: MSST method, see msst_direction, msst_vel, msst_qmass, msst_vis, msst_tscale in detail. - default_value: nvt - unit: "" - availability: "" - - name: md_nstep - category: Molecular dynamics - type: Integer - description: | - The total number of molecular dynamics steps. - default_value: "10" - unit: "" - availability: "" - - name: md_dt - category: Molecular dynamics - type: Real - description: | - The time step used in molecular dynamics calculations. - default_value: "1.0" - unit: fs - availability: "" - - name: md_thermostat - category: Molecular dynamics - type: String - description: | - Specify the temperature control method used in NVT ensemble. - - * nhc: Nose-Hoover chain, see md_tfreq and md_tchain in detail. - * anderson: Anderson thermostat, see md_nraise in detail. - * berendsen: Berendsen thermostat, see md_nraise in detail. - * rescaling: velocity Rescaling method 1, see md_tolerance in detail. - * rescale_v: velocity Rescaling method 2, see md_nraise in detail. - * csvr: Canonical Sampling through Velocity Rescaling, see md_csvr_tau in detail. - default_value: nhc - unit: "" - availability: "" - - name: md_tfirst - category: Molecular dynamics - type: Real - description: | - The temperature used in molecular dynamics calculations. - - If md_tfirst is unset or less than zero, init_vel is autoset to be true. If init_vel is true, the initial temperature will be determined by the velocities read from STRU. In this case, if velocities are unspecified in STRU, the initial temperature is set to zero. - - If md_tfirst is set to a positive value and init_vel is true simultaneously, please make sure they are consistent, otherwise abacus will exit immediately. - - 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. - default_value: No default - unit: K - availability: "" - - name: md_tlast - category: Molecular dynamics - type: Real - description: | - The temperature used in molecular dynamics calculations. - - If md_tfirst is unset or less than zero, init_vel is autoset to be true. If init_vel is true, the initial temperature will be determined by the velocities read from STRU. In this case, if velocities are unspecified in STRU, the initial temperature is set to zero. - - If md_tfirst is set to a positive value and init_vel is true simultaneously, please make sure they are consistent, otherwise abacus will exit immediately. - - 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. - default_value: No default - unit: K - availability: "" - - name: md_prec_level - category: Molecular dynamics - type: Integer - description: | - Determine the precision level of variable-cell molecular dynamics calculations. - * 0: FFT grids do not change, only G vectors and K vectors are changed due to the change of lattice vector. This level is suitable for cases where the variation of the volume and shape is not large, and the efficiency is relatively higher. - * 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. - default_value: "0" - unit: "" - availability: "" - - name: md_restart - category: Molecular dynamics - type: Boolean - description: | - Control whether to restart molecular dynamics calculations and time-dependent density functional theory calculations. - * True: ABACUS will read in {md_step}, then read in the corresponding STRU_MD_suffix/STRU/ automatically. For tddft, ABACUS will also read in WFC_NAO_K${kpoint} of the last step (You need to set out_wfc_lcao=1 and out_app_flag=0 to obtain this file). - * False: ABACUS will start molecular dynamics calculations normally from the first step. - default_value: "False" - unit: "" - availability: "" - - name: md_restartfreq - category: Molecular dynamics - type: Integer - description: | - The output frequency of OUT.{suffix}/STRIU/, which are used to restart molecular dynamics calculations, see md_restart in detail. - default_value: "5" - unit: "" - availability: "" - - name: md_dumpfreq - category: Molecular dynamics - type: Integer - description: | - The output frequency of OUT.${suffix}/MD_dump in molecular dynamics calculations, which including the information of lattices and atoms. - default_value: "1" - unit: "" - availability: "" - - name: dump_force - category: Molecular dynamics - type: Boolean - description: | - Whether to output atomic forces into the file OUT.${suffix}/MD_dump. - default_value: "True" - unit: "" - availability: "" - - name: dump_vel - category: Molecular dynamics - type: Boolean - description: | - Whether to output atomic velocities into the file OUT.${suffix}/MD_dump. - default_value: "True" - unit: "" - availability: "" - - name: dump_virial - category: Molecular dynamics - type: Boolean - description: | - Whether to output lattice virials into the file OUT.${suffix}/MD_dump. - default_value: "True" - unit: "" - availability: "" - - name: md_seed - category: Molecular dynamics - type: Integer - description: | - The random seed to initialize random numbers used in molecular dynamics calculations. - * < 0: No srand() function is called. - * >= 0: The function srand(md_seed) is called. - default_value: "-1" - unit: "" - availability: "" - - name: md_tfreq - category: Molecular dynamics - type: Real - description: | - Control the frequency of temperature oscillations during the simulation. If it is too large, the temperature will fluctuate violently; if it is too small, the temperature will take a very long time to equilibrate with the atomic system. - - 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. - default_value: 1/40/md_dt - unit: "" - availability: "" - - name: md_tchain - category: Molecular dynamics - type: Integer - description: | - Number of thermostats coupled with the particles in the NVT/NPT ensemble based on the Nose-Hoover style non-Hamiltonian equations of motion. - default_value: "1" - unit: "" - availability: "" - - name: md_pmode - category: Molecular dynamics - type: String - description: | - Determine the precision level of variable-cell molecular dynamics calculations. - * 0: FFT grids do not change, only G vectors and K vectors are changed due to the change of lattice vector. This level is suitable for cases where the variation of the volume and shape is not large, and the efficiency is relatively higher. - * 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. - default_value: iso - unit: "" - availability: "" - - name: ref_cell_factor - category: Molecular dynamics - type: Real - 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. - default_value: "1.0" - unit: "" - availability: "" - - name: md_pcouple - category: Molecular dynamics - type: String - description: | - The coupled lattice vectors will scale proportionally in NPT ensemble based on the Nose-Hoover style non-Hamiltonian equations of motion. - * none: Three lattice vectors scale independently. - * xyz: Lattice vectors x, y, and z scale proportionally. - * xy: Lattice vectors x and y scale proportionally. - * xz: Lattice vectors x and z scale proportionally. - * yz: Lattice vectors y and z scale proportionally. - default_value: none - unit: "" - availability: "" - - name: md_pfirst - category: Molecular dynamics - type: Real - 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. - default_value: "-1.0" - unit: kbar - availability: "" - - name: md_plast - category: Molecular dynamics - type: Real - 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. - default_value: "-1.0" - unit: kbar - availability: "" - - name: md_pfreq - category: Molecular dynamics - type: Real - description: | - The frequency of pressure oscillations during the NPT ensemble simulation. If it is too large, the pressure will fluctuate violently; if it is too small, the pressure will take a very long time to equilibrate with the atomic system. - - Note: It is a system-dependent empirical parameter. An improper choice might lead to the failure of jobs. - default_value: 1/400/md_dt - unit: "" - availability: "" - - name: md_pchain - category: Molecular dynamics - type: Integer - description: | - The number of thermostats coupled with the barostat in the NPT ensemble based on the Nose-Hoover style non-Hamiltonian equations of motion. - default_value: "1" - unit: "" - availability: "" - - name: lj_rule - category: Molecular dynamics - type: Integer - description: | - The Lennard-Jones potential between two atoms equals: $\sigma_k\sigma(i,j)$ - default_value: "2" - unit: "" - availability: "" - - name: lj_eshift - category: Molecular dynamics - type: Boolean - description: | - It True, the LJ potential is shifted by a constant such that it is zero at the cut-off distance. - default_value: "False" - unit: "" - availability: "" - - name: lj_rcut - category: Molecular dynamics - type: Real - 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. - default_value: No default - unit: Angstrom - availability: "" - - name: lj_epsilon - category: Molecular dynamics - type: Real - description: | - The vector representing the matrix for Leonard Jones potential. See details in lj_rule. - default_value: No default - unit: eV - availability: "" - - name: lj_sigma - category: Molecular dynamics - type: Real - description: | - The vector representing the matrix for Leonard Jones potential. See details in lj_rule. - default_value: No default - unit: Angstrom - availability: "" - - name: pot_file - category: Molecular dynamics - type: String - description: | - The filename of DP/NEP potential files, see md.md in detail. - default_value: graph.pb - unit: "" - availability: "" - - name: dp_rescaling - category: Molecular dynamics - type: Real - description: | - 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. - - name: dp_fparam - category: Molecular dynamics - type: Real - 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_value: "{}" - unit: "" - availability: esolver_type = dp. - - name: dp_aparam - category: Molecular dynamics - type: Real - 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_value: "{}" - unit: "" - availability: esolver_type = dp. - - name: msst_direction - category: Molecular dynamics - type: Integer - description: | - The direction of the shock wave in the MSST method. - * 0: x direction - * 1: y direction - * 2: z direction - default_value: "2" - unit: "" - availability: "" - - name: msst_vel - category: Molecular dynamics - type: Real - description: | - The velocity of the shock wave in the MSST method. - default_value: "0.0" - unit: Angstrom/fs - availability: "" - - name: msst_vis - category: Molecular dynamics - type: Real - description: | - Artificial viscosity in the MSST method. - default_value: "0.0" - unit: "g/(mol*Angstrom*fs)" - availability: "" - - name: msst_tscale - category: Molecular dynamics - type: Real - description: | - The reduction percentage of the initial temperature used to compress volume in the MSST method. - default_value: "0.01" - unit: "" - availability: "" - - name: msst_qmass - category: Molecular dynamics - type: Real - description: | - Inertia of the extended system variable. You should set a number larger than 0. - default_value: No default - unit: "" - availability: "" - - name: md_damp - category: Molecular dynamics - type: Real - description: | - The damping parameter used to add fictitious force in the Langevin method. - default_value: "1.0" - unit: fs - availability: "" - - name: md_csvr_tau - category: Molecular dynamics - type: Real - 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_value: "100.0" - unit: fs - availability: md_thermostat = csvr - - name: md_tolerance - category: Molecular dynamics - type: Real - description: | - The temperature tolerance for velocity rescaling. Velocities are rescaled if the current and target temperature differ more than md_tolerance. - default_value: "100.0" - unit: K - availability: "" - - name: md_nraise - category: Molecular dynamics - type: Integer - description: | - * Anderson: The "collision frequency" parameter is given as 1/md_nraise. - * Berendsen: The "rise time" parameter is given in units of the time step: tau = md_nraise*md_dt, so md_dt/tau = 1/md_nraise. - * Rescale_v: Every md_nraise steps the current temperature is rescaled to the target temperature. - default_value: "1" - unit: "" - availability: "" - - name: cal_syns - category: Molecular dynamics - type: "Boolean [Integer](optional)" - description: | - Whether to calculate and output asynchronous overlap matrix for Hefei-NAMD interface. When enabled, calculates by computing overlap between basis functions at atomic positions from previous time step and current time step. The overlap is calculated by shifting atom positions backward by velocity x md_dt. Output file: OUT.*/syns_nao.csr in CSR format. - - * 0 or false: disable - * 1 or true: enable with default precision (8 digits) - * 1 5: enable with custom precision (5 digits) - - [NOTE] Only works with LCAO basis and molecular dynamics calculations. Requires atomic velocities. Output starts from the second MD step (istep > 0). - default_value: "False" - unit: "" - availability: "" - - name: dmax - category: Molecular dynamics - type: Real - description: | - The maximum displacement of all atoms in one step. This parameter is useful when cal_syns = True. - default_value: "0.01" - unit: bohr - availability: "" - - name: of_kinetic - category: "OFDFT: orbital free density functional theory" - type: String - description: | - Kinetic energy functional type: - * tf: Thomas-Fermi (TF) functional - * vw: von Weizsacker (vW) functional - * tf+: TF + vW functional - * wt: Wang-Teter (WT) functional - * ext-wt: Extended Wang-Teter functional - * xwm: XWM functional - * lkt: Luo-Karasiev-Trickey (LKT) functional - * ml: Machine learning KEDF - * mpn: MPN KEDF (automatically sets ml parameters) - * cpn5: CPN5 KEDF (automatically sets ml parameters) - default_value: wt - unit: "" - availability: OFDFT - - name: of_method - category: "OFDFT: orbital free density functional theory" - type: String - description: | - The optimization method used in OFDFT. - * cg1: Polak-Ribiere. Standard CG algorithm. - * cg2: Hager-Zhang (generally faster than cg1). - * tn: Truncated Newton algorithm. - default_value: tn - unit: "" - availability: OFDFT - - name: of_conv - category: "OFDFT: orbital free density functional theory" - type: String - 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. - * both: Both energy and potential must satisfy the convergence criterion. - default_value: energy - unit: "" - availability: OFDFT - - name: of_tole - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - Tolerance of the energy change for determining the convergence. - default_value: "2e-6" - unit: Ry - availability: OFDFT - - name: of_tolp - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - Tolerance of potential for determining the convergence. - default_value: "1e-5" - unit: Ry - availability: OFDFT - - name: of_tf_weight - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - Weight of TF KEDF (kinetic energy density functional). - default_value: "1.0" - unit: "" - availability: "OFDFT with of_kinetic=tf, tf+, wt, ext-wt, xwm" - - name: of_vw_weight - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - 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" - - name: of_wt_alpha - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - Parameter alpha of WT KEDF (kinetic energy density functional). - default_value: "" - unit: "" - availability: "OFDFT with of_kinetic=wt, ext-wt" - - name: of_wt_beta - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - Parameter beta of WT KEDF (kinetic energy density functional). - default_value: "" - unit: "" - availability: "OFDFT with of_kinetic=wt, ext-wt" - - name: of_extwt_kappa - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - 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 - - name: of_wt_rho0 - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - The average density of system. - default_value: "0.0" - unit: Bohr^-3 - availability: OFDFT with of_kinetic=wt - - name: of_hold_rho0 - category: "OFDFT: orbital free density functional theory" - type: Boolean - 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. - default_value: "False" - unit: "" - availability: OFDFT with of_kinetic=wt - - name: of_lkt_a - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - Parameter a of LKT KEDF (kinetic energy density functional). - default_value: "1.3" - unit: "" - availability: OFDFT with of_kinetic=lkt - - name: of_xwm_rho_ref - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - 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 - - name: of_xwm_kappa - category: "OFDFT: orbital free density functional theory" - type: Real - description: | - 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 - - name: of_read_kernel - category: "OFDFT: orbital free density functional theory" - type: Boolean - 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. - default_value: "False" - unit: "" - availability: OFDFT with of_kinetic=wt - - name: of_kernel_file - category: "OFDFT: orbital free density functional theory" - type: String - description: | - The name of WT kernel file. - default_value: WTkernel.txt - unit: "" - availability: OFDFT with of_read_kernel=True - - name: of_full_pw - category: "OFDFT: orbital free density functional theory" - type: Boolean - 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. - default_value: "True" - unit: "" - availability: OFDFT - - name: of_full_pw_dim - category: "OFDFT: orbital free density functional theory" - type: Integer - description: | - Specify the parity of FFT dimensions. - * 0: either odd or even. - * 1: odd only. - * 2: even only. - - 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 - - name: of_ml_gene_data - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Boolean - 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_value: "False" - unit: "" - availability: Used only for KSDFT with plane wave basis - - name: of_ml_device - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: String - description: | - Run Neural Network on GPU or CPU. - * cpu: CPU - * gpu: GPU - default_value: cpu - unit: "" - availability: OFDFT - - name: of_ml_feg - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Integer - 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. - * 3: Incorporate the FEG limit by nonlinear transformation using softplus function. - default_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_nkernel - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Integer - description: | - Number of kernel functions. - default_value: "1" - unit: "" - availability: OFDFT - - name: of_ml_kernel - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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. - * 3: Truncated kinetic kernel (TKK), the file containing TKK is specified by of_ml_kernel_file. - default_value: "1" - unit: "" - availability: OFDFT - - name: of_ml_kernel_scaling - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Real - 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_value: "1.0" - unit: "" - availability: OFDFT - - name: of_ml_yukawa_alpha - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Real - 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_value: "1.0" - unit: "" - availability: OFDFT - - name: of_ml_kernel_file - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of String - 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_value: none - unit: "" - availability: OFDFT - - name: of_ml_gamma - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Boolean - description: | - Local descriptor: gamma = (rho / rho0)^(1/3). - default_value: "False" - unit: "" - availability: OFDFT - - name: of_ml_p - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Boolean - description: | - Semi-local descriptor: p = |nabla rho|^2 / [2 (3 pi^2)^(1/3) rho^(4/3)]^2. - default_value: "False" - unit: "" - availability: OFDFT - - name: of_ml_q - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Boolean - description: | - Semi-local descriptor: q = nabla^2 rho / [4 (3 pi^2)^(2/3) rho^(5/3)]. - default_value: "False" - unit: "" - availability: OFDFT - - name: of_ml_tanhp - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Boolean - description: | - Semi-local descriptor: tanhp = tanh(chi_p * p). - default_value: "False" - unit: "" - availability: OFDFT - - name: of_ml_tanhq - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Boolean - description: | - Semi-local descriptor: tanhq = tanh(chi_q * q). - default_value: "False" - unit: "" - availability: OFDFT - - name: of_ml_chi_p - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Real - description: | - Hyperparameter chi_p: tanhp = tanh(chi_p * p). - default_value: "1.0" - unit: "" - availability: OFDFT - - name: of_ml_chi_q - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Real - description: | - Hyperparameter chi_q: tanhq = tanh(chi_q * q). - default_value: "1.0" - unit: "" - availability: OFDFT - - name: of_ml_gammanl - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_pnl - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_qnl - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_xi - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_tanhxi - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_tanhxi_nl - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_tanh_pnl - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_tanh_qnl - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_tanhp_nl - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_tanhq_nl - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Integer - 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_value: "0" - unit: "" - availability: OFDFT - - name: of_ml_chi_xi - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Real - 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_value: "1.0" - unit: "" - availability: OFDFT - - name: of_ml_chi_pnl - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Real - 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_value: "1.0" - unit: "" - availability: OFDFT - - name: of_ml_chi_qnl - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Vector of Real - 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_value: "1.0" - unit: "" - availability: OFDFT - - name: of_ml_local_test - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Boolean - description: | - FOR TEST. Read in the density, and output the F and Pauli potential. - default_value: "False" - unit: "" - availability: OFDFT - - name: ml_exx - category: "ML-KEDF: machine learning based kinetic energy density functional for OFDFT" - type: Boolean - description: | - Whether to use machine learning based exact exchange (ML-EXX). - default_value: "False" - unit: "" - availability: "" - - name: method_sto - category: Electronic structure (SDFT) - type: Integer - 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. - * other: use 2 - default_value: "2" - unit: "" - availability: esolver_type = sdft - - name: nbands_sto - category: Electronic structure (SDFT) - type: Integer or string - description: | - The number of stochastic orbitals - * > 0: 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: Perform Kohn-Sham DFT. - * 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 - - name: nche_sto - category: Electronic structure (SDFT) - type: Integer - description: | - Chebyshev expansion orders for stochastic DFT. - default_value: "100" - unit: "" - availability: esolver_type = sdft - - name: emin_sto - category: Electronic structure (SDFT) - type: Real - description: | - Trial energy to guess the lower bound of eigen energies of the Hamiltonian Operator. - default_value: "0.0" - unit: Ry - availability: esolver_type = sdft - - name: emax_sto - category: Electronic structure (SDFT) - type: Real - description: | - Trial energy to guess the upper bound of eigen energies of the Hamiltonian Operator. - default_value: "0.0" - unit: Ry - availability: esolver_type = sdft - - name: seed_sto - category: Electronic structure (SDFT) - type: Integer - 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). - * <= -1: Stochastic orbitals have the form of +1 or -1 with equal probability. - * -1: the seed is decided by time(NULL). - default_value: "0" - unit: "" - availability: esolver_type = sdft - - name: initsto_ecut - category: Electronic structure (SDFT) - type: Real - 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_value: "0.0" - unit: Ry - availability: esolver_type = sdft - - name: initsto_freq - category: Electronic structure (SDFT) - type: Integer - 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. - default_value: "0" - unit: "" - availability: esolver_type = sdft - - name: npart_sto - category: Electronic structure (SDFT) - type: Integer - 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_value: "1" - unit: "" - availability: method_sto = 2 and out_dos = 1 or cal_cond = True - - name: deepks_out_labels - category: DeePKS - type: Integer - 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. - * 2 : Output target labels for label preperation. The label files are named as deepks_.npy or deepks_.csr, where the units and formats are the same as label files .npy or .csr required for training, except that the first dimension (nframes) is excluded. System structrue files are also given in deepks_atom.npy and deepks_box.npy in the unit of Bohr, which means lattice_constant should be set to 1 when training. - - [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 - - name: deepks_out_freq_elec - category: DeePKS - type: Integer - 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_value: "0" - unit: "" - availability: Numerical atomic orbital basis - - name: deepks_out_base - category: DeePKS - type: String - 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_value: None - unit: "" - availability: Numerical atomic orbital basis and deepks_out_freq_elec is greater than 0 - - name: deepks_scf - category: DeePKS - type: Boolean - description: | - perform self-consistent field iteration in DeePKS method - - [NOTE] A trained, traced model file is needed. - default_value: "False" - unit: "" - availability: Numerical atomic orbital basis - - name: deepks_equiv - category: DeePKS - type: Boolean - 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. - default_value: "False" - unit: "" - availability: Numerical atomic orbital basis - - name: deepks_model - category: DeePKS - type: String - description: | - 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 - - name: bessel_descriptor_lmax - category: DeePKS - type: Integer - 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_value: "2" - unit: "" - availability: gen_bessel calculation - - name: bessel_descriptor_ecut - category: DeePKS - type: String - description: | - energy cutoff of Bessel functions - default_value: same as ecutwfc - unit: Ry - availability: gen_bessel calculation - - name: bessel_descriptor_tolerence - category: DeePKS - type: Real - description: | - tolerance for searching the zeros of Bessel functions - default_value: "1.0e-12" - unit: "" - availability: gen_bessel calculation - - name: bessel_descriptor_rcut - category: DeePKS - type: Real - description: | - cutoff radius of Bessel functions - default_value: "6.0" - unit: Bohr - availability: gen_bessel calculation - - name: bessel_descriptor_smooth - category: DeePKS - type: Boolean - description: | - smooth the Bessel functions at radius cutoff - default_value: "False" - unit: "" - availability: gen_bessel calculation - - name: bessel_descriptor_sigma - category: DeePKS - type: Real - description: | - smooth parameter at the cutoff radius of projectors - default_value: "0.1" - unit: Bohr - availability: gen_bessel calculation - - name: deepks_bandgap - category: DeePKS - type: Integer - 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) - * 2: Include multiple bandgap label (see deepks_band_range for more details) - * 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 - - name: deepks_band_range - category: DeePKS - type: "Integer*2" - description: | - The first value should not be larger than the second one and the meaning differs in different cases below - * deepks_bandgap is 1: Bandgap label is the energy between LUMO + deepks_band_range[0] and LUMO + deepks_band_range[1]. If not set, it will calculate energy between HOMO and LUMO states. - * 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" - - name: deepks_v_delta - category: DeePKS - type: Integer - 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. - * deepks_v_delta = -1: deepks_vdrpre.npy, which is used to calculate V_delta_R during DeePKS training. - * 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 - - name: deepks_out_unittest - category: DeePKS - type: Boolean - description: | - generate files for constructing DeePKS unit test - - [NOTE] Not relevant when running actual calculations. When set to 1, ABACUS needs to be run with only 1 process. - default_value: "False" - unit: "" - availability: "" - - name: estep_per_md - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Integer - description: | - The number of electronic propagation steps between two ionic steps. - default_value: "1" - unit: "" - availability: "" - - name: td_dt - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Real - description: | - The time step used in electronic propagation. Setting td_dt will reset the value of md_dt to td_dt * estep_per_md. - default_value: md_dt / estep_per_md - unit: fs - availability: "" - - name: td_edm - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Integer - description: | - Method to calculate the energy-density matrix, mainly affects the calculation of force and stress. - * 0: Using the original formula. - * 1: Using the formula for ground state (deprecated). Note that this usually does not hold if wave function is not the eigenstate of the Hamiltonian. - default_value: "0" - unit: "" - availability: "" - - name: td_print_eij - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Real - description: | - Controls the printing of Hamiltonian matrix elements. - * < 0: Suppress all output. - * >= 0: Print only elements with either i or j exceeding td_print_eij. - default_value: "-1" - unit: Ry - availability: "" - - name: td_propagator - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Integer - description: | - Methods of electronic propagation. - * 0: Crank-Nicolson, based on matrix inversion. - * 1: 4th-order Taylor expansion of exponential. - * 2: Enforced time-reversal symmetry (ETRS). - * 3: Crank-Nicolson, based on solving linear equation. - default_value: "0" - unit: "" - availability: "" - - name: td_vext - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Boolean - description: | - * True: Add a laser-material interaction (external electric field). - * False: No external electric field. - default_value: "False" - unit: "" - availability: "" - - name: td_vext_dire - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Specifies the direction(s) of the external electric field when td_vext is enabled. For example, td_vext_dire 1 2 indicates that external electric fields are applied to both the x and y directions simultaneously. Electric field parameters can also be written as strings. For example, td_gauss_phase 0 1.5707963 indicates that the Gaussian type electric fields in the x and y directions have a phase delay of pi/2. - * 1: The external field direction is along the x-axis. - * 2: The external field direction is along the y-axis. - * 3: The external field direction is along the z-axis. - default_value: "1" - unit: "" - availability: "" - - name: td_stype - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Integer - description: | - Type of electric field in the space domain, i.e. the gauge of the electric field. - * 0: Length gauge. - * 1: Velocity gauge. - * 2: Hybrid gauge. See J. Chem. Theory Comput. 2025, 21, 3335-3341 for more information. - default_value: "0" - unit: "" - availability: "" - - name: td_ttype - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Type of electric field in the time domain. - * 0: Gaussian type function. - * 1: Trapezoid type function. - * 2: Trigonometric type function. - * 3: Heaviside type function. - default_value: "0" - unit: "" - availability: "" - - name: td_tstart - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Integer - description: | - The initial time step when the time-dependent electric field is activated. - default_value: "1" - unit: "" - availability: "" - - name: td_tend - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Integer - description: | - The final time step when the time-dependent electric field is deactivated. The field remains active between td_tstart and td_tend. - default_value: "1000" - unit: "" - availability: "" - - name: td_lcut1 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Real - description: | - The lower bound of the interval in the length gauge RT-TDDFT, where the coordinate is the fractional coordinate. - default_value: "0.05" - unit: "" - availability: "" - - name: td_lcut2 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Real - description: | - The upper bound of the interval in the length gauge RT-TDDFT, where the coordinate is the fractional coordinate. - default_value: "0.95" - unit: "" - availability: "" - - name: td_gauss_freq - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Frequency of the Gaussian type electric field. - default_value: "22.13" - unit: 1/fs - availability: "" - - name: td_gauss_phase - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Phase of the Gaussian type electric field. - default_value: "0.0" - unit: "" - availability: "" - - name: td_gauss_sigma - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Pulse width (standard deviation) of the Gaussian type electric field. - default_value: "30.0" - unit: fs - availability: "" - - name: td_gauss_t0 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Step number of the time center of the Gaussian type electric field. - default_value: "100" - unit: "" - availability: "" - - name: td_gauss_amp - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Amplitude of the Gaussian type electric field. - default_value: "0.25" - unit: V/Angstrom - availability: "" - - name: td_trape_freq - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Frequency of the trapezoid type electric field. - default_value: "1.60" - unit: 1/fs - availability: "" - - name: td_trape_phase - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Phase of the trapezoid type electric field. - default_value: "0.0" - unit: "" - availability: "" - - name: td_trape_t1 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Step number of the time interval t1 of the trapezoid type electric field. - default_value: "1875" - unit: "" - availability: "" - - name: td_trape_t2 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Step number of the time interval t2 of the trapezoid type electric field. - default_value: "5625" - unit: "" - availability: "" - - name: td_trape_t3 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Step number of the time interval t3 of the trapezoid type electric field. - default_value: "7500" - unit: "" - availability: "" - - name: td_trape_amp - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Amplitude of the trapezoid type electric field. - default_value: "2.74" - unit: V/Angstrom - availability: "" - - name: td_trigo_freq1 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Frequency 1 of the trigonometric type electric field. - default_value: "1.164656" - unit: 1/fs - availability: "" - - name: td_trigo_freq2 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Frequency 2 of the trigonometric type electric field. - default_value: "0.029116" - unit: 1/fs - availability: "" - - name: td_trigo_phase1 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Phase 1 of the trigonometric type electric field. - default_value: "0.0" - unit: "" - availability: "" - - name: td_trigo_phase2 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Phase 2 of the trigonometric type electric field. - default_value: "0.0" - unit: "" - availability: "" - - name: td_trigo_amp - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Amplitude of the trigonometric type electric field. - default_value: "2.74" - unit: V/Angstrom - availability: "" - - name: td_heavi_t0 - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Step number of the switch time of the Heaviside type electric field. - default_value: "100" - unit: "" - availability: "" - - name: td_heavi_amp - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - Amplitude of the Heaviside type electric field. - default_value: "1.0" - unit: V/Angstrom - availability: "" - - name: init_vecpot_file - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Boolean - description: | - Initialize vector potential through file or not. - * True: Initialize vector potential from file At.dat (unit: a.u.). It consists of four columns, representing the step number and vector potential on each direction. - * False: Calculate vector potential by integrating the electric field. - default_value: "False" - unit: "" - availability: "" - - name: ocp - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Boolean - description: | - * True: Fixes the band occupations based on the values specified in ocp_set. - * False: Does not fix the band occupations. - default_value: "False" - unit: "" - availability: "" - - name: ocp_set - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: String - description: | - If ocp is set to 1, ocp_set must be provided as a string specifying the occupation numbers for each band across all k-points. The format follows a space-separated pattern, where occupations are assigned sequentially to bands for each k-point. A shorthand notation Nx can be used to repeat a value x for N bands. - * Example: - 1 10*1 0 1 represents occupations for 13 bands, where the 12th band is fully unoccupied (0), and all others are occupied (1). - * For a system with multiple k-points, the occupations must be specified for all k-points, following their order in the output file kpoints (may lead to fractional occupations). - * Incorrect specification of ocp_set could lead to inconsistencies in electron counting, causing the calculation to terminate with an error. - default_value: None - unit: "" - availability: "" - - name: of_cd - category: "TDOFDFT: time dependent orbital free density functional theory" - type: Boolean - 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. - default_value: "False" - unit: "" - availability: TDOFDFT - - name: of_mcd_alpha - category: "TDOFDFT: time dependent orbital free density functional theory" - type: Real - description: | - 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 - - name: xc_kernel - category: Linear Response TDDFT (Under Development Feature) - type: String - description: | - The exchange-correlation kernel used in the calculation. Currently supported: RPA, LDA, PBE, HSE, HF. - default_value: LDA - unit: "" - availability: "" - - name: lr_init_xc_kernel - category: Linear Response TDDFT (Under Development Feature) - type: "Vector of String (>=1 values)" - description: | - The method to initalize the xc kernel. - * "default": Calculate xc kernel from the ground-state charge density. - * "file": Read the xc kernel on grid from the provided files. The following words should be the paths of ".cube" files, where the first 1 (nspin==1) or 3 (nspin==2, namely spin-aa, spin-ab and spin-bb) will be read in. The parameter xc_kernel will be invalid. Now only LDA-type kernel is supported as the potential will be calculated by directly multiplying the transition density. - * "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. - default_value: "\"default\"" - unit: "" - availability: "" - - name: lr_solver - category: Linear Response TDDFT (Under Development Feature) - type: String - description: | - The method to solve the Casida equation in LR-TDDFT under Tamm-Dancoff approximation (TDA). - * dav/dav_subspace/cg: Construct and diagonalize the Hamiltonian matrix iteratively with Davidson/Non-ortho-Davidson/CG algorithm. - * lapack: Construct the full matrix and directly diagonalize with LAPACK. - * spectrum: Calculate absorption spectrum only without solving Casida equation. - default_value: dav - unit: "" - availability: "" - - name: lr_thr - category: Linear Response TDDFT (Under Development Feature) - type: Real - 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. - default_value: "1e-2" - unit: "" - availability: "" - - name: nocc - category: Linear Response TDDFT (Under Development Feature) - type: Integer - description: | - The number of occupied orbitals (up to HOMO) used in the LR-TDDFT calculation. - * Note: If the value is illegal ( > nelec/2 or <= 0), it will be autoset to nelec/2. - default_value: nband - unit: "" - availability: "" - - name: nvirt - category: Linear Response TDDFT (Under Development Feature) - type: Integer - description: | - The number of virtual orbitals (starting from LUMO) used in the LR-TDDFT calculation. - default_value: "1" - unit: "" - availability: "" - - name: lr_nstates - category: Linear Response TDDFT (Under Development Feature) - type: Integer - description: | - The number of 2-particle states to be solved. - default_value: "0" - unit: "" - availability: "" - - name: lr_unrestricted - category: Linear Response TDDFT (Under Development Feature) - type: Boolean - description: | - Whether to use unrestricted construction for LR-TDDFT (the matrix size will be doubled). - * True: Always use unrestricted LR-TDDFT. - * False: Use unrestricted LR-TDDFT only when the system is open-shell. - default_value: "False" - unit: "" - availability: "" - - name: abs_wavelen_range - category: Linear Response TDDFT (Under Development Feature) - type: Real Real - description: | - The range of the wavelength for the absorption spectrum calculation. - default_value: 0.0 0.0 - unit: nm - availability: "" - - name: out_wfc_lr - category: Linear Response TDDFT (Under Development Feature) - type: Boolean - 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. - default_value: "False" - unit: "" - availability: "" - - name: abs_gauge - category: Linear Response TDDFT (Under Development Feature) - type: String - description: | - Whether to use length or velocity gauge to calculate the absorption spectrum in LR-TDDFT. - default_value: length - unit: "" - availability: "" - - name: abs_broadening - category: Linear Response TDDFT (Under Development Feature) - type: Real - description: | - The broadening factor for the absorption spectrum calculation. - default_value: "0.01" - unit: "" - availability: "" - - name: out_freq_ion - category: Output information - type: Integer - description: | - Controls the output interval in ionic steps. When set to a positive integer, information such as charge density, local potential, electrostatic potential, Hamiltonian matrix, overlap matrix, density matrix, and Mulliken population analysis is printed every n ionic steps. - - [NOTE] In RT-TDDFT calculations, this parameter is inactive; output frequency is instead controlled by out_freq_td. - default_value: "0" - unit: "" - availability: "" - - name: out_freq_td - category: Output information - type: Integer - description: | - Controls the output interval in completed electronic evolution steps during RT-TDDFT calculations. When set to a positive integer n, detailed information (see out_freq_ion) is printed every n electron time-evolution steps (i.e., every STEP OF ELECTRON EVOLVE). For example, if you wish to output information once per ionic step, you should set out_freq_td equal to estep_per_md, since one ionic step corresponds to estep_per_md electronic evolution steps. - - [NOTE] This parameter is only active in RT-TDDFT mode (esolver_type = tddft). It has no effect in ground-state calculations. - default_value: "0" - unit: "" - availability: "" - - name: out_freq_elec - category: Output information - type: Integer - 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. - default_value: scf_nmax - unit: "" - availability: "" - - name: out_chg - category: Output information - type: "Integer \\[Integer\\](optional)" - description: | - The first integer controls whether to output the charge density on real space grids: - - 1: Output the charge density (in Bohr^-3) on real space grids into the density files in the folder `OUT.${suffix}`. The files are named as: - - nspin = 1: `chg.cube`; - - nspin = 2: `chgs1.cube`, and `chgs2.cube`; - - nspin = 4: `chgs1.cube`, `chgs2.cube`, `chgs3.cube`, and `chgs4.cube`; - - When using the Meta-GGA functional, additional files containing the kinetic energy density are also output: - - nspin = 1: `tau.cube`; - - nspin = 2: `taus1.cube`, and `taus2.cube`; - - nspin = 4: `taus1.cube`, `taus2.cube`, `taus3.cube`, and `taus4.cube`; - - 2: On top of 1, also output the initial charge density files. The files are named as: - - out_freq_ion = 0: - - nspin = 1: `chg_ini.cube`; - - nspin = 2: `chgs1_ini.cube` and `chgs2_ini.cube`; - - nspin = 4: `chgs1_ini.cube`, `chgs2_ini.cube`, `chgs3_ini.cube`, and `chgs4_ini.cube`; - - output at every step (overwrite same file) - - out_freq_ion > 0: - - nspin = 1: `chgg{geom_step}_ini.cube` (e.g., `chgg1_ini.cube`); - - nspin = 2: `chgs1g{geom_step}_ini.cube` and `chgs2g{geom_step}_ini.cube`; - - nspin = 4: `chgs1g{geom_step}_ini.cube`, `chgs2g{geom_step}_ini.cube`, `chgs3g{geom_step}_ini.cube`, and `chgs4g{geom_step}_ini.cube`. - - output every out_freq_ion steps - Here, {geom_step} denotes the geometry step index, starting from 1 (geom_step = istep + 1). - - -1: Disable the charge density auto-back-up file `{suffix}-CHARGE-DENSITY.restart`, useful for large systems. - - The second integer controls the precision of the charge density output. If not given, `3` is used as default. For restarting from this file and other high-precision calculations, `10` is recommended. - - In molecular dynamics simulations, the output frequency is controlled by out_freq_ion. - - [NOTE] In the 3.10-LTS version, the file names are SPIN1_CHG.cube and SPIN1_CHG_INI.cube, etc. - default_value: 0 3 - unit: "" - availability: "" - - name: out_pot - category: Output information - type: "Integer \\[Integer\\](optional)" - description: | - * 1: Output the total local potential (i.e., local pseudopotential + Hartree potential + XC potential + external electric field (if exists) + dipole correction potential (if exists) + ...) on real space grids (in Ry) into files in the folder OUT.{suffix}. The files are named as: - * nspin = 1: pots1.cube; - * nspin = 2: pots1.cube and pots2.cube; - * nspin = 4: pots1.cube, pots2.cube, pots3.cube, and pots4.cube - * 2: Output the electrostatic potential on real space grids into OUT.{suffix}/pot_es.cube. The Python script named tools/02_postprocessing/average_pot/aveElecStatPot.py can be used to calculate the average electrostatic potential along the z-axis and outputs it into ElecStaticPot_AVE. Please note that the total local potential refers to the local component of the self-consistent potential, excluding the non-local pseudopotential. The distinction between the local potential and the electrostatic potential is as follows: local potential = electrostatic potential + XC potential. - * 3: Apart from 1, also output the total local potential of the initial charge density. The files are named as: - * out_freq_ion = 0: - * nspin = 1: `pot_ini.cube`; - * nspin = 2: `pots1_ini.cube` and `pots2_ini.cube`; - * nspin = 4: `pots1_ini.cube`, `pots2_ini.cube`, `pots3_ini.cube`, and `pots4_ini.cube`; - * output at every step (overwrite same file) - * out_freq_ion > 0: - * nspin = 1: `potg{geom_step}_ini.cube` (e.g., `potg1_ini.cube`); - * nspin = 2: `pots1g{geom_step}_ini.cube` and `pots2g{geom_step}_ini.cube`; - * nspin = 4: `pots1g{geom_step}_ini.cube`, `pots2g{geom_step}_ini.cube`, `pots3g{geom_step}_ini.cube`, and `pots4g{geom_step}_ini.cube`. - * output every out_freq_ion steps - Here, {geom_step} denotes the geometry step index, starting from 1 (geom_step = istep + 1). - - The optional second integer controls the output precision. If not provided, the default precision is 8. - - In molecular dynamics calculations, the output frequency is controlled by out_freq_ion. - - [NOTE] In the 3.10-LTS version, the file names are SPIN1_POT.cube and SPIN1_POT_INI.cube, etc. - default_value: "0" - unit: "" - availability: "" - - name: out_dmk - category: Output information - type: "Boolean \\[Integer\\](optional)" - 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; - * nspin = 2: dms1g1_nao.txt and dms2g1_nao.txt for the two spin channels. - * For multi-k points case: - * nspin = 1 and 4: dmk1g1_nao.txt, dmk2g1_nao.txt, ...; - * nspin = 2: dmk1s1g1_nao.txt... and dmk1s2g1_nao.txt... for the two spin channels. - - Here, g{istep} denotes the geometry/step index in the output file name. - - [NOTE] Version difference (develop vs 3.10-LTS): - * In develop, out_dmk supports both gamma-only and multi-k-point density-matrix output. - * 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 - - name: out_dmr - category: Output information - type: "Boolean \\[Integer\\](optional)" - 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_mat_hs2. 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. - - [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) - - name: out_wfc_pw - category: Output information - type: Integer - 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) - * non-gamma-only with nspin=1: wfk1_pw.txt, wfk2_pw.txt, ...; - * non-gamma-only with nspin=2: wfk1s1_pw.txt, wfk1s2_pw.txt, wfk2s1_pw.txt, wfk2s2_pw.txt, ...; - * non-gamma-only with nspin=4: wfk1s4_pw.txt, wfk2s4_pw.txt, ...; - * 2: (binary format) - * non-gamma-only with nspin=1: wfk1_pw.dat, wfk2_pw.dat, ...; - * non-gamma-only with nspin=2: wfk1s1_pw.dat, wfk1s2_pw.dat, wfk2s1_pw.dat, wfk2s2_pw.dat, ...; - * non-gamma-only with nspin=4: wfk1s4_pw.dat, wfk2s4_pw.dat, ...; - - [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)" - - name: out_wfc_lcao - category: Output information - type: Integer - 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) - * gamma-only: wfs1_nao.txt or wfs2_nao.txt, ...; - * non-gamma-only: wfs1k1_nao.txt or wfs1k2_nao.txt, ...; - * 2: (binary format) - * gamma-only: wfs1_nao.dat or wfs2_nao.dat, ...; - * non-gamma-only: wfs1k1_nao.dat or wfs1k2_nao.dat, .... - - The corresponding sequence of the orbitals can be seen in Basis Set. - - 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. - default_value: "0" - unit: "" - availability: Numerical atomic orbital basis - - name: out_dos - category: Output information - type: Integer - description: | - Whether to output the density of states (DOS). For more information, refer to the dos.md. - * 0: no output - * 1: output the density of states (DOS) - * nspin=1 or 4: doss1g{geom}_{basis}.txt, where geom is the geometry index when cell changes or ions move while basis is either pw or nao. - * nspin=2: doss1g{geom}_{basis}.txt and doss2g{geom}_{basis}.txt for two spin channles. - * 2: (LCAO) output the density of states (DOS) and the projected density of states (PDOS) - * 3: output the Fermi surface file (fermi.bxsf) in BXSF format that can be visualized by XCrySDen - default_value: "0" - unit: "" - availability: "" - - name: out_ldos - category: Output information - type: "Integer \\[Integer\\](optional)" - description: | - Whether to output the local density of states (LDOS), optionally output precision can be set by a second parameter, default is 3. - * 0: no output - * 1: output the partial charge density for given bias (controlled by stm_bias) in cube file format, which can be used to plot scanning tunneling spectroscopys to mimick STM images using the Python script plot.py. - * 2: output LDOS along a line in real space (controlled by ldos_line). Parameters used to control DOS output are also valid for LDOS. - * 3: output both two LDOS modes above. - default_value: "0" - unit: "" - availability: "" - - name: out_band - category: Output information - type: "Boolean \\[Integer\\](optional)" - description: | - Whether to output the eigenvalues of the Hamiltonian matrix (in eV) into the running log during electronic iterations and into a file at the end of calculations. The former can be used with the 'out_freq_elec' parameter while the latter option allows the output precision to be set via a second parameter, with a default value of 8. The output file names are: - * nspin = 1 or 4: eig.txt; - * nspin = 2: eigs1.txt and eigs2.txt; - * For more information, refer to the band.md - default_value: "False" - unit: "" - availability: "" - - name: out_proj_band - category: Output information - type: Boolean - description: | - Whether to output the projected band structure. For more information, refer to the band.md - default_value: "False" - unit: "" - availability: "" - - name: out_stru - category: Output information - type: Boolean - description: | - Whether to output structure files per ionic step in geometry relaxation calculations into OUT.{istep}_D, where ${istep} is the ionic step. - default_value: "False" - unit: "" - availability: "" - - name: out_level - category: Output information - type: String - description: | - Control the output level of information in OUT.{calculation}.log. - * ie: electronic iteration level, which prints useful information for electronic iterations; - * i: geometry relaxation level, which prints some information for geometry relaxations additionally; - * m: molecular dynamics level, which does not print some information for simplicity. - default_value: ie - unit: "" - availability: "" - - name: out_mat_hs - category: Output information - type: "Boolean \\[Integer\\](optional)" - description: | - Whether to print the upper triangular part of the Hamiltonian matrices and overlap matrices for each k-point into files in the directory OUT.${suffix}. The second number controls precision. For more information, please refer to hs_matrix.md. Also controled by out_freq_ion and out_app_flag. - * For gamma only case: - * nspin = 1: hks1_nao.txt for the Hamiltonian matrix and sks1_nao.txt for the overlap matrix; - * nspin = 2: hks1_nao.txt and hks2_nao.txt for the Hamiltonian matrix and sks1_nao.txt for the overlap matrix. Note that the code will not output sks2_nao.txt because it is the same as sks1_nao.txt; - * nspin = 4: hks12_nao.txt for the Hamiltonian matrix and sks12_nao.txt for the overlap matrix. - * For multi-k points case: - * nspin = 1: hks1k1_nao.txt for the Hamiltonian matrix at the 1st k-point, and sks1k1_nao.txt for the overlap matrix for the 1st k-point, ...; - * nspin = 2: hks1k1_nao.txt and hks2k1_nao.txt for the two spin channels of the Hamiltonian matrix at the 1st k-point, and sks1k1_nao.txt for the overlap matrix for the 1st k-point. Note that the code will not output sks2k1_nao.txt because it is the same as sks1k1_nao.txt, ...; - * nspin = 4: hks12k1_nao.txt for the Hamiltonian matrix at the 1st k-point, and sks12k1_nao.txt for the overlap matrix for the 1st k-point, ...; - - [NOTE] In the 3.10-LTS version, the file names are data-0-H and data-0-S, etc. - default_value: False 8 - unit: Ry - availability: Numerical atomic orbital basis - - name: out_mat_hs2 - category: Output information - type: "Boolean \\[Integer\\](optional)" - description: | - Whether to print files containing the Hamiltonian matrix and overlap matrix into files in the directory OUT.${suffix}. For more information, please refer to hs_matrix.md. - - [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: "False [8]" - unit: Ry - availability: Numerical atomic orbital basis (not gamma-only algorithm) - - name: out_mat_tk - category: Output information - type: "Boolean \\[Integer\\](optional)" - 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. - default_value: "False [8]" - unit: Ry - availability: Numerical atomic orbital basis - - name: out_mat_r - category: Output information - type: "Boolean \\[Integer\\](optional)" - 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. - default_value: False 8 - unit: Bohr - availability: Numerical atomic orbital basis (not gamma-only algorithm) - - name: out_mat_t - category: Output information - type: "Boolean \\[Integer\\](optional)" - 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_mat_hs2. 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. - default_value: False 8 - unit: Ry - availability: Numerical atomic orbital basis (not gamma-only algorithm) - - name: out_mat_dh - category: Output information - type: Integer - 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_mat_hs2. 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: [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. - - [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) - - name: out_mat_dh_t - category: Output information - type: Integer - description: | - Whether to print files containing the derivatives of the kinetic energy matrix dT/dR. - - See out_mat_dh for format details (enable, precision, atom indices). - default_value: 0 8 - unit: Ry/Bohr - availability: "" - - name: out_mat_dh_vl - category: Output information - type: Integer - description: | - Whether to print files containing the derivatives of the local pseudopotential matrix dV^L/dR. - - See out_mat_dh for format details. - default_value: 0 8 - unit: Ry/Bohr - availability: "" - - name: out_mat_dh_vnl - category: Output information - type: Integer - description: | - Whether to print files containing the derivatives of the nonlocal pseudopotential matrix dV^NL/dR. - - See out_mat_dh for format details. - default_value: 0 8 - unit: Ry/Bohr - availability: "" - - name: out_mat_dh_vh - category: Output information - type: Integer - description: | - Whether to print files containing the derivatives of the Hartree matrix dV^H/dR. - - See out_mat_dh for format details. - default_value: 0 8 - unit: Ry/Bohr - availability: "" - - name: out_mat_dh_vxc - category: Output information - type: Integer - description: | - Whether to print files containing the derivatives of the XC matrix dV^XC/dR. - - See out_mat_dh for format details. - default_value: 0 8 - unit: Ry/Bohr - availability: "" - - name: out_mat_dh_exx - category: Output information - type: Integer - description: | - Whether to print files containing the derivatives of the exact-exchange matrix dV^EXX/dR. - - See out_mat_dh for format details. - default_value: 0 8 - unit: Ry/Bohr - availability: "" - - name: out_mat_h_t - category: Output information - type: Integer - description: | - Whether to print files containing the kinetic energy matrix T(R) in CSR format. - - See out_mat_hs2 for format details. - default_value: 0 8 - unit: Ry - availability: "" - - name: out_mat_h_vnl - category: Output information - type: Integer - description: | - Whether to print files containing the nonlocal pseudopotential matrix Vnl(R) in CSR format. - - See out_mat_hs2 for format details. - default_value: 0 8 - unit: Ry - availability: "" - - name: out_mat_h_vl - category: Output information - type: Integer - description: | - Whether to print files containing the local pseudopotential matrix Vl(R) in CSR format. - - See out_mat_hs2 for format details. - default_value: 0 8 - unit: Ry - availability: "" - - name: out_mat_h_vh - category: Output information - type: Integer - description: | - Whether to print files containing the Hartree matrix Vh(R) in CSR format. - - See out_mat_hs2 for format details. - default_value: 0 8 - unit: Ry - availability: "" - - name: out_mat_h_vxc - category: Output information - type: Integer - description: | - Whether to print files containing the XC matrix Vxc(R) in CSR format. - - See out_mat_hs2 for format details. - default_value: 0 8 - unit: Ry - availability: "" - - name: out_mat_h_exx - category: Output information - type: Integer - description: | - Whether to print files containing the exact-exchange matrix Vexx(R) in CSR format. - - See out_mat_hs2 for format details. - default_value: 0 8 - unit: Ry - availability: "" - - name: out_mat_ds - category: Output information - type: "Boolean \\[Integer\\](optional)" - 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. - default_value: False 8 - unit: Ry/Bohr - availability: Numerical atomic orbital basis (not gamma-only algorithm) - - name: out_mat_xc - category: Output information - type: Boolean - 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. - default_value: "False" - unit: Ry - availability: Numerical atomic orbital (NAO) and NAO-in-PW basis - - name: out_mat_xc2 - category: Output information - type: "Boolean \\[Integer\\](optional)" - 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. - default_value: False 8 - unit: Ry - availability: Numerical atomic orbital (NAO) basis - - name: out_mat_l - category: Output information - type: "Boolean \\[Integer\\](optional)" - 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_value: False 8 - unit: "" - availability: Numerical atomic orbital (NAO) basis - - name: out_xc_r - category: Output information - type: "Integer \\[Integer\\](optional)" - description: | - The first integer controls whether to output the exchange-correlation (in Bohr^-3) on real space grids using Libxc to folder OUT.${suffix}: - * 0: rho, amag, sigma, exc - * 1: vrho, vsigma - * 2: v2rho2, v2rhosigma, v2sigma2 - * 3: v3rho3, v3rho2sigma, v3rhosigma2, v3sigma3 - * 4: v4rho4, v4rho3sigma, v4rho2sigma2, v4rhosigma3, v4sigma4 The meaning of the files is presented in Libxc - - The second integer controls the precision of the charge density output, if not given, will use 3 as default. - - 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). - default_value: "-1 3" - unit: "" - availability: "" - - name: out_eband_terms - category: Output information - type: Boolean - 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_value: "False" - unit: "" - availability: Numerical atomic orbital basis - - name: out_hr_npz - category: Output information - type: Boolean - description: | - Whether to print Hamiltonian matrices H(R) in npz format. The output files are named output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. - default_value: "False" - unit: Ry - availability: Numerical atomic orbital basis (not gamma-only algorithm) - - name: out_hsr_npz - category: Output information - type: Boolean - description: | - Whether to print Hamiltonian matrices H(R) and overlap matrix S(R) in npz format. The output files are named output_SR.npz, output_HR0.npz, output_HR1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. - default_value: "False" - unit: Ry - availability: Numerical atomic orbital basis (not gamma-only algorithm) - - name: out_dm_npz - category: Output information - type: Boolean - description: | - Whether to print density matrices DM(R) in npz format. The output files are named output_DM0.npz, output_DM1.npz, and so on according to spin channel. This feature requires ABACUS to be built with CNPY. - default_value: "False" - unit: "" - availability: Numerical atomic orbital basis (not gamma-only algorithm) - - name: out_mul - category: Output information - type: Boolean - 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_value: "False" - unit: "" - availability: Numerical atomic orbital basis - - name: out_app_flag - category: Output information - type: Boolean - 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_mat_hs2, out_mat_t, out_mat_dh, out_mat_hs and out_wfc_lcao for more information. - default_value: "true" - unit: "" - availability: Numerical atomic orbital basis (not gamma-only algorithm) - - name: out_ndigits - category: Output information - type: Integer - description: | - 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_mat_hs 1 case presently. - - name: out_element_info - category: Output information - type: Boolean - 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). - default_value: "False" - unit: "" - availability: "" - - name: restart_save - category: Output information - type: Boolean - 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/. - - 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 - - name: rpa - category: Output information - type: Boolean - description: | - Generate output files used in rpa calculations. - - [NOTE] If symmetry is set to 1, additional files containing the necessary information for exploiting symmetry in the subsequent rpa calculation will be output: irreducible_sector.txt, symrot_k.txt and symrot_R.txt. - default_value: "False" - unit: "" - availability: "" - - name: out_pchg - category: Output information - type: String - 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_value: none - unit: "" - availability: "For both PW and LCAO. When basis_type = lcao, used when calculation = get_pchg." - - name: out_wfc_norm - category: Output information - type: String - 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_value: none - unit: "" - availability: "For both PW and LCAO. When basis_type = lcao, used when calculation = get_wf." - - name: out_wfc_re_im - category: Output information - type: String - 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_value: none - unit: "" - availability: "For both PW and LCAO. When basis_type = lcao, used when calculation = get_wf." - - name: if_separate_k - category: Output information - type: Boolean - 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_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." - - name: out_elf - category: Output information - type: "Integer \\[Integer\\](optional)" - 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}}$; - * nspin = 2: - * elfs1.cube, elfs2.cube: ${\rm{ELF}}_\sigma = \frac{1}{1+\chi_\sigma^2}$, $\chi_\sigma = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i,\sigma}|^2} - \frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}$; - * elftot.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i,\sigma}{f_i |\nabla\psi_{i,\sigma}|^2} - \sum_{\sigma}{\frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}}{\sum_{\sigma}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}}$; - * nspin = 4 (noncollinear): - * elftot.cube: ELF for total charge density, ${\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}}$ - - When `out_freq_ion > 0`, a geometry step suffix `g{#}` is appended to the file names (e.g., `elftotg1.cube`, `elfs1g1.cube`). - - The second integer controls the precision of the kinetic energy density output, if not given, will use 3 as default. For purpose restarting from this file and other high-precision involved calculation, recommend to use 10. - - 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. - - name: out_spillage - category: Output information - type: Integer - 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_value: "0" - unit: "" - availability: Only for Kohn-Sham DFT with plane-wave basis. - - name: out_dipole - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Boolean - description: | - * True: Output electric dipole moment. - * False: Do not output electric dipole moment. - default_value: "False" - unit: "" - availability: "" - - name: out_current - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Integer - description: | - * 0: Do not output current. - * 1: Output current using the two-center integral, faster. - * 2: Output current using the matrix commutation, more precise. - default_value: "0" - unit: "" - availability: "" - - name: out_current_k - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Boolean - description: | - * True: Output current for each k-points separately. - * False: Output current in total. - default_value: "False" - unit: "" - availability: "" - - name: out_efield - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Boolean - description: | - Whether to output the electric field data to files. When enabled, writes real-time electric field values (unit: V/A) into files named efield_[num].txt, where [num] is the sequential index of the electric field ranges from 0 to N-1 for N configured fields. It is noteworthy that the field type sequence follows td_ttype, while the direction sequence follows td_vext_dire. - * True: Output electric field. - * False: Do not output electric field. - default_value: "False" - unit: "" - availability: "" - - name: out_vecpot - category: "RT-TDDFT: Real-Time Time-Dependent Density Functional Theory" - type: Boolean - description: | - Output vector potential or not (unit: a.u.). - * True: Output vector potential into file At.dat. - * False: Do not output vector potential. - default_value: "False" - unit: "" - availability: "" - - name: cal_symm_repr - category: System variables - type: "Integer \\[Integer\\](optional)" - 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. - default_value: 1 3 - unit: "" - availability: "" - - name: spillage_outdir - category: Input files - type: String - description: | - The directory to save the spillage files. - default_value: "\"./\"" - unit: "" - availability: Used only for plane wave basis set. - - name: dos_edelta_ev - category: Density of states - type: Real - description: | - The step size in writing Density of States (DOS) - default_value: "0.01" - unit: eV - availability: "" - - name: dos_sigma - category: Density of states - type: Real - description: | - The width of the Gaussian factor when obtaining smeared Density of States (DOS) - default_value: "0.07" - unit: eV - availability: "" - - name: dos_scale - category: Density of states - type: Real - 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. - default_value: "0.01" - unit: eV - availability: "" - - name: dos_emin_ev - category: Density of states - type: Real - description: | - The minimal range for Density of States (DOS) - * If set, "dos_scale" will be ignored. - default_value: Minimal eigenenergy of - unit: eV - availability: "" - - name: dos_emax_ev - category: Density of states - type: Real - description: | - The maximal range for Density of States (DOS) - * If set, "dos_scale" will be ignored. - default_value: Maximal eigenenergy of - unit: eV - availability: "" - - name: dos_nche - category: Density of states - type: Integer - description: | - The order of Chebyshev expansions when using Stochastic Density Functional Theory (SDFT) to calculate DOS. - default_value: "100" - unit: "" - availability: "" - - name: stm_bias - category: Density of states - type: Real Real(optional) Integer(optional) - description: | - The bias voltage used to calculate local density of states to simulate scanning tunneling microscope, see details in out_ldos. When using three parameters: - - * The first parameter specifies the initial bias voltage value. - * The second parameter defines the voltage increment (step size between consecutive bias values). - * The third parameter determines the total number of voltage points - default_value: "1.0" - unit: V - availability: "" - - name: ldos_line - category: Density of states - type: "Real*6 Integer(optional)" - 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. - default_value: 0.0 0.0 0.0 0.0 0.0 1.0 100 - unit: "" - availability: "" - - name: cal_cond - category: Electronic conductivities - type: Boolean - description: | - Whether to calculate electronic conductivities. - default_value: "False" - unit: "" - availability: basis_type = pw - - name: cond_che_thr - category: Electronic conductivities - type: Real - description: | - Control the error of Chebyshev expansions for conductivities. - default_value: "1e-8" - unit: "" - availability: esolver_type = sdft - - name: cond_dw - category: Electronic conductivities - type: Real - description: | - Frequency interval () for frequency-dependent conductivities. - default_value: "0.1" - unit: eV - availability: basis_type = pw - - name: cond_wcut - category: Electronic conductivities - type: Real - description: | - Cutoff frequency for frequency-dependent conductivities. - default_value: "10.0" - unit: eV - availability: basis_type = pw - - name: cond_dt - category: Electronic conductivities - type: Real - description: | - Time interval () to integrate Onsager coefficients. - default_value: "0.02" - unit: a.u. - availability: basis_type = pw - - name: cond_dtbatch - category: Electronic conductivities - type: Integer - 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_value: "0" - unit: "" - availability: esolver_type = sdft - - name: cond_smear - category: Electronic conductivities - type: Integer - description: | - Smearing method for conductivities - * 1: Gaussian smearing - * 2: Lorentzian smearing - default_value: "1" - unit: "" - availability: "" - - name: cond_fwhm - category: Electronic conductivities - type: Real - description: | - FWHM for conductivities. For Gaussian smearing, ; for Lorentzian smearing, . - default_value: "0.4" - unit: eV - availability: basis_type = pw - - name: cond_nonlocal - category: Electronic conductivities - type: Boolean - description: | - Whether to consider nonlocal potential correction when calculating velocity matrix . - * True: . - * False: . - default_value: "True" - unit: "" - availability: basis_type = pw - - name: berry_phase - category: Berry phase and wannier90 interface - type: Boolean - description: | - Controls the calculation of Berry phase - * true: Calculate Berry phase. - * false: Do not calculate Berry phase. - default_value: "false" - unit: "" - availability: "" - - name: gdir - category: Berry phase and wannier90 interface - type: Integer - description: | - The direction of the polarization in the lattice vector for Berry phase calculation - * 1: Calculate the polarization in the direction of the lattice vector a_1 defined in the STRU file. - * 2: Calculate the polarization in the direction of the lattice vector a_2 defined in the STRU file. - * 3: Calculate the polarization in the direction of the lattice vector a_3 defined in the STRU file. - default_value: "3" - unit: "" - availability: "" - - name: towannier90 - category: Berry phase and wannier90 interface - type: Boolean - description: | - Controls the generation of files for the Wannier90 code. - * 1: Generate files for the Wannier90 code. - * 0: Do not generate files for the Wannier90 code. - default_value: "0" - unit: "" - availability: "" - - name: nnkpfile - category: Berry phase and wannier90 interface - type: String - description: | - The file name generated when running "wannier90 -pp ..." command - default_value: seedname.nnkp - unit: "" - availability: "" - - name: wannier_method - category: Berry phase and wannier90 interface - type: Integer - description: | - Only available on LCAO basis, using different methods to generate "\.mmn" file and "\.amn" file. - * 1: Calculated using the lcao_in_pw method, the calculation accuracy can be improved by increasing ecutwfc to maintain consistency with the pw basis set results. - * 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. - default_value: "1" - unit: "" - availability: "" - - name: wannier_spin - category: Berry phase and wannier90 interface - type: String - description: | - The spin direction for the Wannier function calculation when nspin is set to 2 - * up: Calculate spin up for the Wannier function. - * down: Calculate spin down for the Wannier function. - default_value: up - unit: "" - availability: "" - - name: out_wannier_mmn - category: Berry phase and wannier90 interface - type: Boolean - description: | - Write the "*.mmn" file or not. - * 0: don't write the "*.mmn" file. - * 1: write the "*.mmn" file. - default_value: "1" - unit: "" - availability: "" - - name: out_wannier_amn - category: Berry phase and wannier90 interface - type: Boolean - description: | - Write the "*.amn" file or not. - * 0: don't write the "*.amn" file. - * 1: write the "*.amn" file. - default_value: "1" - unit: "" - availability: "" - - name: out_wannier_eig - category: Berry phase and wannier90 interface - type: Boolean - description: | - Write the "*.eig" file or not. - * 0: don't write the "*.eig" file. - * 1: write the "*.eig" file. - default_value: "1" - unit: "" - availability: "" - - name: out_wannier_unk - category: Berry phase and wannier90 interface - type: Boolean - description: | - Write the "UNK.*" file or not. - * 0: don't write the "UNK.*" file. - * 1: write the "UNK.*" file. - default_value: "0" - unit: "" - availability: "" - - name: out_wannier_wvfn_formatted - category: Berry phase and wannier90 interface - type: Boolean - description: | - Write the "UNK.*" file in ASCII format or binary format. - * 0: write the "UNK.*" file in binary format. - * 1: write the "UNK.*" file in ASCII format (text file format). - default_value: "1" - unit: "" - availability: "" - - name: efield_flag - category: Electric field and dipole correction - type: Boolean - description: | - Added the electric field. - * True: A saw-like potential simulating an electric field is added to the bare ionic potential. - * False: Not added the electric field. - default_value: "False" - unit: "" - availability: "" - - name: dip_cor_flag - category: Electric field and dipole correction - type: Boolean - 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. - - [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. - - name: efield_dir - category: Electric field and dipole correction - type: Integer - 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 - * 2: parallel to the third reciprocal lattice vector - default_value: "2" - unit: "" - availability: with efield_flag = True. - - name: efield_pos_max - category: Electric field and dipole correction - type: Real - 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_value: Autoset to center of vacuum - width of vacuum / 20 - unit: "" - availability: with efield_flag = True. - - name: efield_pos_dec - category: Electric field and dipole correction - type: Real - description: | - 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. - - name: efield_amp - category: Electric field and dipole correction - type: Real - 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] 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. - - name: gate_flag - category: Gate field (compensating charge) - type: Boolean - description: | - Controls the addition of compensating charge by a charged plate for charged cells. - * true: A charged plate is placed at the zgate position to add compensating charge. The direction is determined by efield_dir. - * false: No compensating charge is added. - default_value: "false" - unit: "" - availability: "" - - name: zgate - category: Gate field (compensating charge) - type: Real - description: | - Position of the charged plate in the unit cell - default_value: "0.5" - unit: Unit cell size - availability: "" - - name: block - category: Gate field (compensating charge) - type: Boolean - description: | - Controls the addition of a potential barrier to prevent electron spillover. - * true: A potential barrier is added from block_down to block_up with a height of block_height. If dip_cor_flag is set to true, efield_pos_dec is used to smoothly increase and decrease the potential barrier. - * false: No potential barrier is added. - default_value: "false" - unit: "" - availability: "" - - name: block_down - category: Gate field (compensating charge) - type: Real - description: | - Lower beginning of the potential barrier - default_value: "0.45" - unit: Unit cell size - availability: "" - - name: block_up - category: Gate field (compensating charge) - type: Real - description: | - Upper beginning of the potential barrier - default_value: "0.55" - unit: Unit cell size - availability: "" - - name: block_height - category: Gate field (compensating charge) - type: Real - description: | - Height of the potential barrier - default_value: "0.1" - unit: Rydberg - availability: "" - - name: imp_sol - category: Implicit solvation model - type: Boolean - description: | - Calculate implicit solvation correction - default_value: "False" - unit: "" - availability: "" - - name: eb_k - category: Implicit solvation model - type: Real - description: | - The relative permittivity of the bulk solvent, 80 for water - default_value: "80" - unit: "" - availability: imp_sol is true. - - name: tau - category: Implicit solvation model - type: Real - 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 - default_value: "1.0798e-05" - unit: "" - availability: "" - - name: sigma_k - category: Implicit solvation model - type: Real - description: | - The width of the diffuse cavity that is implicitly determined by the electronic structure of the solute - default_value: "0.6" - unit: "" - availability: "" - - name: nc_k - category: Implicit solvation model - type: Real - description: | - The value of the electron density at which the dielectric cavity forms - default_value: "0.00037" - unit: "" - availability: "" - - name: vdw_method - category: vdW correction - type: String - description: | - Specifies the method used for Van der Waals (VdW) correction. Available options are: - * d2: Grimme's D2 dispersion correction method - * d3_0: Grimme's DFT-D3(0) dispersion correction method (zero-damping) - * d3_bj: Grimme's DFTD3(BJ) dispersion correction method (BJ-damping) - * d4: Grimme's DFT-D4 dispersion correction method using the external DFT-D4 library - * none: no vdW correction - - [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. - default_value: none - unit: "" - availability: "" - - name: vdw_d4_xc - category: vdW correction - type: String - 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_value: default - unit: "" - availability: vdw_method is set to d4 - - name: vdw_d4_model - category: vdW correction - type: String - description: | - DFT-D4 dispersion model used by the external DFT-D4 library. - Available options are: - * d4: standard D4 model - * d4s: smooth D4S model - default_value: "d4" - unit: "" - availability: vdw_method is set to d4 - - name: vdw_s6 - category: vdW correction - type: String - 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. - default_value: "" - unit: "" - availability: "vdw_method is set to d2, d3_0, or d3_bj" - - name: vdw_s8 - category: vdW correction - type: String - 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. - default_value: "" - unit: "" - availability: vdw_method is set to d3_0 or d3_bj - - name: vdw_a1 - category: vdW correction - type: String - 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. - default_value: "" - unit: "" - availability: vdw_method is set to d3_0 or d3_bj - - name: vdw_a2 - category: vdW correction - type: String - 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. - default_value: "" - unit: "" - availability: vdw_method is set to d3_0 or d3_bj - - name: vdw_d - category: vdW correction - type: Real - description: | - Controls the damping rate of the damping function in the DFT-D2 method. - default_value: "20" - unit: "" - availability: vdw_method is set to d2 - - name: vdw_abc - category: vdW correction - type: Boolean - 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. - default_value: "False" - unit: "" - availability: vdw_method is set to d3_0 or d3_bj - - name: vdw_c6_file - category: vdW correction - type: String - 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 - - Namely, each line contains the element name and the corresponding parameter. - default_value: default - unit: "" - availability: vdw_method is set to d2 - - name: vdw_c6_unit - category: vdW correction - type: String - description: | - Specifies the unit of the provided parameters in the D2 method. Available options are: - * Jnm6/mol (J nm^6/mol) - * eVA (eV Angstrom) - default_value: Jnm6/mol - unit: "" - availability: vdw_C6_file is not default - - name: vdw_r0_file - category: vdW correction - type: String - 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 - - Namely, each line contains the element name and the corresponding parameter. - default_value: default - unit: "" - availability: vdw_method is set to d2 - - name: vdw_r0_unit - category: vdW correction - type: String - description: | - Specifies the unit for the parameters in the D2 method when manually set by the user. Available options are: - * A (Angstrom) - * Bohr - default_value: "A" - unit: "" - availability: vdw_R0_file is not default - - name: vdw_cutoff_type - category: vdW correction - type: String - description: | - Determines the method used for specifying the cutoff radius in periodic systems when applying Van der Waals correction. Available options are: - * radius: The supercell is selected within a sphere centered at the origin with a radius defined by vdw_cutoff_radius. - * period: The extent of the supercell is explicitly specified using the vdw_cutoff_period keyword. - default_value: radius - unit: "" - availability: "" - - name: vdw_cutoff_radius - category: vdW correction - type: String - 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. - default_value: "" - unit: defined by vdw_radius_unit (default Bohr) - availability: vdw_cutoff_type is set to radius - - name: vdw_radius_unit - category: vdW correction - type: String - description: | - Specify the unit of vdw_cutoff_radius. Available options are: - * A(Angstrom) - * Bohr - default_value: Bohr - unit: "" - availability: vdw_cutoff_type is set to radius - - name: vdw_cutoff_period - category: vdW correction - type: Integer Integer Integer - description: | - 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 - - name: vdw_cn_thr - category: vdW correction - type: Real - description: | - 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" - - name: vdw_cn_thr_unit - category: vdW correction - type: String - description: | - Unit of the coordination number cutoff (vdw_cn_thr). Available options are: - * A(Angstrom) - * Bohr - default_value: Bohr - unit: "" - availability: "" - - name: exx_fock_alpha - category: Exact Exchange (Common) - type: Real - description: | - Fraction of full-ranged Fock exchange $1/r$ in range-separated hybrid functionals. - default_value: see hybrid_func_params - unit: "" - availability: "" - - name: exx_erfc_alpha - category: Exact Exchange (Common) - type: Real - description: | - Fraction of short-ranged Fock exchange $\mathrm{erfc}(\omega r)/r$ in range-separated hybrid functionals. - default_value: see hybrid_func_params - unit: "" - availability: "" - - name: exx_erfc_omega - category: Exact Exchange (Common) - type: Real - description: | - Range-separation parameter $\omega$ in the short-ranged Fock term $\mathrm{erfc}(\omega r)/r$. - default_value: see hybrid_func_params - unit: "" - availability: "" - - name: exx_separate_loop - category: Exact Exchange (Common) - type: Boolean - description: | - There are two types of iterative approaches provided by ABACUS to evaluate Fock exchange. - * False: Start with a GGA-Loop, and then Hybrid-Loop, in which EXX Hamiltonian is updated with electronic iterations. - * 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. - default_value: "True" - unit: "" - availability: "" - - name: exx_hybrid_step - category: Exact Exchange (Common) - type: Integer - description: | - The maximal iteration number of the outer-loop, where the Fock exchange is calculated - default_value: "100" - unit: "" - availability: exx_separate_loop==1 - - name: exx_mixing_beta - category: Exact Exchange (Common) - type: Real - description: | - Mixing parameter for densty matrix in each iteration of the outer-loop - default_value: "1.0" - unit: "" - availability: exx_separate_loop==1 - - name: exx_fock_lambda - category: Exact Exchange (LCAO in PW) - type: Real - description: | - It is used to compensate for divergence points at G=0 in the evaluation of Fock exchange using lcao_in_pw method. - default_value: "0.3" - unit: "" - availability: basis_type==lcao_in_pw - - name: exx_pca_threshold - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "1E-4" - unit: "" - availability: "" - - name: exx_c_threshold - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "1E-4" - unit: "" - availability: "" - - name: exx_cs_inv_thr - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "-1" - unit: "" - availability: "" - - name: exx_v_threshold - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "1E-1" - unit: "" - availability: "" - - name: exx_dm_threshold - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "1E-4" - unit: "" - availability: "" - - name: exx_c_grad_threshold - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "1E-4" - unit: "" - availability: "" - - name: exx_v_grad_threshold - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "1E-1" - unit: "" - availability: "" - - name: exx_c_grad_r_threshold - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "1E-4" - unit: "" - availability: "" - - name: exx_v_grad_r_threshold - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "1E-1" - unit: "" - availability: "" - - name: exx_ccp_rmesh_times - category: Exact Exchange (LCAO) - type: String - 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. - default_value: "" - unit: "" - availability: "" - - name: exx_opt_orb_lmax - category: Exact Exchange (LCAO) - type: Integer - 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. - default_value: "0" - unit: "" - availability: calculation==gen_opt_abfs - - name: exx_opt_orb_ecut - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "0" - unit: Ry - availability: calculation==gen_opt_abfs - - name: exx_opt_orb_tolerence - category: Exact Exchange (LCAO) - type: Real - description: | - The threshold when solving for the zeros of spherical Bessel functions. A reasonable choice is 1e-12. - default_value: "1E-12" - unit: "" - availability: calculation==gen_opt_abfs - - name: exx_real_number - category: Exact Exchange (LCAO) - type: String - description: | - * True: Enforce LibRI to use double data type. - * False: Enforce LibRI to use complex data type. Setting it to True can effectively improve the speed of self-consistent calculations with hybrid functionals. - default_value: depends on the gamma_only option - unit: "" - availability: "" - - name: exx_singularity_correction - category: Exact Exchange (LCAO) - type: String - description: | - * spencer: see Phys. Rev. B 77, 193110 (2008). - * revised_spencer: see Phys. Rev. Mater. 5, 013807 (2021). Set the scheme of Coulomb singularity correction. - default_value: default - unit: "" - availability: "" - - name: rpa_ccp_rmesh_times - category: Exact Exchange (LCAO) - type: Real - 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. - default_value: "10" - unit: "" - availability: "" - - name: exx_symmetry_realspace - category: Exact Exchange (LCAO) - type: Boolean - 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_value: "True" - unit: "" - availability: symmetry==1 and exx calculation (dft_fuctional==hse/hf/pbe0/scan0 or rpa==True) - - name: out_ri_cv - category: Exact Exchange (LCAO) - type: Boolean - 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. - default_value: "false" - unit: "" - availability: "" - - name: out_unshrinked_v - category: Exact Exchange (LCAO) - type: Boolean - description: | - Whether to output the large Vq matrix in the unshrinked auxiliary basis. - default_value: "false" - unit: "" - availability: "" - - name: exx_coul_moment - category: Exact Exchange (LCAO) - type: Boolean - description: | - Whether to use the moment method for Coulomb calculation. - default_value: "false" - unit: "" - availability: "" - - name: exx_rotate_abfs - category: Exact Exchange (LCAO) - type: Boolean - description: | - Whether to rotate the auxiliary basis for Coulomb calculation. - default_value: "false" - unit: "" - availability: "" - - name: exx_multip_moments_threshold - category: Exact Exchange (LCAO) - type: Real - description: | - Threshold to screen multipole moments in Coulomb calculation. - default_value: "1e-10" - unit: "" - availability: "" - - name: shrink_abfs_pca_thr - category: Exact Exchange (LCAO) - type: Real - description: | - Threshold to shrink the auxiliary basis for GW/RPA calculations. - default_value: "-1" - unit: "" - availability: "" - - name: shrink_lu_inv_thr - category: Exact Exchange (LCAO) - type: Real - description: | - Threshold for obtaining the inverse of the overlap matrix by LU decomposition in the auxiliary-basis representation. - default_value: "1e-6" - unit: "" - availability: "" - - name: dft_plus_u - category: DFT+U correction - type: Integer - description: | - Determines whether to calculate the plus U correction, which is especially important for correlated electrons. - * 1: Calculate plus U correction with radius-adjustable localized projections (with parameter onsite_radius). - * 2: Calculate plus U correction using first zeta of NAOs as projections (this is old method for testing). - * 0: Do not calculate plus U correction. - default_value: "0" - unit: "" - availability: "" - - name: dft_plus_dmft - category: DFT+U correction - type: Boolean - description: | - Whether to enable DFT+DMFT calculation. True: DFT+DMFT; False: standard DFT calculation. - default_value: "False" - unit: "" - availability: basis_type==lcao - - name: orbital_corr - category: DFT+U correction - type: Vector of Integer (n values where n is the number of atomic types) - description: | - Specifies which orbits need plus U correction for each atom type ( for atom type 1, 2, 3, respectively). - * -1: The plus U correction will not be calculated for this atom. - * 1: For p-electron orbits, the plus U correction is needed. - * 2: For d-electron orbits, the plus U correction is needed. - * 3: For f-electron orbits, the plus U correction is needed. - default_value: "-1" - unit: "" - availability: "" - - name: hubbard_u - category: DFT+U correction - type: Vector of Real (n values where n is the number of atomic types) - description: | - Specifies the Hubbard Coulomb interaction parameter U (eV) in plus U correction, which should be specified for each atom unless the Yukawa potential is used. - - [NOTE] Note: Since only the simplified scheme by Duradev is implemented, the 'U' here is actually U-effective, which is given by Hubbard U minus Hund J. - default_value: "0.0" - unit: "" - availability: "" - - name: yukawa_potential - category: DFT+U correction - type: Boolean - description: | - Determines whether to use the local screen Coulomb potential method to calculate the values of U and J. - * True: hubbard_u does not need to be specified. - * False: hubbard_u does need to be specified. - default_value: "False" - unit: "" - availability: "" - - name: yukawa_lambda - category: DFT+U correction - type: Real - 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_value: Calculated on the fly. - unit: "" - availability: DFT+U with yukawa_potential = True. - - name: uramping - category: DFT+U correction - type: Real - 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 0." - - name: omc - category: DFT+U correction - type: Integer - description: | - The parameter controls the form of occupation matrix control used. - * 0: No occupation matrix control is performed, and the onsite density matrix will be calculated from wavefunctions in each SCF step. - * 1: The first SCF step will use an initial density matrix read from a file named initial_onsite.dm, but for later steps, the onsite density matrix will be updated. - * 2: The same onsite density matrix from initial_onsite.dm will be used throughout the entire calculation. - - [NOTE] The easiest way to create initial_onsite.dm is to run a DFT+U calculation, look for a file named onsite.dm in the OUT.prefix directory, and make replacements there. The format of the file is rather straight-forward. - default_value: "0" - unit: "" - availability: "" - - name: onsite_radius - category: DFT+U correction - type: Real - description: | - * The onsite_radius parameter facilitates modulation of the single-zeta portion of numerical atomic orbitals used for DFT+U projections. - * The modulation algorithm applies a smooth truncation to the orbital tail followed by normalization. A representative profile is $f(r)=\frac{1}{2}\left[1+\operatorname{erf}\!\left(\frac{r_c-r}{\sigma}\right)\right]$, where $r_c$ is the cutoff radius and $\sigma=\gamma r_c$ controls smoothness. - default_value: "3.0" - unit: Bohr - availability: dft_plus_u is set to 1 - - name: sc_mag_switch - category: Spin-Constrained DFT - type: Boolean - description: | - Switch to control spin-constrained DFT calculation - default_value: "False" - unit: "" - availability: "" - - name: decay_grad_switch - category: Spin-Constrained DFT - type: Boolean - description: | - Switch to control gradient break condition in spin-constrained DFT - default_value: "False" - unit: "" - availability: "" - - name: sc_thr - category: Spin-Constrained DFT - type: Real - description: | - Convergence criterion of spin-constrained iteration (RMS) in uB - default_value: "1.0e-6" - unit: uB - availability: sc_mag_switch is true - - name: nsc - category: Spin-Constrained DFT - type: Integer - description: | - Maximal number of spin-constrained iteration - default_value: "100" - unit: "" - availability: sc_mag_switch is true - - name: nsc_min - category: Spin-Constrained DFT - type: Integer - description: | - Minimum number of spin-constrained iteration - default_value: "2" - unit: "" - availability: sc_mag_switch is true - - name: alpha_trial - category: Spin-Constrained DFT - type: Real - description: | - Initial trial step size for lambda in eV/uB^2 - default_value: "0.01" - unit: eV/uB^2 - availability: sc_mag_switch is true - - name: sccut - category: Spin-Constrained DFT - type: Real - description: | - Maximal step size for lambda in eV/uB - default_value: "3.0" - unit: eV/uB - availability: sc_mag_switch is true - - name: sc_drop_thr - category: Spin-Constrained DFT - type: Real - description: | - Convergence criterion ratio of lambda iteration in Spin-constrained DFT - default_value: "1.0e-2" - unit: "" - availability: sc_mag_switch is true - - name: sc_scf_thr - category: Spin-Constrained DFT - type: Real - description: | - Density error threshold for inner loop of spin-constrained SCF - default_value: "1.0e-4" - unit: "" - availability: sc_mag_switch is true - - name: sc_direction_only - category: Spin-Constrained DFT - type: Boolean - 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. - default_value: "False" - unit: "" - availability: sc_mag_switch is true - - name: sc_lambda_strategy - category: Spin-Constrained DFT - type: String - description: | - Lambda update strategy for spin-constrained DFT: - * bfgs: BFGS quasi-Newton method - * linear_response: linear response (Scheme B) - * augmented_lagrangian: augmented Lagrangian (Scheme C) - * hybrid_delayed: hybrid delayed update (Scheme D) - * linear_scan: linear sweep of lambda for testing magnetic moment response - default_value: bfgs - unit: "" - availability: sc_mag_switch is true - - name: sc_scan_lambda_start - category: Spin-Constrained DFT - type: Float - description: | - 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 - - name: sc_scan_lambda_end - category: Spin-Constrained DFT - type: Float - description: | - 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 - - name: sc_scan_steps - category: Spin-Constrained DFT - type: Integer - description: | - 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 - - name: qo_switch - category: Quasiatomic Orbital (QO) analysis - type: Boolean - description: | - Whether to let ABACUS output QO analysis required files - default_value: "False" - unit: "" - availability: "" - - name: qo_basis - category: Quasiatomic Orbital (QO) analysis - type: String - description: | - Type of QO basis function: - * hydrogen: hydrogen-like basis - * pswfc: read basis from pseudopotential - * szv: single-zeta valence basis - default_value: szv - unit: "" - availability: "" - - name: qo_strategy - category: Quasiatomic Orbital (QO) analysis - type: Vector of String (1 or n values where n is the number of atomic types) - description: | - Strategy to generate radial orbitals for QO analysis. For hydrogen: energy-valence, for pswfc and szv: all - default_value: "for hydrogen: energy-valence, for pswfc and szv: all" - unit: "" - availability: "" - - name: qo_screening_coeff - category: Quasiatomic Orbital (QO) analysis - type: Vector of Real (n values where n is the number of atomic types; 1 value allowed for qo_basis=pswfc) - description: | - The screening coefficient for each atom type to rescale the shape of radial orbitals - default_value: "0.1" - unit: Bohr^-1 - availability: "" - - name: qo_thr - category: Quasiatomic Orbital (QO) analysis - type: Real - description: | - The convergence threshold determining the cutoff of generated orbital. Lower threshold will yield orbital with larger cutoff radius. - default_value: "1.0e-6" - unit: "" - availability: "" - - name: pexsi_npole - category: PEXSI - type: Integer - description: | - The number of poles used in the pole expansion method, should be a even number. - default_value: "40" - unit: "" - availability: "" - - name: pexsi_inertia - category: PEXSI - type: Boolean - description: | - Whether inertia counting is used at the very beginning. - default_value: "True" - unit: "" - availability: "" - - name: pexsi_nmax - category: PEXSI - type: Integer - description: | - Maximum number of PEXSI iterations after each inertia counting procedure. - default_value: "80" - unit: "" - availability: "" - - name: pexsi_comm - category: PEXSI - type: Boolean - description: | - Whether to construct PSelInv communication pattern. - default_value: "True" - unit: "" - availability: "" - - name: pexsi_storage - category: PEXSI - type: Boolean - description: | - Whether to use symmetric storage space used by the Selected Inversion algorithm for symmetric matrices. - default_value: "True" - unit: "" - availability: "" - - name: pexsi_ordering - category: PEXSI - type: Integer - description: | - Ordering strategy for factorization and selected inversion. 0: Parallel ordering using ParMETIS, 1: Sequential ordering using METIS, 2: Multiple minimum degree ordering - default_value: "0" - unit: "" - availability: "" - - name: pexsi_row_ordering - category: PEXSI - type: Integer - 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. - default_value: "1" - unit: "" - availability: "" - - name: pexsi_nproc - category: PEXSI - type: Integer - description: | - Number of processors for PARMETIS. Only used if pexsi_ordering == 0. - default_value: "1" - unit: "" - availability: "" - - name: pexsi_symm - category: PEXSI - type: Boolean - description: | - Whether the matrix is symmetric. - default_value: "True" - unit: "" - availability: "" - - name: pexsi_trans - category: PEXSI - type: Boolean - description: | - Whether to factorize the transpose of the matrix. - default_value: "False" - unit: "" - availability: "" - - name: pexsi_method - category: PEXSI - type: Integer - description: | - The pole expansion method to be used. 1 for Cauchy Contour Integral method, 2 for Moussa optimized method. - default_value: "1" - unit: "" - availability: "" - - name: pexsi_nproc_pole - category: PEXSI - type: Integer - description: | - The point parallelizaion of PEXSI. Recommend two points parallelization. - default_value: "1" - unit: "" - availability: "" - - name: pexsi_temp - category: PEXSI - type: Real - 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. - default_value: "0.015" - unit: "" - availability: "" - - name: pexsi_gap - category: PEXSI - type: Real - description: | - Spectral gap, this can be set to be 0 in most cases. - default_value: "0" - unit: "" - availability: "" - - name: pexsi_delta_e - category: PEXSI - type: Real - description: | - Upper bound for the spectral radius of S^{-1}H. - default_value: "20" - unit: "" - availability: "" - - name: pexsi_mu_lower - category: PEXSI - type: Real - description: | - Initial guess of lower bound for mu. - default_value: "-10" - unit: "" - availability: "" - - name: pexsi_mu_upper - category: PEXSI - type: Real - description: | - Initial guess of upper bound for mu. - default_value: "10" - unit: "" - availability: "" - - name: pexsi_mu - category: PEXSI - type: Real - description: | - Initial guess for mu (for the solver). - default_value: "0" - unit: "" - availability: "" - - name: pexsi_mu_thr - category: PEXSI - type: Real - description: | - Stopping criterion in terms of the chemical potential for the inertia counting procedure. - default_value: "0.05" - unit: "" - availability: "" - - name: pexsi_mu_expand - category: PEXSI - type: Real - description: | - If the chemical potential is not in the initial interval, the interval is expanded by this value. - default_value: "0.3" - unit: "" - availability: "" - - name: pexsi_mu_guard - category: PEXSI - type: Real - description: | - Safe guard criterion in terms of the chemical potential to reinvoke the inertia counting procedure. - default_value: "0.2" - unit: "" - availability: "" - - name: pexsi_elec_thr - category: PEXSI - type: Real - description: | - Stopping criterion of the PEXSI iteration in terms of the number of electrons compared to numElectronExact. - default_value: "0.001" - unit: "" - availability: "" - - name: pexsi_zero_thr - category: PEXSI - type: Real - description: | - if the absolute value of CCS matrix element is less than this value, it will be considered as zero. - default_value: "1e-10" - unit: "" - availability: "" - - name: out_alllog - category: Output information - type: Boolean - description: | - Whether to print information into individual logs from all ranks in an MPI run. - * True: Information from each rank will be written into individual files named OUT.{calculation}_{suffix}/running_${calculation}.log. - default_value: "False" - unit: "" - availability: "" - - name: nurse - category: Variables useful for debugging - type: Integer - description: | - Debugging flag for developers - default_value: "0" - unit: "" - availability: "" - - name: t_in_h - category: Variables useful for debugging - type: Boolean - description: | - Specify whether to include kinetic term in obtaining the Hamiltonian matrix. - * 0: No. - * 1: Yes. - default_value: "1" - unit: "" - availability: "" - - name: vl_in_h - category: Variables useful for debugging - type: Boolean - description: | - Specify whether to include local pseudopotential term in obtaining the Hamiltonian matrix. - * 0: No. - * 1: Yes. - default_value: "1" - unit: "" - availability: "" - - name: vnl_in_h - category: Variables useful for debugging - type: Boolean - description: | - Specify whether to include non-local pseudopotential term in obtaining the Hamiltonian matrix. - * 0: No. - * 1: Yes. - default_value: "1" - unit: "" - availability: "" - - name: vh_in_h - category: Variables useful for debugging - type: Boolean - description: | - Specify whether to include Hartree potential term in obtaining the Hamiltonian matrix. - * 0: No. - * 1: Yes. - default_value: "1" - unit: "" - availability: "" - - name: vion_in_h - category: Variables useful for debugging - type: Boolean - description: | - Specify whether to include local ionic potential term in obtaining the Hamiltonian matrix. - * 0: No. - * 1: Yes. - default_value: "1" - unit: "" - availability: "" - - name: test_force - category: Variables useful for debugging - type: Boolean - description: | - Specify whether to output the detailed components in forces. - * 0: No. - * 1: Yes. - default_value: "0" - unit: "" - availability: "" - - name: test_stress - category: Variables useful for debugging - type: Boolean - description: | - Specify whether to output the detailed components in stress. - * 0: No. - * 1: Yes. - default_value: "0" - unit: "" - availability: "" - - name: test_skip_ewald - category: Variables useful for debugging - type: Boolean - description: | - Specify whether to skip the calculation of the ewald energy. - * 0: No. - * 1: Yes. - default_value: "0" - unit: "" - availability: "" - - name: ri_hartree_benchmark - category: Linear Response TDDFT - type: String - description: | - Whether to use the RI approximation for the Hartree term in LR-TDDFT for benchmark (with FHI-aims/ABACUS read-in style) - default_value: none - unit: "" - availability: "" - - name: aims_nbasis - category: Linear Response TDDFT - type: A number(ntype) of Integers - description: | - 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 - - name: rdmft - category: Reduced Density Matrix Functional Theory - type: Boolean - description: | - Whether to perform rdmft calculation (reduced density matrix funcional theory) - default_value: "false" - unit: "" - availability: "" - - name: rdmft_power_alpha - category: Reduced Density Matrix Functional Theory - type: Real - description: | - The alpha parameter of power-functional(or other exx-type/hybrid functionals) which used in RDMFT, g(occ_number) = occ_number^alpha - default_value: "0.656" - unit: "" - availability: "" - - name: "exxace" - category: Exact Exchange (PW) - type: Boolean - 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. - default_value: "True" - unit: "" - availability: exx_separate_loop==True. - - name: exx_gamma_extrapolation - category: Exact Exchange (PW) - type: Boolean - 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. - default_value: "True" - unit: "" - availability: "" - - name: ecutexx - category: Exact Exchange (PW) - type: Real - 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. - default_value: same as ecutrho - unit: Ry - availability: "" - - name: exx_thr_type - category: Exact Exchange (PW) - type: String - description: | - The type of threshold used to judge whether the outer loop has converged in the separate loop EXX calculation. - * energy: use the change of exact exchange energy to judge convergence. - * 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. - default_value: density - unit: "" - availability: "" - - name: exx_ene_thr - category: Exact Exchange (PW) - type: Real - description: | - The threshold for the change of exact exchange energy to judge convergence of the outer loop in the separate loop EXX calculation. - default_value: "1e-5" - unit: Ry - availability: exx_thr_type==energy diff --git a/docs/tests/test_conf_input_docs.py b/docs/tests/test_conf_input_docs.py new file mode 100644 index 00000000000..697896f51e6 --- /dev/null +++ b/docs/tests/test_conf_input_docs.py @@ -0,0 +1,73 @@ +import stat +import sys +import tempfile +import unittest +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) +import conf + + +PARAMETER_YAML = """\ +parameters: + - key: ecutwfc + name: ecutwfc + category: Plane wave related variables + type: double + default_value: 100 + unit: Ry + description: Plane wave kinetic energy cutoff. +""" + + +class InputDocsGenerationTest(unittest.TestCase): + def test_refreshes_input_docs_from_abacus_binary_without_writing_yaml_file(self): + with tempfile.TemporaryDirectory() as tmpdir: + tmp_path = Path(tmpdir) + docs_dir = tmp_path / "docs" + docs_dir.mkdir() + fake_abacus = tmp_path / "abacus" + fake_abacus.write_text( + "#!/bin/sh\n" + "if [ \"$1\" = \"--generate-parameters-yaml\" ]; then\n" + f" cat <<'EOF'\n{PARAMETER_YAML}EOF\n" + " exit 0\n" + "fi\n" + "exit 1\n" + ) + fake_abacus.chmod(fake_abacus.stat().st_mode | stat.S_IXUSR) + + warnings = [] + refreshed = conf.refresh_input_docs( + docs_dir=docs_dir, + abacus_binary=fake_abacus, + warn=warnings.append, + ) + + output = docs_dir / "advanced" / "input_files" / "input-main.md" + self.assertTrue(refreshed) + self.assertTrue(output.exists()) + self.assertIn("ecutwfc", output.read_text()) + self.assertFalse((docs_dir / "parameters.yaml").exists()) + self.assertEqual([], warnings) + + def test_warns_when_abacus_binary_is_not_available(self): + with tempfile.TemporaryDirectory() as tmpdir: + docs_dir = Path(tmpdir) / "docs" + docs_dir.mkdir() + warnings = [] + + refreshed = conf.refresh_input_docs( + docs_dir=docs_dir, + abacus_binary=docs_dir / "missing-abacus", + warn=warnings.append, + ) + + self.assertFalse(refreshed) + self.assertEqual([], list(docs_dir.rglob("input-main.md"))) + self.assertEqual(1, len(warnings)) + self.assertIn("may not be up to date", warnings[0]) + + +if __name__ == "__main__": + unittest.main() From 6658864ffeed62659aaf8e90f15f73cc4370d70e Mon Sep 17 00:00:00 2001 From: Bonan Zhu Date: Sun, 12 Jul 2026 17:37:36 +0800 Subject: [PATCH 5/6] tools: align governance input docs check --- .../agent_governance_check.py | 7 +++---- .../test_agent_governance_check.py | 20 ++++++++++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/tools/03_code_analysis/agent_governance_check.py b/tools/03_code_analysis/agent_governance_check.py index 19488c16cd1..9391d4c5ccb 100644 --- a/tools/03_code_analysis/agent_governance_check.py +++ b/tools/03_code_analysis/agent_governance_check.py @@ -465,12 +465,11 @@ def check_input_parameter_docs( ) -> None: if not input_parameter_changed(changed, lines): return - has_yaml = "docs/parameters.yaml" in changed and not statuses.get("docs/parameters.yaml", "").startswith("D") has_markdown = ( "docs/advanced/input_files/input-main.md" in changed and not statuses.get("docs/advanced/input_files/input-main.md", "").startswith("D") ) - if has_yaml and has_markdown: + if has_markdown: return if pr_body and pr_body_allows_no_input_doc_update(pr_body): return @@ -480,8 +479,8 @@ def check_input_parameter_docs( BLOCK, "source/source_io/module_parameter", None, - "INPUT parameter behavior appears to change without both docs/parameters.yaml and input-main.md updates.", - "Regenerate docs/parameters.yaml and docs/advanced/input_files/input-main.md, or state why no INPUT documentation update is required in the PR.", + "INPUT parameter behavior appears to change without an input-main.md update.", + "Regenerate docs/advanced/input_files/input-main.md from the ABACUS parameter metadata, or state why no INPUT documentation update is required in the PR.", ) diff --git a/tools/03_code_analysis/test_agent_governance_check.py b/tools/03_code_analysis/test_agent_governance_check.py index d5b6bff299a..9143cb1b946 100644 --- a/tools/03_code_analysis/test_agent_governance_check.py +++ b/tools/03_code_analysis/test_agent_governance_check.py @@ -251,7 +251,6 @@ def test_allows_input_parameter_changes_with_required_docs(self): "source/source_io/module_parameter/read_input_item_model.cpp", 'Input_Item item("new_switch");\nitem.default_value = "0";\n', ) - self.write("docs/parameters.yaml", "parameters: []\n") self.write("docs/advanced/input_files/input-main.md", "# INPUT\n") head = self.commit_change() @@ -259,8 +258,24 @@ def test_allows_input_parameter_changes_with_required_docs(self): self.assertEqual(result.returncode, 0, result.stdout + result.stderr) - def test_blocks_input_parameter_change_when_required_docs_are_deleted(self): + def test_allows_input_parameter_changes_with_markdown_and_deleted_yaml(self): self.write("docs/parameters.yaml", "parameters: []\n") + self.git("add", ".") + self.git("commit", "-m", "add legacy parameter yaml") + base = self.git("rev-parse", "HEAD").stdout.strip() + self.write( + "source/source_io/module_parameter/read_input_item_model.cpp", + 'Input_Item item("new_switch");\nitem.default_value = "0";\n', + ) + self.write("docs/advanced/input_files/input-main.md", "# INPUT\n") + (self.repo / "docs" / "parameters.yaml").unlink() + head = self.commit_change() + + result = self.run_checker("--base", base, "--head", head) + + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + + def test_blocks_input_parameter_change_when_required_docs_are_deleted(self): self.write("docs/advanced/input_files/input-main.md", "# INPUT\n") self.git("add", ".") self.git("commit", "-m", "add input docs") @@ -269,7 +284,6 @@ def test_blocks_input_parameter_change_when_required_docs_are_deleted(self): "source/source_io/module_parameter/read_input_item_model.cpp", 'Input_Item item("new_switch");\nitem.default_value = "0";\n', ) - (self.repo / "docs" / "parameters.yaml").unlink() (self.repo / "docs" / "advanced" / "input_files" / "input-main.md").unlink() head = self.commit_change() From c969a48187cb24ad3fc81db585b10b26f3e72ce6 Mon Sep 17 00:00:00 2001 From: Bonan Zhu Date: Sun, 12 Jul 2026 21:13:49 +0800 Subject: [PATCH 6/6] docs: fail RTD input reference refresh errors --- docs/README.md | 9 +++-- docs/conf.py | 34 +++++++++++++---- docs/tests/test_conf_input_docs.py | 60 ++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 12 deletions(-) diff --git a/docs/README.md b/docs/README.md index 0221bc5816e..4d9d4c905b3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -4,7 +4,8 @@ These files are the source for the ABACUS manual published on Read the Docs. Read the Docs builds a minimal serial ABACUS binary, regenerates `docs/advanced/input_files/input-main.md` from that binary during the -documentation build, and emits a warning if no ABACUS executable is available. +documentation build, and fails the build if the INPUT reference cannot be +refreshed. ## Build the Manual Locally @@ -59,9 +60,9 @@ Run the following commands from the repository root. 1. Open `build-docs/html/index.html` in a browser. -If no ABACUS executable is available, the Sphinx build still continues with the -checked-in `docs/advanced/input_files/input-main.md` and prints a warning that -the INPUT parameter reference may not be up to date. +For local builds, if no ABACUS executable is available, the Sphinx build still +continues with the checked-in `docs/advanced/input_files/input-main.md` and +prints a warning that the INPUT parameter reference may not be up to date. ## Regenerate Only the INPUT Reference diff --git a/docs/conf.py b/docs/conf.py index 6f97f0af117..60126aa2382 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -122,12 +122,23 @@ def warn_input_docs(message): print(f"Warning: {message}") +def input_docs_refresh_required(env=None): + env = os.environ if env is None else env + return env.get('READTHEDOCS') == 'True' + + +def handle_input_docs_failure(message, warn, fail_on_error): + if fail_on_error: + raise RuntimeError(message) + warn(message) + + def candidate_abacus_binaries(repo_root): """Return candidate ABACUS binaries for local and Read the Docs builds.""" env_binary = os.environ.get('ABACUS_BINARY') or os.environ.get('ABACUS_EXECUTABLE') - candidates = [] if env_binary: - candidates.append(Path(env_binary)) + return [Path(env_binary)] + candidates = [] candidates.extend([ repo_root / 'build-rtd-docs' / 'source' / 'abacus_pw_ser', repo_root / 'build-rtd-docs' / 'abacus_pw_ser', @@ -146,16 +157,18 @@ def find_abacus_binary(repo_root): return None -def refresh_input_docs(docs_dir, abacus_binary=None, warn=warn_input_docs): +def refresh_input_docs(docs_dir, abacus_binary=None, warn=warn_input_docs, fail_on_error=False): """Refresh input-main.md from an ABACUS executable, if one is available.""" docs_dir = Path(docs_dir) repo_root = docs_dir.parent binary = Path(abacus_binary) if abacus_binary else find_abacus_binary(repo_root) if binary is None or not binary.exists() or not os.access(binary, os.X_OK): - warn( + handle_input_docs_failure( "ABACUS executable not found; INPUT parameter documentation may not " "be up to date. Set ABACUS_BINARY=/path/to/abacus or build the " - "reduced documentation binary first." + "reduced documentation binary first.", + warn, + fail_on_error, ) return False @@ -170,10 +183,12 @@ def refresh_input_docs(docs_dir, abacus_binary=None, warn=warn_input_docs): ) if result.returncode != 0: detail = result.stderr.strip() or result.stdout.strip() - warn( + handle_input_docs_failure( "ABACUS could not generate INPUT parameter metadata; documentation " f"may not be up to date. Command: {binary} --generate-parameters-yaml" - + (f". Output: {detail}" if detail else "") + + (f". Output: {detail}" if detail else ""), + warn, + fail_on_error, ) return False @@ -188,7 +203,10 @@ def refresh_input_docs(docs_dir, abacus_binary=None, warn=warn_input_docs): def generate_input_docs(app): - refresh_input_docs(Path(__file__).resolve().parent) + refresh_input_docs( + Path(__file__).resolve().parent, + fail_on_error=input_docs_refresh_required(), + ) def setup(app): app.connect('builder-inited', generate_input_docs) diff --git a/docs/tests/test_conf_input_docs.py b/docs/tests/test_conf_input_docs.py index 697896f51e6..7cce650f856 100644 --- a/docs/tests/test_conf_input_docs.py +++ b/docs/tests/test_conf_input_docs.py @@ -2,6 +2,7 @@ import sys import tempfile import unittest +from unittest import mock from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[1])) @@ -21,6 +22,22 @@ class InputDocsGenerationTest(unittest.TestCase): + def test_readthedocs_environment_requires_fresh_input_docs(self): + self.assertTrue(conf.input_docs_refresh_required({"READTHEDOCS": "True"})) + self.assertFalse(conf.input_docs_refresh_required({"READTHEDOCS": "False"})) + self.assertFalse(conf.input_docs_refresh_required({})) + + def test_explicit_abacus_binary_path_disables_fallback_search(self): + with tempfile.TemporaryDirectory() as tmpdir: + repo_root = Path(tmpdir) + fallback_binary = repo_root / "build-rtd-docs" / "source" / "abacus_pw_ser" + fallback_binary.parent.mkdir(parents=True) + fallback_binary.write_text("#!/bin/sh\nexit 0\n") + fallback_binary.chmod(fallback_binary.stat().st_mode | stat.S_IXUSR) + + with mock.patch.dict("os.environ", {"ABACUS_BINARY": str(repo_root / "missing-abacus")}): + self.assertIsNone(conf.find_abacus_binary(repo_root)) + def test_refreshes_input_docs_from_abacus_binary_without_writing_yaml_file(self): with tempfile.TemporaryDirectory() as tmpdir: tmp_path = Path(tmpdir) @@ -68,6 +85,49 @@ def test_warns_when_abacus_binary_is_not_available(self): self.assertEqual(1, len(warnings)) self.assertIn("may not be up to date", warnings[0]) + def test_required_refresh_raises_when_abacus_binary_is_not_available(self): + with tempfile.TemporaryDirectory() as tmpdir: + docs_dir = Path(tmpdir) / "docs" + docs_dir.mkdir() + warnings = [] + + with self.assertRaises(RuntimeError) as caught: + conf.refresh_input_docs( + docs_dir=docs_dir, + abacus_binary=docs_dir / "missing-abacus", + warn=warnings.append, + fail_on_error=True, + ) + + self.assertIn("may not be up to date", str(caught.exception)) + self.assertEqual([], warnings) + + def test_required_refresh_raises_when_abacus_metadata_generation_fails(self): + with tempfile.TemporaryDirectory() as tmpdir: + tmp_path = Path(tmpdir) + docs_dir = tmp_path / "docs" + docs_dir.mkdir() + fake_abacus = tmp_path / "abacus" + fake_abacus.write_text( + "#!/bin/sh\n" + "echo 'metadata generation failed' >&2\n" + "exit 2\n" + ) + fake_abacus.chmod(fake_abacus.stat().st_mode | stat.S_IXUSR) + warnings = [] + + with self.assertRaises(RuntimeError) as caught: + conf.refresh_input_docs( + docs_dir=docs_dir, + abacus_binary=fake_abacus, + warn=warnings.append, + fail_on_error=True, + ) + + self.assertIn("could not generate INPUT parameter metadata", str(caught.exception)) + self.assertIn("metadata generation failed", str(caught.exception)) + self.assertEqual([], warnings) + if __name__ == "__main__": unittest.main()