Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/advanced/elec_properties/hs_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ We also offer the option of only calculating the overlap matrix without running

A file named `SR.csr` will be generated in the working directory, which contains the overlap matrix.

> 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.
These numerical atomic orbitals are ordered from outer to inner loop as atom, angular quantum number $l$, zeta, and magnetic quantum number $m$.
When `nspin` is set to 4, the dimension of the overlap matrix is (2 $\times$ nlocal) $\times$ (2 $\times$ nlocal). In this case, the numerical atomic orbitals are ordered from outer to inner loop as atom, angular quantum number $l$, zeta, magnetic quantum number $m$, and npol (npol ranges from 0 to 1).


## examples
We provide [examples](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/matrix_hs) of outputting the matrices. There are four examples:

Expand Down
5 changes: 4 additions & 1 deletion docs/advanced/elec_properties/position_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ Each file or each section of the appended file starts with "STEP: " followed by

Each block here contains the matrix for the corresponding cell. There are three columns in each block, giving the matrix elements in x, y, z directions, respectively. There are altogether nbasis * nbasis lines in each block, which emulates the matrix elements.

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.
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.

## get_S
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 value keyword [calculation](../input_files/input-main.md#calculation) to be `get_S`.
2 changes: 1 addition & 1 deletion docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ These variables are used to control the output of properties.

- **Type**: Boolean
- **Availability**: Numerical atomic orbital basis (not gamma-only algorithm)
- **Description**: Whether to print the matrix representation of the position matrix (in Bohr) into a file named `data-rR-tr` in the directory `OUT.${suffix}`. For more information, please refer to [position_matrix.md](../elec_properties/position_matrix.md#extracting-position-matrices).
- **Description**: Whether to print the matrix representation of the position matrix (in Bohr) into a file named `data-rR-tr` 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).
- **Default**: False

### out_mat_hs2
Expand Down
7 changes: 4 additions & 3 deletions source/module_esolver/esolver_gets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ void ESolver_GetS::before_all_runners(UnitCell& ucell, const Input_para& inp)
this->pelec = new elecstate::ElecStateLCAO<std::complex<double>>(&(this->chr), // use which parameter?
&(this->kv),
this->kv.get_nks(),
&(this->GG), // mohan add 2024-04-01
&(this->GK), // mohan add 2024-04-01
nullptr, // mohan add 2024-04-01
nullptr, // mohan add 2024-04-01
this->pw_rho,
this->pw_big);
}
Expand Down Expand Up @@ -100,7 +100,8 @@ void ESolver_GetS::runner(UnitCell& ucell, const int istep)
search_radius,
PARAM.inp.test_atom_input);

this->RA.for_2d(this->pv, PARAM.globalv.gamma_only_local, orb_.cutoffs());
Record_adj RA;
RA.for_2d(this->pv, PARAM.globalv.gamma_only_local, orb_.cutoffs());

if (this->p_hamilt == nullptr)
{
Expand Down
11 changes: 0 additions & 11 deletions source/module_esolver/esolver_gets.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include "module_basis/module_nao/two_center_bundle.h"
#include "module_cell/unitcell.h"
#include "module_esolver/esolver_ks.h"
#include "module_hamilt_lcao/module_gint/gint_gamma.h"
#include "module_hamilt_lcao/module_gint/gint_k.h"

#include <memory>

Expand Down Expand Up @@ -34,18 +32,9 @@ class ESolver_GetS : public ESolver_KS<std::complex<double>>
void cal_stress(UnitCell& ucell, ModuleBase::matrix& stress) {};

protected:
// we will get rid of this class soon, don't use it, mohan 2024-03-28
Record_adj RA;

// 2d block - cyclic distribution info
Parallel_Orbitals pv;

// used for k-dependent grid integration.
Gint_k GK;

// used for gamma only algorithms.
Gint_Gamma GG;

TwoCenterBundle two_center_bundle_;

// temporary introduced during removing GlobalC::ORB
Expand Down
Loading