Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hphratchian authored Jul 8, 2022
2 parents e402648 + 21c1610 commit 0bef452
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mqc_algebra2.F03
Original file line number Diff line number Diff line change
Expand Up @@ -3518,8 +3518,8 @@ end subroutine MQC_Variable_Matrix_Eigensystem
!PROCEDURE MQC_Variable_Matrix_Determinant
function MQC_Variable_Matrix_Determinant(mqcVariable) result(det)
!
! This routine carries out eigen decomposision of a matrix stored in input
! argument <mqcVariable>.
! This routine determines the determinant of a matrix of a matrix stored in
! input argument <mqcVariable>.
!
!
! H. P. Hratchian, 2022.
Expand Down
43 changes: 43 additions & 0 deletions src/mqc_general.F03
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,49 @@ Subroutine mqc_vectorPhase(vector,largestPositive,trimZero)
end subroutine mqc_vectorPhase


!PROCEDURE mqc_outerProduct_real
Function mqc_outerProduct_real(vector1,vector2,scalar) result(matrixOut)
!
! This function forms the outer product of two vectors -- vector1 and
! vector2. The result is a matrix that is returned in matrixOut, which is
! assumed to be allocatable. Optionally, a scalar <scalar> can be sent to
! multiply the outer product.
!
!
! H. P. Hratchian, 2022.
!
!
! Variable Declarations.
implicit none
real(kind=real64),dimension(:),intent(in)::vector1,vector2
real(kind=real64),OPTIONAL,intent(in)::scalar
real(kind=real64),allocatable,dimension(:,:)::matrixOut
!
integer(kind=int64)::n1,n2,i,j
!
! Do the work...
!
n1 = SIZE(vector1)
n2 = SIZE(vector2)
Allocate(matrixOut(n1,n2))
if(PRESENT(scalar)) then
do i = 1,n1
do j = 1,n2
matrixOut(i,j) = scalar*vector1(i)*vector2(j)
endDo
endDo
else
do i = 1,n1
do j = 1,n2
matrixOut(i,j) = vector1(i)*vector2(j)
endDo
endDo
endIf
!
return
end function mqc_outerProduct_real


!PROCEDURE mqc_packedSymmetricMatrix2FullMatrix_integer
Subroutine mqc_packedSymmetricMatrix2FullMatrix_integer(matrixSymmetric, &
matrixFull,upperLower)
Expand Down

0 comments on commit 0bef452

Please sign in to comment.