Constraint DFT for non-collinear spin orientation

To calculate an electronic structure with an arbitrary spin orientation in the non-collinear DFT, OpenMX Ver. 3.9 provides two kinds of constraint functionals which give a penalty unless the difference between the calculated spin orientation and the initial one is zero [13]. The constraint DFT for the non-collinear spin orientation is available by the following keywords:

```     scf.Constraint.NC.Spin       on      # on|on2|off, default=off
scf.Constraint.NC.Spin.v    0.5      # default=0.0(eV)
```
You can introduce the penalty functional by either 'on' or 'on2' for the keyword 'scf.Constraint.NC.Spin'. By 'on', the spin direction is constrained at the initial orientation, but the magnitude of the spin moment can vary so that the total energy can be stabilized. On the other hand, by 'on2', the spin direction and the magnitude of the spin moment are constrained at the initial setting by the keyword 'Atoms.SpeciesAndCoordinates'. The keyword 'scf.Constraint.NC.Spin.v' gives a magnitude which determines the strength of constraint when the constraint is introduced. The constraint is applied on each atom by specifying a flag as follows:
```  <Atoms.SpeciesAndCoordinates
1   Cr    0.00000   0.00000   0.00000  7.0  5.0 -20.0 0.0  0.0 0.0  1  off
2   Cr    0.00000   2.00000   0.00000  7.0  5.0  20.0 0.0  0.0 0.0  1  off
Atoms.SpeciesAndCoordinates>
```

The '1' in the 12th column means that the constraint is applied, and '0' no constraint. The method constrains only the spin orientation. Therefore, the magnitude of spin can vary. Also the constraint scheme is compatible with the DFT+ calculation explained in the Section 'DFT+'. As an illustration of this method, the dependence of the total energy and magnetic moment in a chromium dimer on the relative angle between two local spins is shown in Fig. 35. You can trace the calculation using an input file 'Cr2_CNC.dat' in the directory 'work'.

Here we provide tips to calculate a smooth energy curve as a function of spin rotational angle using the constraint DFT method. In many cases, local magnetic moments arises from partially filled localized - and/or -orbitals such as -orbitals. In this case, the occupation of electrons to the localized orbitals may lead to multiple local minima due to the degree of freedom of the occupation. To avoid such a local minima problem, you can start the calculation with a spin orientation along an easy axis. Once the calculation finishes, the restart file is generated. In the next calculation, you may rotate the spin orientation moderately, e.g., 30 degree, compared to the first calculation, and read the restart file which was generated by the first calculation. The same procedure can be performed for all the spin rotational angle that you want to calculate, and at each calculation the restart file generated by the previous step should be read. The step-by-step approach is very effective to avoid the local minima problem.