mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-08 20:33:26 +01:00
Merge Anouar (#53)
* Fix THE QMCPACK Determinant print * Add correlation_energy_ratio_max as an exit criterion * Fix Print * Fix ENDIF * Fix comment
This commit is contained in:
parent
9e32c9250e
commit
4dd50301f1
@ -10,6 +10,12 @@ program fci_zmq
|
|||||||
|
|
||||||
allocate (pt2(N_states))
|
allocate (pt2(N_states))
|
||||||
|
|
||||||
|
IF (correlation_energy_ratio_max .NE. 1.d0) THEN
|
||||||
|
|
||||||
|
DOUBLE PRECISION :: hf_energy_ref
|
||||||
|
CALL ezfio_get_hartree_fock_energy(hf_energy_ref)
|
||||||
|
END IF
|
||||||
|
|
||||||
pt2 = 1.d0
|
pt2 = 1.d0
|
||||||
threshold_davidson_in = threshold_davidson
|
threshold_davidson_in = threshold_davidson
|
||||||
threshold_davidson = threshold_davidson_in * 100.d0
|
threshold_davidson = threshold_davidson_in * 100.d0
|
||||||
@ -41,10 +47,29 @@ program fci_zmq
|
|||||||
E_CI_before(1:N_states) = CI_energy(1:N_states)
|
E_CI_before(1:N_states) = CI_energy(1:N_states)
|
||||||
n_det_before = 0
|
n_det_before = 0
|
||||||
|
|
||||||
|
|
||||||
do while ( (N_det < N_det_max) .and. (maxval(abs(pt2(1:N_states))) > pt2_max) )
|
do while ( (N_det < N_det_max) .and. (maxval(abs(pt2(1:N_states))) > pt2_max) )
|
||||||
|
|
||||||
|
|
||||||
|
IF (correlation_energy_ratio_max .NE. 1.d0) THEN
|
||||||
|
DOUBLE PRECISION :: correlation_energy_var, correlation_energy_var_ratio
|
||||||
|
|
||||||
|
correlation_energy_var = MAXVAL(E_CI_before) - hf_energy_ref
|
||||||
|
correlation_energy_var_ratio = correlation_energy_var / (correlation_energy_var + MAXVAL(pt2(:)))
|
||||||
|
|
||||||
|
IF (correlation_energy_ratio_max < correlation_energy_var_ratio) THEN
|
||||||
|
EXIT
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
print *, 'N_det = ', N_det
|
print *, 'N_det = ', N_det
|
||||||
print *, 'N_states = ', N_states
|
print *, 'N_states = ', N_states
|
||||||
|
IF (correlation_energy_ratio_max .NE. 1.d0) THEN
|
||||||
|
print*, 'correlation_ratio = ', correlation_energy_var
|
||||||
|
ENDIF
|
||||||
|
|
||||||
do k=1, N_states
|
do k=1, N_states
|
||||||
print*,'State ',k
|
print*,'State ',k
|
||||||
print *, 'PT2 = ', pt2(k)
|
print *, 'PT2 = ', pt2(k)
|
||||||
|
@ -14,10 +14,17 @@ default: 0.0001
|
|||||||
[var_pt2_ratio]
|
[var_pt2_ratio]
|
||||||
type: Normalized_float
|
type: Normalized_float
|
||||||
doc: The selection process stops when the energy ratio variational/(variational+PT2)
|
doc: The selection process stops when the energy ratio variational/(variational+PT2)
|
||||||
is equal to var_pt2_ratio
|
is equal to var_pt2_ratio. (Obsolete. Need to be removed)
|
||||||
interface: ezfio,provider,ocaml
|
interface: ezfio,provider,ocaml
|
||||||
default: 0.75
|
default: 0.75
|
||||||
|
|
||||||
|
[correlation_energy_ratio_max]
|
||||||
|
type: Normalized_float
|
||||||
|
doc: The selection process stops at a fixed correlation ratio (usefull for getting same accuracy between molecules)
|
||||||
|
Defined as (E_CI-E_HF)/ (E_CI+PT2 - E_HF) If Ratio eq 1 it will not be used. (E_HF) is not required.
|
||||||
|
interface: ezfio,provider,ocaml
|
||||||
|
default: 1.00
|
||||||
|
|
||||||
[threshold_generators_pt2]
|
[threshold_generators_pt2]
|
||||||
type: Threshold
|
type: Threshold
|
||||||
doc: Thresholds on generators (fraction of the norm) for final PT2 calculation
|
doc: Thresholds on generators (fraction of the norm) for final PT2 calculation
|
||||||
|
@ -183,9 +183,6 @@ def get_nb_permutation(str_):
|
|||||||
|
|
||||||
|
|
||||||
def order_l_l_sym(l_l_sym):
|
def order_l_l_sym(l_l_sym):
|
||||||
|
|
||||||
l_order_mo = [i for i,_ in enumerate(l_l_sym)]
|
|
||||||
|
|
||||||
n = 1
|
n = 1
|
||||||
for i in range(len(l_l_sym)):
|
for i in range(len(l_l_sym)):
|
||||||
if n != 1:
|
if n != 1:
|
||||||
@ -195,11 +192,11 @@ def order_l_l_sym(l_l_sym):
|
|||||||
l = l_l_sym[i]
|
l = l_l_sym[i]
|
||||||
n = get_nb_permutation(l[2])
|
n = get_nb_permutation(l[2])
|
||||||
|
|
||||||
l_l_sym[i:i + n], l_order_mo[i:i+n] = zip(*sorted(zip(l_l_sym[i:i + n],l_order_mo[i:i+n]),
|
l_l_sym[i:i + n] = sorted(l_l_sym[i:i + n],
|
||||||
key=lambda x: x[0][2],
|
key=lambda x: x[2],
|
||||||
cmp=compare_gamess_style))
|
cmp=compare_gamess_style)
|
||||||
|
|
||||||
return l_l_sym, l_order_mo
|
return l_l_sym
|
||||||
|
|
||||||
|
|
||||||
#==========================
|
#==========================
|
||||||
@ -208,13 +205,8 @@ def order_l_l_sym(l_l_sym):
|
|||||||
|
|
||||||
l_sym_without_header = sym_raw.split("\n")[3:-2]
|
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_raw = [i.split() for i in l_sym_without_header]
|
||||||
print len(l_l_sym_raw)
|
|
||||||
|
|
||||||
l_l_sym_expend_sym = expend_sym_l(l_l_sym_raw)
|
l_l_sym_expend_sym = expend_sym_l(l_l_sym_raw)
|
||||||
print len(l_l_sym_expend_sym)
|
l_l_sym_ordered = order_l_l_sym(l_l_sym_expend_sym)
|
||||||
|
|
||||||
l_l_sym_ordered, l_order_mo = order_l_l_sym(l_l_sym_expend_sym)
|
|
||||||
|
|
||||||
|
|
||||||
#========
|
#========
|
||||||
#MO COEF
|
#MO COEF
|
||||||
@ -356,7 +348,6 @@ d_rep={"+":"1","-":"0"}
|
|||||||
|
|
||||||
det_without_header = det_raw[pos+2::]
|
det_without_header = det_raw[pos+2::]
|
||||||
|
|
||||||
|
|
||||||
for line_raw in det_without_header.split("\n"):
|
for line_raw in det_without_header.split("\n"):
|
||||||
line = line_raw
|
line = line_raw
|
||||||
|
|
||||||
@ -364,10 +355,8 @@ for line_raw in det_without_header.split("\n"):
|
|||||||
try:
|
try:
|
||||||
float(line)
|
float(line)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
line_order = [line_raw[i] for i in l_order_mo]
|
|
||||||
line= "".join([d_rep[x] if x in d_rep else x for x in line_raw])
|
line= "".join([d_rep[x] if x in d_rep else x for x in line_raw])
|
||||||
|
|
||||||
print line.strip()
|
print line.strip()
|
||||||
|
|
||||||
print "END_DET"
|
print "END_DET"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user