Skip to content

Commit 20b6144

Browse files
committed
Merge remote-tracking branch 'deepmodeling/develop' into pr-7580
# Conflicts: # source/source_hsolver/test/CMakeLists.txt
2 parents 53f0577 + 94c4bc5 commit 20b6144

435 files changed

Lines changed: 36681 additions & 20797 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: 1 addition & 2 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
@@ -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

AGENTS.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rules. Read the complete governance document before making or reviewing changes:
88

99
## Required Baseline
1010

11-
- Follow the seven ABACUS coding rules summarized from the project governance:
11+
- Follow the nine ABACUS coding rules summarized from the project governance:
1212
1. Do not increase cross-layer control through `GlobalV`, `GlobalC`, or
1313
`PARAM`; pass dependencies explicitly where practical. Migration-neutral
1414
moves must keep the PR-level global dependency budget non-increasing and
@@ -23,6 +23,9 @@ rules. Read the complete governance document before making or reviewing changes:
2323
6. Add focused tests for key features, bug fixes, INPUT behavior changes,
2424
heterogeneous kernels, and core-module refactors.
2525
7. Keep code compatible with the repository C++11 baseline.
26+
8. Declare one variable per line; do not use comma-separated declarations.
27+
9. Do not call MPI routines directly; use the internally-guarded wrappers
28+
(e.g., `Parallel_Reduce::reduce_*`, `Parallel_Common::bcast_*`) instead.
2629
- Use LF line endings for text files. Only `.bat` and `.cmd` files may use CRLF.
2730
- Keep source file additions deterministic: update the relevant `CMakeLists.txt`
2831
or explain why the file is generated or included indirectly.
@@ -31,6 +34,14 @@ rules. Read the complete governance document before making or reviewing changes:
3134
is required.
3235
- Report the exact verification performed. Do not claim completion without
3336
fresh test or check output.
37+
- For multi-step refactors (e.g., splitting a large `.cpp` into several
38+
files), build and commit after each step rather than batching all changes
39+
before verification. This keeps the blast radius small when a step
40+
surfaces a missing include or instantiation error.
41+
- Prefer `std::vector` over raw `new`/`delete` for dynamic arrays; before
42+
converting class members, confirm no external code consumes them as raw
43+
pointers (e.g., `std::vector<bool>` has no `.data()`), and use
44+
`std::fill`/`std::copy` instead of `ZEROS`/`COPYARRAY` on vector buffers.
3445

3546
## Repository Map
3647

@@ -83,13 +94,24 @@ rules. Read the complete governance document before making or reviewing changes:
8394
test sufficiency, and exception approval require human review.
8495
- Exceptions must be recorded in the PR with reason, scope, risk, and a follow-up
8596
cleanup plan.
97+
- After a refactor, propose brief lessons worth recording in this file, then
98+
ask the developer whether to write them in; be cautious and skip unclear
99+
or unverified lessons.
100+
101+
## Refactoring Patterns
102+
103+
- Member -> free function: inventory `this->` reads; pass as params (const
104+
for config, ref for mutable state); move only when body is `this`-free;
105+
keep thin wrapper; compile each step.
86106

87107
## Local Commands
88108

89109
```bash
90110
python3 tools/03_code_analysis/agent_governance_check.py --staged
91111
python3 tools/03_code_analysis/agent_governance_check.py --base upstream/develop --head HEAD --format text
92112
pre-commit run abacus-agent-governance --all-files
113+
# Score changed C++ files for quality debt (pass line is 60):
114+
python3 tools/03_code_analysis/code_quality_score.py $(git diff --name-only upstream/develop...HEAD | grep -E '\.(cpp|h)$')
93115
```
94116

95117
The repository text files have been normalized to LF once. Day-to-day line

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 \

docs/advanced/acceleration/cuda.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The ABACUS program will automatically determine whether the current ELPA support
4444
## Run with the GPU support by editing the INPUT script:
4545

4646
In `INPUT` file we need to set the input parameter [device](../input_files/input-main.md#device) to `gpu`. If this parameter is not set, ABACUS will try to determine if there are available GPUs.
47-
- Set `ks_solver`: For the PW basis, CG, BPCG and Davidson methods are supported on GPU; set the input parameter [ks_solver](../input_files/input-main.md#ks_solver) to `cg`, `bpcg` or `dav`. For the LCAO basis, `cusolver`, `cusolvermp` and `elpa` is supported on GPU.
47+
- Set `ks_solver`: For the PW basis, CG, BPCG, Davidson, and Davidson subspace methods are supported on GPU; set the input parameter [ks_solver](../input_files/input-main.md#ks_solver) to `cg`, `bpcg`, `dav`, or `dav_subspace`. For the LCAO basis, `cusolver`, `cusolvermp`, and `elpa` are supported on GPU.
4848
- **single-card**: ABACUS allows for single-GPU acceleration. You can run ABACUS without any MPI process by command `abacus`, and `ks_solver cusolver` is recommended for the LCAO basis. *note: avoid using `mpirun -n 1 abacus`*.
4949
- **multi-cards**: ABACUS allows for multi-GPU acceleration. If you have multiple GPU cards, you can run ABACUS with several MPI processes, and each process will utilize one GPU card. For example, the command `mpirun -n 2 abacus` will by default launch two GPUs for computation. If you only have one card, this command will only start one GPU. *note: the number of MPI processes SHOULD be equal to the number of GPU cards, unless you are using MPS in your computer.*
5050

@@ -58,4 +58,4 @@ PW basis:
5858

5959
LCAO basis:
6060
- Unless there is a specific reason, avoid using multiple GPUs, as it can be slower than using a single GPU. This is because the generalized eigenvalue solution of the LCAO basis set will incur additional communication overhead when calculated on multiple cards. When the memory limit of a GPU card makes it insufficient to complete the task, it is recommended to use multiple cards for calculation.
61-
- When using elpa on GPUs, some ELPA internal logs will be output.
61+
- When using elpa on GPUs, some ELPA internal logs will be output.

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)