10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-23 04:43:50 +01:00

Merge branch 'master' of github.com:TApplencourt/quantum_package

This commit is contained in:
TApplencourt 2016-03-07 20:35:56 +01:00
commit b521a8d015
9 changed files with 161 additions and 25 deletions

118
data/list_element.txt Normal file
View File

@ -0,0 +1,118 @@
1 H Hydrogen
2 He Helium
3 Li Lithium
4 Be Beryllium
5 B Boron
6 C Carbon
7 N Nitrogen
8 O Oxygen
9 F Fluorine
10 Ne Neon
11 Na Sodium
12 Mg Magnesium
13 Al Aluminum
14 Si Silicon
15 P Phosphorus
16 S Sulfur
17 Cl Chlorine
18 Ar Argon
19 K Potassium
20 Ca Calcium
21 Sc Scandium
22 Ti Titanium
23 V Vanadium
24 Cr Chromium
25 Mn Manganese
26 Fe Iron
27 Co Cobalt
28 Ni Nickel
29 Cu Copper
30 Zn Zinc
31 Ga Gallium
32 Ge Germanium
33 As Arsenic
34 Se Selenium
35 Br Bromine
36 Kr Krypton
37 Rb Rubidium
38 Sr Strontium
39 Y Yttrium
40 Zr Zirconium
41 Nb Niobium
42 Mo Molybdenum
43 Tc Technetium
44 Ru Ruthenium
45 Rh Rhodium
46 Pd Palladium
47 Ag Silver
48 Cd Cadmium
49 In Indium
50 Sn Tin
51 Sb Antimony
52 Te Tellurium
53 I Iodine
54 Xe Xenon
55 Cs Cesium
56 Ba Barium
57 La Lanthanum
58 Ce Cerium
59 Pr Praseodymium
60 Nd Neodymium
61 Pm Promethium
62 Sm Samarium
63 Eu Europium
64 Gd Gadolinium
65 Tb Terbium
66 Dy Dysprosium
67 Ho Holmium
68 Er Erbium
69 Tm Thulium
70 Yb Ytterbium
71 Lu Lutetium
72 Hf Hafnium
73 Ta Tantalum
74 W Tungsten
75 Re Rhenium
76 Os Osmium
77 Ir Iridium
78 Pt Platinum
79 Au Gold
80 Hg Mercury
81 Tl Thallium
82 Pb Lead
83 Bi Bismuth
84 Po Polonium
85 At Astatine
86 Rn Radon
87 Fr Francium
88 Ra Radium
89 Ac Actinium
90 Th Thorium
91 Pa Protactinium
92 U Uranium
93 Np Neptunium
94 Pu Plutonium
95 Am Americium
96 Cm Curium
97 Bk Berkelium
98 Cf Californium
99 Es Einsteinium
100 Fm Fermium
101 Md Mendelevium
102 No Nobelium
103 Lr Lawrencium
104 Rf Rutherfordium
105 Db Dubnium
106 Sg Seaborgium
107 Bh Bohrium
108 Hs Hassium
109 Mt Meitnerium
110 Ds Darmstadtium
111 Rg Roentgenium
112 Cn Copernicium
113 Uut Ununtrium
114 Fl Flerovium
115 Uup Ununpentium
116 Lv Livermorium
117 Uus Ununseptium
118 Uuo Ununoctium

View File

@ -11,7 +11,8 @@ module Determinants_by_hand : sig
psi_coef : Det_coef.t array;
psi_det : Determinant.t array;
} with sexp
val read : unit -> t option
val read : unit -> t
val read_maybe : unit -> t option
val write : t -> unit
val to_string : t -> string
val to_rst : t -> Rst_string.t
@ -210,13 +211,6 @@ end = struct
let read () =
if (Ezfio.has_mo_basis_mo_tot_num ()) then
let n_det =
read_n_det ()
in
if ( (Det_number.to_int n_det) > n_det_read_max ) then
None
else
Some
{ n_int = read_n_int () ;
bit_kind = read_bit_kind () ;
n_det = read_n_det () ;
@ -224,6 +218,17 @@ end = struct
psi_coef = read_psi_coef () ;
psi_det = read_psi_det () ;
}
else
failwith "No molecular orbitals, so no determinants"
;;
let read_maybe () =
let n_det =
read_n_det ()
in
if ( (Det_number.to_int n_det) < n_det_read_max ) then
try Some (read ()) with
| Failure _ -> None
else
None
;;

View File

@ -36,7 +36,7 @@ let bind_socket ~socket_type ~socket ~address =
| 0 -> failwith @@ Printf.sprintf
"Unable to bind the %s socket : %s "
socket_type address
| -1 -> ();
| -1 -> ()
| i ->
try
ZMQ.Socket.bind socket address;

