Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .other_libs/build_fcns/configure.ac_FormCHK
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([MQC_Pack], [25.11.1], [hhratchian@ucmerced.edu])
AC_INIT([MQC_Pack], [25.11.2], [hhratchian@ucmerced.edu])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([src/mqc_general.F03])
AC_PROG_CPP
Expand Down
2 changes: 1 addition & 1 deletion .other_libs/build_fcns/configure.ac_MatrixFile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([MQC_Pack], [25.11.1], [hhratchian@ucmerced.edu])
AC_INIT([MQC_Pack], [25.11.2], [hhratchian@ucmerced.edu])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([src/mqc_general.F03])
AC_LANG([Fortran])
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
** **
** The Merced Quantum Chemistry Package **
** (MQCPack) **
** Version 25.11.1 **
** November 10, 2025 **
** Version 25.11.2 **
** November 11, 2025 **
** **
** **
** Written By: **
Expand Down
4 changes: 2 additions & 2 deletions src/mqc_FullWavefunction.F03
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ module MQC_FullWavefunction
! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave **
! ** Mullally, and Hrant P. Hratchian **
! ** **
! ** Version 25.11.1 **
! ** November 10, 2025 **
! ** Version 25.11.2 **
! ** November 11, 2025 **
! ** **
! ** **
! ** Modules beloning to MQCPack: **
Expand Down
4 changes: 2 additions & 2 deletions src/mqc_algebra.F03
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Module MQC_Algebra
! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave **
! ** Mullally, and Hrant P. Hratchian **
! ** **
! ** Version 25.11.1 **
! ** November 10, 2025 **
! ** Version 25.11.2 **
! ** November 11, 2025 **
! ** **
! ** **
! ** Modules beloning to MQCPack: **
Expand Down
4 changes: 2 additions & 2 deletions src/mqc_algebra2.F03
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Module MQC_Algebra2
! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave **
! ** Mullally, and Hrant P. Hratchian **
! ** **
! ** Version 25.11.1 **
! ** November 10, 2025 **
! ** Version 25.11.2 **
! ** November 11, 2025 **
! ** **
! ** **
! ** Modules beloning to MQCPack: **
Expand Down
4 changes: 2 additions & 2 deletions src/mqc_binary.F03
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module MQC_Binary
! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave **
! ** Mullally, and Hrant P. Hratchian **
! ** **
! ** Version 25.11.1 **
! ** November 10, 2025 **
! ** Version 25.11.2 **
! ** November 11, 2025 **
! ** **
! ** **
! ** Modules beloning to MQCPack: **
Expand Down
4 changes: 2 additions & 2 deletions src/mqc_datastructures.F03
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Module MQC_DataStructures
! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave **
! ** Mullally, and Hrant P. Hratchian **
! ** **
! ** Version 25.11.1 **
! ** November 10, 2025 **
! ** Version 25.11.2 **
! ** November 11, 2025 **
! ** **
! ** **
! ** Modules beloning to MQCPack: **
Expand Down
4 changes: 2 additions & 2 deletions src/mqc_est.F03
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Module MQC_EST
! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave **
! ** Mullally, and Hrant P. Hratchian **
! ** **
! ** Version 25.11.1 **
! ** November 10, 2025 **
! ** Version 25.11.2 **
! ** November 11, 2025 **
! ** **
! ** **
! ** Modules beloning to MQCPack: **
Expand Down
4 changes: 2 additions & 2 deletions src/mqc_files.F03
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Module MQC_Files
! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave **
! ** Mullally, and Hrant P. Hratchian **
! ** **
! ** Version 25.11.1 **
! ** November 10, 2025 **
! ** Version 25.11.2 **
! ** November 11, 2025 **
! ** **
! ** **
! ** Modules beloning to MQCPack: **
Expand Down
4 changes: 2 additions & 2 deletions src/mqc_gaussian.F03
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Module MQC_Gaussian
! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave **
! ** Mullally, and Hrant P. Hratchian **
! ** **
! ** Version 25.11.1 **
! ** November 10, 2025 **
! ** Version 25.11.2 **
! ** November 11, 2025 **
! ** **
! ** **
! ** Modules beloning to MQCPack: **
Expand Down
8 changes: 4 additions & 4 deletions src/mqc_general.F03
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Module MQC_General
! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave **
! ** Mullally, and Hrant P. Hratchian **
! ** **
! ** Version 25.11.1 **
! ** November 10, 2025 **
! ** Version 25.11.2 **
! ** November 11, 2025 **
! ** **
! ** **
! ** Modules beloning to MQCPack: **
Expand Down Expand Up @@ -192,8 +192,8 @@ subroutine mqc_version(major,minor,revision,versionString)
!
if(PRESENT(major)) major = 25
if(PRESENT(minor)) minor = 11
if(PRESENT(revision)) revision = 1
if(PRESENT(versionString)) versionString = '25.11.1'
if(PRESENT(revision)) revision = 2
if(PRESENT(versionString)) versionString = '25.11.2'
!
return
end subroutine mqc_version
Expand Down
210 changes: 121 additions & 89 deletions src/mqc_general_lapack.F03
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave **
! ** Mullally, and Hrant P. Hratchian **
! ** **
! ** Version 25.11.1 **
! ** November 10, 2025 **
! ** Version 25.11.2 **
! ** November 11, 2025 **
! ** **
! ** **
! ** Modules beloning to MQCPack: **
Expand Down Expand Up @@ -240,85 +240,112 @@ subroutine mqc_dgeev_eigensystem_Full(matrix,eigenValues, &
return
end subroutine mqc_dgeev_eigensystem_Full

!hph
!!
!!PROCEDURE mqc_dsyev_eigensystem_symm
! subroutine mqc_dsyev_eigensystem_symm(matrix,eigenValues,eigenVectors)
!!
!! This subroutine wraps the LAPACK eigensystem routines for a symmetric
!! matrix in full/dense memory storage format.
!!
!! H. P. Hratchian, 2020
!!
! implicit none
! real(kind=real64),dimension(:,:),intent(in)::matrix
! real(kind=real64),dimension(:),allocatable,intent(out)::eigenValues
! real(kind=real64),dimension(:,:),allocatable,OPTIONAL,intent(out)::eigenVectors
!!
! integer::i,N,INFO,LWORK
! real(kind=real64),dimension(:,:),allocatable::matrixCopy
! real(kind=real64),dimension(:),allocatable::Work
! real(kind=real64),dimension(1)::WorkTmp
! character(len=1)::JOBZ
!!
!!
!! Do some initial checking of matrix to ensure it's square. Next, figure out
!! the dimension of <matrix>, <N>. Then, allocate space for <matrixCopy> and
!! copy matrix into that space so that the LAPACK routine DSYEV can use this
!! space as working memory. Finally, allocate space for <eigenValues> and, if
!! sent, <eigenVectors>.
!!
! if(SIZE(matrix,1).ne.SIZE(matrix,2)) call mqc_error( &
! 'mqc_eigensystem_symmMatrixFull: Rectangular matrix sent.')
! N = SIZE(matrix,1)
! Allocate(matrixCopy(N,N))
! matrixCopy = matrix
! if(Allocated(eigenValues)) then
! if(SIZE(eigenValues).ne.N) then
! DeAllocate(eigenValues)
! Allocate(eigenValues(N))
! endIf
! else
! Allocate(eigenValues(N))
! endIf
! if(PRESENT(eigenVectors)) then
! JOBZ = 'V'
! if(Allocated(eigenVectors)) then
! if(SIZE(eigenVectors,1).ne.N.or.SIZE(eigenVectors,2).ne.N) then
! DeAllocate(eigenVectors)
! Allocate(eigenVectors(N,N))
! endIf
! else
! Allocate(eigenVectors(N,N))
! endIf
! else
! JOBZ = 'N'
! endIf
!!
!! Call LAPCK routine DSYEV.
!!
! call dsyev(JOBZ,'U',N,matrixCopy,N,eigenValues,WorkTmp,-1,INFO)
! if(INFO.ne.0) call mqc_error( &
! 'mqc_eigensystem_symmMatrixFull: Failure in DSYEV getting WORK length.')
! LWork = WorkTmp(1)
! Allocate(Work(LWork))
! call dsyev(JOBZ,'U',N,matrixCopy,N,eigenValues,Work,LWork,INFO)
! if(INFO.ne.0) call mqc_error( &
! 'mqc_eigensystem_symmMatrixFull: Failure in DSYEV diagonalizing matrix.')
! if(PRESENT(eigenVectors)) then
! eigenVectors = matrixCopy
! do i = 1,N
! call mqc_vectorPhase(eigenVectors(:,i),.true.)
! endDo
! endIf
!
! deAllocate(matrixCopy,Work)
!!
! return
! end subroutine mqc_eigensystem_symmFull
!hph
!
!PROCEDURE mqc_dsyevr_eigensystem_symmFull
subroutine mqc_dsyevr_eigensystem_symmFull(matrix,eigenValues,eigenVectors)
!
! Wraps LAPACK DSYEVR to compute eigenvalues (and optionally eigenvectors)
! of a real symmetric matrix in full/dense storage.
!
!
! H. P. Hratchian, 2025.
!
!
implicit none
real(kind=real64),dimension(:,:),intent(in)::matrix
real(kind=real64),dimension(:),allocatable,intent(out)::eigenValues
real(kind=real64),dimension(:,:),allocatable,optional,intent(out)::eigenVectors
!
integer::i,N,INFO,LDA,LDZ,LWORK,LIWORK,M
character(len=1)::JOBZ
real(kind=real64)::ABSTOL
real(kind=real64),dimension(:,:),allocatable::matrixCopy,Zloc
real(kind=real64),dimension(:),allocatable::Work,Wtmp
integer,dimension(:),allocatable::IWork,IWtmp,ISUPPZ
!
! Quick checks and setup
!
if(SIZE(matrix,1).ne.SIZE(matrix,2)) call mqc_error( &
'mqc_dsyevr_eigensystem_symmFull: Rectangular matrix sent.')
N = SIZE(matrix,1)
LDA = N
!
! Copy input so LAPACK can overwrite it.
!
allocate(matrixCopy(N,N))
matrixCopy = matrix
!
! Prepare outputs...
!
if (allocated(eigenValues)) then
if (SIZE(eigenValues) .ne. N) then
deallocate(eigenValues)
allocate(eigenValues(N))
end if
else
allocate(eigenValues(N))
end if
if(present(eigenVectors)) then
JOBZ = 'V'
LDZ = N
if (allocated(eigenVectors)) then
if (SIZE(eigenVectors,1) .ne. N .or. SIZE(eigenVectors,2) .ne. N) then
deallocate(eigenVectors)
allocate(eigenVectors(N,N))
end if
else
allocate(eigenVectors(N,N))
end if
allocate(Zloc(N,N))
else
JOBZ = 'N'
LDZ = 1
! Minimal dummy Z to satisfy the interface (not referenced when JOBZ='N')
allocate(Zloc(1,1))
end if
!
! ISUPPZ size: 2*max(1,M); we don't know M until after the call, but for
! RANGE='A' we have M=N. Allocate for N.
!
allocate(ISUPPZ(2*max(1,N)))
!
! Workspace check...
!
allocate(Wtmp(1), IWtmp(1))
ABSTOL = 2.0_real64 * mqc_small
INFO = 0
call dsyevr(JOBZ,'A','L',N,matrixCopy,LDA,0.0_real64,0.0_real64,0,0,&
ABSTOL,M,eigenValues,Zloc,LDZ,ISUPPZ,Wtmp,-1,IWtmp,-1,INFO)
if(INFO.ne.0) call mqc_error( &
& 'mqc_dsyevr_eigensystem_symmFull: Workspace query failed in DSYEVR.')

LWORK = int(Wtmp(1))
LIWORK = IWtmp(1)
deallocate(Wtmp,IWtmp)
allocate(Work(LWORK),IWork(LIWORK))
!
! Actual computation (RANGE='A' ⇒ all eigenpairs; eigenvalues ascending)
!
INFO = 0
call dsyevr(JOBZ,'A','L',N,matrixCopy,LDA,0.0_real64,0.0_real64,0,0,&
ABSTOL,M,eigenValues,Zloc,LDZ,ISUPPZ,Work,LWORK,IWork,LIWORK,INFO)
if(INFO.ne.0) call mqc_error( &
'mqc_dsyevr_eigensystem_symmFull: Failure in DSYEVR.')
!
! If vectors requested, return them (columns) and phase-normalize like DSYEV wrapper
!
if(present(eigenVectors)) then
eigenVectors = Zloc(:,1:M) ! here M should equal N for RANGE='A'
do i = 1,N
call mqc_vectorPhase(eigenVectors(:,i),.true.)
end do
end if

! Cleanup
deallocate(matrixCopy,Zloc,ISUPPZ,Work,IWork)
!
return
end subroutine mqc_dsyevr_eigensystem_symmFull

!
!PROCEDURE mqc_dgesvd_svd_Full
Expand Down Expand Up @@ -476,26 +503,28 @@ subroutine mqc_dgesv_mat(A,B,X,infoOut)
LDB = N
allocate(IPIV(N))
INFO = 0
call dgesv(N, NRHS, Acopy, LDA, IPIV, Bcopy, LDB, INFO)
call dgesv(N,NRHS,Acopy,LDA,IPIV,Bcopy,LDB,INFO)
!
! Check for errors in the LAPack run.
!
if(present(infoOut)) infoOut = INFO
if(INFO.ne.0) &
call mqc_error('mqc_dgesv: DGESV failed (INFO /= 0).')
if(present(infoOut)) then
infoOut = INFO
if(INFO.ne.0) return
endIf
call mqc_error('mqc_dgesv_mat: DGESV failed (INFO /= 0).')
!
! Move Bcopy into the output argument X. Then, DeAllocate the temporary
! memory space this routine has allocated.
!
X = Bcopy
deallocate(Acopy, Bcopy, IPIV)
deallocate(Acopy,Bcopy,IPIV)
!
return
end subroutine mqc_dgesv_mat


!PROCEDURE mqc_dgesv_vec
subroutine mqc_dgesv_vec(A, b, x, infoOut)
subroutine mqc_dgesv_vec(A,b,x,infoOut)
!
! This routine is a wrapper for the LAPack routine DGESV for cases where the
! right hand side of the linear system of equations is a vector.
Expand Down Expand Up @@ -544,19 +573,22 @@ subroutine mqc_dgesv_vec(A, b, x, infoOut)
LDB = N
allocate(IPIV(N))
INFO = 0
call dgesv(N, NRHS, Acopy, LDA, IPIV, Bcopy, LDB, INFO)
call dgesv(N,NRHS,Acopy,LDA,IPIV,Bcopy,LDB,INFO)
!
! Check for errors in the LAPack run.
!
if(present(infoOut)) infoOut = INFO
if(present(infoOut)) then
infoOut = INFO
if(INFO.ne.0) return
endIf
if(INFO.ne.0) &
call mqc_error('mqc_dgesv: DGESV failed (INFO /= 0).')
call mqc_error('mqc_dgesv_vec: DGESV failed (INFO /= 0).')
!
! Move Bcopy into the output argument X. Then, DeAllocate the temporary
! memory space this routine has allocated.
!
x = Bcopy(:,1)
deallocate(Acopy, Bcopy, IPIV)
deallocate(Acopy,Bcopy,IPIV)
!
return
end subroutine mqc_dgesv_vec
Loading