10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-19 03:36:23 +02:00

Merge branch 'LCPQ-master'

This commit is contained in:
Anthony Scemama 2016-03-04 12:14:09 +01:00
commit 58cfe027d4
2 changed files with 43 additions and 33 deletions

View File

@ -35,7 +35,26 @@ let mo () =
|> print_endline
let psi_det () =
let ezfio_filename =
Sys.argv.(1)
in
if (not (Sys.file_exists_exn ezfio_filename)) then
failwith "Error reading EZFIO file";
Ezfio.set_file ezfio_filename;
let psi_det =
match Input.Determinants_by_hand.read () with
| Some psi_det -> psi_det
| _ -> failwith "Error reading the mo set"
in
Input.Determinants_by_hand.to_rst psi_det
|> Rst_string.to_string
|> print_endline
let () =
basis ();
mo ()
mo ();
psi_det ();

View File

@ -17,7 +17,7 @@ ezfio.set_file(ezfio_path)
do_pseudo = ezfio.get_pseudo_do_pseudo()
if do_pseudo:
print "do_pseudo True"
zcore = ezfio.get_pseudo_nucl_charge_remove()
print "The charge of nucl will be decreasced for taking into acount the pseudo potentiel"
else:
print "do_pseudo False"
@ -68,11 +68,7 @@ print "nucl_num", len(l_label)
print "Atomic coord in Bohr"
for i, t in enumerate(zip(l_label, l_charge, l_coord_str)):
try:
l = (t[0], t[1] + zcore[i], t[2])
except NameError:
l = t
print list_to_string(l)
print list_to_string(t)
#
# Call externet process to get the sysmetry
@ -83,7 +79,8 @@ process = subprocess.Popen(
stdout=subprocess.PIPE)
out, err = process.communicate()
basis_raw, sym_raw, _= out.split("\n\n\n")
print len(out.split("\n\n\n"))
basis_raw, sym_raw, _ , det_raw, _ = out.split("\n\n\n")
# _ __
# |_) _. _ o _ (_ _ _|_
@ -305,8 +302,8 @@ if do_pseudo:
if l_dump:
l_str.append(l_dump)
str_ = "PARAMETERS FOR {0} ON ATOM {1} WITH ZCORE {2} AND LMAX {3} ARE"
print str_.format(a, i + 1, int(zcore[i]), int(len(l_str) - 1))
str_ = "PARAMETERS FOR {0} ON ATOM {1} WITH ZCORE -1 AND LMAX {2} ARE"
print str_.format(a, i + 1, int(len(l_str) - 1))
for i, l in enumerate(l_str):
str_ = "FOR L= {0} COEFF N ZETA"
@ -314,8 +311,7 @@ if do_pseudo:
for ii, ll in enumerate(l):
print " ", ii + 1, ll
str_ = "THE ECP RUN REMOVES {0} CORE ELECTRONS, AND THE SAME NUMBER OF PROTONS."
print str_.format(sum(zcore))
str_ = "THE ECP RUN REMOVES -1 CORE ELECTRONS, AND THE SAME NUMBER OF PROTONS."
print "END_PSEUDO"
# _
@ -329,31 +325,26 @@ print "mo_num", mo_num
print "det_num", n_det
print ""
psi_det = ezfio.get_determinants_psi_det()
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
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))
token = "Determinants ::"
pos = det_raw.rfind(token) + len(token)
print bin_det
det_without_header = det_raw[pos+2::]
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))
d_rep={"+":"1","-":"0"}
print bin_det
print ""
det_without_header = det_raw[pos+2::]
for line_raw in det_without_header.split("\n"):
line = line_raw
if line_raw:
try:
float(line)
except ValueError:
line= "".join([d_rep[x] if x in d_rep else x for x in line_raw])
print line.strip()
print "END_DET"