Skip to content

Commit b11209f

Browse files
authored
Merge branch 'develop' into 2026-08-10
2 parents 0e4ab44 + d923b08 commit b11209f

79 files changed

Lines changed: 2288 additions & 1180 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.

cmake/CollectBuildInfoVars.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ else()
187187
set(ABACUS_LIBXC_VERSION "no")
188188
endif()
189189

190+
if(ENABLE_DFTD4)
191+
set(ABACUS_DFTD4_VERSION "yes (v${dftd4_VERSION})")
192+
else()
193+
set(ABACUS_DFTD4_VERSION "no")
194+
endif()
195+
190196
# Accelerators
191197
if(USE_CUDA AND CUDAToolkit_VERSION)
192198
set(ABACUS_CUDA_VERSION "yes (v${CUDAToolkit_VERSION})")
@@ -451,6 +457,7 @@ message(" LibRI = ${ABACUS_LIBRI_VERSION}")
451457
if(ENABLE_EXX_DEV)
452458
message(" (EXX developing features enabled)")
453459
endif()
460+
message(" DFT-D4 = ${ABACUS_DFTD4_VERSION}")
454461
message(" RAPIDJSON = ${ABACUS_RAPIDJSON_VERSION}")
455462
message(" PEXSI = ${ABACUS_PEXSI_VERSION}")
456463
message(" CNPY = ${ABACUS_CNPY_VERSION}")

