mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-31 00:23:42 +02:00
Merge pull request #137 from TApplencourt/master
Corected script qmcpack
This commit is contained in:
commit
3d12ee82da
@ -175,29 +175,31 @@ def get_nb_permutation(str_):
|
||||
|
||||
|
||||
def order_l_l_sym(l_l_sym):
|
||||
l_l_sym_iter = iter(l_l_sym)
|
||||
for i, l in enumerate(l_l_sym_iter):
|
||||
n = get_nb_permutation(l[2])
|
||||
n = 1
|
||||
for i in range(len(l_l_sym)):
|
||||
if n != 1:
|
||||
n += -1
|
||||
continue
|
||||
|
||||
l = l_l_sym[i]
|
||||
n = get_nb_permutation(l[2])
|
||||
|
||||
l_l_sym[i:i + n] = sorted(l_l_sym[i:i + n],
|
||||
key=lambda x: x[2],
|
||||
cmp=compare_gamess_style)
|
||||
for next_ in range(n - 1):
|
||||
next(l_l_sym_iter)
|
||||
|
||||
return l_l_sym
|
||||
|
||||
|
||||
#==========================
|
||||
# We will order the symetry
|
||||
#==========================
|
||||
|
||||
l_sym_without_header = sym_raw.split("\n")[3:-2]
|
||||
|
||||
l_l_sym_raw = [i.split() for i in l_sym_without_header]
|
||||
l_l_sym_expend_sym = expend_sym_l(l_l_sym_raw)
|
||||
|
||||
l_l_sym_ordered = order_l_l_sym(l_l_sym_expend_sym)
|
||||
|
||||
|
||||
#========
|
||||
#MO COEF
|
||||
#========
|
||||
@ -220,14 +222,6 @@ def order_phase(mo_coef):
|
||||
mo_coef_phase.append(ii)
|
||||
return mo_coef_phase
|
||||
|
||||
|
||||
def order_by_sim(mo_coef, l_l_sym):
|
||||
l_sym_oder = [int(l[0]) - 1 for l in l_l_sym]
|
||||
mo_coef_order = [[x for (y, x) in sorted(zip(l_sym_oder, i))]
|
||||
for i in mo_coef]
|
||||
return mo_coef_order
|
||||
|
||||
|
||||
def chunked(l, chunks_size):
|
||||
l_block = []
|
||||
for i in l:
|
||||
@ -264,10 +258,7 @@ def print_mo_coef(mo_coef_block, l_l_sym):
|
||||
|
||||
|
||||
mo_coef = ezfio.get_mo_basis_mo_coef()
|
||||
#mo_coef_phase = order_phase(mo_coef)
|
||||
mo_coef_phase = mo_coef
|
||||
mo_coef_phase_order = order_by_sim(mo_coef_phase, l_l_sym_ordered)
|
||||
mo_coef_transp = zip(*mo_coef_phase_order)
|
||||
mo_coef_transp = zip(*mo_coef)
|
||||
mo_coef_block = chunked(mo_coef_transp, 4)
|
||||
print_mo_coef(mo_coef_block, l_l_sym_ordered)
|
||||
|
||||
@ -343,14 +334,25 @@ psi_coef = ezfio.get_determinants_psi_coef()[0]
|
||||
|
||||
for c, (l_det_bit_alpha, l_det_bit_beta) in zip(psi_coef, psi_det):
|
||||
print c
|
||||
for det in l_det_bit_alpha:
|
||||
bin_det_raw = "{0:b}".format(det)[::-1]
|
||||
bin_det = bin_det_raw + "0" * (mo_num - len(bin_det_raw))
|
||||
|
||||
bin_det = ""
|
||||
for i,int_det in enumerate(l_det_bit_alpha):
|
||||
bin_det_raw = "{0:b}".format(int_det)[::-1]
|
||||
if mo_num - 64*(i+1) > 0:
|
||||
bin_det += bin_det_raw + "0" * (64*(i+1) - len(bin_det_raw))
|
||||
else:
|
||||
bin_det += bin_det_raw + "0" * (mo_num-64*i - len(bin_det_raw))
|
||||
|
||||
print bin_det
|
||||
|
||||
for det in l_det_bit_beta:
|
||||
bin_det_raw = "{0:b}".format(det)[::-1]
|
||||
bin_det = bin_det_raw + "0" * (mo_num - len(bin_det_raw))
|
||||
bin_det = ""
|
||||
for i,int_det in enumerate(l_det_bit_beta):
|
||||
bin_det_raw = "{0:b}".format(int_det)[::-1]
|
||||
if mo_num - 64*(i+1) > 0:
|
||||
bin_det += bin_det_raw + "0" * (64*(i+1) - len(bin_det_raw))
|
||||
else:
|
||||
bin_det += bin_det_raw + "0" * (mo_num-64*i - len(bin_det_raw))
|
||||
|
||||
print bin_det
|
||||
print ""
|
||||
|
@ -15,6 +15,6 @@ program qmcpack
|
||||
enddo
|
||||
call ezfio_set_ao_basis_ao_coef(ao_coef)
|
||||
call system('rm '//trim(ezfio_filename)//'/mo_basis/ao_md5')
|
||||
call system('$QP_ROOT/src/qmcpack/qp_convert_qmcpack_from_ezfio.py '//trim(ezfio_filename))
|
||||
call system('$QP_ROOT/src/qmcpack/qp_convert_qmcpack_to_ezfio.py '//trim(ezfio_filename))
|
||||
|
||||
end
|
||||
|
@ -69,7 +69,6 @@ subroutine cache_map_init(map,sze)
|
||||
implicit none
|
||||
type (cache_map_type), intent(inout) :: map
|
||||
integer(cache_map_size_kind) :: sze
|
||||
call omp_init_lock(map%lock)
|
||||
call omp_set_lock(map%lock)
|
||||
map%n_elements = 0_8
|
||||
map%map_size = 0_8
|
||||
@ -101,6 +100,9 @@ subroutine map_init(map,keymax)
|
||||
stop 5
|
||||
endif
|
||||
sze = 2
|
||||
do i=0_8,map%map_size
|
||||
call omp_init_lock(map%map(i)%lock)
|
||||
enddo
|
||||
!$OMP PARALLEL DEFAULT(NONE) SHARED(map,sze) PRIVATE(i)
|
||||
!$OMP DO SCHEDULE(STATIC,512)
|
||||
do i=0_8,map%map_size
|
||||
|
Loading…
Reference in New Issue
Block a user