ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
deltaspin_state.h File Reference

Constraint parameters and runtime state for the DeltaSpin (spin-constrained DFT) module. More...

#include <map>
#include <string>
#include <vector>
#include "source_base/vector3.h"
Include dependency graph for deltaspin_state.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  spinconstrain::ScAtomData
 Per-atom spin constraint parameters parsed from STRU file. More...
class  spinconstrain::ScState

Namespaces

namespace  spinconstrain

Detailed Description

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