docs/advanced/elec_properties/hs_matrix.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Use [out_hsk](../input_files/input-main.md#out_hsk) to print the upper triangula
1818
| --- | --- |
1919
| `0` | Disabled |
2020
| `1` | Text; an optional second value controls precision, for example `out_hsk 1 12` |
21-
| `2` | Reserved for future binary output; not implemented |
21+
| `2` | Native binary `.dat` output |
2222
| `3` | Reserved for H(k)/S(k) NPZ output; not implemented |
2323

2424
The legacy keyword `out_mat_hs 1 [precision]` remains supported as an alias for `out_hsk 1 [precision]`. If both names are present, `out_hsk` takes precedence.
@@ -45,6 +45,18 @@ Each output block starts with a comment header containing the one-based ionic-st
4545

4646
For multi-k calculations, the matrices are Hermitian and each matrix element is written as `(real,imag)`. For gamma-only calculations, the matrices are symmetric and the matrix elements are written as real numbers.
4747

48+
### Native Binary Format
49+
50+
For `out_hsk 2`, the filenames in the table above use `.dat` instead of `.txt`. Each matrix record is written without padding or a self-describing header:
51+
52+
1. the matrix dimension as a native C++ `int`;
53+
2. the upper-triangular elements in row-major order, from `(0,0)` through `(0,N-1)`, then `(1,1)` through `(1,N-1)`, and so on;
54+
3. each gamma-only element as one native `double`, or each multi-k/spinor element as two consecutive native `double` values containing the real and imaginary parts.
55+
56+
The file therefore contains `sizeof(int) + N(N+1)/2 * sizeof(double)` bytes for a gamma-only record and `sizeof(int) + N(N+1) * sizeof(double)` bytes for a multi-k or spinor record. The format uses the host integer representation and byte order and is intended for readers using a compatible ABI.
57+
58+
When `out_app_flag` is true, the first ionic step truncates the shared file and every later step appends another complete record. When it is false, each ionic step has a separate filename containing `g${step}` before `_nao`.
59+
4860
## out_hsr
4961

5062
The output of $H(R)$ and $S(R)$ matrices is controlled by [out_hsr](../input_files/input-main.md#out_hsr). It is available for both gamma-only and multi-k LCAO calculations:

docs/advanced/input_files/input-main.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,7 @@
20032003
- **Description**: Output the upper triangular part of the Hamiltonian and overlap matrices in reciprocal space for each k-point into files in the directory OUT.${suffix}. The first integer selects the format:
20042004
- 0: disabled;
20052005
- 1: text output; the optional second integer controls precision and defaults to 8;
2006-
- 2: reserved for binary output, which is not implemented yet;
2006+
- 2: binary output in the native ABACUS .dat format;
20072007
- 3: NPZ output, which is not implemented for H(k)/S(k).
20082008

20092009
The output is also controlled by out_freq_ion and out_app_flag. For more information, refer to hs_matrix.md.
@@ -2014,6 +2014,8 @@
20142014
- Multi-k, nspin = 1: hk1_nao.txt for the Hamiltonian matrix and sk1_nao.txt for the overlap matrix at the first k-point.
20152015
- Multi-k, nspin = 2: hk1s1_nao.txt and hk1s2_nao.txt for the two spin channels of the Hamiltonian matrix, and sk1_nao.txt for the overlap matrix at the first k-point. Only one overlap matrix is written because it is identical for both spin channels.
20162016
- Multi-k, nspin = 4: hk1s4_nao.txt for the spinor Hamiltonian matrix and sk1_nao.txt for the spinor overlap matrix at the first k-point.
2017+
For binary output, the same names use the .dat suffix. Each native binary record contains the matrix dimension as an int followed by the row-major upper triangle. Gamma-only elements are doubles; multi-k and spinor elements are pairs of doubles containing the real and imaginary parts. Native integer representation and byte order are used.
2018+
When out_app_flag is true, the first ionic step truncates the file and later steps append complete records.
20172019
When out_app_flag is false, g followed by the one-based ionic-step index is inserted before _nao, for example hk1s1g1_nao.txt.
20182020

20192021
> Note: In the 3.10-LTS version, the file names are data-0-H and data-0-S, etc.

docs/parameters.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3112,7 +3112,7 @@ parameters:
31123112
Output the upper triangular part of the Hamiltonian and overlap matrices in reciprocal space for each k-point into files in the directory OUT.${suffix}. The first integer selects the format:
31133113
* 0: disabled;
31143114
* 1: text output; the optional second integer controls precision and defaults to 8;
3115-
* 2: reserved for binary output, which is not implemented yet;
3115+
* 2: binary output in the native ABACUS .dat format;
31163116
* 3: NPZ output, which is not implemented for H(k)/S(k).
31173117
31183118
The output is also controlled by out_freq_ion and out_app_flag. For more information, refer to hs_matrix.md.
@@ -3122,6 +3122,8 @@ parameters:
31223122
* Multi-k, nspin = 1: hk1_nao.txt for the Hamiltonian matrix and sk1_nao.txt for the overlap matrix at the first k-point.
31233123
* Multi-k, nspin = 2: hk1s1_nao.txt and hk1s2_nao.txt for the two spin channels of the Hamiltonian matrix, and sk1_nao.txt for the overlap matrix at the first k-point. Only one overlap matrix is written because it is identical for both spin channels.
31243124
* Multi-k, nspin = 4: hk1s4_nao.txt for the spinor Hamiltonian matrix and sk1_nao.txt for the spinor overlap matrix at the first k-point.
3125+
For binary output, the same names use the .dat suffix. Each native binary record contains the matrix dimension as an int followed by the row-major upper triangle. Gamma-only elements are doubles; multi-k and spinor elements are pairs of doubles containing the real and imaginary parts. Native integer representation and byte order are used.
3126+
When out_app_flag is true, the first ionic step truncates the file and later steps append complete records.
31253127
When out_app_flag is false, g followed by the one-based ionic-step index is inserted before _nao, for example hk1s1g1_nao.txt.
31263128
31273129
[NOTE] In the 3.10-LTS version, the file names are data-0-H and data-0-S, etc.

interfaces/ASE_interface/abacuslite/xtest.sh

100644100755
File mode changed.

source/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ set(_abacus_feature_definitions
6767
$<$<BOOL:${ENABLE_LIBRI}>:TEST_EXX_RADIAL=1>
6868
$<$<BOOL:${ENABLE_EXX_DEV}>:__EXX_DEV>
6969
$<$<BOOL:${ENABLE_LIBXC}>:__LIBXC>
70+
$<$<BOOL:${ENABLE_DFTD4}>:__DFTD4>
7071
$<$<BOOL:${MATH_INFO}>:GATHER_INFO>)
7172

7273
if(ABACUS_COMMIT_INFO_INCLUDE_DIR)

0 commit comments

Comments
 (0)