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
Update the 'get_s' command and related description. Update the 'DOS' output filenames. Move some functions in 'after_all_runners' to 'after_scf'. Change 'out_dm' to 'out_dmk' and change 'out_dm1' to 'out_dmr' (#6278)
* begin changing the output file names of out_mat_hs
* update output vxc an output tk
* Fix example 006_NO_GO_OH in 02_NAO_Gamma
* fix a bug
* fix 17_NO_KP_OH example in 03_NAO_multik
* partly update the 19_NO_KP_OH_nscf exxample and related codes
* partly update 20_NO_KP_OHS_S4
* fix the example 20_NO_KP_OHS_S4
* print out the information for H(R), S(R), H(k) and S(k)
* update 08_EXX examples
* update output filenames related to dH, dS, rR
* update documents
* add ctrl_output_lcao.h and ctrl_output_lcao.cpp files
* update ctrl_output_lcao function
* add more function in ctrl_output_lcao
* update ctrl_output_lcao
* update the output_mat_sparse function
* update p_hamilt class without the Device parameter
* add back functions in ctrl_output_lcao
* add back berry phase in ctrl_output_lcao
* add back wannier90
* add back rdmft
* update lcao_after_scf, this is before using ctrl_outut_lcao in lcao_after_scf
* update
* the functions turn normal, reconstruction finished
* merge
* fix bug related to deepks and exc
* update input-main.md
* fix exx codes
* update description for printing out H and S matrices
* change get_S to get_s
* update get_s document
* update the output of dos
* output dos when nspin = 2
* update the dos documents
* change out_dm to out_dmk and out_dm1 to out_dmr
* update out_dmk and out_dmr examples
* update the DOS name, update the output frequency of DOS for LCAO, not for PW yet
* update dos description
* add example relax_output, delete useless out_dm parameter in 11_PW_GPU tests
* update DOS related testing codes
* update 031 032 103 104
* update reference data for DOS
* fix a bug in example 05_NO_KP_DJ_OC2
* fix bug
* update SDFT DOS
* update dos ref
* update DOS examples
* update deepks examples
Copy file name to clipboardExpand all lines: docs/advanced/elec_properties/density_matrix.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Extracting Density Matrices
2
2
3
-
ABACUS can output the density matrix by adding the keyword "[out_dm](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-dm)" in INPUT file:
4
4
```
5
-
out_dm 1
5
+
out_dmk 1
6
6
```
7
7
After finishing the calculation, the information of the density matrix is stroed in files `OUT.${suffix}/SPIN${spin}_DM`, which looks like:
8
8
```
@@ -37,4 +37,4 @@ The following line is dimension of the density matrix, and the rest lines are th
37
37
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
-
- Note: now this function is valid only for LCAO gamma only calcualtion.
40
+
- Note: now this function is valid only for LCAO gamma only calcualtion.
In ABACUS, we provide the option to write the Hamiltonian and Overlap matrices to files after SCF calculation.
3
+
In ABACUS, we provide the option to write the Hamiltonian and Overlap matrices to files after SCF calculations.
4
4
5
-
For periodic systems, there are two ways to represent the matrices, the first is to write the entire square matrices for each k point, namely $H(k)$ and $S(k)$; the second is the R space representation, $H(R)$ and $S(R)$, where R is the lattice vector. The two representations are connected by Fourier transform:
5
+
For periodic systems, there are two ways to construct the matrices, the first is to write the entire square matrices for each $k$ point in the Brillouin zone, namely $H(k)$ and $S(k)$; the second one is the real space representation, $H(R)$ and $S(R)$, where R is the Bravis lattice vector. The two representations are connected by Fourier transform:
6
6
7
7
- $H(k)=\sum_R H(R)e^{-ikR}$
8
8
@@ -12,18 +12,9 @@ and
12
12
13
13
## out_mat_hs
14
14
15
-
Users can set the keyword [out_mat_hs](../input_files/input-main.md#out_mat_hs) to true for outputting the upper triangular part of the Hamiltonian matrices and overlap matrices for each k point into files in the directory `OUT.${suffix}`. It is available for both gamma_only and multi-k calculations.
15
+
Users can set the keyword [out_mat_hs](../input_files/input-main.md#out_mat_hs) to true to print the upper triangular part of the Hamiltonian matrices and overlap matrices for each k point into files in the directory `OUT.${suffix}`. It is available for both gamma_only and multi-k calculations.
16
16
17
-
The files are named `data-$k-H` and `data-$k-S`, where `$k` is a composite index consisting of the k point index as well as the spin index. The corresponding sequence of the orbitals can be seen in [Basis Set](../pp_orb.md#basis-set).
18
-
19
-
For nspin = 1 and nspin = 4 calculations, there will be only one spin component, so `$k` runs from 0 up to `$nkpoints-1`. For nspin = 2, `$k` runs from `2*$nkpoints-1`. In the latter case, the files are arranged into blocks of up and down spins. For example, if there are 3 k points, then we have the following correspondence:
20
-
21
-
- data-0-H : 1st k point, spin up
22
-
- data-1-H : 2nd k point, spin up
23
-
- data-2-H : 3rd k point, spin up
24
-
- data-3-H : 1st k point, spin down
25
-
- data-4-H : 2nd k point, spin down
26
-
- data-5-H : 3rd k point, spin down
17
+
The $H(k)$ and $S(k)$ matrices are stored with numerical atomic orbitals as basis, and the corresponding sequence of the numerical atomic orbitals can be seen in [Basis Set](../pp_orb.md#basis-set).
27
18
28
19
As for information on the k points, one may look for the `SETUP K-POINTS` section in the running log.
29
20
@@ -33,12 +24,10 @@ The rest of the file contains the upper triangular part of the specified matrice
33
24
34
25
## out_mat_hs2
35
26
36
-
The output of R-space matrices is controlled by the keyword [out_mat_hs2](../input_files/input-main.md#out_mat_hs2). This functionality is not available for gamma_only calculations. To generate such matrices for gamma only calculations, users should turn off [gamma_only](../input_files/input-main.md#gamma_only), and explicitly specify that gamma point is the only k point in the KPT file.
27
+
The output of $H(R)$ and $S(R)$ matrices is controlled by the keyword [out_mat_hs2](../input_files/input-main.md#out_mat_hs2). This functionality is not available for gamma_only calculations. To generate such matrices for gamma only calculations, users should turn off [gamma_only](../input_files/input-main.md#gamma_only), and explicitly specify that gamma point is the only k point in the KPT file.
37
28
38
29
For single-point SCF calculations, if nspin = 1 or nspin = 4, two files `hrs1_nao.csr` and `sr_nao.csr` are generated, which contain the Hamiltonian matrix $H(R)$ and overlap matrix $S(R)$ respectively. For nspin = 2, three files `hrs1_nao.csr` and `hrs2_nao.csr` and `sr_nao.csr` are created, where the first two files correspodn to $H(R)$ for spin up and spin down, respectively.
39
30
40
-
As for molecular dynamics calculations, the format is controlled by [out_interval](../input_files/input-main.md#out_interval) and [out_app_flag](../input_files/input-main.md#out_app_flag) in the same manner as the position matrix as detailed in [out_mat_r](../input_files/input-main.md#out_mat_r).
41
-
42
31
Each file or each section of the appended file starts with three lines, the first gives the current ion/md step, the second gives the dimension of the matrix, and the last indicates how many different `R` are in the file.
43
32
44
33
The rest of the files are arranged in blocks. Each block starts with a line giving the lattice vector `R` and the number of nonzero matrix elements, such as:
@@ -56,10 +45,12 @@ The CSR format stores a sparse m × n matrix M in row form using three (one-dime
56
45
- The arrays V and COL_INDEX are of length NNZ, and contain the non-zero values and the column indices of those values respectively.
57
46
- The array ROW_INDEX is of length m + 1 and encodes the index in V and COL_INDEX where the given row starts. This is equivalent to ROW_INDEX[j] encoding the total number of nonzeros above row j. The last element is NNZ , i.e., the fictitious index in V immediately after the last valid index NNZ - 1.
58
47
59
-
## get_S
60
-
We also offer the option of only calculating the overlap matrix without running SCF. For that purpose, in `INPUT` file we need to set the value keyword [calculation](../input_files/input-main.md#calculation) to be `get_S`.
48
+
For calculations involving ionic movements, the output frequency of the matrix is controlled by [out_interval](../input_files/input-main.md#out_interval) and [out_app_flag](../input_files/input-main.md#out_app_flag).
49
+
50
+
## get_s
51
+
We also offer the option of only calculating the overlap matrix without running SCF. For that purpose, in `INPUT` file we need to set the value keyword [calculation](../input_files/input-main.md#calculation) to be `get_s`.
61
52
62
-
A file named `SR.csr` will be generated in the working directory, which contains the overlap matrix.
53
+
A file named `sr_nao.csr` will be generated in the working directory, which contains the overlap matrix.
63
54
64
55
> When `nspin` is set to 1 or 2, the dimension of the overlap matrix is nlocal $\times$ nlocal, where nlocal is the total number of numerical atomic orbitals.
65
56
These numerical atomic orbitals are ordered from outer to inner loop as atom, angular quantum number $l$, zeta (multiple radial orbitals corresponding to each $l$), and magnetic quantum number $m$.
@@ -69,9 +60,9 @@ When `nspin` is set to 4, the dimension of the overlap matrix is (2 $\times$ nlo
69
60
## examples
70
61
We provide [examples](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/matrix_hs) of outputting the matrices. There are four examples:
71
62
72
-
-out_hs2_multik : writing H(R) and S(R) for multi-k calculation
73
-
-out_hs_gammaonly : writing H(k) and S(k) for gamma-only calculation
74
-
-out_hs_multik : writing H(k) and S(k) for multi-k calculation
75
-
- out_s_multik: running get_S for multi-k calculation
63
+
-out_hs_gammaonly: writing H(k) and S(k) for gamma-only calculation
64
+
-out_hs_multik: writing H(k) and S(k) for multi-k calculation
65
+
-out_hs2_multik: writing H(R) and S(R) for multi-k calculation
66
+
- out_s_multik: running calculation=get_s to obtain overlap matrix for multi-k calculation
76
67
77
68
Reference output files are provided in each directory.
Copy file name to clipboardExpand all lines: docs/advanced/elec_properties/position_matrix.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -20,5 +20,5 @@ Each block here contains the matrix for the corresponding cell. There are three
20
20
21
21
In molecular dynamics (MD) calculations, if [out_app_flag](../input_files/input-main.md#out_app_flag) is set to true, then `data-rR-tr` is written in an append manner. Otherwise, output files will be put in a separate directory, `matrix`, and named as `$x`_data-rR-tr, where `$x` is the number of MD step. In addition, the output frequency is controlled by [out_interval](../input_files/input-main.md#out_interval). For example, if we are running a 10-step MD with out_interval = 3, then `$x` will be 0, 3, 6, and 9.
22
22
23
-
## get_S
24
-
We also offer the option of only calculating the position matrix without running SCF. For that purpose, in `INPUT` file we need to set the keyword [calculation](../input_files/input-main.md#calculation) to `get_S`, and [out_mat_r](../input_files/input-main.md#out_mat_r) to `true`.
23
+
## get_s
24
+
We also offer the option of only calculating the position matrix without running SCF. For that purpose, in `INPUT` file we need to set the keyword [calculation](../input_files/input-main.md#calculation) to `get_s`, and [out_mat_r](../input_files/input-main.md#out_mat_r) to `true`.
Copy file name to clipboardExpand all lines: docs/advanced/input_files/input-main.md
+13-11Lines changed: 13 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -133,8 +133,8 @@
133
133
-[out\_freq\_elec](#out_freq_elec)
134
134
-[out\_chg](#out_chg)
135
135
-[out\_pot](#out_pot)
136
-
-[out\_dm](#out_dm)
137
-
-[out\_dm1](#out_dm1)
136
+
-[out\_dm](#out_dmk)
137
+
-[out\_dm1](#out_dmr)
138
138
-[out\_wfc\_pw](#out_wfc_pw)
139
139
-[out\_wfc\_lcao](#out_wfc_lcao)
140
140
-[out\_dos](#out_dos)
@@ -503,7 +503,7 @@ These variables are used to control general system parameters.
503
503
- md: perform molecular dynamics simulations
504
504
- get_pchg: obtain partial (band-decomposed) charge densities (for LCAO basis only). See `nbands_istate` and `out_pchg` for more information
505
505
- get_wf: obtain wave functions (for LCAO basis only). See `nbands_istate`, `out_wfc_norm` and `out_wfc_re_im` for more information
506
-
-get_S: obtain the overlap matrix formed by localized orbitals (for LCAO basis with multiple k points). the file name is `SR.csr` with file format being the same as that generated by [out_mat_hs2](#out_mat_hs2)
506
+
-get_s: obtain the overlap matrix formed by localized orbitals (for LCAO basis with multiple k points). the file name is `SR.csr` with file format being the same as that generated by [out_mat_hs2](#out_mat_hs2). Note: in the 3.10-LTS version, the command was named `get_S`
507
507
- gen_bessel: generates projectors, i.e., a series of Bessel functions, for the DeePKS method (for LCAO basis only); see also keywords `bessel_descriptor_lmax`, `bessel_descriptor_rcut` and `bessel_descriptor_tolerence`. A file named `jle.orb` will be generated which contains the projectors. An example is provided in examples/H2O-deepks-pw
508
508
- test_memory: obtain a rough estimation of memory consuption for the calculation
509
509
- test_neighbour: obtain information of neighboring atoms (for LCAO basis only), please specify a positive [search_radius](#search_radius) manually
@@ -532,7 +532,7 @@ These variables are used to control general system parameters.
532
532
- 1: Symmetry analysis will be performed to determine the type of Bravais lattice and associated symmetry operations. (point groups, space groups, primitive cells, and irreducible k-points)
533
533
-**Default**:
534
534
- 0:
535
-
- if [calculation](#calculation)==md/nscf/get_pchg/get_wf/get_S or [gamma_only](#gamma_only)==True;
535
+
- if [calculation](#calculation)==md/nscf/get_pchg/get_wf/get_s or [gamma_only](#gamma_only)==True;
536
536
- If ([dft_fuctional](#dft_functional)==hse/hf/pbe0/scan0/opt_orb or [rpa](#rpa)==True).
537
537
- If [efield_flag](#efield_flag)==1
538
538
- 1: else
@@ -1649,7 +1649,7 @@ These variables are used to control the output of properties.
1649
1649
-**Default**: 0
1650
1650
-**Note**: In the 3.10-LTS version, the file names are SPIN1_POT.cube and SPIN1_POT_INI.cube, etc.
1651
1651
1652
-
### out_dm
1652
+
### out_dmk
1653
1653
1654
1654
-**Type**: Boolean
1655
1655
-**Availability**: Numerical atomic orbital basis
@@ -1661,17 +1661,17 @@ These variables are used to control the output of properties.
- nspin = 2: `dms1k1_nao.csr`... and `dms2k1_nao.csr`... for the two spin channels.
1663
1663
-**Default**: False
1664
-
-**Note**: In the 3.10-LTS version, the file names are SPIN1_DM and SPIN2_DM, etc.
1664
+
-**Note**: In the 3.10-LTS version, the parameter is named `out_dm` and the file names are SPIN1_DM and SPIN2_DM, etc.
1665
1665
1666
-
### out_dm1
1666
+
### out_dmr
1667
1667
1668
1668
-**Type**: Boolean
1669
1669
-**Availability**: Numerical atomic orbital basis (multi-k points)
1670
1670
-**Description**: Whether to output the density matrix with Bravias lattice vector R index into files in the folder `OUT.${suffix}`. The files are named as `dmr{s}{spin index}{g}{geometry index}{_nao} + {".csr"}`. Here, 's' refers to spin, where s1 means spin up channel while s2 means spin down channel, and the sparse matrix format 'csr' is mentioned in [out_mat_hs2](#out_mat_hs2). Finally, if [out_app_flag](#out_app_flag) is set to false, the file name contains the optinal 'g' index for each ionic step that may have different geometries, and if [out_app_flag](#out_app_flag) is set to true, the density matrix with respect to Bravias lattice vector R accumulates during ionic steps:
1671
1671
- nspin = 1: `dmrs1_nao.csr`;
1672
1672
- nspin = 2: `dmrs1_nao.csr` and `dmrs2_nao.csr` for the two spin channels.
1673
1673
-**Default**: False
1674
-
-**Note**: In the 3.10-LTS version, the file names are data-DMR-sparse_SPIN0.csr and data-DMR-sparse_SPIN1.csr, etc.
1674
+
-**Note**: In the 3.10-LTS version, the parameter is named `out_dm1`, and the file names are data-DMR-sparse_SPIN0.csr and data-DMR-sparse_SPIN1.csr, etc.
1675
1675
1676
1676
### out_wfc_pw
1677
1677
@@ -1710,7 +1710,9 @@ These variables are used to control the output of properties.
1710
1710
-**Type**: Integer
1711
1711
-**Description**: Whether to output the density of states (DOS). For more information, refer to the [dos.md](../elec_properties/dos.md).
1712
1712
- 0: no output
1713
-
- 1: output the density of states (DOS)
1713
+
- 1: output the density of states (DOS)
1714
+
- nspin=1 or 4: `doss1g{geom}_{basis}.txt`, where geom is the geometry index when cell changes or ions move while basis is either `pw` or `nao`.
1715
+
- nspin=2: `doss1g{geom}_{basis}.txt` and `doss2g{geom}_{basis}.txt` for two spin channles.
1714
1716
- 2: (LCAO) output the density of states (DOS) and the projected density of states (PDOS)
1715
1717
- 3: output the Fermi surface file (fermi.bxsf) in BXSF format that can be visualized by XCrySDen
1716
1718
-**Default**: 0
@@ -1811,7 +1813,7 @@ These variables are used to control the output of properties.
1811
1813
1812
1814
-**Type**: Boolean
1813
1815
-**Availability**: Numerical atomic orbital basis (not gamma-only algorithm)
1814
-
-**Description**: Whether to print the matrix representation of the position matrix into a file named `rr.csr` in the directory `OUT.${suffix}`. If [calculation](#calculation) is set to `get_S`, the position matrix can be obtained without scf iterations. For more information, please refer to [position_matrix.md](../elec_properties/position_matrix.md#extracting-position-matrices).
1816
+
-**Description**: Whether to print the matrix representation of the position matrix into a file named `rr.csr` in the directory `OUT.${suffix}`. If [calculation](#calculation) is set to `get_s`, the position matrix can be obtained without scf iterations. For more information, please refer to [position_matrix.md](../elec_properties/position_matrix.md#extracting-position-matrices).
1815
1817
-**Default**: False
1816
1818
-**Unit**: Bohr
1817
1819
-**Note**: In the 3.10-LTS version, the file name is data-rR-sparse.csr.
@@ -1838,7 +1840,7 @@ These variables are used to control the output of properties.
1838
1840
1839
1841
-**Type**: Boolean
1840
1842
-**Availability**: Numerical atomic orbital basis (not gamma-only algorithm)
1841
-
-**Description**: Whether to print files containing the derivatives of the overlap matrix. The format will be the same as the overlap matrix $dH(R)$ as mentioned in [out_mat_dh](#out_mat_dh). The name of the files will be `dsrxs1.csr` and so on. Also controled by [out_interval](#out_interval) and [out_app_flag](#out_app_flag). This feature can be used with `calculation get_S`.
1843
+
-**Description**: Whether to print files containing the derivatives of the overlap matrix. The format will be the same as the overlap matrix $dH(R)$ as mentioned in [out_mat_dh](#out_mat_dh). The name of the files will be `dsrxs1.csr` and so on. Also controled by [out_interval](#out_interval) and [out_app_flag](#out_app_flag). This feature can be used with `calculation get_s`.
1842
1844
-**Default**: False
1843
1845
-**Unit**: Ry/Bohr
1844
1846
-**Note**: In the 3.10-LTS version, the file name is data-dSRx-sparse_SPIN0.csr and so on.
0 commit comments