Skip to content

Commit

Permalink
Docs: delay release of deltaspin due to bugs (#4146)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongriTianqi committed May 11, 2024
1 parent 7fdd771 commit 4066253
Show file tree
Hide file tree
Showing 77 changed files with 10 additions and 30,444 deletions.
132 changes: 0 additions & 132 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,16 +370,6 @@
- [tau](#tau)
- [sigma\_k](#sigma_k)
- [nc\_k](#nc_k)
- [Deltaspin](#deltaspin)
- [sc\_mag\_switch](#sc_mag_switch)
- [decay\_grad\_switch](#decay_grad_switch)
- [sc\_thr](#sc_thr)
- [nsc](#nsc)
- [nsc\_min](#nsc_min)
- [sc\_scf\_nmin](#sc_scf_nmin)
- [alpha\_trial](#alpha_trial)
- [sccut](#sccut)
- [sc\_file](#sc_file)
- [Quasiatomic Orbital (QO) analysis](#quasiatomic-orbital-qo-analysis)
- [qo\_switch](#qo_switch)
- [qo\_basis](#qo_basis)
Expand Down Expand Up @@ -3474,128 +3464,6 @@ These variables are used to control the usage of implicit solvation model. This

[back to top](#full-list-of-input-keywords)

## Deltaspin

These variables are used to control the usage of deltaspin functionality.

### sc_mag_switch

- **Type**: boolean
- **Description**: the switch of deltaspin functionality
- 0: no deltaspin
- 1: use the deltaspin method to constrain atomic magnetic moments
- **Default**: 0

### decay_grad_switch

- **Type**: boolean
- **Description**: the switch of decay gradient method
- 0: no decay gradient method
- 1: use the decay gradient method and set ScDecayGrad in the file specified by `sc_file`. ScDecayGrad is an element dependent parameter, which is used to control the decay rate of the gradient of the magnetic moment.
- **Default**: 0

### sc_thr

- **Type**: Real
- **Description**: the threshold of the spin constraint atomic magnetic moment
- **Default**: 1e-6
- **Unit**: Bohr Mag (\muB)

### nsc

- **Type**: Integer
- **Description**: the maximum number of steps in the inner lambda loop
- **Default**: 100

### nsc_min

- **Type**: Integer
- **Description**: the minimum number of steps in the inner lambda loop
- **Default**: 2

### sc_scf_nmin

- **Type**: Integer
- **Description**: the minimum number of outer scf loop before initializing lambda loop
- **Default**: 2

### alpha_trial

- **Type**: Real
- **Description**: initial trial step size for lambda in eV/uB^2
- **Default**: 0.01
- **Unit**: eV/uB^2

### sccut

- **Type**: Real
- **Description**: restriction of step size in eV/uB
- **Default**: 3
- **Unit**: eV/uB

### 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 for the `nspin 4` case:

```json
[
{
"element": "Fe",
"itype": 0,
"ScDecayGrad": 0.9,
"ScAtomData": [
{
"index": 0,
"lambda": [0, 0, 0],
"target_mag": [2.0, 0.0, 0.0],
"constrain": [1,1,1]
},
{
"index": 1,
"lambda": [0, 0, 0],
"target_mag_val": 2.0,
"target_mag_angle1": 80.0,
"target_mag_angle2": 0.0,
"constrain": [1,1,1]
}
]
}
]
```

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)

## Quasiatomic Orbital (QO) analysis

These variables are used to control the usage of QO analysis. QO further compress information from LCAO: usually PW basis has dimension in million, LCAO basis has dimension below thousand, and QO basis has dimension below hundred.
Expand Down
89 changes: 0 additions & 89 deletions docs/advanced/scf/spin.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,6 @@ 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 @@ -88,54 +47,6 @@ The SOC effect is considered but the magnetic moment is limited to the Z directi
- noncolin=1 lspinorb=1 :
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, for example:
```
#deltaspin
sc_mag_switch 1
decay_grad_switch 1
sc_thr 1e-7
nsc 150
nsc_min 2
sc_file sc.json
alpha_trial 0.01
sccut 3
```


`sc_mag_switch` is the switch of deltaspin functionality; `decay_grad_switch` is the switch of decay gradient method; `sc_thr` is the threshold of the spin constraint atomic magnetic moment in unit of Bohr Mag (\muB); `nsc` is the number of self-consistent iterations; `nsc_min` is the minimum number of self-consistent iterations; `sc_file` is the file name of the spin constraint parameters; `alpha_trial` is the initial trial step size for lambda in eV/uB^2; `sccut` restriction of step size in eV/uB.

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, 0],
"target_mag": [2.0, 0.0, 0.0],
"constrain": [1,1,1]
},
{
"index": 1,
"lambda": [0, 0, 0],
"target_mag_val": 2.0,
"target_mag_angle1": 80.0,
"target_mag_angle2": 0.0,
"constrain": [1,1,1]
}
]
}
]
```

The sc_file json file is a list of elemental data in total. For each element, the user should specify its name, the `itype` parameter should be in accord with `STRU` file and start from 0. `ScDecayGrad` is a parameter for each element in unit of (uB^2/eV), this parameter needs to be determined for different element, for example, 0.9 uB^2/eV is an appropriate value for BCC-Fe according to Zefeng Cai's tests. `ScAtomData` specifies spin constraining parameters for each atom, the `index` starts from 0 and corresponds atomic order in the `STRU` file. `lambda` is a 3d vector for each atom, and it is recommended to set to [0.0, 0.0, 0.0] for all atoms. Users have two optional choices to set the target magnetic moments for each atom, i.e., by a 3d vector or by angles. If the `target_mag` is set, the `target_mag_val` and `target_mag_angle1` and `target_mag_angle2` will be ignored. The `target_mag` is a 3d vector in unit of Bohr Mag (\muB), and the `target_mag_val` is a scalar value in unit of Bohr Mag (\muB), `target_mag_angle1` and `target_mag_angle2` are two angles in unit of degree. The `constrain` is a 3d vector, if the corresponding element is set to 1, the corresponding component of the magnetic moment will be constrained, otherwise, it will be free. Note that the initial atomic magnetic moments are still set in the `STRU` file. Simple examples are provided in the `abacus-develop/examples/noncollinear` directory. One should set `noncolliear` to 1 to run the DeltaSpin function, `lspinorb=1` is not mandatory, but it is recommended to set to 1 to get more accurate results.


## For the continuation job
- Continuation job for "nspin 1" need file "SPIN1_CHG.cube" which is generated by setting "out_chg=1" in task before. By setting "init_chg file" in new job's INPUT file, charge density will start from file but not atomic.
- Continuation job for "nspin 2" need files "SPIN1_CHG.cube" and "SPIN2_CHG.cube" which are generated by "out_chg 1" with "nspin 2", and refer to spin-up and spin-down charge densities respectively. It should be note that reading "SPIN1_CHG.cube" only for the continuation target magnetic moment job is not supported now.
Expand Down
30 changes: 0 additions & 30 deletions examples/noncollinear/BCC_Fe_NC_deltaspin/INPUT

This file was deleted.

4 changes: 0 additions & 4 deletions examples/noncollinear/BCC_Fe_NC_deltaspin/KPT

This file was deleted.

21 changes: 0 additions & 21 deletions examples/noncollinear/BCC_Fe_NC_deltaspin/STRU

This file was deleted.

0 comments on commit 4066253

Please sign in to comment.