From a963b222939804e62a34c886058970b3346a8079 Mon Sep 17 00:00:00 2001 From: Pierre-Francois Loos Date: Mon, 29 Apr 2019 09:43:33 +0200 Subject: [PATCH] debugging --- include/parameters.h | 2 +- input/basis | 68 +---------------------------------- input/methods | 6 ++-- input/molecule | 2 +- input/options | 2 +- run_sph.sh | 11 +++--- src/QuAcK/linear_response.f90 | 8 ++++- src/utils/wrap_lapack.f90 | 32 +++++++++++++++++ 8 files changed, 52 insertions(+), 79 deletions(-) diff --git a/include/parameters.h b/include/parameters.h index 20d7562..91b3be4 100644 --- a/include/parameters.h +++ b/include/parameters.h @@ -2,7 +2,7 @@ integer,parameter :: nspin = 2 integer,parameter :: nsp = 3 integer,parameter :: maxEns = 10 - integer,parameter :: maxShell = 1024 + integer,parameter :: maxShell = 512 integer,parameter :: n1eInt = 3 integer,parameter :: n2eInt = 4 integer,parameter :: n3eInt = 3 diff --git a/input/basis b/input/basis index 81628dd..9c24319 100644 --- a/input/basis +++ b/input/basis @@ -1,70 +1,4 @@ -1 49 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 +1 16 S 1 1.00 1.0000000 1.0000000 S 1 1.00 diff --git a/input/methods b/input/methods index ddba53e..cbab5bc 100644 --- a/input/methods +++ b/input/methods @@ -1,14 +1,14 @@ # RHF UHF MOM T F F # MP2 MP3 MP2-F12 - F F F + T F F # CCD CCSD CCSD(T) F F F # CIS TDHF ADC - T T F + F F F # GF2 GF3 T F # G0W0 evGW qsGW - T T F + T F F # MCMP2 F diff --git a/input/molecule b/input/molecule index 16f7084..39a84f4 100644 --- a/input/molecule +++ b/input/molecule @@ -1,4 +1,4 @@ # nAt nEla nElb nCore nRyd - 1 72 72 0 0 + 1 4 4 0 0 # Znuc x y z X 0.0 0.0 0.0 diff --git a/input/options b/input/options index e5dae4f..3699ef2 100644 --- a/input/options +++ b/input/options @@ -5,7 +5,7 @@ # CC: maxSCF thresh DIIS n_diis 64 0.00001 F 1 # CIS/TDHF: singlet triplet - T T + T F # GF: maxSCF thresh DIIS n_diis renormalization 64 0.00001 T 5 3 # GW: maxSCF thresh DIIS n_diis COHSEX SOSEX BSE TDA G0W GW0 linearize diff --git a/run_sph.sh b/run_sph.sh index c9cedc6..afaa813 100755 --- a/run_sph.sh +++ b/run_sph.sh @@ -1,7 +1,8 @@ #! /bin/bash -Lmax=6 -Mmax=6 +Lmin=0 +Lmax=2 +Mmax=3 rs=$1 if [ $# != 1 ] @@ -15,7 +16,7 @@ else echo "------------------------" echo - for (( L=0 ; L<=$Lmax ; L++ )) ; do + for (( L=$Lmin ; L<=$Lmax ; L++ )) ; do ne=$(bc -l <<< "(2*($L+1)*($L+1))") echo @@ -29,8 +30,8 @@ else nb=$(bc -l <<< "(($M+1)*($M+1))") echo "Number of basis functions = " $nb echo -e "# rs \n" $rs > input/sph - ./GoSph $ne $M > Sph_${ne}_${M}.out - grep "Total CPU time for QuAcK =" Sph_${ne}_${M}.out + ./GoSph $ne $M > Sph_${ne}_${nb}.out + grep "Total CPU time for QuAcK =" Sph_${ne}_${nb}.out done diff --git a/src/QuAcK/linear_response.f90 b/src/QuAcK/linear_response.f90 index 7a21e58..5675a2f 100644 --- a/src/QuAcK/linear_response.f90 +++ b/src/QuAcK/linear_response.f90 @@ -43,8 +43,8 @@ subroutine linear_response(ispin,dRPA,TDA,BSE,nBas,nC,nO,nV,nR,nS,e,ERI,rho,EcRP ! Build A + B and A - B matrices - AmB = A - B ApB = A + B + AmB = A - B ! print*,'A+B' ! call matout(nS,nS,ApB) @@ -62,6 +62,9 @@ subroutine linear_response(ispin,dRPA,TDA,BSE,nBas,nC,nO,nV,nR,nS,e,ERI,rho,EcRP call ADAt(nS,AmB,sqrt(Omega),AmBSq) Z = matmul(AmBSq,matmul(ApB,AmBSq)) +! print*,'Z' +! call matout(nS,nS,Z) + call diagonalize_matrix(nS,Z,Omega) if(minval(Omega) < 0d0) & @@ -71,6 +74,9 @@ subroutine linear_response(ispin,dRPA,TDA,BSE,nBas,nC,nO,nV,nR,nS,e,ERI,rho,EcRP XpY = matmul(transpose(Z),AmBSq) call DA(nS,1d0/sqrt(Omega),XpY) +! print*,'X+Y' +! call matout(nS,nS,XpY) + ! print*,'RPA excitations' ! call matout(nS,1,Omega) diff --git a/src/utils/wrap_lapack.f90 b/src/utils/wrap_lapack.f90 index 6c29ab7..c88a8ef 100644 --- a/src/utils/wrap_lapack.f90 +++ b/src/utils/wrap_lapack.f90 @@ -29,6 +29,38 @@ ! !end subroutine eigenvalues_non_symmetric_matrix +!subroutine diagonalize_matrix_lowest(N,M,A,e) +! +!! Diagonalize a square matrix but only provide the M lowest eigenvalues/eigenvectors +! +! implicit none +! +!! Input variables +! +! integer,intent(in) :: N +! integer,intent(in) :: M +! double precision,intent(inout):: A(N,N) +! double precision,intent(out) :: e(N) +! +!! Local variables +! +! integer :: lwork,info +! double precision,allocatable :: work(:) +! +!! Memory allocation +! +! allocate(work(3*N)) +! lwork = size(work) +! abstol = 1d-15 +! +! call dsyevx('V','I','U',N,A,N,VL,VU,1,M,abstol,M,e,work,lwork,info) +! +! if(info /= 0) then +! print*,'Problem in diagonalize_matrix (dsyev)!!' +! endif +! +!end subroutine diagonalize_matrix_lowest + subroutine diagonalize_matrix(N,A,e) ! Diagonalize a square matrix