10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 04:43:50 +01:00

DDCI is working from scratch

This commit is contained in:
Manu 2015-03-16 17:33:37 +01:00
parent 1291270ee9
commit a4593d7e17
7 changed files with 126 additions and 0 deletions

View File

View File

@ -0,0 +1,16 @@
use bitmasks
BEGIN_SHELL [ /usr/bin/env python ]
from generate_h_apply import *
s = H_apply("DDCI_selection")
s.set_selection_pt2("epstein_nesbet_2x2")
s.set_filter_2h_2p()
print s
s = H_apply("DDCI_PT2")
s.set_perturbation("epstein_nesbet_2x2")
s.set_filter_2h_2p()
print s
END_SHELL

View File

@ -0,0 +1,8 @@
default: all
# Define here all new external source files and objects.Don't forget to prefix the
# object files with IRPF90_temp/
SRC=
OBJ=
include $(QPACKAGE_ROOT)/src/Makefile.common

View File

@ -0,0 +1 @@
AOs BiInts Bitmask Dets Electrons Ezfio_files Generators_CAS Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Selectors_full Utils

View File

@ -0,0 +1,4 @@
====================
DDCI_selected Module
====================

View File

@ -0,0 +1,65 @@
program full_ci
implicit none
integer :: i,k
double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:)
integer :: N_st, degree
N_st = N_states
allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st))
character*(64) :: perturbation
pt2 = 1.d0
diag_algorithm = "Lapack"
if (N_det > n_det_max_fci) then
call diagonalize_CI
call save_wavefunction
psi_det = psi_det_sorted
psi_coef = psi_coef_sorted
N_det = n_det_max_fci
soft_touch N_det psi_det psi_coef
call diagonalize_CI
call save_wavefunction
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
print *, 'PT2 = ', pt2
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
endif
do while (N_det < n_det_max_fci.and.maxval(abs(pt2(1:N_st))) > pt2_max)
call H_apply_DDCI_selection(pt2, norm_pert, H_pert_diag, N_st)
PROVIDE psi_coef
PROVIDE psi_det
PROVIDE psi_det_sorted
if (N_det > n_det_max_fci) then
psi_det = psi_det_sorted
psi_coef = psi_coef_sorted
N_det = n_det_max_fci
soft_touch N_det psi_det psi_coef
endif
call diagonalize_CI
call save_wavefunction
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
print *, 'PT2 = ', pt2
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
print *, '-----'
call ezfio_set_full_ci_energy(CI_energy)
if (abort_all) then
exit
endif
enddo
if(do_pt2_end)then
call H_apply_DDCI_pt2(pt2, norm_pert, H_pert_diag, N_st)
print *, 'N_det = ', N_det
print *, 'N_states = ', N_states
print *, 'PT2 = ', pt2
print *, 'E = ', CI_energy
print *, 'E+PT2 = ', CI_energy+pt2
endif
end

View File

@ -0,0 +1,32 @@
BEGIN_SHELL [ /usr/bin/python ]
from ezfio_with_default import EZFIO_Provider
T = EZFIO_Provider()
T.set_type ( "integer" )
T.set_name ( "N_det_max_fci" )
T.set_doc ( "Max number of determinants in the wave function" )
T.set_ezfio_dir ( "full_ci" )
T.set_ezfio_name( "N_det_max_fci" )
T.set_output ( "output_full_ci" )
print T
T.set_type ( "logical" )
T.set_name ( "do_pt2_end" )
T.set_doc ( "If true, compute the PT2 at the end of the selection" )
T.set_ezfio_name( "do_pt2_end" )
print T
T.set_type ( "double precision" )
T.set_name ( "pt2_max" )
T.set_doc ( """The selection process stops when the largest PT2 (for all the states)
is lower than pt2_max in absolute value""" )
T.set_ezfio_name( "pt2_max" )
print T
T.set_type ( "double precision" )
T.set_name ( "var_pt2_ratio" )
T.set_doc ( """The selection process stops when the energy ratio variational/(variational+PT2)
is equal to var_pt2_ratio""" )
T.set_ezfio_name( "var_pt2_ratio" )
print T
END_SHELL