|
# Arythemtics
|
|
# Arythemtics
|
|
Static codes support two types arithmetics:
|
|
Static codes support two types arithmetics:
|
|
* `double complex`: `ESIZE=16B`
|
|
* `double complex`: `ELEMENT_SIZE=16B`
|
|
default mode: matrix elements of hamiltonian are assumed to be of complex numbers.
|
|
default mode: matrix elements of hamiltonian are assumed to be of complex numbers.
|
|
* `double`: `ESIZE=8B`
|
|
* `double`: `ELEMENT_SIZE=8B`
|
|
if you know that matrix elements, as well as the solution, will be real numbers (for examples based on symmetries of your problem) you can speed-up the calculation process by switching to double arythmetics. To do this you need to activate in [predefines.h](https://gitlab.fizyka.pw.edu.pl/gabrielw/wslda/-/blob/public/st-project-template/predefines.h) flag:
|
|
if you know that matrix elements, as well as the solution, will be real numbers (for examples based on symmetries of your problem) you can speed-up the calculation process by switching to double arythmetics. To do this you need to activate in [predefines.h](https://gitlab.fizyka.pw.edu.pl/gabrielw/wslda/-/blob/public/st-project-template/predefines.h) flag:
|
|
```c
|
|
```c
|
|
/**
|
|
/**
|
... | @@ -14,5 +14,37 @@ if you know that matrix elements, as well as the solution, will be real numbers |
... | @@ -14,5 +14,37 @@ if you know that matrix elements, as well as the solution, will be real numbers |
|
|
|
|
|
|
|
|
|
# st-wslda-3d
|
|
# st-wslda-3d
|
|
3D version of the code diagonalized matrix of size: `matrix_size = NX*NY*NZ*2`.
|
|
3D version of the code diagonalizes matrix of size:
|
|
Memory needed TODO |
|
`MATRIX_DIM = NX*NY*NZ*2`.
|
|
\ No newline at end of file |
|
Memory needed store this matrix in memory is
|
|
|
|
`MATRIX_SIZE = MATRIX_DIM*ELEMENT_SIZE`.
|
|
|
|
To execute diagonalization routine `st-wslda-3d` code needs at most:
|
|
|
|
`REQUIRED_MEMORY < 4*MATRIX_SIZE`,
|
|
|
|
Factor 4 accounts for storage for matrix, storage for eigen-vectors, working space which depends on selected [diagonalization engine](Setting up diagonalization engine) and execution parameters.
|
|
|
|
|
|
|
|
# st-wslda-2d
|
|
|
|
In (quasi) 2D formulation of the problem diagonalization of full hamiltonian matrix factorizes into a series of `max(NZ/2,1)` diagonalizations of matrices of size (`NZ/2` arises from fact that there is the degeneracy of states with respect to sign of $`k_z`$ wave-vectors):
|
|
|
|
`MATRIX_DIM = NX*NY*2`
|
|
|
|
and the corresponding matrix size is
|
|
|
|
`MATRIX_SIZE = MATRIX_DIM*ELEMENT_SIZE`.
|
|
|
|
Number of matrices diagonalized simultaneously is:
|
|
|
|
`NUMBER_OF_SIMULTANUES_DIAGONALIZATIONS = np / (p*q)`
|
|
|
|
where `np` is number of MPI processes (provided to mpi execution command) and `p` and `q` are input file parameters.
|
|
|
|
To execute diagonalization routine `st-wslda-2d` code needs at most:
|
|
|
|
`REQUIRED_MEMORY < 4*MATRIX_SIZE*NUMBER_OF_SIMULTANUES_DIAGONALIZATIONS`.
|
|
|
|
|
|
|
|
*Note*: if `p` and `q` are not specified in the input file, by default `st-wslda-2d` will select the values that provide the highest parallelization (maximization of a number of simultaneous diagonalization). It means the highest memory request.
|
|
|
|
|
|
|
|
|
|
|
|
# st-wslda-1d
|
|
|
|
In (quasi) 1D formulation of the problem diagonalization of full hamiltonian matrix factorizes into a series of `max(NY*NZ/4,1)` diagonalizations of matrices of size:
|
|
|
|
`MATRIX_DIM = NX*2`
|
|
|
|
and the corresponding matrix size is
|
|
|
|
`MATRIX_SIZE = MATRIX_DIM*ELEMENT_SIZE`.
|
|
|
|
Number of matrices diagonalized simultaneously is:
|
|
|
|
`NUMBER_OF_SIMULTANUES_DIAGONALIZATIONS = np / (p*q)`
|
|
|
|
where `np` is number of MPI processes (provided to mpi execution command) and `p` and `q` are input file parameters.
|
|
|
|
To execute diagonalization routine `st-wslda-1d` code needs at most:
|
|
|
|
`REQUIRED_MEMORY < 4*MATRIX_SIZE*NUMBER_OF_SIMULTANUES_DIAGONALIZATIONS`.
|
|
|
|
|
|
|
|
*Note*: if `p` and `q` are not specified in the input file, by default `st-wslda-1d` will select the values that provide the highest parallelization (maximization of a number of simultaneous diagonalization). It means the highest memory request. |
|
|
|
\ No newline at end of file |