10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-26 06:14:43 +01:00

Save MRCC WF

This commit is contained in:
Anthony Scemama 2018-07-24 17:59:14 +02:00
parent 6c1040c766
commit 76cc05f7cd
9 changed files with 3635 additions and 8 deletions

2
configure vendored
View File

@ -138,7 +138,7 @@ ezfio = Info(
default_path=join(QP_ROOT_INSTALL, "EZFIO")) default_path=join(QP_ROOT_INSTALL, "EZFIO"))
zeromq = Info( zeromq = Info(
url='https://github.com/zeromq/libzmq/archive/v4.2.5.tar.gz' url='https://github.com/zeromq/libzmq/archive/v4.2.5.tar.gz',
description=' ZeroMQ', description=' ZeroMQ',
default_path=join(QP_ROOT_LIB, "libzmq.a")) default_path=join(QP_ROOT_LIB, "libzmq.a"))

1303
data/basis/ncsu-vdz Normal file

File diff suppressed because it is too large Load Diff

1960
data/basis/ncsu-vtz Normal file

File diff suppressed because it is too large Load Diff

183
data/pseudo/ncsu Normal file
View File

@ -0,0 +1,183 @@
H GEN 0 1
3
-10.851924053 2 21.7769665504
1.0 1 21.2435950826
21.2435950826 3 21.2435950826
1
0.0 2 1.0
C GEN 2 1
3
4.0 1 14.43502
57.74008 3 8.39889
-25.81955 2 7.38188
1
52.13345 2 7.76079
Cl GEN 10 2
3
7.0 1 22.71655173
159.01586213 3 78.57185685
-15.6531065 2 7.47352436
2
6.50888648 2 17.23708573
46.763467 2 4.31148447
2
2.9946477 2 11.38275704
28.0170341 2 3.83218762
Co GEN 10 2
4
17.0 1 24.7400138129
420.580234819 3 23.5426031368
-194.630579018 2 24.0406241364
-2.94301943013 2 10.237411369
2
270.86974114 2 23.0205711168
54.1910212498 2 10.9219568474
2
200.63032558 2 25.3244045243
38.9480947892 2 10.6533915029
Cr GEN 10 2
4
14.0 1 18.2809107439
255.932750414 3 17.0980065531
-132.018263171 2 16.7226727605
-0.773887613451 2 5.02865105891
2
219.481462096 2 16.9007876081
28.079331766 2 7.33662150761
2
139.983968717 2 17.3197451654
19.5483578632 2 6.92409757503
F GEN 2 1
3
7.0 1 11.3954401213
79.7680808491 3 10.49201883
-49.4990068225 2 10.2868054098
1
51.3934743997 2 11.3903478843
Fe GEN 10 2
4
16.0 1 23.2209171361
371.534674178 3 23.5471467972
-181.226034452 2 23.4725634461
-2.3730523614 2 9.85238815041
2
277.500325475 2 22.2106269743
46.2049558527 2 9.51515800919
2
194.998750566 2 24.5700087185
31.6794513291 2 8.86648776669
Mn GEN 10 2
4
15.0 1 21.9061889166
328.592833748 3 21.3460106503
-162.049880237 2 21.2709151562
-1.85679609726 2 7.90771171833
2
244.669998154 2 18.9263045646
33.5399867643 2 8.31114792811
2
162.350195446 2 20.162449313
24.1593874179 2 7.79269955633
Ni GEN 10 2
4
18.0 1 37.839331506
681.107967108 3 23.875701156
-173.162219465 2 19.8803935987
0.34274858261 2 3.56565870195
2
91.6513902571 2 13.545098213
331.659352198 2 27.7907700999
2
7.5147228016 2 6.46792786898
265.586894944 2 23.6921476759
O GEN 2 1
3
6.0 1 12.30997
73.85984 3 14.76962
-47.876 2 13.71419
1
85.86406 2 13.65512
S GEN 2 1
3
14.00000000 1 17.46806994
244.55297916 3 16.40396851
-128.37752591 2 16.71429998
2
30.00006536 2 54.87912854
125.50010056 2 31.32968867
Sc GEN 10 2
4
11.0 1 16.0484863686
176.533350054 3 14.07764439
-83.673420518 2 11.993486653
0.331064789149 2 3.75115298216
2
153.959870288 2 11.4712713921
14.9643185607 2 5.00756742752
2
97.2094454291 2 11.4449481137
10.8162163087 2 4.78509457131
Ti GEN 10 2
4
12.0 1 18.4136620219
220.963944263 3 15.9229241432
-94.2902582468 2 13.6500062314
0.0979114248227 2 5.0955521057
2
173.946572359 2 12.7058061392
18.8376833381 2 6.11178551988
2
111.45672882 2 12.6409192965
11.1770268269 2 5.35437415684
V GEN 10 2
4
13.0 1 20.3216891426
264.181958854 3 19.5969804012
-115.292932083 2 17.3314734817
-0.662887260057 2 5.12320657929
2
195.567138911 2 15.1250215054
22.8864283476 2 6.2989891447
2
126.421195008 2 15.9385511327
16.0359712766 2 5.74006266866
Zn GEN 10 2
4
20.0 1 35.8079761618
716.159523235 3 34.536460837
-204.683933235 2 28.6283017827
0.760266144617 2 7.9623968256
2
95.8764043739 2 14.6349869153
431.708043027 2 35.0214135667
2
74.0127004894 2 14.5742930415
313.577705639 2 42.2297923499
Cu GEN 10 2
4
19.0 1 31.5381126304
599.224139977 3 31.0692553147
-244.689154841 2 30.5903586806
-1.2934952584 2 14.0514106386
2
66.2756081341 2 12.7723591969
370.71371825 2 29.355622426
2
49.7626505709 2 12.5247148487
271.662810283 2 33.5169454376

