ergo
rho-mat.h
Go to the documentation of this file.
1 /* Ergo, version 3.8, a program for linear scaling electronic structure
2  * calculations.
3  * Copyright (C) 2019 Elias Rudberg, Emanuel H. Rubensson, Pawel Salek,
4  * and Anastasia Kruchinina.
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Primary academic reference:
20  * Ergo: An open-source program for linear-scaling electronic structure
21  * calculations,
22  * Elias Rudberg, Emanuel H. Rubensson, Pawel Salek, and Anastasia
23  * Kruchinina,
24  * SoftwareX 7, 107 (2018),
25  * <http://dx.doi.org/10.1016/j.softx.2018.03.005>
26  *
27  * For further information about Ergo, see <http://www.ergoscf.org>.
28  */
29 
30 #ifndef RHOMAT_HEADER
31 #define RHOMAT_HEADER 1
32 
33 #include "grid_matrix.h"
34 
37 void
38 getrho_blocked_lda(int nbast, const real * dmat, const real * gao,
39  const int* nblocks, const int (*iblocks)[2],
40  int ldaib, real *tmp, int nvclen, real *rho);
41 
42 inline void
43 getrho_blocked_lda(int nbast, const Dft::FullMatrix& m, const real * gao,
44  const int* nblocks, const int (*iblocks)[2],
45  int ldaib, real *tmp, int nvclen, real *rho)
46 {
47  getrho_blocked_lda(nbast, m.mat, gao, nblocks, iblocks,
48  ldaib, tmp, nvclen, rho);
49 }
50 
51 
52 void
53 getrho_blocked_gga(int nbast, const real * dmat, const real * gao,
54  const int* nblocks, const int (*iblocks)[2],
55  int ldaib, real *tmp, int nvclen,
56  real *rho, real (*grad)[3]);
57 
58 inline void
59 getrho_blocked_gga(int nbast, const Dft::FullMatrix& dmat, const real * gao,
60  const int* nblocks, const int (*iblocks)[2],
61  int ldaib, real *tmp, int nvclen,
62  real *rho, real (*grad)[3])
63 {
64  getrho_blocked_gga(nbast, dmat.mat, gao, nblocks, iblocks,
65  ldaib, tmp, nvclen, rho, grad);
66 }
67 
68 void
69 getexp_blocked_lda(int nbast, const real * dmat, const real * gao,
70  const int* nblocks, const int (*iblocks)[2],
71  int ldaib, real *tmp, int nvclen, real *rho);
72 void
73 getexp_blocked_gga(int nbast, const real * dmat, const real * gao,
74  const int* nblocks, const int (*iblocks)[2],
75  int ldaib, real *tmp, int nvclen,
76  real (*rgrad)[4]);
77 
78 #endif
getexp_blocked_lda
void getexp_blocked_lda(int nbast, const real *dmat, const real *gao, const int *nblocks, const int(*iblocks)[2], int ldaib, real *tmp, int nvclen, real *rho)
Computes the expectation value <o|dmat|o'> for a nonsymmetric matrix and given set of precomputed orb...
Definition: rho-mat.cc:264
realtype.h
Definition of the main floating-point datatype used; the ergo_real type.
real
ergo_real real
Definition: rho-mat.cc:42
zeroorbs
static void zeroorbs(real *tmp, const int *nblocks, const int(*iblocks)[2], int ldaib, int nvclen)
helper function for zeroing only used blocks of orbitals.
Definition: rho-mat.cc:65
ergo_real
double ergo_real
Definition: realtype.h:69
getexp_blocked_lda
void getexp_blocked_lda(int nbast, const real *dmat, const real *gao, const int *nblocks, const int(*iblocks)[2], int ldaib, real *tmp, int nvclen, real *rho)
Computes the expectation value <o|dmat|o'> for a nonsymmetric matrix and given set of precomputed orb...
Definition: rho-mat.cc:264
Dft::FullMatrix
Definition: grid_matrix.h:53
real
ergo_real real
Definition: test.cc:46
mat_gblas.h
getexp_blocked_gga
void getexp_blocked_gga(int nbast, const real *dmat, const real *gao, const int *nblocks, const int(*iblocks)[2], int ldaib, real *tmp, int nvclen, real(*rgrad)[4])
Computes the expectation value <o|dmat|o'> and its derivatives for a nonsymmetric matrix and given se...
Definition: rho-mat.cc:326
getrho_blocked_gga
void getrho_blocked_gga(int nbast, const real *dmat, const real *gao, const int *nblocks, const int(*iblocks)[2], int ldaib, real *tmp, int nvclen, real *rho, real(*grad)[3])
mat::gemm
static void gemm(const char *ta, const char *tb, const int *n, const int *k, const int *l, const T *alpha, const T *A, const int *lda, const T *B, const int *ldb, const T *beta, T *C, const int *ldc)
Definition: mat_gblas.h:232
getexp_blocked_gga
void getexp_blocked_gga(int nbast, const real *dmat, const real *gao, const int *nblocks, const int(*iblocks)[2], int ldaib, real *tmp, int nvclen, real(*rgrad)[4])
Computes the expectation value <o|dmat|o'> and its derivatives for a nonsymmetric matrix and given se...
Definition: rho-mat.cc:326
getrho_blocked_lda
void getrho_blocked_lda(int nbast, const real *dmat, const real *gao, const int *nblocks, const int(*iblocks)[2], int ldaib, real *tmp, int nvclen, real *rho)
ONER
real ONER
Definition: dft_common.cc:65
restrict
#define restrict
Definition: rho-mat.cc:48
mat::symm
static void symm(const char *side, const char *uplo, const int *m, const int *n, const T *alpha, const T *A, const int *lda, const T *B, const int *ldb, const T *beta, T *C, const int *ldc)
Definition: mat_gblas.h:342
rho-mat.h
config.h
Dft::FullMatrix::mat
ergo_real * mat
Definition: grid_matrix.h:55
grid_matrix.h
Generic matrix interface. It is not optimized for speed.
getrho_blocked_gga
void getrho_blocked_gga(int nbast, const real *dmat, const real *restrict gao, const int *nblocks, const int(*iblocks)[2], int ldaib, real *tmp, int nvclen, real *rho, real(*grad)[3])
Computes the expectation value <o|dmat|o'> and its derivatives for a symmetric matrix and given set o...
Definition: rho-mat.cc:187
getrho_blocked_lda
void getrho_blocked_lda(int nbast, const real *dmat, const real *restrict gao, const int *nblocks, const int(*iblocks)[2], int ldaib, real *tmp, int nvclen, real *rho)
Computes the expectation value <o|dmat|o'> for a symmetric matrix and given set of precomputed orbita...
Definition: rho-mat.cc:94