mirror of
https://github.com/LCPQ/quantum_package
synced 2024-11-12 17:13:54 +01:00
Introduced generators_bitmask in EZFIO
This commit is contained in:
parent
1caa90b2ae
commit
d5bbe35bff
@ -57,9 +57,15 @@ Documentation
|
||||
`full_ijkl_bitmask <http://github.com/LCPQ/quantum_package/tree/master/src/Bitmask/bitmasks.irp.f#L12>`_
|
||||
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>`_
|
||||
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>`_
|
||||
Number of 64-bit integers needed to represent determinants as binary strings
|
||||
|
||||
|
8
src/Bitmask/bitmasks.ezfio_config
Normal file
8
src/Bitmask/bitmasks.ezfio_config
Normal file
@ -0,0 +1,8 @@
|
||||
bitmasks
|
||||
N_int integer
|
||||
bit_kind integer
|
||||
N_mask_gen integer
|
||||
generators integer (bitmasks_N_int*bitmasks_bit_kind/4,2,2,bitmasks_N_mask_gen)
|
||||
N_mask_ref integer
|
||||
reference integer (bitmasks_N_int*bitmasks_bit_kind/4,2,2,bitmasks_N_mask_ref)
|
||||
|
@ -55,4 +55,57 @@ BEGIN_PROVIDER [ integer(bit_kind), ref_bitmask, (N_int,2)]
|
||||
ref_bitmask = HF_bitmask
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ integer, N_generators_bitmask ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Number of bitmasks for generators
|
||||
END_DOC
|
||||
logical :: exists
|
||||
PROVIDE ezfio_filename
|
||||
|
||||
call ezfio_has_bitmasks_N_mask_gen(exists)
|
||||
if (exists) then
|
||||
call ezfio_get_bitmasks_N_mask_gen(N_generators_bitmask)
|
||||
integer :: N_int_check
|
||||
integer :: bit_kind_check
|
||||
call ezfio_get_bitmasks_bit_kind(bit_kind_check)
|
||||
if (bit_kind_check /= bit_kind) then
|
||||
print *, bit_kind_check, bit_kind
|
||||
print *, 'Error: bit_kind is not correct in EZFIO file'
|
||||
endif
|
||||
call ezfio_get_bitmasks_N_int(N_int_check)
|
||||
if (N_int_check /= N_int) then
|
||||
print *, N_int_check, N_int
|
||||
print *, 'Error: N_int is not correct in EZFIO file'
|
||||
endif
|
||||
else
|
||||
N_generators_bitmask = 1
|
||||
call ezfio_set_bitmasks_N_int(N_int)
|
||||
call ezfio_set_bitmasks_bit_kind(bit_kind)
|
||||
call ezfio_set_bitmasks_N_mask_gen(N_generators_bitmask)
|
||||
endif
|
||||
ASSERT (N_generators_bitmask > 0)
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ integer(bit_kind), generators_bitmask, (N_int,2,2,N_generators_bitmask) ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Bitmasks for generator determinants. (N_int, alpha/beta, hole/particle, generator)
|
||||
END_DOC
|
||||
logical :: exists
|
||||
PROVIDE ezfio_filename
|
||||
|
||||
call ezfio_has_bitmasks_generators(exists)
|
||||
if (exists) then
|
||||
call ezfio_get_bitmasks_generators(generators_bitmask)
|
||||
else
|
||||
generators_bitmask(:,:,1,1) = HF_bitmask
|
||||
generators_bitmask(:,1,2,1) = iand(not(HF_bitmask(:,1)),full_ijkl_bitmask(:,1))
|
||||
generators_bitmask(:,2,2,1) = iand(not(HF_bitmask(:,2)),full_ijkl_bitmask(:,2))
|
||||
call ezfio_set_bitmasks_generators(generators_bitmask)
|
||||
endif
|
||||
ASSERT (N_generators_bitmask > 0)
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
|
@ -49,19 +49,16 @@ subroutine H_apply_cisd
|
||||
|
||||
integer(bit_kind) :: hole_mask(N_int,2)
|
||||
integer(bit_kind) :: particle_mask(N_int,2)
|
||||
hole_mask(:,1) = HF_bitmask(:,1)
|
||||
hole_mask(:,2) = HF_bitmask(:,2)
|
||||
particle_mask(:,1) = iand(not(HF_bitmask(:,1)),full_ijkl_bitmask(:,1))
|
||||
particle_mask(:,2) = iand(not(HF_bitmask(:,2)),full_ijkl_bitmask(:,2))
|
||||
|
||||
PROVIDE N_det_generators
|
||||
|
||||
call H_apply_cisd_OpenMP_monoexc(HF_bitmask, &
|
||||
hole_mask, particle_mask)
|
||||
call H_apply_cisd_OpenMP_diexc(HF_bitmask, &
|
||||
hole_mask, particle_mask, &
|
||||
hole_mask, particle_mask )
|
||||
|
||||
|
||||
ASSERT (N_det_generators == 1)
|
||||
PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map
|
||||
|
||||
call H_apply_cisd_OpenMP_monoexc(HF_bitmask, &
|
||||
generators_bitmask(:,:,1,1), generators_bitmask(:,:,2,1))
|
||||
call H_apply_cisd_OpenMP_diexc(HF_bitmask, &
|
||||
generators_bitmask(:,:,1,1), generators_bitmask(:,:,2,1), &
|
||||
generators_bitmask(:,:,1,1), generators_bitmask(:,:,2,1) )
|
||||
|
||||
call copy_h_apply_buffer_to_wf
|
||||
end
|
||||
|
||||
|
@ -50,8 +50,5 @@ Documentation
|
||||
`repeat_excitation <http://github.com/LCPQ/quantum_package/tree/master/src/CISD/SC2.irp.f#L143>`_
|
||||
Undocumented
|
||||
|
||||
`cisd <http://github.com/LCPQ/quantum_package/tree/master/src/CISD/cisd_sc2.irp.f#L1>`_
|
||||
Undocumented
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user