Commit 062d5c2e authored by Marie bernadette Lepetit's avatar Marie bernadette Lepetit
Browse files

Merge branch 'dev/prop' of https://code.ill.fr/relaxse/relaxse-code into dev/prop

parents 845ae985 d407c735
Pipeline #12709 failed with stage
in 24 minutes and 5 seconds
...@@ -45,10 +45,10 @@ add_runtest(CuO_00800_LS) ...@@ -45,10 +45,10 @@ add_runtest(CuO_00800_LS)
if(NOT ENABLE_NOGEN) if(NOT ENABLE_NOGEN)
add_runtest(CuO_02240) add_runtest(CuO_02240)
add_runtest(CuO_30405) add_runtest(CuO_30405)
add_runtest(CuO_03450_nodet2) #add_runtest(CuO_03450_nodet2)
add_runtest(CuO_03450_nodet3) #add_runtest(CuO_03450_nodet3)
add_runtest(CuO_03450_nocontraction) #add_runtest(CuO_03450_nocontraction)
add_runtest(CuO_03450_allcontraction) #add_runtest(CuO_03450_allcontraction)
add_runtest(CuO_03450) add_runtest(CuO_03450)
add_runtest(CuO_12423) add_runtest(CuO_12423)
add_runtest(CuO_CAS+S) add_runtest(CuO_CAS+S)
...@@ -69,26 +69,26 @@ if(ENABLE_DEV) ...@@ -69,26 +69,26 @@ if(ENABLE_DEV)
add_test( add_test(
NAME prop_CuO_02204 NAME prop_CuO_02204
COMMAND python3 ${CMAKE_SOURCE_DIR}/test/CuO_02204/test_prop --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/CuO_02204 --verbose --log=${CMAKE_BINARY_DIR}/test/CuO_02204/runtest.stderr.logprop) COMMAND python3 ${CMAKE_SOURCE_DIR}/test/prop_CuO_02204/test_prop --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/prop_CuO_02204 --verbose --log=${CMAKE_BINARY_DIR}/test/prop_CuO_02204/runtest.stderr.logprop)
set_tests_properties(prop_CuO_02204 PROPERTIES set_tests_properties(prop_CuO_02204 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/CuO_02204) RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/prop_CuO_02204)
add_test( add_test(
NAME prop_CuO_20204 NAME prop_CuO_20204
COMMAND python3 ${CMAKE_SOURCE_DIR}/test/CuO_20204/test_prop --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/CuO_20204 --verbose --log=${CMAKE_BINARY_DIR}/test/CuO_20204/runtest.stderr.logprop) COMMAND python3 ${CMAKE_SOURCE_DIR}/test/prop_CuO_20204/test_prop --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/prop_CuO_20204 --verbose --log=${CMAKE_BINARY_DIR}/test/prop_CuO_20204/runtest.stderr.logprop)
set_tests_properties(prop_CuO_20204 PROPERTIES set_tests_properties(prop_CuO_20204 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/CuO_20204) RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/prop_CuO_20204)
add_test( add_test(
NAME prop_CuO_02240 NAME prop_CuO_02240
COMMAND python3 ${CMAKE_SOURCE_DIR}/test/CuO_02240/test_prop --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/CuO_02240 --verbose --log=${CMAKE_BINARY_DIR}/test/CuO_02240/runtest.stderr.logprop) COMMAND python3 ${CMAKE_SOURCE_DIR}/test/prop_CuO_02240/test_prop --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/prop_CuO_02240 --verbose --log=${CMAKE_BINARY_DIR}/test/prop_CuO_02240/runtest.stderr.logprop)
set_tests_properties(prop_CuO_02240 PROPERTIES set_tests_properties(prop_CuO_02240 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/CuO_02240) RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/prop_CuO_02240)
add_test( add_test(
NAME prop_CuO_03450 NAME prop_CuO_03450
COMMAND python3 ${CMAKE_SOURCE_DIR}/test/CuO_03450/test_prop --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/CuO_03450 --verbose --log=${CMAKE_BINARY_DIR}/test/CuO_03450/runtest.stderr.logprop) COMMAND python3 ${CMAKE_SOURCE_DIR}/test/prop_CuO_03450/test_prop --binary-dir=${CMAKE_BINARY_DIR} --work-dir=${CMAKE_BINARY_DIR}/test/prop_CuO_03450 --verbose --log=${CMAKE_BINARY_DIR}/test/prop_CuO_03450/runtest.stderr.logprop)
set_tests_properties(prop_CuO_03450 PROPERTIES set_tests_properties(prop_CuO_03450 PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/CuO_03450) RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/prop_CuO_03450)
endif() endif()
...@@ -45,12 +45,13 @@ Program proprietes ...@@ -45,12 +45,13 @@ Program proprietes
use utils_wrt use utils_wrt
#ifdef VAR_DEV #ifdef VAR_DEV
use densite use densite
! use density_matrix ! use density_matrix
#endif #endif
!$ use OMP_LIB
!!$ -------- Donnes locales ----------------------------------- !!$ -------- Donnes locales -----------------------------------
implicit none implicit none
type(prop_infotype) :: prop_info type(prop_infotype) :: prop_info
type(prog_infotype) :: prog_info type(prog_infotype) :: prog_info
type(g_infotype) :: g_info type(g_infotype) :: g_info
...@@ -59,7 +60,7 @@ Program proprietes ...@@ -59,7 +60,7 @@ Program proprietes
type(det_infotype) :: det_info type(det_infotype) :: det_info
type(sym_infotype) :: sym_info type(sym_infotype) :: sym_info
! det ! det
type(deter), dimension(:), allocatable :: det, ref0 type(deter), dimension(:), allocatable :: det, ref0
Integer (KIND=kd_int) :: ndet, nvec, nblock, nelact, nact Integer (KIND=kd_int) :: ndet, nvec, nblock, nelact, nact
...@@ -73,14 +74,14 @@ Program proprietes ...@@ -73,14 +74,14 @@ Program proprietes
! vecteurs ! vecteurs
real(kd_dble), dimension(:,:), allocatable :: psi real(kd_dble), dimension(:,:), allocatable :: psi
real(kd_dble), dimension(:), allocatable :: ener, psi_S real(kd_dble), dimension(:), allocatable :: ener, psi_S
! prop ! prop
Integer(KIND=kd_int) :: nprop Integer(KIND=kd_int) :: nprop
character*5, dimension(:), allocatable :: whichprop character*5, dimension(:), allocatable :: whichprop
! proprietes ! proprietes
! real(kd_dble), dimension(:,:,:), allocatable :: rho_tot,rho_spin ! real(kd_dble), dimension(:,:,:), allocatable :: rho_tot,rho_spin
! impressions ! impressions
integer, parameter :: pas = 10 integer, parameter :: pas = 10
character*1, parameter :: A1=" " character*1, parameter :: A1=" "
...@@ -100,7 +101,7 @@ Program proprietes ...@@ -100,7 +101,7 @@ Program proprietes
real(kind=kd_dble), allocatable :: rho(:, :) real(kind=kd_dble), allocatable :: rho(:, :)
real(kind=kd_dble), allocatable :: WF(:) real(kind=kd_dble), allocatable :: WF(:)
#endif #endif
!!$============================================================ !!$============================================================
!!$ -------- Code --------------------------------------------- !!$ -------- Code ---------------------------------------------
!!$----- !!$-----
...@@ -112,7 +113,7 @@ Program proprietes ...@@ -112,7 +113,7 @@ Program proprietes
!$OMP PARALLEL SHARED(nb_thread) !$OMP PARALLEL SHARED(nb_thread)
nb_thread=OMP_GET_MAX_THREADS() nb_thread=OMP_GET_MAX_THREADS()
!$OMP END PARALLEL !$OMP END PARALLEL
prog_info%nb_thread = nb_thread prog_info%nb_thread = nb_thread
#endif #endif
...@@ -120,10 +121,10 @@ Program proprietes ...@@ -120,10 +121,10 @@ Program proprietes
call def_files_prop(prog_info, ndet) call def_files_prop(prog_info, ndet)
flush(f_output) flush(f_output)
call gettime(tstart, wstart) call gettime(tstart, wstart)
! lecture des x_info ! lecture des x_info
read(f_info) prog_info read(f_info) prog_info
read(f_info) g_info read(f_info) g_info
...@@ -145,7 +146,7 @@ Program proprietes ...@@ -145,7 +146,7 @@ Program proprietes
nelact = g_info%nelact nelact = g_info%nelact
nact = o_info%nact nact = o_info%nact
det_info%nref0 = nref0lu det_info%nref0 = nref0lu
!!$----- !!$-----
!!$ --- Generation des det !!$ --- Generation des det
!!$----- !!$-----
...@@ -159,7 +160,7 @@ Program proprietes ...@@ -159,7 +160,7 @@ Program proprietes
end if end if
if (prog_info%id_cpu.eq.0) flush(f_output) if (prog_info%id_cpu.eq.0) flush(f_output)
call detact_all_init(r, nb_rlist) call detact_all_init(r, nb_rlist)
if (prog_info%id_cpu.eq.0) then if (prog_info%id_cpu.eq.0) then
write(f_output,*) write(f_output,*)
...@@ -201,7 +202,7 @@ Program proprietes ...@@ -201,7 +202,7 @@ Program proprietes
psi(:,:) = 0.d0 psi(:,:) = 0.d0
ener(:) = 0.d0 ener(:) = 0.d0
call lect_vect(psi, ener, ndet, nvec) call lect_vect(psi, ener, ndet, nvec)
!!$----- !!$-----
!!$ --- Projection sur le cas !!$ --- Projection sur le cas
!!$----- !!$-----
...@@ -215,110 +216,90 @@ Program proprietes ...@@ -215,110 +216,90 @@ Program proprietes
write(f_output,'(X,A,A,F17.2,A,F17.2,A)') '>>> Active space projection in ',& write(f_output,'(X,A,A,F17.2,A,F17.2,A)') '>>> Active space projection in ',&
'CPU time ',t2-t1,'s, Wall time ',wt2-wt1,' s' 'CPU time ',t2-t1,'s, Wall time ',wt2-wt1,' s'
flush(f_output) flush(f_output)
!!$----------------------------------------------------------------------------- !!$-----------------------------------------------------------------------------
!!$ --- Autres proprits !!$ --- Autres proprits
!!$----------------------------------------------------------------------------- !!$-----------------------------------------------------------------------------
nprop = prop_info%nprop nprop = prop_info%nprop
if (nprop.eq.0) goto 9999 if (nprop.ne.0) then
allocate(whichprop(nprop)) allocate(whichprop(nprop))
whichprop(1:nprop) = prop_info%whichprop(1:nprop) whichprop(1:nprop) = prop_info%whichprop(1:nprop)
do iprop = 1, nprop do iprop = 1, nprop
call lowercase(whichprop(iprop)) call lowercase(whichprop(iprop))
select case (whichprop(iprop)) select case (whichprop(iprop))
case("s-s2") case("s-s2")
write(f_output,*) write(f_output,*)
write(f_output,*) " >>> Total S " write(f_output,*) " >>> Total S "
allocate(psi_S(nvec)) allocate(psi_S(nvec))
psi_S(:) = 0.d0 psi_S(:) = 0.d0
call s2(psi,psi_S,ndet,nvec,nelact, det, det_info, d, o_info, f_output) call s2(psi,psi_S,ndet,nvec,nelact, det, det_info, d, o_info, f_output)
nq=nvec/10 nq=nvec/10
nr=nvec - nq*pas nr=nvec - nq*pas
do i =1,nq do i =1,nq
write(f_output,'(" S ")',advance='no')
do iwr = 1, max(2*nact +1-6,0)
write(f_output,'(a1)',advance='no') A1
end do
write(f_output,9012) psi_S((i-1)*pas+1:i*pas)
end do
write(f_output,'(" S ")',advance='no') write(f_output,'(" S ")',advance='no')
do iwr = 1, max(2*nact +1-6,0) do iwr = 1, max(2*nact +1-6,0)
write(f_output,'(a1)',advance='no') A1 write(f_output,'(a1)',advance='no') A1
end do end do
write(f_output,9012) psi_S((i-1)*pas+1:i*pas) write(f_output,9012) psi_S(nq*pas+1:nvec)
end do write(f_output,*)
write(f_output,'(" S ")',advance='no') deallocate(psi_S)
do iwr = 1, max(2*nact +1-6,0) 9012 format(10(F18.8,2x))
write(f_output,'(a1)',advance='no') A1 case("wf") !------- Print WFs ---------------------------------------------
end do write(f_output,*)
write(f_output,9012) psi_S(nq*pas+1:nvec) write(f_output,*) " >>> Total WFs"
write(f_output,*) call wrt_WF(ndet,nvec,1,nvec,det,psi,o_info,f_output)
deallocate(psi_S) case("pref1") !---- Project WF on Ref1 ------------------------------------
9012 format(10(F18.8,2x)) write(f_output,*)
case("wf") !------- Print WFs --------------------------------------------- write(f_output,*) " >>> Projection on Ref1"
write(f_output,*) write(f_output,*) " Not yet implemented"
write(f_output,*) " >>> Total WFs" case("lcoef") !---- Print largest determinants ----------------------------
call wrt_WF(ndet,nvec,1,nvec,det,psi,o_info,f_output) write(f_output,*)
case("pref1") !---- Project WF on Ref1 ------------------------------------ write(f_output,*) " >>> Projection on determinants with coefficients largest than 0.05"
write(f_output,*) write(f_output,*) " Not yet implemented"
write(f_output,*) " >>> Projection on Ref1" case("dens") !----- 1e-density matrix --------------------------------------
write(f_output,*) " Not yet implemented" write(f_output,*)
case("lcoef") !---- Print largest determinants ---------------------------- write(f_output,*) ">>> One particule density matrix"
write(f_output,*)
write(f_output,*) " >>> Projection on determinants with coefficients largest than 0.05"
write(f_output,*) " Not yet implemented"
case("dens") !----- 1e-density matrix --------------------------------------
write(f_output,*)
write(f_output,*) ">>> One particule density matrix"
#ifdef VAR_DEV #ifdef VAR_DEV
call dens(ndet,nvec, psi,det, d,rspin, o_info,g_info,prog_info) call dens(ndet,nvec, psi,det, d,rspin, o_info,g_info,prog_info)
call verif_dens(ndet,nvec, psi,det, d,rspin, o_info,g_info,prog_info) call verif_dens(ndet,nvec, psi,det, d,rspin, o_info,g_info,prog_info)
! allocate(WF(ndet)) write(f_output,*)
! Wf(:) = psi(:,2) write(f_output,*)
! norb = o_info%ntot + o_info%ngel + o_info%ndel
! allocate(rho(norb,norb))
! rho(:,:) = 0.d0
! rho = calc_density_matrix(WF, o_info, det)
! write(f_output,*) " calc_density_matrix : non zero terms"
! do iorb2=1,norb
! ! do iorb1=1,norb
! iorb1 = iorb2
! if (abs(rho(iorb1,iorb2)).gt.1.d-10) write(f_output,9983) iorb1,iorb2, rho(iorb1,iorb2)
! ! end do
! end do
write(f_output,*)
write(f_output,*)
9983 format (5x,2(I4,1x),2x,10(F22.16,1x))
#endif #endif
end select end select
end do end do
deallocate(whichprop)
end if
9001 format(a7," :",a80)
9993 format (5x,10(E15.6,1x))
9994 format ("Ener ",10(F15.6,1x))
9995 format (a5,10(F15.6,1x))
9999 write(f_output,*) write(f_output,*)
write(f_output,*) ' <<< End of prop code >>> ' write(f_output,*) ' <<< End of prop code >>> '
write(f_output,*) write(f_output,*)
deallocate(shtblkdet, nblkdet, deter_index) deallocate(shtblkdet, nblkdet, deter_index)
deallocate(det) deallocate(det)
deallocate(psi, ener) deallocate(psi, ener)
if (nprop.ne.0) deallocate(whichprop)
call gettime(tend,wend) call gettime(tend,wend)
call date_and_time(date, time, zone, values) call date_and_time(date, time, zone, values)
write(f_output,'(X,A,F17.2,A,F17.2,A)') 'Calculation finished in CPUtime',& write(f_output,'(X,A,F17.2,A,F17.2,A)') 'Calculation finished in CPUtime',&
tend-tstart,'s Walltime:', & tend-tstart,'s Walltime:', &
wend-wstart,'s' wend-wstart,'s'
write(f_output,*) 'Calculation finished on ', date(7:8),'-',date(5:6),& write(f_output,*) 'Calculation finished on ', date(7:8),'-',date(5:6),&
'-',date(1:4), ' at ', time(1:2),':',time(3:4) '-',date(1:4), ' at ', time(1:2),':',time(3:4)
flush(f_output)
!!$ Clean !!$ Clean
call detact_all_free(r) call detact_all_free(r)
......
&sassinp
prefix="cuo",
prt_cipci=.false.,
restart=.false.
lexplicitHmat = .false.,
iprint=1
&end
&infomolcasinp
nirrep=1,
ntot=8,
iIrTb(1,1) = 1,
iChTb(1,1) = 1
&end
&orbinp
norb_gel = 40,
norb_occ = 0,
norb_ligo = 2,
norb_act = 2,
norb_ligv = 0,
norb_virt = 4,
norb_del = 70
&end
&vecinp
stot=1,
sz=0,
vec_irrep=1,
nvec=2,
nref0=1,
nelact = 2
&end
&davidinp
NiterDavidson = 50,
SizeheffDavidson = 5,
tol_conv = 1.d-16,
&end
&propinp
nprop = 2,
whichprop="WF", "dens"
&end
This diff is collapsed.
#!/usr/bin/env python
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_relaxse import Filter, TestRun
test = TestRun(__file__, sys.argv)
f = Filter()
f.add(string = ' 41 41',
abs_tolerance = 1.0e-12)
f.add(string = ' 43 44',
abs_tolerance = 1.0e-12)
f.add(string = ' 44 44',
abs_tolerance = 1.0e-12)
f.add(string = '45 42',
abs_tolerance = 1.0e-12)
f.add(string = '45 47',
abs_tolerance = 1.0e-12)
test.run(['cuo.input'], {'propout': f}, prop=True)
sys.exit(test.return_code)
#
#
&sassinp
prefix="cuo",
prt_cipci=.false.,
restart=.false.
lexplicitHmat = .false.,
iprint=1
&end
&infomolcasinp
nirrep=1,
ntot=8,
iIrTb(1,1) = 1,
iChTb(1,1) = 1
&end
&orbinp
norb_gel = 40,
norb_occ = 0,
norb_ligo = 2,
norb_act = 2,
norb_ligv = 4,
norb_virt = 0,
norb_del = 70
&end
&vecinp
stot=1,
sz=0,
vec_irrep=1,
nvec=2,
nref0=1,
nelact = 2
&end
&davidinp
NiterDavidson = 50,
SizeheffDavidson = 5,
tol_conv = 1.d-16,
&end
&propinp
nprop = 2,
whichprop="WF", "dens"
&end
This diff is collapsed.
#!/usr/bin/env python
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_relaxse import Filter, TestRun
test = TestRun(__file__, sys.argv)
f = Filter()
f.add(string = ' 41 41',
abs_tolerance = 1.0e-12)
f.add(string = ' 43 44',
abs_tolerance = 1.0e-12)
f.add(string = ' 44 44',
abs_tolerance = 1.0e-12)
f.add(string = '45 42',
abs_tolerance = 1.0e-12)
f.add(string = '45 47',
abs_tolerance = 1.0e-12)
test.run(['cuo.input'], {'propout': f}, prop=True)
sys.exit(test.return_code)
#
#
&sassinp
prefix="cuo",
prt_cipci=.false.,
iprint=1
&end
&infomolcasinp
nirrep=1,
ntot=12,
iIrTb(1,1) = 1,
iChTb(1,1) = 1
&end
&orbinp
norb_gel = 38,
norb_occ = 0,
norb_ligo = 3,
norb_act = 4,
norb_ligv = 5,
norb_virt = 0,
norb_del = 68
&end
&vecinp
stot=1,
sz=0,