Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • wslda wslda
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wtools
  • wsldawslda
  • Wiki
  • Reference scales

Reference scales · Changes

Page history
Update Reference scales authored Feb 19, 2026 by Gabriel Wlazłowski's avatar Gabriel Wlazłowski
Show whitespace changes
Inline Side-by-side
Reference-scales.md
View page @ ed340fcf
[[_TOC_]]
# General info
During the computation process, W-SLDA codes exploit information about typical scales present in the problem. Precisely, *reference scales* define typical orders of magnitude for computed quantities. The most important reference scale is Fermi momentum. For uniform system it is defined as
During computation, W-SLDA codes exploit information about the typical scales present in the problem. Precisely, *reference scales* define typical orders of magnitude for computed quantities. The most important reference scale is the Fermi momentum. For a uniform system, it is defined as
* $`k_F^{(1D)}=\frac{\pi n}{2}`$
* $`k_F^{(2D)}=\sqrt{2\pi n}`$
* $`k_F^{(3D)}=(3\pi^2 n)^{1/3}`$
......@@ -13,26 +13,26 @@ Other reference scales computed automatically from $`k_F`$ are:
- $`c_E^{(3D)}=\frac{3}{5}`$.
Finally, chemical potentials also serve as reference scales for static problems:
* $`\mu_{\uparrow}`$ - chemical potential is spin-up particles (particles of type `a`),
* $`\mu_{\downarrow}`$ - chemical potential is spin-down particles (particles of type `b`).
* $`\mu_{a}`$ - chemical potential is spin-up particles (particles of type `a`),
* $`\mu_{b}`$ - chemical potential is spin-down particles (particles of type `b`).
# Defining reference scales for static calculation
## Fermi momentum `kF`
There are the following methods of defining the $`k_F`$ reference scale:
* *via input file*: $`k_F`$ is provided by user in input file. To activate this mode you need to **uncomment** tag `referencekF`:
* *via input file*: $`k_F`$ is provided by user in input file. To activate this mode, you need to **uncomment** the tag `referencekF`:
```bash
referencekF 1.0 # hard set for reference value of kF
```
* *via problem-definition.h file*: (VERSION>=2022.02.21) by editing function:
```c
/**
* This function computes Fermi momentum, which is used as the reference value.
* This function computes the Fermi momentum, which is used as the reference value.
* Other reference scales are set automatically to: eF=kF^2/2, Effg=(3/5)*N*eF (N-total number of particles)
* For more details see: https://gitlab.fizyka.pw.edu.pl/wtools/wslda/-/wikis/Reference%20scales
* For more details, see: Wiki -> Setting reference scales.
* NOTE units are: hbar=m=k_b=1
* @param it iteration number
* @param h_densities structure with densities, see (wiki) documentation for list of fields
* @param params array of input parameters, before call of this routine the params array is processed by process_params() routine
* @param h_densities structure with densities, see (wiki) documentation for the list of fields
* @param params array of input parameters, before the call of this routine, the params array is processed by process_params() routine
* @param extra_data_size size of extra_data in bytes, if extra_data size=0 the optional data is not uploaded
* @param extra_data optional set of data uploaded by load_extra_data()
* @return value of Fermi momentum for your problem
......@@ -49,7 +49,7 @@ double referencekF(int it, wslda_density h_densities, double *params, size_t ext
for(ixyz=0; ixyz<h_densities.nx*h_densities.ny*h_densities.nz; ixyz++)
if(h_densities.rho_a[ixyz]+h_densities.rho_b[ixyz]>max_dens) max_dens=h_densities.rho_a[ixyz]+h_densities.rho_b[ixyz];
// depending on dimensionality of the problem
// depending on the dimensionality of the problem
if(NY==1 && NZ==1) kF = 0.5*M_PI*max_dens; // 1D
else if(NZ==1) kF = pow(2.0*M_PI*max_dens,1./2.); // 2D
else kF = pow(3.*M_PI*M_PI*max_dens,1./3.); // 3D
......@@ -62,14 +62,14 @@ Over the entire code, it is defined as $`\varepsilon_F=\frac{1}{2}k_F^2`$.
## Free Fermi gas energy `Effg`
**API_VERSION>=20221120**
The quantity is used only for reporting values of the energy. The definition can be controlled via `logger.h` file, by changing the body of the function `energy_unit(...)`. Default values are computed as:
The quantity is used only for reporting energy values. The definition can be controlled via the `logger.h` file, by changing the body of the function `energy_unit(...)`. Default values are computed as:
```c
/**
* This function defines the unit in which energies are printed in stdout.
* @param kF typical Fermi momentum scale of the problem, value returned by referencekF() function.
* @param mu array with chemical potentials: mu[SPINA], mu[SPINB].
* @param npart array with computed particle numbers: npart[SPINA] and npart[SPINB].
* @param params array of input parameters, before call of this routine the params array is processed by process_params() routine
* @param params array of input parameters, before the call of this routine, the params array is processed by process_params() routine
* @param extra_data_size size of extra_data in bytes, if extra_data size=0 the optional data is not uploaded
* @param extra_data optional set of data uploaded by load_extra_data()
* */
......@@ -80,7 +80,7 @@ double energy_unit(double kF, double *mu, double *npart,
double eF = kF*kF/2.0; // Fermi energy
double N = npart[SPINA]+npart[SPINB]; // total number of particles
// depending on dimensionality of the problem
// depending on the dimensionality of the problem
if(NY==1 && NZ==1) Effg=(1./3.)*N*eF; // 1D
else if(NZ==1) Effg=(1./2.)*N*eF; // 2D
else Effg=(3./5.)*N*eF; // 3D
......@@ -90,7 +90,7 @@ double energy_unit(double kF, double *mu, double *npart,
```
## Chemical potentials `mu`
Chemical potentials are adjusted automatically when mode with fixed particle number is executed. For mode with fixed chemical potential see [here](Chemical potentials control).
Chemical potentials are automatically adjusted when the mode with fixed particle number is used. For the mode with fixed chemical potential, see [here](Chemical-potentials-control).
## Examples
### Fermi momentum is fixed by density in the box center
......@@ -108,7 +108,7 @@ double referencekF(int it, wslda_density h_densities, double *params, size_t ext
double dens = h_densities.rho_a[ixyz]+h_densities.rho_b[ixyz];
// depending on dimensionality of the problem
// depending on the dimensionality of the problem
double kF;
if(NY==1 && NZ==1) kF = 0.5*M_PI*dens; // 1D
else if(NZ==1) kF = pow(2.0*M_PI*dens,1./2.); // 2D
......@@ -119,4 +119,4 @@ double referencekF(int it, wslda_density h_densities, double *params, size_t ext
```
# Defining reference scales for time-dependent calculations
All reference scales are provided together with an initial state, i.e. binary files produced by static codes contain this information. Presently there is no option of changing values for reference scales.
\ No newline at end of file
All reference scales are provided along with an initial state; i.e., the binary files produced by static codes contain this information. Presently, there is no option to change values for reference scales in time-dependent codes.
\ No newline at end of file
Clone repository

Content of Documentation
Official webpage
W-BSK Toolkit