mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-03 10:05:57 +01:00
add create_excitations.irp.f
This commit is contained in:
parent
f5315414b0
commit
31dc7cc641
36
src/Dets/create_excitations.irp.f
Normal file
36
src/Dets/create_excitations.irp.f
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
subroutine do_mono_excitation(key_in,i_hole,i_particle,ispin,i_ok)
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Apply the mono excitation operator : a^{dager}_(i_particle) a_(i_hole) of spin = ispin
|
||||||
|
! on key_in
|
||||||
|
! ispin = 1 == alpha
|
||||||
|
! ispin = 2 == beta
|
||||||
|
! i_ok = 1 == the excitation is possible
|
||||||
|
! i_ok = -1 == the excitation is not possible
|
||||||
|
END_DOC
|
||||||
|
integer, intent(in) :: i_hole,i_particle,ispin
|
||||||
|
integer(bit_kind), intent(inout) :: key_in(N_int,2)
|
||||||
|
integer, intent(out) :: i_ok
|
||||||
|
integer :: k,j,i
|
||||||
|
use bitmasks
|
||||||
|
ASSERT (i_hole > 0 )
|
||||||
|
ASSERT (i_particle <= mo_tot_num)
|
||||||
|
i_ok = 1
|
||||||
|
! hole
|
||||||
|
k = ishft(i_hole-1,-bit_kind_shift)+1
|
||||||
|
j = i_hole-ishft(k-1,bit_kind_shift)-1
|
||||||
|
key_in(k,ispin) = ibclr(key_in(k,ispin),j)
|
||||||
|
|
||||||
|
! particle
|
||||||
|
k = ishft(i_particle-1,-bit_kind_shift)+1
|
||||||
|
j = i_particle-ishft(k-1,bit_kind_shift)-1
|
||||||
|
key_in(k,ispin) = ibset(key_in(k,ispin),j)
|
||||||
|
integer :: n_elec_tmp
|
||||||
|
n_elec_tmp = 0
|
||||||
|
do i = 1, N_int
|
||||||
|
n_elec_tmp += popcnt(key_in(i,1)) + popcnt(key_in(i,2))
|
||||||
|
enddo
|
||||||
|
if(n_elec_tmp .ne. elec_num)then
|
||||||
|
i_ok = -1
|
||||||
|
endif
|
||||||
|
end
|
2162
tests/ethylen.CAS1212.gms.out
Normal file
2162
tests/ethylen.CAS1212.gms.out
Normal file
File diff suppressed because it is too large
Load Diff
7
tests/methane.xyz
Normal file
7
tests/methane.xyz
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
5
|
||||||
|
methane molecule (in ångströms)
|
||||||
|
C 0.000000 0.000000 0.000000
|
||||||
|
H 0.000000 0.000000 1.089000
|
||||||
|
H 1.026719 0.000000 -0.363000
|
||||||
|
H -0.513360 -0.889165 -0.363000
|
||||||
|
H -0.513360 0.889165 -0.363000
|
Loading…
Reference in New Issue
Block a user