10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-03 09:55:59 +02:00

Added exrtapolation

This commit is contained in:
Anthony Scemama 2017-11-21 15:40:04 +01:00
parent cd3c13077a
commit c63d4255d7
4 changed files with 33 additions and 3 deletions

View File

@ -12,7 +12,7 @@ interface: ezfio
type: integer
doc: Save data at each iteration : 1(Append) | 2(Overwrite) | 3(NoSave)
interface: ezfio,ocaml
default: 3
default: 2
[n_iter]
interface: ezfio

View File

@ -33,7 +33,6 @@ filter_only_1h2p_double
filter_only_2h2p_single
filter_only_2h2p_double
filterhole
filter_integrals
filter_only_1h1p_double
filter_only_1h1p_single
filterparticle

View File

@ -303,7 +303,7 @@ subroutine fill_H_apply_buffer_no_selection(n_selected,det_buffer,Nint,iproc)
enddo
do j=1,N_states
do i=1,N_selected
H_apply_buffer(iproc)%coef(i+H_apply_buffer(iproc)%N_det,j) = 0.d0
H_apply_buffer(iproc)%coef(i+H_apply_buffer(iproc)%N_det,j) = 1.e-8
enddo
enddo
H_apply_buffer(iproc)%N_det = new_size

View File

@ -0,0 +1,31 @@
subroutine extrapolate_data(N_data, data, pt2, output)
implicit none
BEGIN_DOC
! Extrapolate the data to the FCI limit
END_DOC
integer, intent(in) :: N_data
double precision, intent(in) :: data(N_data)
double precision, intent(in) :: pt2(N_data)
double precision, intent(out) :: output(N_data)
double precision :: data_rev(N_data), pt2_rev(N_data)
integer :: ifit, i,j
double precision :: ab(2), x(N_data,2), x_inv(2,N_data), y(N_data)
do i=1,N_data
data_rev(N_data+1-i) = data(i)
pt2_rev(N_data+1-i) = pt2(i)
enddo
do i=1,N_data
y(i) = data_rev(i)
x(i,1) = 1.d0
x(i,2) = pt2_rev(i)
enddo
do ifit=2,N_data
call get_pseudo_inverse(x,size(x,1),ifit,2,x_inv,size(x_inv,1))
ab = matmul(x_inv(1:2,1:ifit),y(1:ifit))
output(ifit) = ab(1)
enddo
end