10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-12-22 12:23:30 +01:00

build_psi_SVD

This commit is contained in:
Abdallah Ammar 2021-05-26 09:39:57 +02:00
parent 12d8e84ddf
commit 1b9215d45c
6 changed files with 215 additions and 72 deletions

View File

@ -43,10 +43,17 @@ spindeterminants
psi_coef_matrix_rows integer (spindeterminants_n_det) psi_coef_matrix_rows integer (spindeterminants_n_det)
psi_coef_matrix_columns integer (spindeterminants_n_det) psi_coef_matrix_columns integer (spindeterminants_n_det)
psi_coef_matrix_values double precision (spindeterminants_n_det,spindeterminants_n_states) psi_coef_matrix_values double precision (spindeterminants_n_det,spindeterminants_n_states)
n_svd_coefs integer n_svd_coefs_unique integer
psi_svd_alpha double precision (spindeterminants_n_det_alpha,spindeterminants_n_svd_coefs,spindeterminants_n_states) n_svd_coefs integer
psi_svd_beta double precision (spindeterminants_n_det_beta,spindeterminants_n_svd_coefs,spindeterminants_n_states) n_svd_selected integer
psi_svd_coefs double precision (spindeterminants_n_svd_coefs,spindeterminants_n_states) n_svd_toselect integer
psi_svd_alpha_unique double precision (spindeterminants_n_det_alpha,spindeterminants_n_svd_coefs_unique,spindeterminants_n_states)
psi_svd_beta_unique double precision (spindeterminants_n_det_beta,spindeterminants_n_svd_coefs_unique,spindeterminants_n_states)
psi_svd_coefs_unique double precision (spindeterminants_n_svd_coefs_unique,spindeterminants_n_states)
psi_svd_alpha_numselected integer (spindeterminants_n_svd_selected,spindeterminants_n_states)
psi_svd_beta_numselected integer (spindeterminants_n_svd_selected,spindeterminants_n_states)
psi_svd_alpha_numtoselect integer (spindeterminants_n_svd_toselect,spindeterminants_n_states)
psi_svd_beta_numtoselect integer (spindeterminants_n_svd_toselect,spindeterminants_n_states)
simulation simulation
do_run integer do_run integer

View File

@ -23,7 +23,7 @@ END_PROVIDER
BEGIN_PROVIDER [ double precision, ci_h_psidet, (size_ci_h_psidet) ] BEGIN_PROVIDER [ double precision, ci_h_psidet, (size_ci_h_psidet) ]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! < Phi_0 | det(j) > ! < Phi_0 | H | det(j) >
! !
! Dimensions : det_num ! Dimensions : det_num
END_DOC END_DOC
@ -54,7 +54,7 @@ END_PROVIDER
BEGIN_PROVIDER [ double precision, ci_overlap_matrix, (size_ci_overlap_matrix) ] BEGIN_PROVIDER [ double precision, ci_overlap_matrix, (size_ci_overlap_matrix) ]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! < det(i) |H| det(j) > ! < det(i) | det(j) >
! !
! Dimensions : det_num*det_num ! Dimensions : det_num*det_num
END_DOC END_DOC

View File

