This module provides procedures for computing interactions tensors in packed form (one-dimensional arrays) and includes several operations involving tensors.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | parameter | :: | MAX_ORDER | = | 42 | maximum order of derivative |
real(kind=dp), | private, | dimension(0:MAX_ORDER,0:MAX_ORDER,1:2*MAX_ORDER+1), save | :: | tensor_coefficient | = | huge(0.0_dp) | needed for open-ended computation of derivatives of |
real(kind=dp), | public, | dimension(0:MAX_ORDER), save | :: | factorial | = | huge(0.0_dp) | factorials computed and stored during initialization |
real(kind=dp), | public, | dimension(-1:MAX_ORDER), save | :: | double_factorial | = | huge(0.0_dp) | double factorials computed and stored during initialization |
real(kind=dp), | public, | dimension(0:3*MAX_ORDER,0:MAX_ORDER), save | :: | binomial | = | huge(0.0_dp) | binomial coefficients computed and stores during initialization |
real(kind=dp), | public, | dimension(0:MAX_ORDER,0:MAX_ORDER,0:MAX_ORDER), save | :: | trinomial | = | huge(0.0_dp) | trinomial coefficients computed and stores during initialization |
compute element of multipole interaction tensor (C. E. Dykstra, J. Comput. Chem., 9 (1988), 476) which in multi-index notation this is
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | i | order of the derivative wrt -component of |
||
integer, | intent(in) | :: | j | order of the derivative wrt -component of |
||
integer, | intent(in) | :: | k | order of the derivative wrt -component of |
||
real(kind=dp), | intent(in), | dimension(:) | :: | r | coordinate vector - |
compute trace of a packed tensor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | dimension(:) | :: | A | ||
integer, | intent(in) | :: | ax | |||
integer, | intent(in) | :: | ay | |||
integer, | intent(in) | :: | az | |||
integer, | intent(in), | optional | :: | order |
convert from multi-index to packed tensor index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ax | first () component of multi-index |
||
integer, | intent(in) | :: | ay | second () component of multi-index |
||
integer, | intent(in) | :: | az | third () component of multi-index |
compute rank of tensor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | dimension(:) | :: | A |
compute size of tensor of given rank
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | rank |
compute size of first degree polytensor with tensors up to maxmimum rank
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | max_rank |
initialize tensor module
compute tensor coefficients needed to compute open-ended derivatives of (from C. E. Dykstra, J. Comput. Chem., 9 (1988), 476, where C^(n)_ij are stored as tensor_coefficient(j,i,n))
compute and store factorials upto 12!
compute and store double factorials upto 12!!
Calculate binomial coefficients using recursive algorithm by Sten Rettrup and Ruben Pauncz, Int. J. Quantum Chem., 60: 91–98 (1996) DOI: 10.1002/(SICI)1097-461X(1996)60:1<91::AID-QUA10>3.0.CO;2-A
compute trinomial coefficients ()
contract tensors A and B according to rank of C and return result in C
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | dimension(:) | :: | A | ||
real(kind=dp), | intent(in), | dimension(:) | :: | B | ||
real(kind=dp), | intent(inout), | dimension(:) | :: | C |
Compute multipole interaction tensor containing derivatives of , i.e. the da'th derivative wrt and db'th derivative wrt . Tensor is returned in a one-dimensional array with elements in anticanonical ordering, e.g. xx, xy, xz, yy, yz, zz.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | dimension(:) | :: | r_ab | coordinate |
|
real(kind=dp), | intent(out), | dimension(:) | :: | T | the interaction tensor |
|
integer, | intent(in) | :: | da | order of derivative wrt |
||
integer, | intent(in) | :: | db | order of derivative wrt |
Compute folded multipole interaction tensor containing derivatives of , i.e. the da'th derivative wrt and db'th derivative wrt . Tensor is returned in a one-dimensional array with elements in anticanonical ordering, e.g. xx, xy, xz, yy, yz, zz.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | dimension(:) | :: | r_ab | coordinate |
|
real(kind=dp), | intent(out), | dimension(:) | :: | T | the interaction tensor |
|
integer, | intent(in) | :: | da | order of derivative wrt |
||
integer, | intent(in) | :: | db | order of derivative wrt |
convert tensor to traceless tensor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(inout), | dimension(:) | :: | A |