Constraint parameters and runtime state for the DeltaSpin (spin-constrained DFT) module.
More...
#include <map>
#include <string>
#include <vector>
#include "source_base/vector3.h"
Go to the source code of this file.
Constraint parameters and runtime state for the DeltaSpin (spin-constrained DFT) module.
- Purpose
- ScState owns all basis-set-independent data of the spin-constrained calculation: per-atom Lagrange multipliers (lambda), target magnetic moments, constraint flags, computed moments (Mi), atom/orbital indexing maps, and the lambda-loop convergence parameters. It is deliberately non-template: none of this data depends on the wavefunction type TK.
- Unit conversion
- lambda_: Ry/uB internally, but meV/uB in input file (STRU)
- target_mag_, Mi_: uB (Bohr magnetons)
- alpha_trial_: Ry/uB^2 internally, but input is eV/uB^2
- restrict_current_: Ry/uB internally, but input is eV/uB
- decay_grad_: uB^2/Ry internally, but uB^2/eV in ScDecayGrad
- Indexing
- All per-atom arrays (lambda_, target_mag_, Mi_, constrain_) are indexed by GLOBAL atom index (iat), which runs from 0 to nat-1. The mapping from (element_type, local_atom_index) to iat is handled by get_iat().