mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-25 14:01:46 +02:00
Accelerated det_connections
This commit is contained in:
parent
dc3d433d30
commit
a67225a1a3
@ -118,6 +118,7 @@ class H_apply(object):
|
|||||||
double precision :: sum_H_pert_diag(N_st)
|
double precision :: sum_H_pert_diag(N_st)
|
||||||
double precision, allocatable :: e_2_pert_buffer(:,:)
|
double precision, allocatable :: e_2_pert_buffer(:,:)
|
||||||
double precision, allocatable :: coef_pert_buffer(:,:)
|
double precision, allocatable :: coef_pert_buffer(:,:)
|
||||||
|
!$ call omp_init_lock(lck)
|
||||||
ASSERT (Nint == N_int)
|
ASSERT (Nint == N_int)
|
||||||
"""
|
"""
|
||||||
self.data["init_thread"] = """
|
self.data["init_thread"] = """
|
||||||
@ -130,13 +131,13 @@ class H_apply(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.data["deinit_thread"] = """
|
self.data["deinit_thread"] = """
|
||||||
!$OMP CRITICAL
|
!$ call omp_set_lock(lck)
|
||||||
do k=1,N_st
|
do k=1,N_st
|
||||||
sum_e_2_pert_in(k) = sum_e_2_pert_in(k) + sum_e_2_pert(k)
|
sum_e_2_pert_in(k) = sum_e_2_pert_in(k) + sum_e_2_pert(k)
|
||||||
sum_norm_pert_in(k) = sum_norm_pert_in(k) + sum_norm_pert(k)
|
sum_norm_pert_in(k) = sum_norm_pert_in(k) + sum_norm_pert(k)
|
||||||
sum_H_pert_diag_in(k) = sum_H_pert_diag_in(k) + sum_H_pert_diag(k)
|
sum_H_pert_diag_in(k) = sum_H_pert_diag_in(k) + sum_H_pert_diag(k)
|
||||||
enddo
|
enddo
|
||||||
!$OMP END CRITICAL
|
!$ call omp_unset_lock(lck)
|
||||||
deallocate (e_2_pert_buffer, coef_pert_buffer)
|
deallocate (e_2_pert_buffer, coef_pert_buffer)
|
||||||
"""
|
"""
|
||||||
self.data["size_max"] = "256"
|
self.data["size_max"] = "256"
|
||||||
@ -148,6 +149,7 @@ class H_apply(object):
|
|||||||
sum_norm_pert,sum_H_pert_diag,N_st,N_int)
|
sum_norm_pert,sum_H_pert_diag,N_st,N_int)
|
||||||
"""%(pert,)
|
"""%(pert,)
|
||||||
self.data["finalization"] = """
|
self.data["finalization"] = """
|
||||||
|
!$ call omp_destroy_lock(lck)
|
||||||
"""
|
"""
|
||||||
self.data["copy_buffer"] = ""
|
self.data["copy_buffer"] = ""
|
||||||
self.data["generate_psi_guess"] = ""
|
self.data["generate_psi_guess"] = ""
|
||||||
|
@ -57,27 +57,15 @@ Documentation
|
|||||||
`full_ijkl_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L12>`_
|
`full_ijkl_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L12>`_
|
||||||
Bitmask to include all possible MOs
|
Bitmask to include all possible MOs
|
||||||
|
|
||||||
`generators_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L91>`_
|
|
||||||
Bitmasks for generator determinants. (N_int, alpha/beta, hole/particle, generator)
|
|
||||||
|
|
||||||
`hf_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L32>`_
|
`hf_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L32>`_
|
||||||
Hartree Fock bit mask
|
Hartree Fock bit mask
|
||||||
|
|
||||||
`n_generators_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L58>`_
|
|
||||||
Number of bitmasks for generators
|
|
||||||
|
|
||||||
`n_int <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L3>`_
|
`n_int <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L3>`_
|
||||||
Number of 64-bit integers needed to represent determinants as binary strings
|
Number of 64-bit integers needed to represent determinants as binary strings
|
||||||
|
|
||||||
`n_reference_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L112>`_
|
|
||||||
Number of bitmasks for reference
|
|
||||||
|
|
||||||
`ref_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L50>`_
|
`ref_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L50>`_
|
||||||
Reference bit mask, used in Slater rules, chosen as Hartree-Fock bitmask
|
Reference bit mask, used in Slater rules, chosen as Hartree-Fock bitmask
|
||||||
|
|
||||||
`reference_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L145>`_
|
|
||||||
Bitmasks for reference determinants. (N_int, alpha/beta, hole/particle, reference)
|
|
||||||
|
|
||||||
`bitstring_to_hexa <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L95>`_
|
`bitstring_to_hexa <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks_routines.irp.f#L95>`_
|
||||||
Transform a bit string to a string in hexadecimal format for printing
|
Transform a bit string to a string in hexadecimal format for printing
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ subroutine $subroutine_diexc(key_in, hole_1,particl_1, hole_2, particl_2, i_gene
|
|||||||
integer, allocatable :: ia_ja_pairs(:,:,:)
|
integer, allocatable :: ia_ja_pairs(:,:,:)
|
||||||
double precision :: diag_H_mat_elem
|
double precision :: diag_H_mat_elem
|
||||||
integer :: iproc
|
integer :: iproc
|
||||||
|
integer(omp_lock_kind) :: lck
|
||||||
PROVIDE H_apply_threshold
|
PROVIDE H_apply_threshold
|
||||||
|
|
||||||
$initialization
|
$initialization
|
||||||
@ -245,6 +246,7 @@ subroutine $subroutine_monoexc(key_in, hole_1,particl_1,i_generator $parameters
|
|||||||
integer, allocatable :: ia_ja_pairs(:,:,:)
|
integer, allocatable :: ia_ja_pairs(:,:,:)
|
||||||
double precision :: diag_H_mat_elem
|
double precision :: diag_H_mat_elem
|
||||||
integer :: iproc
|
integer :: iproc
|
||||||
|
integer(omp_lock_kind) :: lck
|
||||||
PROVIDE H_apply_threshold
|
PROVIDE H_apply_threshold
|
||||||
|
|
||||||
$initialization
|
$initialization
|
||||||
|
@ -133,36 +133,33 @@ Documentation
|
|||||||
`n_det <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L20>`_
|
`n_det <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L20>`_
|
||||||
Number of determinants in the wave function
|
Number of determinants in the wave function
|
||||||
|
|
||||||
`n_det_max_jacobi <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L38>`_
|
`n_det_reference <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L75>`_
|
||||||
Maximum number of determinants diagonalized my jacobi
|
|
||||||
|
|
||||||
`n_det_reference <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L93>`_
|
|
||||||
Number of determinants in the reference wave function
|
Number of determinants in the reference wave function
|
||||||
|
|
||||||
`n_states <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L3>`_
|
`n_states <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L3>`_
|
||||||
Number of states to consider
|
Number of states to consider
|
||||||
|
|
||||||
`psi_average_norm_contrib <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L102>`_
|
`psi_average_norm_contrib <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L84>`_
|
||||||
Contribution of determinants to the state-averaged density
|
Contribution of determinants to the state-averaged density
|
||||||
|
|
||||||
`psi_average_norm_contrib_sorted <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L123>`_
|
`psi_average_norm_contrib_sorted <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L105>`_
|
||||||
Wave function sorted by determinants (state-averaged)
|
Wave function sorted by determinants (state-averaged)
|
||||||
|
|
||||||
`psi_coef <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L65>`_
|
`psi_coef <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L47>`_
|
||||||
The wave function. Initialized with Hartree-Fock if the EZFIO file
|
The wave function. Initialized with Hartree-Fock if the EZFIO file
|
||||||
is empty
|
is empty
|
||||||
|
|
||||||
`psi_coef_sorted <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L122>`_
|
`psi_coef_sorted <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L104>`_
|
||||||
Wave function sorted by determinants (state-averaged)
|
Wave function sorted by determinants (state-averaged)
|
||||||
|
|
||||||
`psi_det <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L64>`_
|
`psi_det <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L46>`_
|
||||||
The wave function. Initialized with Hartree-Fock if the EZFIO file
|
The wave function. Initialized with Hartree-Fock if the EZFIO file
|
||||||
is empty
|
is empty
|
||||||
|
|
||||||
`psi_det_size <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L56>`_
|
`psi_det_size <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L38>`_
|
||||||
Size of the psi_det/psi_coef arrays
|
Size of the psi_det/psi_coef arrays
|
||||||
|
|
||||||
`psi_det_sorted <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L121>`_
|
`psi_det_sorted <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants.irp.f#L103>`_
|
||||||
Wave function sorted by determinants (state-averaged)
|
Wave function sorted by determinants (state-averaged)
|
||||||
|
|
||||||
`double_exc_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants_bitmasks.irp.f#L40>`_
|
`double_exc_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/determinants_bitmasks.irp.f#L40>`_
|
||||||
@ -301,7 +298,7 @@ Documentation
|
|||||||
Returns <i|H|j> where i and j are determinants
|
Returns <i|H|j> where i and j are determinants
|
||||||
|
|
||||||
`i_h_psi <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/slater_rules.irp.f#L491>`_
|
`i_h_psi <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/slater_rules.irp.f#L491>`_
|
||||||
<key|H|psi> for the various Nstates
|
<key|H|psi> for the various Nstate
|
||||||
|
|
||||||
`i_h_psi_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/slater_rules.irp.f#L527>`_
|
`i_h_psi_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Dets/slater_rules.irp.f#L527>`_
|
||||||
<key|H|psi> for the various Nstate
|
<key|H|psi> for the various Nstate
|
||||||
|
@ -2,7 +2,7 @@ subroutine get_excitation_degree(key1,key2,degree,Nint)
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Returns the excitation degree between two determinants
|
! Returns the excitation degree between two determinants
|
||||||
END_DOC
|
END_DOC
|
||||||
integer, intent(in) :: Nint
|
integer, intent(in) :: Nint
|
||||||
integer(bit_kind), intent(in) :: key1(Nint,2)
|
integer(bit_kind), intent(in) :: key1(Nint,2)
|
||||||
@ -31,7 +31,7 @@ subroutine get_excitation(det1,det2,exc,degree,phase,Nint)
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Returns the excitation operators between two determinants and the phase
|
! Returns the excitation operators between two determinants and the phase
|
||||||
END_DOC
|
END_DOC
|
||||||
integer, intent(in) :: Nint
|
integer, intent(in) :: Nint
|
||||||
integer(bit_kind), intent(in) :: det1(Nint,2)
|
integer(bit_kind), intent(in) :: det1(Nint,2)
|
||||||
@ -142,7 +142,7 @@ subroutine get_double_excitation(det1,det2,exc,phase,Nint)
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Returns the two excitation operators between two doubly excited determinants and the phase
|
! Returns the two excitation operators between two doubly excited determinants and the phase
|
||||||
END_DOC
|
END_DOC
|
||||||
integer, intent(in) :: Nint
|
integer, intent(in) :: Nint
|
||||||
integer(bit_kind), intent(in) :: det1(Nint,2)
|
integer(bit_kind), intent(in) :: det1(Nint,2)
|
||||||
@ -275,7 +275,7 @@ subroutine get_mono_excitation(det1,det2,exc,phase,Nint)
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Returns the excitation operator between two singly excited determinants and the phase
|
! Returns the excitation operator between two singly excited determinants and the phase
|
||||||
END_DOC
|
END_DOC
|
||||||
integer, intent(in) :: Nint
|
integer, intent(in) :: Nint
|
||||||
integer(bit_kind), intent(in) :: det1(Nint,2)
|
integer(bit_kind), intent(in) :: det1(Nint,2)
|
||||||
@ -356,7 +356,7 @@ subroutine i_H_j(key_i,key_j,Nint,hij)
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Returns <i|H|j> where i and j are determinants
|
! Returns <i|H|j> where i and j are determinants
|
||||||
END_DOC
|
END_DOC
|
||||||
integer, intent(in) :: Nint
|
integer, intent(in) :: Nint
|
||||||
integer(bit_kind), intent(in) :: key_i(Nint,2), key_j(Nint,2)
|
integer(bit_kind), intent(in) :: key_i(Nint,2), key_j(Nint,2)
|
||||||
@ -576,7 +576,7 @@ subroutine get_excitation_degree_vector(key1,key2,degree,Nint,sze,idx)
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Applies get_excitation_degree to an array of determinants
|
! Applies get_excitation_degree to an array of determinants
|
||||||
END_DOC
|
END_DOC
|
||||||
integer, intent(in) :: Nint, sze
|
integer, intent(in) :: Nint, sze
|
||||||
integer(bit_kind), intent(in) :: key1(Nint,2,sze)
|
integer(bit_kind), intent(in) :: key1(Nint,2,sze)
|
||||||
@ -659,7 +659,7 @@ end
|
|||||||
double precision function diag_H_mat_elem(det_in,Nint)
|
double precision function diag_H_mat_elem(det_in,Nint)
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Computes <i|H|i>
|
! Computes <i|H|i>
|
||||||
END_DOC
|
END_DOC
|
||||||
integer,intent(in) :: Nint
|
integer,intent(in) :: Nint
|
||||||
integer(bit_kind),intent(in) :: det_in(Nint,2)
|
integer(bit_kind),intent(in) :: det_in(Nint,2)
|
||||||
@ -694,7 +694,7 @@ double precision function diag_H_mat_elem(det_in,Nint)
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
!call debug_det(det_in,Nint)
|
!call debug_det(det_in,Nint)
|
||||||
integer :: tmp
|
integer :: tmp
|
||||||
call bitstring_to_list(particle(1,1), occ_particle(1,1), tmp, Nint)
|
call bitstring_to_list(particle(1,1), occ_particle(1,1), tmp, Nint)
|
||||||
ASSERT (tmp == nexc(1))
|
ASSERT (tmp == nexc(1))
|
||||||
@ -722,7 +722,7 @@ subroutine a_operator(iorb,ispin,key,hjj,Nint,na,nb)
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Needed for diag_H_mat_elem
|
! Needed for diag_H_mat_elem
|
||||||
END_DOC
|
END_DOC
|
||||||
integer, intent(in) :: iorb, ispin, Nint
|
integer, intent(in) :: iorb, ispin, Nint
|
||||||
integer, intent(inout) :: na, nb
|
integer, intent(inout) :: na, nb
|
||||||
@ -767,7 +767,7 @@ subroutine ac_operator(iorb,ispin,key,hjj,Nint,na,nb)
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Needed for diag_H_mat_elem
|
! Needed for diag_H_mat_elem
|
||||||
END_DOC
|
END_DOC
|
||||||
integer, intent(in) :: iorb, ispin, Nint
|
integer, intent(in) :: iorb, ispin, Nint
|
||||||
integer, intent(inout) :: na, nb
|
integer, intent(inout) :: na, nb
|
||||||
@ -815,7 +815,7 @@ subroutine get_occ_from_key(key,occ,Nint)
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Returns a list of occupation numbers from a bitstring
|
! Returns a list of occupation numbers from a bitstring
|
||||||
END_DOC
|
END_DOC
|
||||||
integer(bit_kind), intent(in) :: key(Nint,2)
|
integer(bit_kind), intent(in) :: key(Nint,2)
|
||||||
integer , intent(in) :: Nint
|
integer , intent(in) :: Nint
|
||||||
@ -831,11 +831,11 @@ subroutine H_u_0(v_0,u_0,H_jj,n,keys_tmp,Nint)
|
|||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Computes v_0 = H|u_0>
|
! Computes v_0 = H|u_0>
|
||||||
!
|
!
|
||||||
! n : number of determinants
|
! n : number of determinants
|
||||||
!
|
!
|
||||||
! H_jj : array of <j|H|j>
|
! H_jj : array of <j|H|j>
|
||||||
END_DOC
|
END_DOC
|
||||||
integer, intent(in) :: n,Nint
|
integer, intent(in) :: n,Nint
|
||||||
double precision, intent(out) :: v_0(n)
|
double precision, intent(out) :: v_0(n)
|
||||||
@ -904,8 +904,101 @@ BEGIN_PROVIDER [ integer*8, det_connections, (N_con_int,N_det) ]
|
|||||||
integer :: degree
|
integer :: degree
|
||||||
integer :: j_int, j_k, j_l
|
integer :: j_int, j_k, j_l
|
||||||
integer, allocatable :: idx(:)
|
integer, allocatable :: idx(:)
|
||||||
|
|
||||||
|
select case(N_int)
|
||||||
|
|
||||||
|
case(1)
|
||||||
|
|
||||||
!$OMP PARALLEL DEFAULT (NONE) &
|
!$OMP PARALLEL DEFAULT (NONE) &
|
||||||
!$OMP SHARED(N_det, N_con_int, psi_det,N_int, det_connections) &
|
!$OMP SHARED(N_det, N_con_int, psi_det,N_int, det_connections)&
|
||||||
|
!$OMP PRIVATE(i,j_int,j_k,j_l,j,degree,idx)
|
||||||
|
allocate (idx(0:N_det))
|
||||||
|
!$OMP DO SCHEDULE(guided)
|
||||||
|
do i=1,N_det
|
||||||
|
do j_int=1,N_con_int
|
||||||
|
det_connections(j_int,i) = 0_8
|
||||||
|
j_k = ishft(j_int-1,11)
|
||||||
|
do j_l = j_k,min(j_k+2047,N_det), 32
|
||||||
|
do j = j_l+1,min(j_l+32,i)
|
||||||
|
degree = popcnt(xor( psi_det(1,1,i),psi_det(1,1,j))) + &
|
||||||
|
popcnt(xor( psi_det(1,2,i),psi_det(1,2,j)))
|
||||||
|
if (degree < 5) then
|
||||||
|
det_connections(j_int,i) = ibset( det_connections(j_int,i), iand(63,ishft(j_l,-5)) )
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
!$OMP ENDDO
|
||||||
|
deallocate(idx)
|
||||||
|
!$OMP END PARALLEL
|
||||||
|
|
||||||
|
case(2)
|
||||||
|
|
||||||
|
!$OMP PARALLEL DEFAULT (NONE) &
|
||||||
|
!$OMP SHARED(N_det, N_con_int, psi_det,N_int, det_connections)&
|
||||||
|
!$OMP PRIVATE(i,j_int,j_k,j_l,j,degree,idx)
|
||||||
|
allocate (idx(0:N_det))
|
||||||
|
!$OMP DO SCHEDULE(guided)
|
||||||
|
do i=1,N_det
|
||||||
|
do j_int=1,N_con_int
|
||||||
|
det_connections(j_int,i) = 0_8
|
||||||
|
j_k = ishft(j_int-1,11)
|
||||||
|
do j_l = j_k,min(j_k+2047,N_det), 32
|
||||||
|
do j = j_l+1,min(j_l+32,i)
|
||||||
|
degree = popcnt(xor( psi_det(1,1,i),psi_det(1,1,j))) + &
|
||||||
|
popcnt(xor( psi_det(1,2,i),psi_det(1,2,j))) + &
|
||||||
|
popcnt(xor( psi_det(2,1,i),psi_det(2,1,j))) + &
|
||||||
|
popcnt(xor( psi_det(2,2,i),psi_det(2,2,j)))
|
||||||
|
if (degree < 5) then
|
||||||
|
det_connections(j_int,i) = ibset( det_connections(j_int,i), iand(63,ishft(j_l,-5)) )
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
!$OMP ENDDO
|
||||||
|
deallocate(idx)
|
||||||
|
!$OMP END PARALLEL
|
||||||
|
|
||||||
|
case(3)
|
||||||
|
|
||||||
|
!$OMP PARALLEL DEFAULT (NONE) &
|
||||||
|
!$OMP SHARED(N_det, N_con_int, psi_det,N_int, det_connections)&
|
||||||
|
!$OMP PRIVATE(i,j_int,j_k,j_l,j,degree,idx)
|
||||||
|
allocate (idx(0:N_det))
|
||||||
|
!$OMP DO SCHEDULE(guided)
|
||||||
|
do i=1,N_det
|
||||||
|
do j_int=1,N_con_int
|
||||||
|
det_connections(j_int,i) = 0_8
|
||||||
|
j_k = ishft(j_int-1,11)
|
||||||
|
do j_l = j_k,min(j_k+2047,N_det), 32
|
||||||
|
do j = j_l+1,min(j_l+32,i)
|
||||||
|
degree = popcnt(xor( psi_det(1,1,i),psi_det(1,1,j))) + &
|
||||||
|
popcnt(xor( psi_det(1,2,i),psi_det(1,2,j))) + &
|
||||||
|
popcnt(xor( psi_det(2,1,i),psi_det(2,1,j))) + &
|
||||||
|
popcnt(xor( psi_det(2,2,i),psi_det(2,2,j))) + &
|
||||||
|
popcnt(xor( psi_det(3,1,i),psi_det(3,1,j))) + &
|
||||||
|
popcnt(xor( psi_det(3,2,i),psi_det(3,2,j)))
|
||||||
|
if (degree < 5) then
|
||||||
|
det_connections(j_int,i) = ibset( det_connections(j_int,i), iand(63,ishft(j_l,-5)) )
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
!$OMP ENDDO
|
||||||
|
deallocate(idx)
|
||||||
|
!$OMP END PARALLEL
|
||||||
|
|
||||||
|
case default
|
||||||
|
|
||||||
|
|
||||||
|
!$OMP PARALLEL DEFAULT (NONE) &
|
||||||
|
!$OMP SHARED(N_det, N_con_int, psi_det,N_int, det_connections)&
|
||||||
!$OMP PRIVATE(i,j_int,j_k,j_l,j,degree,idx)
|
!$OMP PRIVATE(i,j_int,j_k,j_l,j,degree,idx)
|
||||||
allocate (idx(0:N_det))
|
allocate (idx(0:N_det))
|
||||||
!$OMP DO SCHEDULE(guided)
|
!$OMP DO SCHEDULE(guided)
|
||||||
@ -927,7 +1020,9 @@ BEGIN_PROVIDER [ integer*8, det_connections, (N_con_int,N_det) ]
|
|||||||
enddo
|
enddo
|
||||||
!$OMP ENDDO
|
!$OMP ENDDO
|
||||||
deallocate(idx)
|
deallocate(idx)
|
||||||
!$OMP ENDPARALLEL
|
!$OMP END PARALLEL
|
||||||
|
|
||||||
|
end select
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ program cisd
|
|||||||
|
|
||||||
pt2 = 1.d0
|
pt2 = 1.d0
|
||||||
diag_algorithm = "Lapack"
|
diag_algorithm = "Lapack"
|
||||||
do while (maxval(abs(pt2(1:N_st))) > 1.d-4)
|
do while (maxval(abs(pt2(1:N_st))) > 1.d-2)
|
||||||
call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st)
|
call H_apply_FCI(pt2, norm_pert, H_pert_diag, N_st)
|
||||||
call diagonalize_CI
|
call diagonalize_CI
|
||||||
print *, 'N_det = ', N_det
|
print *, 'N_det = ', N_det
|
||||||
|
@ -91,34 +91,34 @@ Documentation
|
|||||||
`ao_nucl_elec_integral <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L1>`_
|
`ao_nucl_elec_integral <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L1>`_
|
||||||
interaction nuclear electron
|
interaction nuclear electron
|
||||||
|
|
||||||
`give_polynom_mult_center_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L161>`_
|
`give_polynom_mult_center_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L157>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
`i_x1_pol_mult_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L289>`_
|
`i_x1_pol_mult_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L285>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
`i_x2_pol_mult_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L361>`_
|
`i_x2_pol_mult_mono_elec <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L357>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
`int_gaus_pol <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L432>`_
|
`int_gaus_pol <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L428>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
`nai_pol_mult <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L82>`_
|
`nai_pol_mult <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L82>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
`v_e_n <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L413>`_
|
`v_e_n <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L409>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
`v_phi <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L477>`_
|
`v_phi <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L473>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
`v_r <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L461>`_
|
`v_r <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L457>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
`v_theta <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L490>`_
|
`v_theta <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L486>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
`wallis <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L506>`_
|
`wallis <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_ao_ints.irp.f#L502>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
`mo_nucl_elec_integral <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_mo_ints.irp.f#L1>`_
|
`mo_nucl_elec_integral <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts/pot_mo_ints.irp.f#L1>`_
|
||||||
|
@ -115,30 +115,29 @@ Needed Modules
|
|||||||
.. NEEDED_MODULES file.
|
.. NEEDED_MODULES file.
|
||||||
|
|
||||||
* `AOs <http://github.com/LCPQ/quantum_package/tree/master/src/AOs>`_
|
* `AOs <http://github.com/LCPQ/quantum_package/tree/master/src/AOs>`_
|
||||||
|
* `BiInts <http://github.com/LCPQ/quantum_package/tree/master/src/BiInts>`_
|
||||||
* `Bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask>`_
|
* `Bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask>`_
|
||||||
|
* `CISD <http://github.com/LCPQ/quantum_package/tree/master/src/CISD>`_
|
||||||
|
* `CISD_SC2_selected <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2_selected>`_
|
||||||
|
* `CISD_selected <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_selected>`_
|
||||||
|
* `DensityMatrix <http://github.com/LCPQ/quantum_package/tree/master/src/DensityMatrix>`_
|
||||||
|
* `Dets <http://github.com/LCPQ/quantum_package/tree/master/src/Dets>`_
|
||||||
* `Electrons <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons>`_
|
* `Electrons <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons>`_
|
||||||
* `Ezfio_files <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files>`_
|
* `Ezfio_files <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files>`_
|
||||||
|
* `Full_CI <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI>`_
|
||||||
|
* `Generators_full <http://github.com/LCPQ/quantum_package/tree/master/src/Generators_full>`_
|
||||||
|
* `Hartree_Fock <http://github.com/LCPQ/quantum_package/tree/master/src/Hartree_Fock>`_
|
||||||
|
* `MOGuess <http://github.com/LCPQ/quantum_package/tree/master/src/MOGuess>`_
|
||||||
|
* `MonoInts <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts>`_
|
||||||
* `MOs <http://github.com/LCPQ/quantum_package/tree/master/src/MOs>`_
|
* `MOs <http://github.com/LCPQ/quantum_package/tree/master/src/MOs>`_
|
||||||
|
* `MP2 <http://github.com/LCPQ/quantum_package/tree/master/src/MP2>`_
|
||||||
* `Nuclei <http://github.com/LCPQ/quantum_package/tree/master/src/Nuclei>`_
|
* `Nuclei <http://github.com/LCPQ/quantum_package/tree/master/src/Nuclei>`_
|
||||||
* `Output <http://github.com/LCPQ/quantum_package/tree/master/src/Output>`_
|
* `Output <http://github.com/LCPQ/quantum_package/tree/master/src/Output>`_
|
||||||
* `Utils <http://github.com/LCPQ/quantum_package/tree/master/src/Utils>`_
|
|
||||||
* `Hartree_Fock <http://github.com/LCPQ/quantum_package/tree/master/src/Hartree_Fock>`_
|
|
||||||
* `BiInts <http://github.com/LCPQ/quantum_package/tree/master/src/BiInts>`_
|
|
||||||
* `MonoInts <http://github.com/LCPQ/quantum_package/tree/master/src/MonoInts>`_
|
|
||||||
* `MOGuess <http://github.com/LCPQ/quantum_package/tree/master/src/MOGuess>`_
|
|
||||||
* `Dets <http://github.com/LCPQ/quantum_package/tree/master/src/Dets>`_
|
|
||||||
* `DensityMatrix <http://github.com/LCPQ/quantum_package/tree/master/src/DensityMatrix>`_
|
|
||||||
* `CISD <http://github.com/LCPQ/quantum_package/tree/master/src/CISD>`_
|
|
||||||
* `Perturbation <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation>`_
|
* `Perturbation <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation>`_
|
||||||
* `SingleRefMethod <http://github.com/LCPQ/quantum_package/tree/master/src/SingleRefMethod>`_
|
* `SC2 <http://github.com/LCPQ/quantum_package/tree/master/src/SC2>`_
|
||||||
* `CISD_selected <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_selected>`_
|
|
||||||
* `Selectors_full <http://github.com/LCPQ/quantum_package/tree/master/src/Selectors_full>`_
|
* `Selectors_full <http://github.com/LCPQ/quantum_package/tree/master/src/Selectors_full>`_
|
||||||
* `MP2 <http://github.com/LCPQ/quantum_package/tree/master/src/MP2>`_
|
* `SingleRefMethod <http://github.com/LCPQ/quantum_package/tree/master/src/SingleRefMethod>`_
|
||||||
* `Generators_full <http://github.com/LCPQ/quantum_package/tree/master/src/Generators_full>`_
|
* `Utils <http://github.com/LCPQ/quantum_package/tree/master/src/Utils>`_
|
||||||
* `Full_CI <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI>`_
|
|
||||||
* `CISD_SC2_selected <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2_selected>`_
|
|
||||||
* `CISD_SC2_selected <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2_selected>`_
|
|
||||||
* `CISD_SC2 <http://github.com/LCPQ/quantum_package/tree/master/src/CISD_SC2>`_
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
=============
|
=============
|
||||||
|
@ -50,10 +50,10 @@ subroutine CISD_SC2(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit)
|
|||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call write_time(output_CISD_SC2)
|
call write_time(output_SC2)
|
||||||
write(output_CISD_SC2,'(A)') ''
|
write(output_SC2,'(A)') ''
|
||||||
write(output_CISD_SC2,'(A)') 'CISD SC2'
|
write(output_SC2,'(A)') 'CISD SC2'
|
||||||
write(output_CISD_SC2,'(A)') '========'
|
write(output_SC2,'(A)') '========'
|
||||||
!$OMP PARALLEL DEFAULT(NONE) &
|
!$OMP PARALLEL DEFAULT(NONE) &
|
||||||
!$OMP SHARED(sze,N_st, &
|
!$OMP SHARED(sze,N_st, &
|
||||||
!$OMP H_jj_ref,Nint,dets_in,u_in) &
|
!$OMP H_jj_ref,Nint,dets_in,u_in) &
|
||||||
@ -120,7 +120,7 @@ subroutine CISD_SC2(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit)
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
if(sze>1000)then
|
if(sze>1000)then
|
||||||
call davidson_diag_hjj(dets_in,u_in,H_jj_dressed,energies,dim_in,sze,N_st,Nint,output_CISD_SC2)
|
call davidson_diag_hjj(dets_in,u_in,H_jj_dressed,energies,dim_in,sze,N_st,Nint,output_SC2)
|
||||||
else
|
else
|
||||||
do i = 1,sze
|
do i = 1,sze
|
||||||
H_matrix_tmp(i,i) = H_jj_dressed(i)
|
H_matrix_tmp(i,i) = H_jj_dressed(i)
|
||||||
@ -141,18 +141,18 @@ subroutine CISD_SC2(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit)
|
|||||||
e_corr_array(i) = u_in(index_double(i),1)*inv_c0 * hij_double(i)
|
e_corr_array(i) = u_in(index_double(i),1)*inv_c0 * hij_double(i)
|
||||||
e_corr_double += e_corr_array(i)
|
e_corr_double += e_corr_array(i)
|
||||||
enddo
|
enddo
|
||||||
write(output_CISD_SC2,'(A,I3)') 'SC2 Iteration ', iter
|
write(output_SC2,'(A,I3)') 'SC2 Iteration ', iter
|
||||||
write(output_CISD_SC2,'(A)') '------------------'
|
write(output_SC2,'(A)') '------------------'
|
||||||
write(output_CISD_SC2,'(A)') ''
|
write(output_SC2,'(A)') ''
|
||||||
write(output_CISD_SC2,'(A)') '===== ================'
|
write(output_SC2,'(A)') '===== ================'
|
||||||
write(output_CISD_SC2,'(A)') 'State Energy '
|
write(output_SC2,'(A)') 'State Energy '
|
||||||
write(output_CISD_SC2,'(A)') '===== ================'
|
write(output_SC2,'(A)') '===== ================'
|
||||||
do i=1,N_st
|
do i=1,N_st
|
||||||
write(output_CISD_SC2,'(I5,X,F16.10)') i, energies(i)+nuclear_repulsion
|
write(output_SC2,'(I5,X,F16.10)') i, energies(i)+nuclear_repulsion
|
||||||
enddo
|
enddo
|
||||||
write(output_CISD_SC2,'(A)') '===== ================'
|
write(output_SC2,'(A)') '===== ================'
|
||||||
write(output_CISD_SC2,'(A)') ''
|
write(output_SC2,'(A)') ''
|
||||||
call write_double(output_CISD_SC2,(e_corr_double - e_corr_double_before),&
|
call write_double(output_SC2,(e_corr_double - e_corr_double_before),&
|
||||||
'Delta(E_corr)')
|
'Delta(E_corr)')
|
||||||
converged = dabs(e_corr_double - e_corr_double_before) < 1.d-10
|
converged = dabs(e_corr_double - e_corr_double_before) < 1.d-10
|
||||||
if (converged) then
|
if (converged) then
|
||||||
@ -162,7 +162,7 @@ subroutine CISD_SC2(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit)
|
|||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
call write_time(output_CISD_SC2)
|
call write_time(output_SC2)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -6,11 +6,11 @@ BEGIN_PROVIDER [ double precision, CI_SC2_energy, (N_states) ]
|
|||||||
|
|
||||||
integer :: j
|
integer :: j
|
||||||
character*(8) :: st
|
character*(8) :: st
|
||||||
call write_time(output_CISD_SC2)
|
call write_time(output_SC2)
|
||||||
do j=1,N_states
|
do j=1,N_states
|
||||||
CI_SC2_energy(j) = CI_SC2_electronic_energy(j) + nuclear_repulsion
|
CI_SC2_energy(j) = CI_SC2_electronic_energy(j) + nuclear_repulsion
|
||||||
write(st,'(I4)') j
|
write(st,'(I4)') j
|
||||||
call write_double(output_CISD_SC2,CI_SC2_energy(j),'Energy of state '//trim(st))
|
call write_double(output_SC2,CI_SC2_energy(j),'Energy of state '//trim(st))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
@ -32,7 +32,7 @@ END_PROVIDER
|
|||||||
|
|
||||||
|
|
||||||
call CISD_SC2(psi_det,CI_SC2_eigenvectors,CI_SC2_electronic_energy, &
|
call CISD_SC2(psi_det,CI_SC2_eigenvectors,CI_SC2_electronic_energy, &
|
||||||
size(CI_SC2_eigenvectors,1),N_det,N_states,N_int,output_CISD_SC2)
|
size(CI_SC2_eigenvectors,1),N_det,N_states,N_int,output_SC2)
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
subroutine diagonalize_CI_SC2
|
subroutine diagonalize_CI_SC2
|
||||||
|
Loading…
Reference in New Issue
Block a user