@ -70,14 +70,21 @@ BEGIN_PROVIDER [ double precision, ci_overlap_matrix_postSVD, (size_ci_overlap_m
END_DOC END_DOC
integer :: k, kp, l, lp integer :: k, kp, l, lp
integer :: ii0, ii1, ii2, ii
double precision :: f double precision :: f
do k = 1, n_svd_coefs do k = 1, n_svd_coefs
ii0 = (k-1)*n_svd_coefs3
do kp = 1, n_svd_coefs do kp = 1, n_svd_coefs
ii1 = ii0 + (kp-1)*n_svd_coefs2
f = det_alpha_value_SVD(k) * det_beta_value_SVD(kp) * psidet_inv_SVD * psidet_inv_SVD f = det_alpha_value_SVD(k) * det_beta_value_SVD(kp) * psidet_inv_SVD * psidet_inv_SVD
do l = 1, n_svd_coefs do l = 1, n_svd_coefs
ii2 = ii1 + (l-1)*n_svd_coefs
do lp = 1, n_svd_coefs do lp = 1, n_svd_coefs
ci_overlap_matrix_postSVD(lp+(l-1)*n_svd_coefs+(kp-1)*n_svd_coefs2+(k-1)*n_svd_coefs3) = det_alpha_value_SVD(l) * det_beta_value_SVD(lp) * f ii = ii2 + lp
ci_overlap_matrix_postSVD(ii) = det_alpha_value_SVD(l) * det_beta_value_SVD(lp) * f
enddo enddo
enddo enddo
enddo enddo
@ -102,10 +109,14 @@ BEGIN_PROVIDER [ double precision, ci_h_matrix_postSVD, (size_ci_h_matrix_postSV
END_DOC END_DOC
integer :: k, kp, l, lp, e integer :: k, kp, l, lp, e
integer :: ii0, ii1, ii2, ii
double precision :: f, g, h, T, V double precision :: f, g, h, T, V
do l = 1, n_svd_coefs do l = 1, n_svd_coefs
ii0 = (l-1)*n_svd_coefs3
do lp = 1, n_svd_coefs do lp = 1, n_svd_coefs
ii1 = ii0 + (lp-1)*n_svd_coefs2
! Lapl D ! Lapl D
g = 0.d0 g = 0.d0
do e = 1, elec_alpha_num do e = 1, elec_alpha_num
@ -115,12 +126,14 @@ BEGIN_PROVIDER [ double precision, ci_h_matrix_postSVD, (size_ci_h_matrix_postSV
g += det_alpha_value_SVD(l) * det_beta_grad_lapl_SVD(4,e,lp) g += det_alpha_value_SVD(l) * det_beta_grad_lapl_SVD(4,e,lp)
enddo enddo
T = g T = g
! D (Lapl J)/J ! D (Lapl J)/J
g = 0.d0 g = 0.d0
do e = 1, elec_num do e = 1, elec_num
g += jast_lapl_jast_inv(e) g += jast_lapl_jast_inv(e)
enddo enddo
T += det_alpha_value_SVD(l) * det_beta_value_SVD(lp) * g T += det_alpha_value_SVD(l) * det_beta_value_SVD(lp) * g
! 2 (grad D).(Grad J)/J ! 2 (grad D).(Grad J)/J
g = 0.d0 g = 0.d0
do e = 1, elec_alpha_num do e = 1, elec_alpha_num
@ -137,6 +150,7 @@ BEGIN_PROVIDER [ double precision, ci_h_matrix_postSVD, (size_ci_h_matrix_postSV
det_beta_grad_lapl_SVD(3,e,lp) * jast_grad_jast_inv_z(e) det_beta_grad_lapl_SVD(3,e,lp) * jast_grad_jast_inv_z(e)
enddo enddo
T += 2.d0 * ( g * det_beta_value_SVD(lp) + h * det_alpha_value_SVD(l) ) T += 2.d0 * ( g * det_beta_value_SVD(lp) + h * det_alpha_value_SVD(l) )
g = det_alpha_value_SVD(l) * det_beta_value_SVD(lp) g = det_alpha_value_SVD(l) * det_beta_value_SVD(lp)
V = E_pot * g V = E_pot * g
do e = 1, elec_alpha_num do e = 1, elec_alpha_num
@ -147,13 +161,18 @@ BEGIN_PROVIDER [ double precision, ci_h_matrix_postSVD, (size_ci_h_matrix_postSV
V -= pseudo_non_local_SVD(e) * g V -= pseudo_non_local_SVD(e) * g
V += det_alpha_value_SVD(l) * det_beta_pseudo_SVD(e,lp) V += det_alpha_value_SVD(l) * det_beta_pseudo_SVD(e,lp)
enddo enddo
f = -0.5d0*T + V f = -0.5d0*T + V
f *= psidet_inv_SVD * psidet_inv_SVD f *= psidet_inv_SVD * psidet_inv_SVD
do k = 1, n_svd_coefs do k = 1, n_svd_coefs
ii2 = ii1 + (k-1)*n_svd_coefs
do kp = 1, n_svd_coefs do kp = 1, n_svd_coefs
ci_h_matrix_postSVD(kp+(k-1)*n_svd_coefs+(lp-1)*n_svd_coefs2+(l-1)*n_svd_coefs3) = f * det_alpha_value_SVD(k) * det_beta_value_SVD(kp) ii = ii2 + kp
ci_h_matrix_postSVD(ii) = f * det_alpha_value_SVD(k) * det_beta_value_SVD(kp)
enddo enddo
enddo enddo
enddo enddo
enddo enddo
@ -176,10 +195,14 @@ BEGIN_PROVIDER [ double precision, ci_h_matrix_diag_postSVD, (size_ci_h_matrix_d
END_DOC END_DOC
integer :: l, lp, e integer :: l, lp, e
integer :: ii0, ii
double precision :: f, g, h, T, V double precision :: f, g, h, T, V
do l = 1, n_svd_coefs do l = 1, n_svd_coefs
ii0 = (l-1)*n_svd_coefs
do lp = 1, n_svd_coefs do lp = 1, n_svd_coefs
ii = ii0 + lp
! Lapl D ! Lapl D
g = 0.d0 g = 0.d0
do e = 1, elec_alpha_num do e = 1, elec_alpha_num
@ -223,7 +246,7 @@ BEGIN_PROVIDER [ double precision, ci_h_matrix_diag_postSVD, (size_ci_h_matrix_d
enddo enddo
f = -0.5d0*T + V f = -0.5d0*T + V
f *= psidet_inv_SVD * psidet_inv_SVD f *= psidet_inv_SVD * psidet_inv_SVD
ci_h_matrix_diag_postSVD(lp+(l-1)*n_svd_coefs) = f * det_alpha_value_SVD(l) * det_beta_value_SVD(lp) ci_h_matrix_diag_postSVD(ii) = f * det_alpha_value_SVD(l) * det_beta_value_SVD(lp)
enddo enddo
enddo enddo

View File

@ -1648,53 +1648,125 @@ END_PROVIDER
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ! ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~ ~~ ~
BEGIN_PROVIDER [ integer, n_svd_coefs_unique ]
implicit none
BEGIN_DOC
! !!!
! rank of Full SVD
END_DOC
call get_spindeterminants_n_svd_coefs_unique(n_svd_coefs_unique)
END_PROVIDER
BEGIN_PROVIDER [ double precision, psi_svd_coefs_unique, ( n_svd_coefs_unique, n_states) ]
&BEGIN_PROVIDER [ double precision, psi_svd_alpha_unique, (det_alpha_num, n_svd_coefs_unique, n_states) ]
&BEGIN_PROVIDER [ double precision, psi_svd_beta_unique , (det_beta_num , n_svd_coefs_unique, n_states) ]
implicit none
BEGIN_DOC
! Full SVD:
! SVD coeff unique
! SVD U unique
! SVD Vt unique
END_DOC
call get_spindeterminants_psi_svd_coefs_unique(psi_svd_coefs_unique)
call get_spindeterminants_psi_svd_alpha_unique(psi_svd_alpha_unique)
call get_spindeterminants_psi_svd_beta_unique (psi_svd_beta_unique )
END_PROVIDER
BEGIN_PROVIDER [ double precision, det_alpha_value_SVD_unique, ( n_svd_coefs_unique) ]
&BEGIN_PROVIDER [ double precision, det_beta_value_SVD_unique , ( n_svd_coefs_unique) ]
&BEGIN_PROVIDER [ double precision, det_alpha_grad_lapl_SVD_unique, (4, elec_alpha_num , n_svd_coefs_unique) ]
&BEGIN_PROVIDER [ double precision, det_beta_grad_lapl_SVD_unique , (4, elec_alpha_num+1:elec_num, n_svd_coefs_unique) ]
implicit none
BEGIN_DOC
! !!!
END_DOC
integer :: mm
integer, save :: ifirst = 0
if (ifirst == 0) then
ifirst = 1
det_alpha_value_SVD_unique = 0.d0
det_beta_value_SVD_unique = 0.d0
det_alpha_grad_lapl_SVD_unique = 0.d0
det_beta_grad_lapl_SVD_unique = 0.d0
endif
! det_alpha_value_SVD_unique = psi_svd_alpha_unique.T @ det_alpha_value
call dgemv('T', det_alpha_num, n_svd_coefs_unique &
, 1.d0, psi_svd_alpha_unique(:,:,1), size(psi_svd_alpha_unique,1), det_alpha_value, 1 &
, 0.d0, det_alpha_value_SVD_unique, 1)
! det_beta_value_SVD_unique = psi_svd_beta_unique.T @ det_beta_value
call dgemv('T', det_beta_num, n_svd_coefs_unique &
, 1.d0, psi_svd_beta_unique(:,:,1), size(psi_svd_beta_unique,1), det_beta_value, 1 &
, 0.d0, det_beta_value_SVD_unique, 1)
do mm = 1, 4
call dgemm('N', 'N', elec_alpha_num, n_svd_coefs_unique, det_alpha_num, 1.d0 &
, det_alpha_grad_lapl(mm,:,:), size(det_alpha_grad_lapl,2) &
, psi_svd_alpha_unique(:,:,1), size(psi_svd_alpha_unique,1) &
, 0.d0, det_alpha_grad_lapl_SVD_unique(mm,:,:), size(det_alpha_grad_lapl_SVD_unique,2) )
if (elec_beta_num /= 0) then
call dgemm('N', 'N', elec_beta_num, n_svd_coefs_unique, det_beta_num, 1.d0 &
, det_beta_grad_lapl(mm,:,:), size(det_beta_grad_lapl,2) &
, psi_svd_beta_unique(:,:,1), size(psi_svd_beta_unique,1) &
, 0.d0, det_beta_grad_lapl_SVD_unique(mm,:,:), size(det_beta_grad_lapl_SVD_unique,2) )
endif
enddo
END_PROVIDER
BEGIN_PROVIDER [ logical, utilise_SVD ] BEGIN_PROVIDER [ logical, utilise_SVD ]
&BEGIN_PROVIDER [ integer, n_svd_coefs ] &BEGIN_PROVIDER [ integer, n_svd_coefs ]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! SVD rank ! truncated SVD rank
END_DOC END_DOC
n_svd_coefs = -1 n_svd_coefs = -1
call get_spindeterminants_n_svd_coefs(n_svd_coefs) call get_spindeterminants_n_svd_coefs(n_svd_coefs)
utilise_SVD = n_svd_coefs > 0 utilise_SVD = n_svd_coefs > 0
if (.not.utilise_SVD) then if (.not.utilise_SVD) then
n_svd_coefs = 1 n_svd_coefs = 1
endif endif
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ integer, n_svd_coefs2 ] BEGIN_PROVIDER [ integer, n_svd_coefs2 ]
&BEGIN_PROVIDER [ integer, n_svd_coefs3 ] &BEGIN_PROVIDER [ integer, n_svd_coefs3 ]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! square and cube of n_svd_coefs ! square and cube of n_svd_coefs
END_DOC END_DOC
n_svd_coefs2 = n_svd_coefs * n_svd_coefs n_svd_coefs2 = n_svd_coefs * n_svd_coefs
n_svd_coefs3 = n_svd_coefs * n_svd_coefs * n_svd_coefs n_svd_coefs3 = n_svd_coefs * n_svd_coefs * n_svd_coefs
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ double precision, psi_svd_alpha, (det_alpha_num, n_svd_coefs, n_states) ]
&BEGIN_PROVIDER [ double precision, psi_svd_coefs, (n_svd_coefs, n_states) ]
&BEGIN_PROVIDER [ double precision, psi_svd_beta, (det_beta_num, n_svd_coefs, n_states) ]
implicit none
BEGIN_DOC
! SVD U
! SVD sigma
! SVD Vt
END_DOC
call get_spindeterminants_psi_svd_alpha(psi_svd_alpha)
call get_spindeterminants_psi_svd_coefs(psi_svd_coefs)
call get_spindeterminants_psi_svd_beta(psi_svd_beta)
END_PROVIDER
!!!!!!!!!!!!!!!!
! ! ! ! ! ! ! !
!!!!!!!!!!!!!!!!
BEGIN_PROVIDER [ double precision, psi_svd_coefs, ( n_svd_coefs, n_states) ]
&BEGIN_PROVIDER [ double precision, psi_svd_alpha, (det_alpha_num, n_svd_coefs, n_states) ]
&BEGIN_PROVIDER [ double precision, psi_svd_beta , (det_beta_num , n_svd_coefs, n_states) ]
implicit none
BEGIN_DOC
! !!!
! truncated SVD
END_DOC
integer :: l
do l = 1, n_svd_coefs
psi_svd_coefs(l,1) = psi_svd_coefs_unique(l,1)
psi_svd_alpha(:,l,1) = psi_svd_alpha_unique(:,l,1)
psi_svd_beta (:,l,1) = psi_svd_beta_unique (:,l,1)
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, det_alpha_value_SVD, (n_svd_coefs) ] BEGIN_PROVIDER [ double precision, det_alpha_value_SVD, (n_svd_coefs) ]
@ -1729,7 +1801,6 @@ END_PROVIDER
! !!! ! !!!
! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ ! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
!do l = 1, n_svd_coefs !do l = 1, n_svd_coefs
! tmp = 0.d0 ! tmp = 0.d0
! do ii = 1, det_alpha_num ! do ii = 1, det_alpha_num
@ -1743,12 +1814,9 @@ END_PROVIDER
! det_beta_value_SVD(l) = tmp ! det_beta_value_SVD(l) = tmp
!enddo !enddo
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ double precision, psidet_value_SVD ] BEGIN_PROVIDER [ double precision, psidet_value_SVD ]
&BEGIN_PROVIDER [ double precision, psidet_inv_SVD ] &BEGIN_PROVIDER [ double precision, psidet_inv_SVD ]
&BEGIN_PROVIDER [ double precision, det_alpha_pseudo_SVD, (elec_alpha_num, n_svd_coefs) ] &BEGIN_PROVIDER [ double precision, det_alpha_pseudo_SVD, (elec_alpha_num, n_svd_coefs) ]
@ -1781,7 +1849,6 @@ END_PROVIDER
! !!! ! !!!
! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ ! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ ! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
! !!! ! !!!
if (do_pseudo) then if (do_pseudo) then
@ -1800,8 +1867,6 @@ END_PROVIDER
! !!! ! !!!
! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ ! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
!do l = 1, n_svd_coefs !do l = 1, n_svd_coefs
! do ee = 1, elec_alpha_num ! do ee = 1, elec_alpha_num
! tmp = 0.d0 ! tmp = 0.d0
@ -1823,13 +1888,6 @@ END_PROVIDER
END_PROVIDER END_PROVIDER
!!!!!!!!!!!!!!!!
! ! ! ! ! ! ! !
!!!!!!!!!!!!!!!!
BEGIN_PROVIDER [ double precision, det_alpha_grad_lapl_SVD, (4, elec_alpha_num , n_svd_coefs) ] BEGIN_PROVIDER [ double precision, det_alpha_grad_lapl_SVD, (4, elec_alpha_num , n_svd_coefs) ]
&BEGIN_PROVIDER [ double precision, det_beta_grad_lapl_SVD , (4, elec_alpha_num+1:elec_num, n_svd_coefs) ] &BEGIN_PROVIDER [ double precision, det_beta_grad_lapl_SVD , (4, elec_alpha_num+1:elec_num, n_svd_coefs) ]
@ -1849,7 +1907,6 @@ END_PROVIDER
det_beta_grad_lapl_SVD = 0.d0 det_beta_grad_lapl_SVD = 0.d0
endif endif
! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ ! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
! !!! ! !!!
do mm = 1, 4 do mm = 1, 4
@ -1892,8 +1949,6 @@ END_PROVIDER
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ double precision, psidet_grad_lapl_SVD, (4,elec_num) ] BEGIN_PROVIDER [ double precision, psidet_grad_lapl_SVD, (4,elec_num) ]
&BEGIN_PROVIDER [ double precision, pseudo_non_local_SVD, (elec_num) ] &BEGIN_PROVIDER [ double precision, pseudo_non_local_SVD, (elec_num) ]
@ -1950,7 +2005,6 @@ END_PROVIDER
! !!! ! !!!
! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ ! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ ! -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
! !!! ! !!!
if (do_pseudo) then if (do_pseudo) then
@ -1991,6 +2045,57 @@ END_PROVIDER
!____________________________________________________________________________________________________________________
BEGIN_PROVIDER [ integer, n_svd_selected ]
&BEGIN_PROVIDER [ integer, n_svd_toselect ]
implicit none
BEGIN_DOC
! !!!
! n_svd_selected : rank of selected space ( ~ n_svd x n_svd )
! n_svd_toselect : rank space to select from ( ~ na x nb - n_svd x n_svd_toselect )
! !!!
END_DOC
call get_spindeterminants_n_svd_selected(n_svd_selected)
call get_spindeterminants_n_svd_toselect(n_svd_toselect)
END_PROVIDER
BEGIN_PROVIDER [ integer, psi_svd_alpha_numselected, (n_svd_selected , n_states) ]
&BEGIN_PROVIDER [ integer, psi_svd_beta_numselected , (n_svd_coefs , n_states) ]
&BEGIN_PROVIDER [ integer, psi_svd_alpha_numtoselect, (n_svd_toselect, n_states) ]
&BEGIN_PROVIDER [ integer, psi_svd_beta_numtoselect , (n_svd_toselect, n_states) ]
implicit none
BEGIN_DOC
! !!!
! pairs of integers indicating the number of the vectors U and V
! !!!
END_DOC
call get_spindeterminants_psi_svd_alpha_numselected(psi_svd_alpha_numselected)
call get_spindeterminants_psi_svd_beta_numselected (psi_svd_beta_numselected )
call get_spindeterminants_psi_svd_alpha_numtoselect(psi_svd_alpha_numtoselect)
call get_spindeterminants_psi_svd_beta_numtoselect (psi_svd_beta_numtoselect )
END_PROVIDER
! BEGIN_PROVIDER [ double precision, psi_svd_alpha_toselect, (det_alpha_num, n_svd_toselect, n_states) ]
!&BEGIN_PROVIDER [ double precision, psi_svd_beta_toselect , (det_beta_num , n_svd_toselect, n_states) ]
! implicit none
! BEGIN_DOC
! ! !!!
! ! pair of | u_i v_j > to select from SVD
! ! !!!
! END_DOC
! integer :: l, i, j
! do l = 1, n_svd_toselect
! i = psi_svd_alpha_numtoselect(l,1)
! j = psi_svd_beta_numtoselect (l,1)
! psi_svd_alpha_toselect(:,l,1) = psi_svd_alpha_unique(:,i,1)
! psi_svd_beta_toselect (:,l,1) = psi_svd_beta_unique (:,j,1)
! enddo
! END_PROVIDER
!____________________________________________________________________________________________________________________

View File

@ -48,10 +48,17 @@ data = [ \
("simulation_e_trial" , "double precision" , "" ), ("simulation_e_trial" , "double precision" , "" ),
("simulation_do_run" , "logical " , "" ), ("simulation_do_run" , "logical " , "" ),
("pseudo_do_pseudo" , "logical " , "" ), ("pseudo_do_pseudo" , "logical " , "" ),
("spindeterminants_n_svd_coefs", "integer", ""), ("spindeterminants_n_svd_coefs_unique", "integer", ""),
("spindeterminants_psi_svd_alpha", "double precision", "(det_alpha_num,n_svd_coefs,n_states)"), ("spindeterminants_n_svd_coefs" , "integer", ""),
("spindeterminants_psi_svd_beta", "double precision", "(det_beta_num,n_svd_coefs,n_states)"), ("spindeterminants_n_svd_selected" , "integer", ""),
("spindeterminants_psi_svd_coefs", "double precision", "(n_svd_coefs,n_states)") ("spindeterminants_n_svd_toselect" , "integer", ""),
("spindeterminants_psi_svd_alpha_unique", "double precision", "(det_alpha_num,n_svd_coefs_unique,n_states)"),
("spindeterminants_psi_svd_beta_unique" , "double precision", "(det_beta_num,n_svd_coefs_unique,n_states)"),
("spindeterminants_psi_svd_coefs_unique", "double precision", "(n_svd_coefs_unique,n_states)"),
("spindeterminants_psi_svd_alpha_numselected" , "integer", "(n_svd_selected,n_states)"),
("spindeterminants_psi_svd_beta_numselected" , "integer", "(n_svd_selected,n_states)"),
("spindeterminants_psi_svd_alpha_numtoselect" , "integer", "(n_svd_toselect,n_states)"),
("spindeterminants_psi_svd_beta_numtoselect" , "integer", "(n_svd_toselect,n_states)"),
] ]
data_no_set = [\ data_no_set = [\

View File

@ -383,7 +383,7 @@ if __name__ == '__main__':
t0 = time.time() t0 = time.time()
# !!! # !!!
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ # # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ #
EZFIO_file = "/home/aammar/qp2/src/svdwf/h2o_631g_frez_nsvd10" EZFIO_file = "/home/aammar/qp2/src/svdwf/h2o_631g_frez_Jopt_nsvd20"
E_toadd = 9.194966082434476 #6.983610961797779 E_toadd = 9.194966082434476 #6.983610961797779
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ # # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ #
# !!! # !!!
@ -468,6 +468,7 @@ if __name__ == '__main__':
ezfio.set_spindeterminants_psi_svd_alpha( U_postSVD_toEZFIO ) ezfio.set_spindeterminants_psi_svd_alpha( U_postSVD_toEZFIO )
ezfio.set_spindeterminants_psi_svd_coefs( sigma_postsvd_diag ) ezfio.set_spindeterminants_psi_svd_coefs( sigma_postsvd_diag )
ezfio.set_spindeterminants_psi_svd_beta( V_postSVD_toEZFIO ) ezfio.set_spindeterminants_psi_svd_beta( V_postSVD_toEZFIO )
print(sigma_postsvd_diag)
# !!! # !!!
else: else:
print("end after {:.3f} minutes".format((time.time()-t0)/60.) ) print("end after {:.3f} minutes".format((time.time()-t0)/60.) )