|
1 | 1 | # Extracting Density Matrices |
2 | 2 |
|
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: |
4 | 4 | ``` |
5 | 5 | out_dmk 1 |
6 | 6 | ``` |
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: |
8 | 16 | ``` |
9 | 17 | test |
10 | 18 | 5.39761 |
@@ -37,16 +45,23 @@ The following line is dimension of the density matrix, and the rest lines are th |
37 | 45 |
|
38 | 46 | The examples can be found in [examples/density_matrix](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/density_matrix) |
39 | 47 |
|
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`. |
41 | 51 |
|
42 | 52 | ## Real-space Density Matrix (CSR format) |
43 | 53 |
|
44 | 54 | ABACUS can also output the real-space density matrix DM(R) in CSR (Compressed Sparse Row) format by setting: |
45 | 55 | ``` |
46 | 56 | out_dmr 1 |
47 | 57 | ``` |
| 58 | +This feature is only valid for multi-k calculations (`gamma_only = 0`). |
| 59 | + |
48 | 60 | 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` |
49 | 62 | - `nspin=1`: `dmrs1_nao.csr` |
50 | 63 | - `nspin=2` (spin-polarized): `dmrs1_nao.csr` (spin-up) and `dmrs2_nao.csr` (spin-down) |
51 | 64 |
|
| 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 | + |
52 | 67 | 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`. |
0 commit comments