Skip to content

Commit dc99085

Browse files
author
Zanthoxylum
committed
merge: 合并 origin/develop
2 parents 3152fff + e461ffd commit dc99085

496 files changed

Lines changed: 18155 additions & 10959 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_test_cmake.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
name: "Build extra components with GNU toolchain"
2929
- tag: intel
3030
external_toolchain_args: "--with-intel"
31-
build_args: "-DENABLE_LIBXC=ON -DENABLE_PEXSI=ON -DENABLE_MLALGO=ON -DENABLE_LIBRI=ON -DENABLE_DFTD4=ON"
31+
build_args: "-DENABLE_LIBXC=ON -DENABLE_MLALGO=ON -DENABLE_LIBRI=ON -DENABLE_DFTD4=ON"
3232
name: "Build extra components with Intel toolchain"
3333

3434
- tag: cuda
@@ -41,7 +41,7 @@ jobs:
4141
name: "Build without LCAO"
4242
- tag: gnu
4343
external_toolchain_args: ""
44-
build_args: "-DUSE_ELPA=OFF "
44+
build_args: "-DENABLE_ELPA=OFF "
4545
name: "Build without ELPA"
4646
- tag: gnu
4747
external_toolchain_args: ""
@@ -72,7 +72,6 @@ jobs:
7272
run: |
7373
git config --global --add safe.directory `pwd`
7474
source toolchain/install/setup
75-
prepend_path CMAKE_PREFIX_PATH ${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}
7675
rm -rf build
7776
cmake -B build -G Ninja ${{ matrix.build_args }}
7877
cmake --build build -j $(nproc)

.github/workflows/cuda.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,30 @@ jobs:
7373
cd tests/13_NAO_multik_GPU
7474
bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
7575
76+
- name: Test 02_NAO_Gamma on GPU
77+
run: |
78+
cd tests/02_NAO_Gamma
79+
find . -name INPUT | while read f; do
80+
if grep -qE '^[[:space:]]*device[[:space:]]+' "$f"; then
81+
sed -i -E 's/^[[:space:]]*device[[:space:]]+.*/device gpu/' "$f"
82+
else
83+
echo "device gpu" >> "$f"
84+
fi
85+
done
86+
bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
87+
88+
- name: Test 03_NAO_multik on GPU
89+
run: |
90+
cd tests/03_NAO_multik
91+
find . -name INPUT | while read f; do
92+
if grep -qE '^[[:space:]]*device[[:space:]]+' "$f"; then
93+
sed -i -E 's/^[[:space:]]*device[[:space:]]+.*/device gpu/' "$f"
94+
else
95+
echo "device gpu" >> "$f"
96+
fi
97+
done
98+
bash ../integrate/Autotest.sh -n 2 -f CASES_GPU.txt
99+
76100
- name: Test 15_rtTDDFT_GPU
77101
run: |
78102
cd tests/15_rtTDDFT_GPU

CMakeLists.txt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ option(ENABLE_RAPIDJSON "Enable rapid-json usage" OFF)
6565
option(ENABLE_CNPY "Enable cnpy usage" OFF)
6666

6767
# Options requiring MPI and LCAO
68-
cmake_dependent_option(ENABLE_ELPA "Enable ELPA for LCAO" ON "ENABLE_LCAO;ENABLE_MPI" OFF)
68+
cmake_dependent_option(ENABLE_ELPA "Enable ELPA eigensolver" ON "ENABLE_MPI" OFF)
6969
cmake_dependent_option(ENABLE_LIBRI "Enable LibRI for hybrid functional"
7070
OFF "ENABLE_LCAO;ENABLE_MPI" OFF)
7171
cmake_dependent_option(ENABLE_PEXSI "Enable PEXSI for LCAO" OFF "ENABLE_LCAO;ENABLE_MPI" OFF)
@@ -304,17 +304,15 @@ if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
304304
set(ENABLE_ABACUS_LIBM OFF)
305305
endif()
306306

