Skip to content

Commit

Permalink
Merge branch 'develop' into relax-read
Browse files Browse the repository at this point in the history
  • Loading branch information
Qianruipku authored Nov 26, 2023
2 parents db5fb34 + 7d237b5 commit c098372
Show file tree
Hide file tree
Showing 264 changed files with 206,719 additions and 303,111 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
GTEST_COLOR: 'yes'
OMP_NUM_THREADS: '2'
run: |
cmake --build build --target test ARGS="-V"
cmake --build build --target test ARGS="-V --timeout 1600"
53 changes: 46 additions & 7 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -964,15 +964,21 @@ calculations.
- **Type**: Real
- **Description**: In general, the formula of charge mixing can be written as $\rho_{new} = \rho_{old} + \beta * \rho_{update}$, where $\rho_{new}$ represents the new charge density after charge mixing, $\rho_{old}$ represents the charge density in previous step, $\rho_{update}$ is obtained through various mixing methods, and $\beta$ is set by the parameter `mixing_beta`. A lower value of 'mixing_beta' results in less influence of $\rho_{update}$ on $\rho_{new}$, making the self-consistent field (SCF) calculation more stable. However, it may require more steps to achieve convergence.
We recommend the following options:
- **-10.0**: Program will auto set `mixing_beta` and `mixing_gg0` before charge mixing method starts.
- Default values of metal system (bandgap <= 1.0 eV) are `mixing_beta=0.2` and `mixing_gg0=1.0`;
- Default values of other systems (bandgap > 1.0eV) are `mixing_beta=0.7` and `mixing_gg0=1.0`.
- **0.8**: `nspin=1`
- **0.4**: `nspin=2`
- **0.2**: `nspin=4`
- **0**: keep charge density unchanged, usually used for restarting with `init_chg=file` or testing.
- **0.1 or less**: if convergence of SCF calculation is difficult to reach, please try `0 < mixing_beta < 0.1`.

Note: For low-dimensional large systems, the setup of `mixing_beta=0.1`, `mixing_ndim=20`, and `mixing_gg0=1.5` usually works well.
Note: For low-dimensional large systems, the setup of `mixing_beta=0.1`, `mixing_ndim=20`, and `mixing_gg0=1.0` usually works well.

- **Default**: -10.0
- **Default**: 0.8 for `nspin=1`, 0.4 for `nspin=2`, 0.2 for `nspin=4`.

### mixing_beta_mag

- **Type**: Real
- **Description**: Mixing parameter of magnetic density.
- **Default**: `4*mixing_beta`

### mixing_ndim

Expand All @@ -985,11 +991,18 @@ We recommend the following options:
### mixing_gg0

- **Type**: Real
- **Description**: Whether to perfom Kerker scaling.
- **Description**: Whether to perfom Kerker scaling for charge density.
- **>0**: The high frequency wave vectors will be suppressed by multiplying a scaling factor $\frac{k^2}{k^2+gg0^2}$. Setting `mixing_gg0 = 1.0` is normally a good starting point. Kerker preconditioner will be automatically turned off if `mixing_beta <= 0.1`.
- **0**: No Kerker scaling is performed.

For systems that are difficult to converge, particularly metallic systems, enabling Kerker scaling may aid in achieving convergence.
- **Default**: 1.0

### mixing_gg0_mag

- **Type**: Real
- **Description**: Whether to perfom Kerker preconditioner of magnetic density.
Note: we do not recommand to open Kerker preconditioner of magnetic density unless the system is too hard to converge.
- **Default**: 0.0

### mixing_tau
Expand Down Expand Up @@ -3318,7 +3331,7 @@ These variables are used to control the usage of deltaspin functionality.
### sc_file

- **Type**: String
- **Description**: the file in json format to specify atomic constraining parameters. An example of the sc_file json file is shown below:
- **Description**: the file in json format to specify atomic constraining parameters. An example of the sc_file json file is shown below for the `nspin 4` case:
```json
[
{
Expand All @@ -3344,6 +3357,32 @@ These variables are used to control the usage of deltaspin functionality.
}
]
```
and
```json
[
{
"element": "Fe",
"itype": 0,
"ScDecayGrad": 0.9,
"ScAtomData": [
{
"index": 0,
"lambda": 0.0,
"target_mag": 2.0,
"constrain": 1
},
{
"index": 1,
"lambda": 0,
"target_mag": 2.0,
"constrain": 1
}
]
}
]
```
for `nspin 2` case. The difference is that `lambda`, `target_mag`, and `constrain` are scalars in `nspin 2` case, and are vectors in `nspin 4` case.

- **Default**: none

[back to top](#full-list-of-input-keywords)
43 changes: 42 additions & 1 deletion docs/advanced/scf/spin.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,47 @@ If **"ocp=1"** and **"ocp_set"** is set in INPUT file, the occupations of states
2. **"nupdown"**
If **"nupdown"** is set to non-zero, number of spin-up and spin-down electrons will be fixed, and Fermi energy level will split to E_Fermi_up and E_Fermi_down. By the way, total magnetization will also be fixed, and will be the value of **"nupdown"**.

3. DeltaSpin
The `DeltaSpin` function as proposed by Zefeng Cai and Ben Xu, et al. [arXiv:2208.04551v6](https://arxiv.org/abs/2208.04551) has been implemented in ABACUS in the LCAO basis for the `nspin 2` case. In order to use this function, the following parameters are needed to be set in the input file, for example:
```
#deltaspin
sc_mag_switch 1
decay_grad_switch 0
sc_thr 1e-7
nsc 150
nsc_min 2
sc_file sc.json
alpha_trial 0.01
sccut 3
```
The explanation of each input paramters has been explained in the [Noncollinear Spin Polarized Calculations](#noncollinear-spin-polarized-calculations) section.

An example of the sc_file json file is shown below:
```json
[
{
"element": "Fe",
"itype": 0,
"ScDecayGrad": 0.9,
"ScAtomData": [
{
"index": 0,
"lambda": 0.0,
"target_mag": 2.0,
"constrain": 1
},
{
"index": 1,
"lambda": 0,
"target_mag": 2.0,
"constrain": 1
}
]
}
]
```
Please refer the [Noncollinear Spin Polarized Calculations](#noncollinear-spin-polarized-calculations) section for the explanation of each input paramters. The difference is that `lambda`, `target_mag`, and `constrain` are scalars instead of vectors. Simple examples are provided in the `abacus-develop/examples/spin_polarized` directory.

## Noncollinear Spin Polarized Calculations
The spin non-collinear polarization calculation corresponds to setting **"noncolin 1"**, in which case the coupling between spin up and spin down will be taken into account.
In this case, nspin is automatically set to 4, which is usually not required to be specified manually.
Expand All @@ -49,7 +90,7 @@ The SOC effect and non-collinear magnetic moment are both calculated.

### Constraint Spin functionality for noncollinear spin polarized calculations

The `DeltaSpin` function as proposed by Zefeng Cai and Ben Xu, et al. [arXiv:2208.04551v6](https://arxiv.org/abs/2208.04551) has been implemented in ABACUS in the LCAO basis. In order to use this function, the following parameters are needed to be set in the input file:
The `DeltaSpin` function as proposed by Zefeng Cai and Ben Xu, et al. [arXiv:2208.04551v6](https://arxiv.org/abs/2208.04551) has been implemented in ABACUS in the LCAO basis. In order to use this function, the following parameters are needed to be set in the input file, for example:
```
#deltaspin
sc_mag_switch 1
Expand Down
Loading

0 comments on commit c098372

Please sign in to comment.