View File

@ -1,6 +1,6 @@
use bitmasks use bitmasks
BEGIN_PROVIDER [ integer, mrmode ] BEGIN_PROVIDER [ integer, mrmode ]
mrmode = 0 mrmode = 0
END_PROVIDER END_PROVIDER

View File

@ -216,11 +216,9 @@ subroutine mrcc_part_dress(delta_ij_, delta_ij_s2_, i_generator,n_selected,det_b
double precision :: hIk, hla, hIl, sla, dIk(N_states), dka(N_states), dIa(N_states), hka double precision :: hIk, hla, hIl, sla, dIk(N_states), dka(N_states), dIa(N_states), hka
double precision, allocatable :: dIa_hla(:,:), dIa_sla(:,:) double precision, allocatable :: dIa_hla(:,:), dIa_sla(:,:)
double precision :: haj, phase, phase2 double precision :: haj, phase, phase2
double precision :: f(N_states), ci_inv(N_states)
integer :: exc(0:2,2,2) integer :: exc(0:2,2,2)
integer :: h1,h2,p1,p2,s1,s2 integer :: h1,h2,p1,p2,s1,s2
integer(bit_kind) :: tmp_det(Nint,2) integer(bit_kind) :: tmp_det(Nint,2)
integer :: iint, ipos
integer :: i_state, k_sd, l_sd, i_I, i_alpha integer :: i_state, k_sd, l_sd, i_I, i_alpha
integer(bit_kind),allocatable :: miniList(:,:,:) integer(bit_kind),allocatable :: miniList(:,:,:)
@ -422,9 +420,6 @@ subroutine mrcc_part_dress(delta_ij_, delta_ij_s2_, i_generator,n_selected,det_b
enddo enddo
enddo enddo
do i_state=1,N_states
ci_inv(i_state) = psi_ref_coef_inv(i_I,i_state)
enddo
do l_sd=1,idx_alpha(0) do l_sd=1,idx_alpha(0)
k_sd = idx_alpha(l_sd) k_sd = idx_alpha(l_sd)
hla = hij_cache(k_sd) hla = hij_cache(k_sd)
@ -1118,3 +1113,135 @@ end
subroutine get_cc_coef(tq,c_alpha)
use bitmasks
implicit none
integer(bit_kind), intent(in) :: tq(N_int,2)
double precision, intent(out) :: c_alpha(N_states)
integer :: k
integer :: degree1, degree2, degree
double precision :: hla, hka, dIk(N_states), dka(N_states), dIa(N_states)
double precision :: phase, phase2
integer :: exc(0:2,2,2)
integer :: h1,h2,p1,p2,s1,s2
integer(bit_kind) :: tmp_det(N_int,2)
integer :: i_state, k_sd, l_sd, i_I
logical :: ok
if (perturbative_triples) then
PROVIDE one_anhil fock_virt_total fock_core_inactive_total one_creat
endif
c_alpha(1:N_states) = 0.d0
do i_I=1,N_det_ref
! Find triples and quadruple grand parents
call get_excitation_degree(tq,psi_ref(1,1,i_I),degree1,N_int)
if (degree1 < 3) then
return
endif
enddo
! |I>
do i_I=1,N_det_ref
! Find triples and quadruple grand parents
call get_excitation_degree(tq,psi_ref(1,1,i_I),degree1,N_int)
if (degree1 > 4) then
cycle
endif
if ( (degree1 < 3).or.(degree1 > 4) ) stop 'bug'
do i_state=1,N_states
dIa(i_state) = 0.d0
enddo
! <I| <> |alpha>
do k_sd=1,N_det_non_ref
call get_excitation_degree(tq,psi_non_ref(1,1,k_sd),degree,N_int)
if (degree > 2) then
cycle
endif
call get_excitation_degree(psi_ref(1,1,i_I),psi_non_ref(1,1,k_sd),degree,N_int)
if (degree > 2) then
cycle
endif
! <I| /k\ |alpha>
! |l> = Exc(k -> alpha) |I>
call get_excitation(psi_non_ref(1,1,k_sd),tq,exc,degree2,phase,N_int)
call decode_exc(exc,degree2,h1,p1,h2,p2,s1,s2)
tmp_det(1:N_int,1:2) = psi_ref(1:N_int,1:2,i_I)
call apply_excitation(psi_ref(1,1,i_I), exc, tmp_det, ok, N_int)
do i_state=1,N_states
dIK(i_state) = dij(i_I, k_sd, i_state)
enddo
! <I| \l/ |alpha>
do i_state=1,N_states
dka(i_state) = 0.d0
enddo
if (ok) then
do l_sd=k_sd+1,N_det_non_ref
call get_excitation_degree(tmp_det,psi_non_ref(1,1,l_sd),degree,N_int)
if (degree == 0) then
call get_excitation(psi_ref(1,1,i_I),psi_non_ref(1,1,l_sd),exc,degree,phase2,N_int)
do i_state=1,N_states
dka(i_state) = dij(i_I, l_sd, i_state) * phase * phase2
enddo
exit
endif
enddo
else if (perturbative_triples) then
! Linked
call i_h_j(tq,psi_non_ref(1,1,k_sd),N_int,hka)
if (dabs(hka) > 1.d-12) then
double precision :: Delta_E(N_states)
call get_delta_e_dyall_general_mp(psi_ref(1,1,i_I),tq,Delta_E)
do i_state=1,N_states
ASSERT (Delta_E(i_state) < 0.d0)
dka(i_state) = hka / Delta_E(i_state)
enddo
endif
endif
if (perturbative_triples.and. (degree2 == 1) ) then
call i_h_j(psi_ref(1,1,i_I),tmp_det,N_int,hka)
call i_h_j(tq,psi_non_ref(1,1,k_sd),N_int,hla)
hka = hla - hka
if (dabs(hka) > 1.d-12) then
call get_delta_e_dyall_general_mp(psi_ref(1,1,i_I),tq,Delta_E)
do i_state=1,N_states
ASSERT (Delta_E(i_state) < 0.d0)
dka(i_state) = hka / Delta_E(i_state)
enddo
endif
endif
do i_state=1,N_states
dIa(i_state) = dIa(i_state) + dIk(i_state) * dka(i_state)
enddo
enddo
do i_state=1,N_states
c_alpha(i_state) += dIa(i_state) * psi_ref_coef(i_I,i_state)
enddo
enddo
end

View File

@ -0,0 +1,50 @@
program save_mrcc_wf
implicit none
threshold_generators = 1.d0
threshold_selectors = 1.d0
TOUCH threshold_generators threshold_selectors
mrmode=5
read_wf = .True.
SOFT_TOUCH read_wf mrmode
call generate_all_alpha_beta_det_products
call run1
call run2
end
subroutine run1
implicit none
integer :: k
double precision :: c_alpha(N_states)
call set_generators_bitmasks_as_holes_and_particles
do k=1,N_det
if (maxval(abs(psi_coef(k,1:N_states))) == 0.d0) then
call get_cc_coef(psi_det(1,1,k), c_alpha)
psi_coef(k,1:N_states) = c_alpha(1:N_states)
endif
enddo
SOFT_TOUCH psi_coef
end
subroutine run2
implicit none
integer :: k
double precision :: c_alpha(N_states)
psi_det(1:N_int,1:2,1:N_det) = psi_det_sorted(1:N_int,1:2,1:N_det)
psi_coef(1:N_det,1:N_states) = psi_coef_sorted(1:N_det,1:N_states)
do k=N_det,1,-1
if (maxval(abs(psi_coef(k,1:N_states))) > 0.d0) then
exit
endif
enddo
N_det = k
SOFT_TOUCH N_det psi_coef psi_det
call save_wavefunction
end

View File

@ -721,6 +721,7 @@ subroutine apply_excitation(det, exc, res, ok, Nint)
case default case default
print *, degree print *, degree
print *, "apply ex" print *, "apply ex"
print *, 1.d0/0.d0 ! For traceback
STOP STOP
end select end select
! END INLINE ! END INLINE

View File

@ -671,7 +671,10 @@ subroutine create_wf_of_psi_bilinear_matrix(truncate)
do i=1,N_det do i=1,N_det
norm(1) += psi_average_norm_contrib_sorted(i) norm(1) += psi_average_norm_contrib_sorted(i)
if (truncate) then if (truncate) then
if (norm(1) >= 0.999999d0) then if (norm(1) >= 1.d0) then
exit
endif
if (psi_average_norm_contrib_sorted(i) == 0.d0) then
exit exit
endif endif
endif endif