mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-21 11:03:29 +01:00
Merge branch 'dev' of https://github.com/QuantumPackage/qp2 into dev
This commit is contained in:
commit
789dacb6af
@ -6,6 +6,7 @@ Usage:
|
||||
qp_plugins download <url> [-n <name>]
|
||||
qp_plugins install <name>...
|
||||
qp_plugins uninstall <name>
|
||||
qp_plugins remove <name>
|
||||
qp_plugins update [-r <repo>]
|
||||
qp_plugins create -n <name> [-r <repo>] [<needed_modules>...]
|
||||
|
||||
@ -24,6 +25,8 @@ Options:
|
||||
|
||||
uninstall Uninstall a plugin
|
||||
|
||||
remove Uninstall a plugin
|
||||
|
||||
update Update the repository
|
||||
|
||||
create
|
||||
@ -274,7 +277,7 @@ def main(arguments):
|
||||
subprocess.check_call(["qp_create_ninja", "update"])
|
||||
print("[ OK ]")
|
||||
|
||||
elif arguments["uninstall"]:
|
||||
elif arguments["uninstall"] or arguments["remove"]:
|
||||
|
||||
m_instance = ModuleHandler([QP_SRC])
|
||||
d_descendant = m_instance.dict_descendant
|
||||
|
@ -204,6 +204,9 @@ _qp_Complete()
|
||||
uninstall)
|
||||
COMPREPLY=( $(compgen -W "$(qp_plugins list -i)" -- $cur ) )
|
||||
return 0;;
|
||||
remove)
|
||||
COMPREPLY=( $(compgen -W "$(qp_plugins list -i)" -- $cur ) )
|
||||
return 0;;
|
||||
create)
|
||||
COMPREPLY=( $(compgen -W "-n " -- $cur ) )
|
||||
return 0;;
|
||||
|
@ -116,6 +116,7 @@ def get_l_module_descendant(d_child, l_module):
|
||||
print("Error: ", file=sys.stderr)
|
||||
print("`{0}` is not a submodule".format(module), file=sys.stderr)
|
||||
print("Check the typo (spelling, case, '/', etc.) ", file=sys.stderr)
|
||||
# pass
|
||||
sys.exit(1)
|
||||
|
||||
return list(set(l))
|
||||
|
@ -58,3 +58,17 @@ END_PROVIDER
|
||||
enddo
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [double precision, final_grid_points_transp, (n_points_final_grid,3)]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Transposed final_grid_points
|
||||
END_DOC
|
||||
|
||||
integer :: i,j
|
||||
do j=1,3
|
||||
do i=1,n_points_final_grid
|
||||
final_grid_points_transp(i,j) = final_grid_points(j,i)
|
||||
enddo
|
||||
enddo
|
||||
END_PROVIDER
|
||||
|
@ -38,6 +38,8 @@ subroutine convertWFfromDETtoCSF(N_st,psi_coef_det_in, psi_coef_cfg_out)
|
||||
|
||||
integer s, bfIcfg
|
||||
integer countcsf
|
||||
integer MS
|
||||
MS = elec_alpha_num-elec_beta_num
|
||||
countcsf = 0
|
||||
phasedet = 1.0d0
|
||||
do i = 1,N_configuration
|
||||
@ -56,12 +58,17 @@ subroutine convertWFfromDETtoCSF(N_st,psi_coef_det_in, psi_coef_cfg_out)
|
||||
enddo
|
||||
enddo
|
||||
|
||||
s = 0
|
||||
s = 0 ! s == total number of SOMOs
|
||||
do k=1,N_int
|
||||
if (psi_configuration(k,1,i) == 0_bit_kind) cycle
|
||||
s = s + popcnt(psi_configuration(k,1,i))
|
||||
enddo
|
||||
|
||||
if(iand(s,1) .EQ. 0) then
|
||||
bfIcfg = max(1,nint((binom(s,s/2)-binom(s,(s/2)+1))))
|
||||
else
|
||||
bfIcfg = max(1,nint((binom(s,(s+1)/2)-binom(s,((s+1)/2)+1))))
|
||||
endif
|
||||
|
||||
! perhaps blocking with CFGs of same seniority
|
||||
! can be more efficient
|
||||
|
@ -65,23 +65,9 @@
|
||||
dimcsfpercfg = 2
|
||||
else
|
||||
if(iand(MS,1) .EQ. 0) then
|
||||
!dimcsfpercfg = max(1,nint((binom(i,i/2)-binom(i,i/2+1))))
|
||||
binom1 = dexp(logabsgamma(1.0d0*(i+1)) &
|
||||
- logabsgamma(1.0d0*((i/2)+1)) &
|
||||
- logabsgamma(1.0d0*(i-((i/2))+1)));
|
||||
binom2 = dexp(logabsgamma(1.0d0*(i+1)) &
|
||||
- logabsgamma(1.0d0*(((i/2)+1)+1)) &
|
||||
- logabsgamma(1.0d0*(i-((i/2)+1)+1)));
|
||||
dimcsfpercfg = max(1,nint(binom1 - binom2))
|
||||
dimcsfpercfg = max(1,nint((binom(i,i/2)-binom(i,i/2+1))))
|
||||
else
|
||||
!dimcsfpercfg = max(1,nint((binom(i,(i+1)/2)-binom(i,(i+3)/2))))
|
||||
binom1 = dexp(logabsgamma(1.0d0*(i+1)) &
|
||||
- logabsgamma(1.0d0*(((i+1)/2)+1)) &
|
||||
- logabsgamma(1.0d0*(i-(((i+1)/2))+1)));
|
||||
binom2 = dexp(logabsgamma(1.0d0*(i+1)) &
|
||||
- logabsgamma(1.0d0*((((i+3)/2)+1)+1)) &
|
||||
- logabsgamma(1.0d0*(i-(((i+3)/2)+1)+1)));
|
||||
dimcsfpercfg = max(1,nint(binom1 - binom2))
|
||||
dimcsfpercfg = max(1,nint((binom(i,(i+1)/2)-binom(i,(i+3)/2))))
|
||||
endif
|
||||
endif
|
||||
n_CSF += ncfg * dimcsfpercfg
|
||||
|
@ -299,7 +299,7 @@ subroutine davidson_diag_csf_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,sze_csf,N
|
||||
shift = N_st_diag*(iter-1)
|
||||
shift2 = N_st_diag*iter
|
||||
|
||||
if ((iter > 1).or.(itertot == 1)) then
|
||||
! if ((iter > 1).or.(itertot == 1)) then
|
||||
! Compute |W_k> = \sum_i |i><i|H|u_k>
|
||||
! -----------------------------------
|
||||
|
||||
@ -309,10 +309,10 @@ subroutine davidson_diag_csf_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,sze_csf,N
|
||||
else
|
||||
call H_u_0_nstates_openmp(W,U,N_st_diag,sze)
|
||||
endif
|
||||
else
|
||||
! Already computed in update below
|
||||
continue
|
||||
endif
|
||||
! else
|
||||
! ! Already computed in update below
|
||||
! continue
|
||||
! endif
|
||||
|
||||
if (dressing_state > 0) then
|
||||
|
||||
@ -508,17 +508,8 @@ subroutine davidson_diag_csf_hjj(dets_in,u_in,H_jj,energies,dim_in,sze,sze_csf,N
|
||||
|
||||
enddo
|
||||
|
||||
! Re-contract U and update W
|
||||
! --------------------------------
|
||||
|
||||
call dgemm('N','N', sze_csf, N_st_diag, shift2, 1.d0, &
|
||||
W_csf, size(W_csf,1), y, size(y,1), 0.d0, u_in, size(u_in,1))
|
||||
do k=1,N_st_diag
|
||||
do i=1,sze_csf
|
||||
W_csf(i,k) = u_in(i,k)
|
||||
enddo
|
||||
enddo
|
||||
call convertWFfromCSFtoDET(N_st_diag,W_csf,W)
|
||||
! Re-contract U
|
||||
! -------------
|
||||
|
||||
call dgemm('N','N', sze_csf, N_st_diag, shift2, 1.d0, &
|
||||
U_csf, size(U_csf,1), y, size(y,1), 0.d0, u_in, size(u_in,1))
|
||||
|
@ -349,7 +349,7 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_
|
||||
shift = N_st_diag*(iter-1)
|
||||
shift2 = N_st_diag*iter
|
||||
|
||||
if ((iter > 1).or.(itertot == 1)) then
|
||||
! if ((iter > 1).or.(itertot == 1)) then
|
||||
! Compute |W_k> = \sum_i |i><i|H|u_k>
|
||||
! -----------------------------------
|
||||
|
||||
@ -359,10 +359,10 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_
|
||||
call H_S2_u_0_nstates_openmp(W(1,shift+1),S_d,U(1,shift+1),N_st_diag,sze)
|
||||
endif
|
||||
S(1:sze,shift+1:shift+N_st_diag) = real(S_d(1:sze,1:N_st_diag))
|
||||
else
|
||||
! Already computed in update below
|
||||
continue
|
||||
endif
|
||||
! else
|
||||
! ! Already computed in update below
|
||||
! continue
|
||||
! endif
|
||||
|
||||
if (dressing_state > 0) then
|
||||
|
||||
|
@ -3,6 +3,7 @@ BEGIN_PROVIDER [ double precision, CI_energy, (N_states_diag) ]
|
||||
BEGIN_DOC
|
||||
! :c:data:`n_states` lowest eigenvalues of the |CI| matrix
|
||||
END_DOC
|
||||
PROVIDE distributed_davidson
|
||||
|
||||
integer :: j
|
||||
character*(8) :: st
|
||||
@ -246,6 +247,7 @@ subroutine diagonalize_CI
|
||||
! eigenstates of the |CI| matrix.
|
||||
END_DOC
|
||||
integer :: i,j
|
||||
PROVIDE distributed_davidson
|
||||
do j=1,N_states
|
||||
do i=1,N_det
|
||||
psi_coef(i,j) = CI_eigenvectors(i,j)
|
||||
|
@ -8,7 +8,7 @@ subroutine set_multiple_levels_omp(activate)
|
||||
logical, intent(in) :: activate
|
||||
|
||||
if (activate) then
|
||||
call omp_set_max_active_levels(5)
|
||||
call omp_set_max_active_levels(3)
|
||||
|
||||
IRP_IF SET_NESTED
|
||||
call omp_set_nested(.True.)
|
||||
|
@ -356,7 +356,8 @@ BEGIN_TEMPLATE
|
||||
if ( isize < 32) then
|
||||
call insertion_$Xsort(x,iorder,isize)
|
||||
else
|
||||
call $Xradix_sort(x,iorder,isize,-1)
|
||||
! call $Xradix_sort(x,iorder,isize,-1)
|
||||
call quick_$Xsort(x,iorder,isize)
|
||||
endif
|
||||
end subroutine $Xsort
|
||||
|
||||
@ -450,7 +451,8 @@ BEGIN_TEMPLATE
|
||||
if ( isize < 32) then
|
||||
call insertion_$Xsort(x,iorder,isize)
|
||||
else
|
||||
call $Xradix_sort(x,iorder,isize,-1)
|
||||
! call $Xradix_sort(x,iorder,isize,-1)
|
||||
call quick_$Xsort(x,iorder,isize)
|
||||
endif
|
||||
end subroutine $Xsort
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user