View File

@ -43,9 +43,7 @@ let psi_det () =
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"
Input.Determinants_by_hand.read ()
in
Input.Determinants_by_hand.to_rst psi_det
|> Rst_string.to_string
@ -56,5 +54,5 @@ let psi_det () =
let () =
basis ();
mo ();
psi_det ();
psi_det ()

View File

@ -1,7 +1,7 @@
open Core.Std
let () =
Message.of_string "new_job tcp://127.0.0.1 inproc://ao_ints:12345 ao_integrals"
Message.of_string "new_job ao_integrals tcp://127.0.0.1 inproc://ao_ints:12345"
|> Message.to_string
|> print_endline
;
@ -37,7 +37,7 @@ let () =
;
try
Message.of_string "new_job inproc://ao_ints tcp://127.0.0.1:12345 ao_integrals"
Message.of_string "new_job ao_integrals inproc://ao_ints tcp://127.0.0.1:12345"
|> Message.to_string
|> print_endline
;

View File

@ -9,6 +9,7 @@ print "#QP -> QMCPACK"
from ezfio import ezfio
import os
import sys
ezfio_path = sys.argv[1]
@ -17,7 +18,15 @@ ezfio.set_file(ezfio_path)
do_pseudo = ezfio.get_pseudo_do_pseudo()
if do_pseudo:
print "do_pseudo True"
print "The charge of nucl will be decreasced for taking into acount the pseudo potentiel"
from qp_path import QP_ROOT
l_ele_path = os.path.join(QP_ROOT,"data","list_element.txt")
with open(l_ele_path, "r") as f:
data_raw = f.read()
l_element_raw = data_raw.split("\n")
l_element = [element_raw.split() for element_raw in l_element_raw]
d_z = dict((abr, z) for (z, abr, ele) in l_element)
else:
print "do_pseudo False"
@ -68,7 +77,10 @@ print "nucl_num", len(l_label)
print "Atomic coord in Bohr"
for i, t in enumerate(zip(l_label, l_charge, l_coord_str)):
print list_to_string(t)
t_1 = d_z[t[0]] if do_pseudo else t[1]
t_new = [t[0],t_1,t[2]]
print list_to_string(t_new)
#
# Call externet process to get the sysmetry
@ -79,7 +91,6 @@ process = subprocess.Popen(
stdout=subprocess.PIPE)
out, err = process.communicate()
print len(out.split("\n\n\n"))
basis_raw, sym_raw, _ , det_raw, _ = out.split("\n\n\n")
# _ __
@ -310,8 +321,8 @@ if do_pseudo:
if l_dump:
l_str.append(l_dump)
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))
str_ = "PARAMETERS FOR {0} ON ATOM {1} WITH ZCORE {2} AND LMAX {3} ARE"
print str_.format(a, i + 1, int(d_z[a])-int(l_charge[i]), int(len(l_str) - 1))
for i, l in enumerate(l_str):
str_ = "FOR L= {0} COEFF N ZETA"
@ -319,7 +330,8 @@ if do_pseudo:
for ii, ll in enumerate(l):
print " ", ii + 1, ll
str_ = "THE ECP RUN REMOVES -1 CORE ELECTRONS, AND THE SAME NUMBER OF PROTONS."
str_ = "THE ECP RUN REMOVES {0} CORE ELECTRONS, AND THE SAME NUMBER OF PROTONS."
print str_.format(sum([int(d_z[a])-int(l_charge[i]) for i,a in enumerate(l_label)]))
print "END_PSEUDO"
# _

View File

@ -14,6 +14,12 @@ program qmcpack
enddo
enddo
call ezfio_set_ao_basis_ao_coef(ao_coef)
do j=1,mo_tot_num
do i=1,ao_num
mo_coef(i,j) *= 1.d0/ao_coef_normalization_factor(i)
enddo
enddo
call save_mos
call system('rm '//trim(ezfio_filename)//'/mo_basis/ao_md5')
call system('$QP_ROOT/src/qmcpack/qp_convert_qmcpack_to_ezfio.py '//trim(ezfio_filename))

View File

@ -75,7 +75,7 @@ let get s =
| Ao_basis ->
f Ao_basis.(read, to_rst)
| Determinants_by_hand ->
f Determinants_by_hand.(read, to_rst)
f Determinants_by_hand.(read_maybe, to_rst)
{section_to_rst}
end
with

View File

@ -52,9 +52,6 @@ END_PROVIDER
enddo
enddo
ao_coef_normalization_factor(i) = 1.d0/sqrt(norm)
do j=1,ao_prim_num(i)
ao_coef_normalized(i,j) = ao_coef_normalized(i,j) * ao_coef_normalization_factor(i)
enddo
enddo
END_PROVIDER