You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: nspin = 2 for init_chg=dm
* Fix: findmkl.cmake error
* Fix: init_chg hr support nspin=2
* Fix: refactor for short esolver_ks_lcao.cpp
* Fix: rewrite init_dm_from_file_test to match new CSR format, add init_chg=hr tests
The CSR file format was updated (commit 9c1a061) with spin info, ucell
data, and CSR comment block headers, but the unit test still wrote the old
format, causing parse failures. Rewrote write_test_csr to use write_dmr_csr
so the test always produces the current format. Added HR read tests for
nspin=1 and nspin=2 covering the init_chg=hr code path.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix: replace system() calls with POSIX mkdir in init_dm_from_file test
Use POSIX mkdir() from <sys/stat.h> instead of system("mkdir -p")
for C++11 compatibility, and remove system("rm -rf") cleanup calls.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: dyzheng <zhengdy@bjaisi.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/advanced/elec_properties/density_matrix.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,3 +38,15 @@ The following line is dimension of the density matrix, and the rest lines are th
38
38
The examples can be found in [examples/density_matrix](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/density_matrix)
39
39
40
40
- Note: now this function is valid only for LCAO gamma only calcualtion.
41
+
42
+
## Real-space Density Matrix (CSR format)
43
+
44
+
ABACUS can also output the real-space density matrix DM(R) in CSR (Compressed Sparse Row) format by setting:
45
+
```
46
+
out_dmr 1
47
+
```
48
+
After the calculation, the density matrix files are written to `OUT.${suffix}/`:
49
+
-`nspin=1`: `dmrs1_nao.csr`
50
+
-`nspin=2` (spin-polarized): `dmrs1_nao.csr` (spin-up) and `dmrs2_nao.csr` (spin-down)
51
+
52
+
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`.
Copy file name to clipboardExpand all lines: docs/advanced/scf/initialization.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,17 @@
1
1
# Initializing SCF
2
2
Good initializing would abate the number of iteration steps in SCF.
3
-
Charge density should be initialed for constructing the initial hamiltonian operator.
3
+
Charge density should be initialed for constructing the initial hamiltonian operator.
4
4
5
5
In PW basis, wavefunction should be initialized for iterate diagonalization method.
6
6
In LCAO basis, wavefunction can be read to calculate initial charge density. The wavefunction itself does not have to be initialized.
7
7
8
8
## Charge Density
9
9
`init_chg` is used for choosing the method of charge density initialization.
10
-
-`atomic` : initial charge density by atomic charge density from pseudopotential file under keyword `PP_RHOATOM`
10
+
-`atomic` : initial charge density by atomic charge density from pseudopotential file under keyword `PP_RHOATOM`
11
11
-`file` : initial charge density from files produced by previous calculations with [`out_chg 1`](../elec_properties/charge.md).
12
12
-`auto`: Abacus first attempts to read the density from a file; if not found, it defaults to using atomic density.
13
+
-`dm` (LCAO only): initial charge density from density matrix files in CSR format. For `nspin=1`, reads `dmrs1_nao.csr`. For `nspin=2` (spin-polarized), reads both `dmrs1_nao.csr` (spin-up) and `dmrs2_nao.csr` (spin-down). These files are generated by previous calculations with [`out_dmr 1`](../elec_properties/density_matrix.md). This method is particularly useful for restarting spin-polarized calculations.
14
+
-`hr` (LCAO only): initial charge density from Hamiltonian matrix files in CSR format. The Hamiltonian is read from file, then diagonalized to obtain wavefunctions and charge density. For `nspin=1`, reads `hrs1_nao.csr`. For `nspin=2` (spin-polarized), reads both `hrs1_nao.csr` (spin-up) and `hrs2_nao.csr` (spin-down). These files are generated by previous calculations with [`out_mat_hs2 1`](../input_files/input-main.md).
13
15
14
16
## Wave function
15
17
`init_wfc` is used for choosing the method of wavefunction coefficient initialization.
0 commit comments