307-
if(ENABLE_LCAO)
308-
if(ENABLE_ELPA)
309-
find_package(ELPA REQUIRED)
310-
endif()
311-
if(ENABLE_PEXSI)
312-
find_package(PEXSI REQUIRED CONFIG)
313-
if(PEXSI_VERSION VERSION_LESS "2.0.0")
314-
message(FATAL_ERROR "PEXSI >= 2.0.0 is required")
315-
endif()
316-
set(CMAKE_CXX_STANDARD 14)
307+
if(ENABLE_ELPA)
308+
find_package(ELPA REQUIRED)
309+
endif()
310+
if(ENABLE_PEXSI)
311+
find_package(PEXSI REQUIRED CONFIG)
312+
if(PEXSI_VERSION VERSION_LESS "2.0.0")
313+
message(FATAL_ERROR "PEXSI >= 2.0.0 is required")
317314
endif()
315+
set(CMAKE_CXX_STANDARD 14)
318316
endif()
319317

320318
if(ENABLE_MPI)

Dockerfile.gnu

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ FROM ubuntu:22.04
1111
RUN apt update && apt install -y --no-install-recommends \
1212
libopenblas-openmp-dev liblapack-dev libscalapack-mpi-dev libelpa-dev libfftw3-dev libcereal-dev \
1313
libxc-dev libgtest-dev libgmock-dev libbenchmark-dev python3-numpy \
14+
libmetis-dev libparmetis-dev libsuperlu-dist-dev \
1415
bc cmake git g++ make time sudo unzip vim wget gfortran ca-certificates && \
1516
rm -rf /var/lib/apt/lists/*
1617
# If you wish to use the LLVM compiler, replace 'g++' above with 'clang libomp-dev'.
@@ -37,13 +38,25 @@ RUN cd /tmp && \
3738

3839
ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake
3940

41+
# PEXSI
42+
ARG PEXSI_VERSION=2.0.0
43+
RUN wget --quiet https://github.com/HPC-AI-Team/pexsi/archive/refs/tags/v${PEXSI_VERSION}.tar.gz \
44+
-O /tmp/pexsi.tar.gz && \
45+
mkdir -p /tmp/pexsi && \
46+
tar -xzf /tmp/pexsi.tar.gz -C /tmp/pexsi --strip-components=1 && \
47+
cmake -S /tmp/pexsi -B /tmp/pexsi/build \
48+
-DPEXSI_ENABLE_OPENMP=ON \
49+
-DSuperLU_DIST_INCLUDE_DIR=/usr/include/superlu-dist && \
50+
cmake --build /tmp/pexsi/build --target install -j $(nproc) && \
51+
rm -rf /tmp/pexsi
52+
4053
ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/develop /dev/null
4154
# This will fetch the latest commit info, and store in docker building cache.
4255
# If there are newer commits, docker build will ignore the cache and build latest codes.
4356

4457
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
4558
cd abacus-develop && \
46-
cmake -B build -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
59+
cmake -B build -DENABLE_MLALGO=ON -DENABLE_PEXSI=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
4760
cmake --build build -j $(nproc) && \
4861
cmake --install build && \
4962
rm -rf build

Dockerfile.intel

Lines changed: 0 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -35,127 +35,12 @@ RUN wget -q https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-
3535
unzip -q /tmp/libtorch.zip -d /opt && rm -f /tmp/libtorch.zip
3636
ENV CMAKE_PREFIX_PATH=/opt/libtorch/share/cmake:${CMAKE_PREFIX_PATH}
3737

38-
39-
###### PEXSI PART: pexsi and gklib and metis and parmetis and superlu_dist
40-
ENV GKLIB_VERSION="master"
41-
ENV METIS_VERSION="master"
42-
ENV PARMETIS_VERSION="main"
43-
ENV SUPERLU_DIST_VERSION=7.2.0
44-
ENV PEXSI_VERSION="master"
45-
ENV GKLIB_ROOT=/usr/local/gklib-${GKLIB_VERSION}
46-
ENV METIS32_ROOT=/usr/local/metis32-${METIS_VERSION}
47-
ENV PARMETIS32_ROOT=/usr/local/parmetis32-${PARMETIS_VERSION}
48-
ENV PEXSI32_ROOT=/usr/local/pexsi32-${PEXSI_VERSION}
49-
ENV SUPERLU_DIST32_ROOT=/usr/local/superlu_dist32-${SUPERLU_DIST_VERSION}
50-
51-
# 2. install GKlib
52-
RUN wget --no-check-certificate --quiet --tries=3 --timeout=30 \
53-
https://codeload.github.com/KarypisLab/GKlib/zip/refs/heads/${GKLIB_VERSION} \
54-
-O GKlib-${GKLIB_VERSION}.zip && \
55-
unzip GKlib-${GKLIB_VERSION}.zip && \
56-
cd GKlib-${GKLIB_VERSION} && \
57-
make config shared=1 prefix=${GKLIB_ROOT} openmp=set && \
58-
make -j $(nproc) && \
59-
make install && \
60-
ls ${GKLIB_ROOT}/lib && \
61-
cp -n ${GKLIB_ROOT}/lib/libGKlib.so.0 ${GKLIB_ROOT}/lib/libGKlib.so || true && \
62-
cd / && rm -rf GKlib-${GKLIB_VERSION} GKlib-${GKLIB_VERSION}.zip
63-
#.so file CANNOT be found otherwise.
64-
# 2. install METIS
65-
RUN export LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${LD_LIBRARY_PATH} && \
66-
wget --no-check-certificate --quiet --tries=3 --timeout=30 \
67-
https://codeload.github.com/KarypisLab/METIS/zip/refs/heads/${METIS_VERSION} \
68-
-O METIS-${METIS_VERSION}.zip && \
69-
unzip METIS-${METIS_VERSION}.zip && \
70-
cd METIS-${METIS_VERSION} && \
71-
make config shared=1 prefix=${METIS32_ROOT} gklib_path=${GKLIB_ROOT} && \
72-
make -j $(nproc) && \
73-
make install && \
74-
cd / && rm -rf METIS-${METIS_VERSION} METIS-${METIS_VERSION}.zip
75-
76-
# 3. install ParMETIS
77-
RUN export LD_LIBRARY_PATH=${METIS32_ROOT}/lib:${GKLIB_ROOT}/lib:${LD_LIBRARY_PATH} && \
78-
wget --no-check-certificate --quiet --tries=3 --timeout=30 \
79-
https://codeload.github.com/KarypisLab/ParMETIS/zip/refs/heads/${PARMETIS_VERSION} \
80-
-O ParMETIS-${PARMETIS_VERSION}.zip && \
81-
unzip ParMETIS-${PARMETIS_VERSION}.zip && \
82-
cd ParMETIS-${PARMETIS_VERSION} && \
83-
make config shared=1 prefix=${PARMETIS32_ROOT} gklib_path=${GKLIB_ROOT} metis_path=${METIS32_ROOT} && \
84-
make -j $(nproc) && \
85-
make install && \
86-
cd / && rm -rf ParMETIS-${PARMETIS_VERSION} ParMETIS-${PARMETIS_VERSION}.zip
87-
88-
# 4. install SuperLU_DIST
89-
RUN wget --no-check-certificate --quiet --tries=3 --timeout=30 \
90-
https://codeload.github.com/xiaoyeli/superlu_dist/tar.gz/refs/tags/v${SUPERLU_DIST_VERSION} \
91-
-O v${SUPERLU_DIST_VERSION}.tar.gz && \
92-
tar -xzf v${SUPERLU_DIST_VERSION}.tar.gz && \
93-
cd superlu_dist-${SUPERLU_DIST_VERSION} && \
94-
mkdir build && cd build && \
95-
cmake .. \
96-
-DTPL_ENABLE_PARMETISLIB=ON \
97-
-DTPL_PARMETIS_LIBRARIES="${PARMETIS32_ROOT}/lib/libparmetis.so;${METIS32_ROOT}/lib/libmetis.so;${GKLIB_ROOT}/lib/libGKlib.so" \
98-
-DTPL_PARMETIS_INCLUDE_DIRS="${PARMETIS32_ROOT}/include;${METIS32_ROOT}/include;${GKLIB_ROOT}/include" \
99-
-DTPL_ENABLE_INTERNAL_BLASLIB=OFF \
100-
-DTPL_ENABLE_LAPACKLIB=ON \
101-
-DTPL_ENABLE_COMBBLASLIB=OFF \
102-
-DTPL_ENABLE_CUDALIB=OFF \
103-
-Denable_complex16=ON \
104-
-DXSDK_INDEX_SIZE=32 \
105-
-DBUILD_SHARED_LIBS=ON \
106-
-DCMAKE_INSTALL_PREFIX=${SUPERLU_DIST32_ROOT} \
107-
-DCMAKE_C_FLAGS="-O3 -fopenmp" \
108-
-DCMAKE_CXX_FLAGS="-O3 -fopenmp" \
109-
-DXSDK_ENABLE_Fortran=ON \
110-
-DCMAKE_Fortran_COMPILER=mpiifx && \
111-
make -j $(nproc) && \
112-
make install && \
113-
cd / && rm -rf superlu_dist-${SUPERLU_DIST_VERSION} v${SUPERLU_DIST_VERSION}.tar.gz
114-
115-
### -DCMAKE_C_COMPILER=mpiicc \
116-
### -DCMAKE_CXX_COMPILER=mpiicpc \
117-
### -DCMAKE_CUDA_COMPILER=nvcc \
118-
119-
# 5. install PEXSI
120-
RUN export LD_LIBRARY_PATH=${SUPERLU_DIST32_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${GKLIB_ROOT}/lib:${LD_LIBRARY_PATH} && \
121-
export LIBRARY_PATH=${SUPERLU_DIST32_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${GKLIB_ROOT}/lib:${LIBRARY_PATH} && \
122-
export PKG_CONFIG_PATH=${SUPERLU_DIST32_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${GKLIB_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH} && \
123-
export CPATH=${SUPERLU_DIST32_ROOT}/include:${PARMETIS32_ROOT}/include:${METIS32_ROOT}/include:${GKLIB_ROOT}/include:${CMAKE_PREFIX_PATH} && \
124-
export CMAKE_PREFIX_PATH=${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH} && \
125-
wget --no-check-certificate --quiet --tries=3 --timeout=30 \
126-
https://codeload.github.com/MCresearch/pexsi/tar.gz/refs/heads/${PEXSI_VERSION} \
127-
-O pexsi-${PEXSI_VERSION}.tar.gz && \
128-
tar -xzf pexsi-${PEXSI_VERSION}.tar.gz && \
129-
cd pexsi-${PEXSI_VERSION} && \
130-
sed -i 's/^add_pexsi_f_example_exe/# add_pexsi_f_example_exe/g' fortran/CMakeLists.txt && \
131-
sed -i 's/^add_pexsi_example_exe/# add_pexsi_example_exe/g' examples/CMakeLists.txt && \
132-
sed -i 's/add_executable/# add_executable/g' fortran/CMakeLists.txt && \
133-
sed -i 's/add_executable/# add_executable/g' examples/CMakeLists.txt && \
134-
mkdir build && cd build && \
135-
cmake .. \
136-
-DCMAKE_INSTALL_PREFIX=${PEXSI32_ROOT} \
137-
-DPEXSI_ENABLE_OPENMP=ON \
138-
-DPEXSI_ENABLE_FORTRAN=OFF && \
139-
make pexsi -j $(nproc) && \
140-
make install && \
141-
cd / && rm -rf pexsi-${PEXSI_VERSION} pexsi-${PEXSI_VERSION}.tar.gz
142-
143-
ENV LD_LIBRARY_PATH=${GKLIB_ROOT}/lib:${METIS32_ROOT}/lib:${PARMETIS32_ROOT}/lib:${SUPERLU_DIST32_ROOT}/lib:${PEXSI32_ROOT}/lib:${LD_LIBRARY_PATH}
144-
ENV PKG_CONFIG_PATH=${GKLIB_ROOT}/lib/pkgconfig:${METIS32_ROOT}/lib/pkgconfig:${PARMETIS32_ROOT}/lib/pkgconfig:${SUPERLU_DIST32_ROOT}/lib/pkgconfig:${PEXSI32_ROOT}/lib/pkgconfig:${PKG_CONFIG_PATH}
145-
ENV CPATH=${GKLIB_ROOT}/include:${METIS32_ROOT}/include:${PARMETIS32_ROOT}/include:${SUPERLU_DIST32_ROOT}/include:${PEXSI32_ROOT}/include:${CPATH}
146-
ENV CMAKE_PREFIX_PATH=${PEXSI32_ROOT}:${SUPERLU_DIST32_ROOT}:${PARMETIS32_ROOT}:${METIS32_ROOT}:${GKLIB_ROOT}:${CMAKE_PREFIX_PATH}
147-
148-
### -DCMAKE_C_COMPILER=mpiicc \
149-
### -DCMAKE_CXX_COMPILER=mpiicpc \
150-
###### END of PEXSI PART
151-
15238
# Clone and build abacus (optional during image build; keep for CI image)
15339
ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/develop /dev/null
15440
RUN cd /tmp && git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
15541
cd abacus-develop && \
15642
cmake -B build \
15743
-DENABLE_MLALGO=ON \
158-
-DENABLE_PEXSI=ON \
15944
-DENABLE_LIBXC=ON \
16045
-DENABLE_LIBRI=ON \
16146
-DENABLE_RAPIDJSON=ON \

cmake/CollectBuildInfoVars.cmake

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,6 @@ else()
126126
set(ABACUS_LCAO_ENABLED "False")
127127
endif()
128128

129-
# Core Math Libraries
130-
if(ENABLE_LCAO AND ENABLE_ELPA)
131-
set(ABACUS_ELPA_VERSION "yes (v${ELPA_VERSION})")
132-
else()
133-
set(ABACUS_ELPA_VERSION "no")
134-
endif()
135-
136129
# BLAS and FFTW libraries
137130
if(MKL_FOUND)
138131
set(ABACUS_BLAS_VENDOR "MKL")
@@ -179,6 +172,13 @@ else()
179172
endif()
180173
endif()
181174

175+
# ELPA eigensolver
176+
if(ENABLE_ELPA)
177+
set(ABACUS_ELPA_VERSION "yes (v${ELPA_VERSION})")
178+
else()
179+
set(ABACUS_ELPA_VERSION "no")
180+
endif()
181+
182182
if(ENABLE_LIBXC AND Libxc_VERSION)
183183
set(ABACUS_LIBXC_VERSION "yes (v${Libxc_VERSION})")
184184
elseif(ENABLE_LIBXC)

docs/CONTRIBUTING.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,12 @@ An practical example is class [LCAO_Deepks](https://github.com/deepmodeling/abac
172172
173173
## Documenting INPUT Parameters
174174
175-
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.
175+
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 under `source/source_io/module_parameter/` using `Input_Item` registrations.
176176
177-
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`.
177+
The C++ `Input_Item` registrations are the source of truth for parameter metadata. The checked-in `docs/parameters.yaml` and `docs/advanced/input_files/input-main.md` files are generated artifacts: do not edit either file manually. `parameters.yaml` is generated from the binary and is used by Sphinx to produce `input-main.md`.
178+
179+
Availability expressions follow the grammar and invariants in
180+
[`developers_guide/input_availability.md`](developers_guide/input_availability.md).
178181
179182
### When to Update `docs/parameters.yaml`
180183
@@ -198,13 +201,13 @@ Then verify the YAML is valid:
198201
python3 -c "import yaml; d=yaml.safe_load(open('docs/parameters.yaml')); print(len(d['parameters']), 'parameters')"
199202
```
200203

201-
You can also regenerate the markdown documentation locally:
204+
Then regenerate the markdown documentation locally:
202205

203206
```bash
204207
python3 docs/generate_input_main.py docs/parameters.yaml --output docs/advanced/input_files/input-main.md
205208
```
206209

207-
**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.
210+
**Important:** Include the updated `docs/parameters.yaml` and `input-main.md` in your commit when submitting a PR that modifies INPUT parameters. CI regenerates both files from the built binary and rejects any mismatch. Do not fix a documentation mismatch by editing either generated file; update the C++ `Input_Item` registration and regenerate them instead.
208211

209212
### Parameter Documentation Format
210213

@@ -218,7 +221,7 @@ When adding or modifying INPUT parameters in C++ source, set the following field
218221
item.description = "Description of what this parameter does.";
219222
item.default_value = "0";
220223
item.unit = "Ry"; // Optional, empty string if no unit
221-
item.availability = ""; // Optional, empty string if always available
224+
item.set_availability("basis_type==pw"); // Optional; omit if always available
222225
// ... read_value, reset_value, check_value functions ...
223226
this->add_item(item);
224227
}

docs/advanced/elec_properties/wfc.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,22 @@ ABACUS is able to output electron wave functions in both PW and LCAO basis calcu
44

55
## Wave Function in G-Space
66

7-
To output wave functions in G-space, add one of the following keywords to the `INPUT` file while performing SCF calculation:
8-
- **PW basis**: Set [`out_wfc_pw`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-pw) to `1`. Output file format: `wfs[spin]k[kpoint]_pw.txt`, where `[spin]` is the spin channel index, and `[kpoint]` the k-point index.
7+
For `basis_type=pw` and `esolver_type=ksdft`, [`out_wfc_pw`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-pw) controls the output of plane-wave Kohn-Sham coefficients:
98

10-
- **LCAO basis**: Set [`out_wfc_lcao`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-lcao) to `1`.
11-
- **Multi-k calculations**: Generates multiple files `wfs[spin]k[kpoint]_nao.txt`.
12-
- **Gamma-only calculations**: `wfs[spin]_nao.txt` instead.
9+
* `0`: Do not write wave-function coefficients.
10+
* `1`: Write text files with the `.txt` suffix.
11+
* `2`: Write binary files with the `.dat` suffix.
12+
13+
The files are stored in `OUT.${suffix}/`. Their pattern is `wfk{k}[s{spin}][g{geometry step}][e{electronic iteration}]_pw.txt` for `out_wfc_pw=1` and `wfk{k}[s{spin}][g{geometry step}][e{electronic iteration}]_pw.dat` for `out_wfc_pw=2`. The `s*` label is omitted for `nspin=1`, is `s1` or `s2` for `nspin=2`, and is `s4` for `nspin=4`. All PW files include the `k*` label, including Gamma-only calculations.
14+
15+
With `out_freq_ion=0`, files are written only when the electronic calculation converges or reaches `scf_nmax`, and the names contain neither `g*` nor `e*`. During structural relaxation or molecular dynamics, each later ionic step overwrites the same files. With `out_freq_ion>0`, output is restricted to the ionic steps selected by `out_freq_ion` and occurs at multiples of `out_freq_elec`, at convergence, or at `scf_nmax`; both `g*` and `e*` are included in the file names. A static `calculation=scf` or `calculation=nscf` run also receives `g1e*` indices when `out_freq_ion>0`.
16+
17+
The normal [`init_wfc=file`](../scf/initialization.md#wave-function) path reads only unindexed binary `wf*_pw.dat` files from `read_file_dir`. Generate directly reusable files with `out_wfc_pw=2` and normally `out_freq_ion=0`. Text `wf*_pw.txt` files and files containing `g*` or `e*` indices are not matched automatically.
18+
19+
For `basis_type=lcao`, set [`out_wfc_lcao=1`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-lcao). Multi-k calculations generate `wfs{spin}k{k-point}_nao.txt`, while Gamma-only calculations generate `wfs{spin}_nao.txt`.
1320

1421
## Wave Function in Real Space
1522

1623
One can also choose to output real-space wave functions with the keyword [`out_wfc_norm`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-norm) or [`out_wfc_re_im`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-wfc-re-im).
1724

18-
Notice: When the [`basis_type`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#basis-type) is `lcao`, only `get_wf` [`calculation`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#calculation) is effective. An example is [examples/11_wfc/lcao_ienvelope_Si2](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/11_wfc/lcao_ienvelope_Si2).
25+
Notice: When the [`basis_type`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#basis-type) is `lcao`, only `get_wf` [`calculation`](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#calculation) is effective. An example is [examples/11_wfc/lcao_ienvelope_Si2](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/11_wfc/lcao_ienvelope_Si2).

0 commit comments

Comments
 (0)