mirror of
https://github.com/LCPQ/quantum_package
synced 2024-08-24 21:41:46 +02:00
Merge branch 'LCPQ-master'
This commit is contained in:
commit
58cfe027d4
@ -35,7 +35,26 @@ let mo () =
|
|||||||
|> print_endline
|
|> 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 () =
|
let () =
|
||||||
basis ();
|
basis ();
|
||||||
mo ()
|
mo ();
|
||||||
|
psi_det ();
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ ezfio.set_file(ezfio_path)
|
|||||||
do_pseudo = ezfio.get_pseudo_do_pseudo()
|
do_pseudo = ezfio.get_pseudo_do_pseudo()
|
||||||
if do_pseudo:
|
if do_pseudo:
|
||||||
print "do_pseudo True"
|
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:
|
else:
|
||||||
print "do_pseudo False"
|
print "do_pseudo False"
|
||||||
|
|
||||||
@ -68,11 +68,7 @@ print "nucl_num", len(l_label)
|
|||||||
print "Atomic coord in Bohr"
|
print "Atomic coord in Bohr"
|
||||||
|
|
||||||
for i, t in enumerate(zip(l_label, l_charge, l_coord_str)):
|
for i, t in enumerate(zip(l_label, l_charge, l_coord_str)):
|
||||||
try:
|
print list_to_string(t)
|
||||||
l = (t[0], t[1] + zcore[i], t[2])
|
|
||||||
except NameError:
|
|
||||||
l = t
|
|
||||||
print list_to_string(l)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Call externet process to get the sysmetry
|
# Call externet process to get the sysmetry
|
||||||
@ -83,7 +79,8 @@ process = subprocess.Popen(
|
|||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
out, err = process.communicate()
|
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 _ (_ _ _|_
|
# |_) _. _ o _ (_ _ _|_
|
||||||
@ -305,8 +302,8 @@ if do_pseudo:
|
|||||||
if l_dump:
|
if l_dump:
|
||||||
l_str.append(l_dump)
|
l_str.append(l_dump)
|
||||||
|
|
||||||
str_ = "PARAMETERS FOR {0} ON ATOM {1} WITH ZCORE {2} AND LMAX {3} ARE"
|
str_ = "PARAMETERS FOR {0} ON ATOM {1} WITH ZCORE -1 AND LMAX {2} ARE"
|
||||||
print str_.format(a, i + 1, int(zcore[i]), int(len(l_str) - 1))
|
print str_.format(a, i + 1, int(len(l_str) - 1))
|
||||||
|
|
||||||
for i, l in enumerate(l_str):
|
for i, l in enumerate(l_str):
|
||||||
str_ = "FOR L= {0} COEFF N ZETA"
|
str_ = "FOR L= {0} COEFF N ZETA"
|
||||||
@ -314,8 +311,7 @@ if do_pseudo:
|
|||||||
for ii, ll in enumerate(l):
|
for ii, ll in enumerate(l):
|
||||||
print " ", ii + 1, ll
|
print " ", ii + 1, ll
|
||||||
|
|
||||||
str_ = "THE ECP RUN REMOVES {0} CORE ELECTRONS, AND THE SAME NUMBER OF PROTONS."
|
str_ = "THE ECP RUN REMOVES -1 CORE ELECTRONS, AND THE SAME NUMBER OF PROTONS."
|
||||||
print str_.format(sum(zcore))
|
|
||||||
print "END_PSEUDO"
|
print "END_PSEUDO"
|
||||||
|
|
||||||
# _
|
# _
|
||||||
@ -329,31 +325,26 @@ print "mo_num", mo_num
|
|||||||
print "det_num", n_det
|
print "det_num", n_det
|
||||||
print ""
|
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 = ""
|
token = "Determinants ::"
|
||||||
for i,int_det in enumerate(l_det_bit_alpha):
|
pos = det_raw.rfind(token) + len(token)
|
||||||
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
|
det_without_header = det_raw[pos+2::]
|
||||||
|
|
||||||
bin_det = ""
|
d_rep={"+":"1","-":"0"}
|
||||||
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
|
det_without_header = det_raw[pos+2::]
|
||||||
print ""
|
|
||||||
|
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"
|
print "END_DET"
|
||||||
|
Loading…
Reference in New Issue
Block a user