Skip to content

Commit 1009827

Browse files
committed
Update the doc of out_dmk
1 parent d65fdca commit 1009827

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

docs/advanced/elec_properties/density_matrix.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# Extracting Density Matrices
22

3-
ABACUS can output the density matrix by adding the keyword "[out_dmk](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-dm)" in INPUT file:
3+
ABACUS can output the density matrix by adding the keyword "[out_dmk](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out_dmk)" in INPUT file:
44
```
55
out_dmk 1
66
```
7-
After finishing the calculation, the information of the density matrix is stroed in files `OUT.${suffix}/SPIN${spin}_DM`, which looks like:
7+
After finishing the calculation, the density matrix is written into `OUT.${suffix}/`.
8+
9+
For current develop versions:
10+
- gamma-only (`gamma_only = 1`): `dm_nao.csr` (`nspin=1/4`) or `dms1_nao.csr` and `dms2_nao.csr` (`nspin=2`)
11+
- multi-k (`gamma_only = 0`): `dmk1_nao.csr`, `dmk2_nao.csr`, ... (`nspin=1/4`) or `dmk1s1_nao.csr`, `dmk1s2_nao.csr`, ... (`nspin=2`)
12+
13+
For 3.10-LTS, the corresponding keyword is `out_dm`, and file names follow the legacy style such as `SPIN1_DM` and `SPIN2_DM`.
14+
15+
The file content looks like:
816
```
917
test
1018
5.39761
@@ -37,16 +45,23 @@ The following line is dimension of the density matrix, and the rest lines are th
3745

3846
The examples can be found in [examples/density_matrix](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/density_matrix)
3947

40-
- Note: now this function is valid only for LCAO gamma only calcualtion.
48+
- Note: Version difference summary:
49+
- develop: `out_dmk` supports both gamma-only and multi-k-point output.
50+
- 3.10-LTS: use `out_dm`.
4151

4252
## Real-space Density Matrix (CSR format)
4353

4454
ABACUS can also output the real-space density matrix DM(R) in CSR (Compressed Sparse Row) format by setting:
4555
```
4656
out_dmr 1
4757
```
58+
This feature is only valid for multi-k calculations (`gamma_only = 0`).
59+
4860
After the calculation, the density matrix files are written to `OUT.${suffix}/`:
61+
- develop naming pattern: `dmr{s}{spin index}{g}{geometry index}{_nao}.csr`
4962
- `nspin=1`: `dmrs1_nao.csr`
5063
- `nspin=2` (spin-polarized): `dmrs1_nao.csr` (spin-up) and `dmrs2_nao.csr` (spin-down)
5164

65+
For 3.10-LTS, the corresponding keyword is `out_dm1`, and the file names are `data-DMR-sparse_SPIN0.csr` and `data-DMR-sparse_SPIN1.csr`, etc.
66+
5267
These files can be used to restart calculations by setting `init_chg dm` in the INPUT file together with `read_file_dir` pointing to the directory containing the CSR files. This is supported for both `nspin=1` and `nspin=2`.

docs/advanced/input_files/input-main.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,10 @@
18101810
- nspin = 1 and 4: dmk1_nao.csr, dmk2_nao.csr, ...;
18111811
- nspin = 2: dmk1s1_nao.csr... and dmk1s2_nao.csr... for the two spin channels.
18121812

1813-
> Note: In the 3.10-LTS version, the parameter is named out_dm and the file names are SPIN1_DM and SPIN2_DM, etc.
1813+
> Note: Version difference (develop vs 3.10-LTS):
1814+
>
1815+
> - In develop, out_dmk supports both gamma-only and multi-k-point density-matrix output.
1816+
> - In 3.10-LTS, the corresponding keyword is out_dm, and the output files are SPIN1_DM and SPIN2_DM, etc.
18141817
- **Default**: False
18151818

18161819
### out_dmr

docs/parameters.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2864,7 +2864,9 @@ parameters:
28642864
* nspin = 1 and 4: dmk1_nao.csr, dmk2_nao.csr, ...;
28652865
* nspin = 2: dmk1s1_nao.csr... and dmk1s2_nao.csr... for the two spin channels.
28662866
2867-
[NOTE] In the 3.10-LTS version, the parameter is named out_dm and the file names are SPIN1_DM and SPIN2_DM, etc.
2867+
[NOTE] Version difference (develop vs 3.10-LTS):
2868+
* In develop, out_dmk supports both gamma-only and multi-k-point density-matrix output.
2869+
* In 3.10-LTS, the corresponding keyword is out_dm, and the output files are SPIN1_DM and SPIN2_DM, etc.
28682870
default_value: "False"
28692871
unit: ""
28702872
availability: Numerical atomic orbital basis

0 commit comments

Comments
 (0)