TABLE OF CONTENTS
ABINIT/cont24 [ Functions ]
NAME
cont24
FUNCTION
Contract symmetric rank2 tensor gxa with rank4 symmetric tensor to produce symmetric rank2 tensor.
COPYRIGHT
Copyright (C) 1998-2018 ABINIT group (DCA, XG) This file is distributed under the terms of the GNU General Public License, see ~abinit/COPYING or http://www.gnu.org/copyleft/gpl.txt . For the initials of contributors, see ~abinit/doc/developers/contributors.txt.
INPUTS
gxa(2,6)=rank 2 symmetric complex tensor in order 11 22 33 32 31 21 rank4(2,15)=rank 4 complex tensor (symmetric storage)
OUTPUT
rank2(6)=rank 2 real tensor (symmetric storage) 11 22 33 32 31 21.
NOTES
Tensors are in "symmetric" storage mode. for gxa and rank2 this is 11, 22, 33, 32, 31, 21; for the rank 4 tensor rank4 this is 1111 2211 3311 3211 3111 2111 2221 3321 3221 3331 2222 3322 3222 3332 3333. gxa and rank4 are complex; rank2 is real. Want $2 Re[contraction]$. $rank2(a,b)=2 Re[gxa(i,j)^"*" rank4(a,b,i,j)]$. Note that the input gxa is typically the result of $gxa(i,j)=[{3 \over 2} gmet(i,l) gmet(j,m) - {1 \over 2} gmet(i,j) gmet(l,m)] gxa_old(l,m)$ where the subroutine "metcon" already includes weights in the definition of gxa for off-diagonal elements (weight of 2 for symmetry). Components 4, 5, and 6 of gxa have already been multiplied by 2 so the expressions below do not carry the 2.
PARENTS
nonlop_pl
CHILDREN
SOURCE
48 #if defined HAVE_CONFIG_H 49 #include "config.h" 50 #endif 51 52 #include "abi_common.h" 53 54 55 subroutine cont24(gxa,rank4,rank2) 56 57 use defs_basis 58 59 !This section has been created automatically by the script Abilint (TD). 60 !Do not modify the following lines by hand. 61 #undef ABI_FUNC 62 #define ABI_FUNC 'cont24' 63 !End of the abilint section 64 65 implicit none 66 67 !Arguments ------------------------------------ 68 !arrays 69 real(dp),intent(in) :: gxa(2,6),rank4(2,15) 70 real(dp),intent(out) :: rank2(6) 71 72 !Local variables------------------------------- 73 !scalars 74 integer,parameter :: im=2,re=1 75 76 ! ************************************************************************* 77 78 !Simply write out index summations 79 80 !a=1, b=1 in rank2(a,b) --> maps to index 1 81 rank2(1)=2.0d0*(& 82 & gxa(re,1)*rank4(re, 1)+gxa(im,1)*rank4(im, 1)+& 83 & gxa(re,2)*rank4(re, 2)+gxa(im,2)*rank4(im, 2)+& 84 & gxa(re,3)*rank4(re, 3)+gxa(im,3)*rank4(im, 3)+& 85 & gxa(re,4)*rank4(re, 4)+gxa(im,4)*rank4(im, 4)+& 86 & gxa(re,5)*rank4(re, 5)+gxa(im,5)*rank4(im, 5)+& 87 & gxa(re,6)*rank4(re, 6)+gxa(im,6)*rank4(im, 6)) 88 89 !a=2, b=2 in rank2(a,b) --> maps to index 2 90 rank2(2)=2.0d0*(& 91 & gxa(re,1)*rank4(re, 2)+gxa(im,1)*rank4(im, 2)+& 92 & gxa(re,2)*rank4(re,11)+gxa(im,2)*rank4(im,11)+& 93 & gxa(re,3)*rank4(re,12)+gxa(im,3)*rank4(im,12)+& 94 & gxa(re,4)*rank4(re,13)+gxa(im,4)*rank4(im,13)+& 95 & gxa(re,5)*rank4(re, 9)+gxa(im,5)*rank4(im, 9)+& 96 & gxa(re,6)*rank4(re, 7)+gxa(im,6)*rank4(im, 7)) 97 98 !a=3, b=3 in rank2(a,b) --> maps to index 3 99 rank2(3)=2.0d0*(& 100 & gxa(re,1)*rank4(re, 3)+gxa(im,1)*rank4(im, 3)+& 101 & gxa(re,2)*rank4(re,12)+gxa(im,2)*rank4(im,12)+& 102 & gxa(re,3)*rank4(re,15)+gxa(im,3)*rank4(im,15)+& 103 & gxa(re,4)*rank4(re,14)+gxa(im,4)*rank4(im,14)+& 104 & gxa(re,5)*rank4(re,10)+gxa(im,5)*rank4(im,10)+& 105 & gxa(re,6)*rank4(re, 8)+gxa(im,6)*rank4(im, 8)) 106 107 !a=3, b=2 in rank2(a,b) --> maps to index 4 108 rank2(4)=2.0d0*(& 109 & gxa(re,1)*rank4(re, 4)+gxa(im,1)*rank4(im, 4)+& 110 & gxa(re,2)*rank4(re,13)+gxa(im,2)*rank4(im,13)+& 111 & gxa(re,3)*rank4(re,14)+gxa(im,3)*rank4(im,14)+& 112 & gxa(re,4)*rank4(re,12)+gxa(im,4)*rank4(im,12)+& 113 & gxa(re,5)*rank4(re, 8)+gxa(im,5)*rank4(im, 8)+& 114 & gxa(re,6)*rank4(re, 9)+gxa(im,6)*rank4(im, 9)) 115 116 !a=3, b=1 in rank2(a,b) --> maps to index 5 117 rank2(5)=2.0d0*(& 118 & gxa(re,1)*rank4(re, 5)+gxa(im,1)*rank4(im, 5)+& 119 & gxa(re,2)*rank4(re, 9)+gxa(im,2)*rank4(im, 9)+& 120 & gxa(re,3)*rank4(re,10)+gxa(im,3)*rank4(im,10)+& 121 & gxa(re,4)*rank4(re, 8)+gxa(im,4)*rank4(im, 8)+& 122 & gxa(re,5)*rank4(re, 3)+gxa(im,5)*rank4(im, 3)+& 123 & gxa(re,6)*rank4(re, 4)+gxa(im,6)*rank4(im, 4)) 124 125 !a=2, b=1 in rank2(a,b) --> maps to index 6 126 rank2(6)=2.0d0*(& 127 & gxa(re,1)*rank4(re, 6)+gxa(im,1)*rank4(im, 6)+& 128 & gxa(re,2)*rank4(re, 7)+gxa(im,2)*rank4(im, 7)+& 129 & gxa(re,3)*rank4(re, 8)+gxa(im,3)*rank4(im, 8)+& 130 & gxa(re,4)*rank4(re, 9)+gxa(im,4)*rank4(im, 9)+& 131 & gxa(re,5)*rank4(re, 4)+gxa(im,5)*rank4(im, 4)+& 132 & gxa(re,6)*rank4(re, 2)+gxa(im,6)*rank4(im, 2)) 133 134 end subroutine cont24