@brief Fortran-90 routine for packing symmetric matrix to 1D array
@date 6 October 2021 - Initial release - @author Igor S. Gerasimov
@param[in] A - matrix for packing (N x N)
@param[out] AP - packed matrix ( N*(N+1)/2 )
@param[in,optional] UPLO - format of packed matrix, U
for upper and L
for lower
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | A(:,:) | |||
real(kind=dp), | intent(out) | :: | AP(:) | |||
character(len=1), | intent(in), | optional | :: | UPLO |
@brief Fortran-77 routine for packing symmetric matrix to 1D array
@date 6 October 2021 - Initial release - @author Igor S. Gerasimov
@param[in] A - matrix for packing (N x N)
@param[in] N - shape of matrix A
@param[out] AP - packed matrix ( N*(N+1)/2 )
@param[in] UPLO - format of packed matrix, U
for upper and L
for lower
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | A(N,*) | |||
integer, | intent(in) | :: | N | |||
real(kind=dp), | intent(out) | :: | AP(*) | |||
character(len=1), | intent(in) | :: | UPLO |
@brief Fortran-90 routine for unpacking 1D array to symmetric matrix
@details LAPACK returns only upper or lower filling of matrix
@date 6 October 2021 - Initial release - @author Igor S. Gerasimov
@param[in] AP - packed matrix (N x N)
@param[out] A - matrix for unpacking ( N*(N+1)/2 )
@param[in,optional] UPLO - format of packed matrix, U
for upper and L
for lower
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | AP(*) | |||
real(kind=dp), | intent(out) | :: | A(:,:) | |||
character(len=1), | intent(in), | optional | :: | UPLO |
@brief Fortran-77 routine for unpacking 1D array to symmetric matrix
@details LAPACK returns only upper or lower filling of matrix
@date 6 October 2021 - Initial release - @author Igor S. Gerasimov
@param[in] AP - packed matrix
@param[out] A - matrix for unpacking (N x N)
@param[in] N - shape of matrix A
@param[in] UPLO - format of packed matrix, U
for upper and L
for lower
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | AP(*) | |||
real(kind=dp), | intent(out) | :: | A(N,*) | |||
integer, | intent(in) | :: | N | |||
character(len=1), | intent(in) | :: | UPLO |
@brief Compute the trace of the product of two symmetric matrices in packed format
@detail The trace is actually an inner product of matrices, assuming they are vectors
@param[in] a first matrix
@param[in] b second matrix
@param[in] n dimension of matrices A
and B
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp) | :: | a(*) | ||||
real(kind=dp) | :: | b(*) | ||||
integer | :: | n |
@brief Compute density matrix from a set of orbitals and respective occupation numbers
@detail Compute the transformation: D = V * X * V^T
@param[out] d density matrix
@param[in] v matrix of orbitals
@param[in] x vector of occupation numbers
@param[in] m number of columns in V
@param[in] n dimension of D
@param[in] ldv leading dimension of V
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(out) | :: | d(*) | |||
real(kind=dp), | intent(in) | :: | v(ldv,*) | |||
real(kind=dp), | intent(in) | :: | x(*) | |||
integer, | intent(in) | :: | m | |||
integer, | intent(in) | :: | n | |||
integer, | intent(in) | :: | ldv |
@brief Compute the solution to a real system of linear equations A * X = B @detai Wrapper for DSYSV from Lapack @param[in,out] A general matrix, destroyed on exit. @param[in,out] B RHS on entry. The solution on exit. @param[in] n size of the problem. @param[in] nrhs number of RHS vectors @param[in] lda leading dimension of matrix A @param[out] ierr Error flag, ierr=0 if no errors. Read DSYEV manual for details
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp) | :: | a(*) | ||||
real(kind=dp) | :: | b(*) | ||||
integer, | intent(in) | :: | n | |||
integer, | intent(in) | :: | nrhs | |||
integer, | intent(in) | :: | lda | |||
integer, | intent(inout) | :: | ierr |
@brief Compute A = A + A^T
of a square matrix
@param[inout] a square NxN matrix
@param[in] n matrix dimension
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(inout) | :: | a(n,*) | |||
integer, | intent(in) | :: | n |
@brief Compute A = A - A^T
of a square matrix
@param[inout] a square NxN matrix
@param[in] n matrix dimension
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(inout) | :: | a(n,*) | |||
integer, | intent(in) | :: | n |
@brief Fill the upper/lower triangle of the symmetric matrix
@param[inout] a square NxN matrix in triangular form
@param[in] n matrix dimension
@param[in] uplo U if A
is upper triangular, L if lower triangular
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(inout) | :: | a(n,*) | |||
integer, | intent(in) | :: | n | |||
character(len=1), | intent(in) | :: | uplo |
@brief Compute orthogonal transformation of a symmetric marix A in packed format: B = U^T * A * U @param[in] a Matrix to transform @param[in] u Orthogonal matrix U(ldu,m) @param[in] n dimension of matrix A @param[in] m dimension of matrix B @param[in] ldu leading dimension of matrix U @param[out] b Result @param[inout] wrk Scratch space @author Vladimir Mironov
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n | |||
integer, | intent(in) | :: | m | |||
real(kind=8), | intent(in) | :: | a(*) | |||
real(kind=8), | intent(in) | :: | u(n,*) | |||
integer, | intent(in) | :: | ldu | |||
real(kind=8), | intent(out) | :: | b(*) |
@brief Compute orthogonal transformation of a square marix @param[in] trans If trans='n' compute B = U^T * A * U If trans='t' compute B = U * A * U^T @param[in] ld Dimension of matrices @param[in] u Square orthogonal matrix @param[inout] a Matrix to transform, optionally output matrix @param[out] b Result, can be absent for in-place transform of matrix A @param[inout] wrk Scratch space, optional @author Vladimir Mironov
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=1), | intent(in) | :: | trans | |||
integer | :: | ld | ||||
real(kind=dp), | intent(in) | :: | u(*) | |||
real(kind=dp), | intent(in) | :: | a(*) | |||
real(kind=dp), | intent(out), | optional | :: | b(*) | ||
real(kind=dp), | intent(inout), | optional, | target | :: | wrk(*) |
@brief Compute orthogonal transformation of a square marix @param[in] trans If trans='n' compute B = U^T * A * U If trans='t' compute B = U * A * U^T @param[in] ld Dimension of matrices @param[in] u Square orthogonal matrix @param[in] a Matrix to transform @param[out] b Result @param[inout] wrk Scratch space @author Vladimir Mironov
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=1), | intent(in) | :: | trans | |||
integer | :: | m | ||||
integer | :: | n | ||||
real(kind=dp), | intent(in) | :: | u(*) | |||
integer | :: | ldu | ||||
real(kind=dp), | intent(in) | :: | a(*) | |||
integer | :: | lda | ||||
real(kind=dp), | intent(out) | :: | b(*) | |||
integer | :: | ldb | ||||
real(kind=dp), | intent(inout) | :: | wrk(*) |
@brief Compute matrix inverse square root using SVD and removing
linear dependency
@detail This subroutine is used to obtain set of canonical orbitals
by diagonalization of the basis set overlap matrix
Q = S^{-1/2}, Q^T * S * Q = I
@param[in] s Overlap matrix, symmetric packed format
@param[out] q Matrix inverse square root, square matrix
@param[in] nbf Dimeension of matrices S and Q, basis set size
@param[out] qrnk Rank of matrix Q
@param[in] tol optional, tolerance to remove linear dependency,
default = 1.0e-8
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | s(*) | |||
real(kind=dp), | intent(out) | :: | q(nbf,*) | |||
integer, | intent(in) | :: | nbf | |||
integer, | intent(out), | optional | :: | qrnk | ||
real(kind=dp), | intent(in), | optional | :: | tol |
@brief Fortran-90 routine for packing symmetric matrix to 1D array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | A(:,:) | |||
real(kind=dp), | intent(out) | :: | AP(:) | |||
character(len=1), | intent(in), | optional | :: | UPLO |
@brief Fortran-90 routine for unpacking 1D array to symmetric matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | AP(*) | |||
real(kind=dp), | intent(out) | :: | A(:,:) | |||
character(len=1), | intent(in), | optional | :: | UPLO |