| ... | @@ -12,4 +12,30 @@ The functional has the generic form: | ... | @@ -12,4 +12,30 @@ The functional has the generic form: | 
|  | + [1-\alpha_{\downarrow}(n_{\uparrow},n_{\downarrow})]\dfrac{\bm{j}_{\downarrow}^2}{2n_{\downarrow}} |  | + [1-\alpha_{\downarrow}(n_{\uparrow},n_{\downarrow})]\dfrac{\bm{j}_{\downarrow}^2}{2n_{\downarrow}} | 
|  | \end{aligned} |  | \end{aligned} | 
|  | ``` |  | ``` | 
|  | TODO |  | TODO | 
|  | \ No newline at end of file |  | # Stabilization of ASLDA functional | 
|  |  |  | In the case of calculations for trapped system term $`\frac{\bm{j}_{\sigma}^2}{2n_{\sigma}}`$ is source of numerical instabilities. Precisely, for small density regions we have: | 
|  |  |  | * $`n_{\sigma}\rightarrow 0`$, | 
|  |  |  | * $`\bm{j}_{\sigma}\rightarrow 0`$, | 
|  |  |  | * $`\frac{\bm{j}_{\sigma}^2}{2n_{\sigma}}\rightarrow 0`$. | 
|  |  |  |  | 
|  |  |  | However, division of very small numbers is numerically not stable operations. For this reason, we introduce stabilization procedure: | 
|  |  |  | ```math | 
|  |  |  | \dfrac{\bm{j}_{\sigma}^2}{2n_{\sigma}}\longrightarrow f_{\textrm{reg.}}(n_{\sigma})\dfrac{\bm{j}_{\sigma}^2}{2n_{\sigma}} | 
|  |  |  | ``` | 
|  |  |  | Role of $`f_{\textrm{reg.}}`$ is to exclude from computation regions of small density. The function is controlled by two parameters in `predefines.h` file: | 
|  |  |  | ```c | 
|  |  |  | /** | 
|  |  |  | * Meaningful only in case of ASLDA. | 
|  |  |  | * Paremeters defining stabilization procedure of ASLDA functional. | 
|  |  |  | * For regions with density smaller than ASLDA_STABILIZATION_EXCLUDE_BELOW_DENISTY | 
|  |  |  | * contribution from current term j^2/2n is assumed to be zero. | 
|  |  |  | * For regions with density above ASLDA_STABILIZATION_RETAIN_ABOVE_DENSITY | 
|  |  |  | * the contribution is assumed to be intact by stabilization procedure. | 
|  |  |  | * */ | 
|  |  |  | #define ASLDA_STABILIZATION_RETAIN_ABOVE_DENSITY  1.0e-5 | 
|  |  |  | #define ASLDA_STABILIZATION_EXCLUDE_BELOW_DENISTY 1.0e-7 | 
|  |  |  | ``` | 
|  |  |  | There meaning is presented on the figure below. | 
|  |  |  |  | 
|  |  |  | Smooth transition between densities `ASLDA_STABILIZATION_EXCLUDE_BELOW_DENISTY` and `ASLDA_STABILIZATION_RETAIN_ABOVE_DENSITY` | 
|  |  |  | \ No newline at end of file |