mirror of
https://github.com/LCPQ/quantum_package
synced 2025-04-28 11:15:01 +02:00
Suport pseudo in qp_create
This commit is contained in:
parent
b1ab3c5ce4
commit
cdc9f46428
@ -13,10 +13,12 @@ let spec =
|
|||||||
~doc:"int Total charge of the molecule. Default is 0."
|
~doc:"int Total charge of the molecule. Default is 0."
|
||||||
+> flag "m" (optional_with_default 1 int)
|
+> flag "m" (optional_with_default 1 int)
|
||||||
~doc:"int Spin multiplicity (2S+1) of the molecule. Default is 1."
|
~doc:"int Spin multiplicity (2S+1) of the molecule. Default is 1."
|
||||||
|
+> flag "p" (optional_with_default 1 int)
|
||||||
|
~doc:"Using pseudo potentiel or not"
|
||||||
+> anon ("xyz_file" %: string)
|
+> anon ("xyz_file" %: string)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let run ?o b c m xyz_file =
|
let run ?o b c m p xyz_file =
|
||||||
|
|
||||||
(* Read molecule *)
|
(* Read molecule *)
|
||||||
let molecule =
|
let molecule =
|
||||||
@ -60,8 +62,12 @@ let run ?o b c m xyz_file =
|
|||||||
| None -> (* Principal basis *)
|
| None -> (* Principal basis *)
|
||||||
let basis = elem_and_basis_name in
|
let basis = elem_and_basis_name in
|
||||||
let command =
|
let command =
|
||||||
|
if (p = 0) then
|
||||||
Qpackage.root ^ "/scripts/get_basis.sh \"" ^ temp_filename
|
Qpackage.root ^ "/scripts/get_basis.sh \"" ^ temp_filename
|
||||||
^ "\" \"" ^ basis ^"\""
|
^ "\" \"" ^ basis ^"\""
|
||||||
|
else
|
||||||
|
Qpackage.root ^ "/scripts/get_basis.sh \"" ^ temp_filename
|
||||||
|
^ "\" \"" ^ basis ^"\" pseudo"
|
||||||
in
|
in
|
||||||
begin
|
begin
|
||||||
let filename =
|
let filename =
|
||||||
@ -247,6 +253,9 @@ let run ?o b c m xyz_file =
|
|||||||
~rank:2 ~dim:[| ao_num ; ao_prim_num_max |] ~data:ao_expo) ;
|
~rank:2 ~dim:[| ao_num ; ao_prim_num_max |] ~data:ao_expo) ;
|
||||||
|
|
||||||
|
|
||||||
|
(* Doesn't work... *)
|
||||||
|
(* if p = 1 then Qpackage.root ^ "scripts/pseudo/put_pseudo_in_ezfio.py" ezfio_file.to_string; *)
|
||||||
|
|
||||||
match Input.Ao_basis.read () with
|
match Input.Ao_basis.read () with
|
||||||
| None -> failwith "Error in basis"
|
| None -> failwith "Error in basis"
|
||||||
| Some x -> Input.Ao_basis.write x
|
| Some x -> Input.Ao_basis.write x
|
||||||
@ -266,8 +275,8 @@ elements can be defined as follows:
|
|||||||
|
|
||||||
")
|
")
|
||||||
spec
|
spec
|
||||||
(fun o b c m xyz_file () ->
|
(fun o b c m p xyz_file () ->
|
||||||
run ?o b c m xyz_file )
|
run ?o b c m p xyz_file )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let () =
|
let () =
|
||||||
|
@ -50,6 +50,6 @@ if [[ -z $pseudo ]]
|
|||||||
then
|
then
|
||||||
${EMSL_API_ROOT}/EMSL_api.py get_basis_data --treat_l --save --path="${tmpfile}" --basis="${basis}"
|
${EMSL_API_ROOT}/EMSL_api.py get_basis_data --treat_l --save --path="${tmpfile}" --basis="${basis}"
|
||||||
else
|
else
|
||||||
${EMSL_API_ROOT}/EMSL_api.py get_basis_data --treat_l --save --path="${tmpfile}" --basis="${basis}" --db_path="${EMSL_API_ROOT}/db/Pseudo.db"
|
${EMSL_API_ROOT}/EMSL_api.py get_basis_data --save --path="${tmpfile}" --basis="${basis}" --db_path="${EMSL_API_ROOT}/db/Pseudo.db"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -311,11 +311,11 @@ if __name__ == "__main__":
|
|||||||
# ~#~#~#~#~ #
|
# ~#~#~#~#~ #
|
||||||
|
|
||||||
klocmax = max([len(i) for i in v_k])
|
klocmax = max([len(i) for i in v_k])
|
||||||
ezfio.pseudo_klocmax = klocmax
|
ezfio.pseudo_intergrals_klocmax = klocmax
|
||||||
|
|
||||||
ezfio.pseudo_v_k = zip(*v_k)
|
ezfio.pseudo_intergrals_v_k = zip(*v_k)
|
||||||
ezfio.pseudo_n_k = zip(*n_k)
|
ezfio.pseudo_intergrals_n_k = zip(*n_k)
|
||||||
ezfio.pseudo_dz_k = zip(*dz_k)
|
ezfio.pseudo_intergrals_dz_k = zip(*dz_k)
|
||||||
|
|
||||||
# ~#~#~#~#~#~#~#~#~ #
|
# ~#~#~#~#~#~#~#~#~ #
|
||||||
# N o n _ L o c a l #
|
# N o n _ L o c a l #
|
||||||
@ -324,13 +324,15 @@ if __name__ == "__main__":
|
|||||||
lmax = max([len(i) for i in v_kl])
|
lmax = max([len(i) for i in v_kl])
|
||||||
kmax = max([len(sublist) for list_ in v_kl for sublist in list_])
|
kmax = max([len(sublist) for list_ in v_kl for sublist in list_])
|
||||||
|
|
||||||
ezfio.pseudo_lmaxpo = lmax
|
ezfio.pseudo_intergrals_lmaxpo = lmax
|
||||||
ezfio.pseudo_kmax = kmax
|
ezfio.pseudo_intergrals_kmax = kmax
|
||||||
|
|
||||||
v_kl = make_it_square(v_kl, [lmax, kmax])
|
v_kl = make_it_square(v_kl, [lmax, kmax])
|
||||||
n_kl = make_it_square(n_kl, [lmax, kmax], int)
|
n_kl = make_it_square(n_kl, [lmax, kmax], int)
|
||||||
dz_kl = make_it_square(dz_kl, [lmax, kmax])
|
dz_kl = make_it_square(dz_kl, [lmax, kmax])
|
||||||
|
|
||||||
ezfio.pseudo_v_kl = zip(*v_kl)
|
ezfio.pseudo_intergrals_v_kl = zip(*v_kl)
|
||||||
ezfio.pseudo_n_kl = zip(*n_kl)
|
ezfio.pseudo_intergrals_n_kl = zip(*n_kl)
|
||||||
ezfio.pseudo_dz_kl = zip(*dz_kl)
|
ezfio.pseudo_intergrals_dz_kl = zip(*dz_kl)
|
||||||
|
|
||||||
|
ezfio.pseudo_intergrals_do_pseudo = True
|
||||||
|
@ -25,13 +25,13 @@
|
|||||||
integer, allocatable :: n_k(:,:)
|
integer, allocatable :: n_k(:,:)
|
||||||
double precision, allocatable :: v_k(:,:), dz_k(:,:)
|
double precision, allocatable :: v_k(:,:), dz_k(:,:)
|
||||||
|
|
||||||
call ezfio_get_pseudo_klocmax(klocmax)
|
call ezfio_get_pseudo_integrals_klocmax(klocmax)
|
||||||
|
|
||||||
allocate(n_k(nucl_num,klocmax),v_k(nucl_num,klocmax), dz_k(nucl_num,klocmax))
|
allocate(n_k(nucl_num,klocmax),v_k(nucl_num,klocmax), dz_k(nucl_num,klocmax))
|
||||||
|
|
||||||
call ezfio_get_pseudo_v_k(v_k)
|
call ezfio_get_pseudo_integrals_v_k(v_k)
|
||||||
call ezfio_get_pseudo_n_k(n_k)
|
call ezfio_get_pseudo_integrals_n_k(n_k)
|
||||||
call ezfio_get_pseudo_dz_k(dz_k)
|
call ezfio_get_pseudo_integrals_dz_k(dz_k)
|
||||||
|
|
||||||
!! Dump array
|
!! Dump array
|
||||||
integer, allocatable :: n_k_dump(:)
|
integer, allocatable :: n_k_dump(:)
|
||||||
@ -50,16 +50,16 @@
|
|||||||
integer, allocatable :: n_kl(:,:,:)
|
integer, allocatable :: n_kl(:,:,:)
|
||||||
double precision, allocatable :: v_kl(:,:,:), dz_kl(:,:,:)
|
double precision, allocatable :: v_kl(:,:,:), dz_kl(:,:,:)
|
||||||
|
|
||||||
call ezfio_get_pseudo_lmaxpo(lmax)
|
call ezfio_get_pseudo_integrals_lmaxpo(lmax)
|
||||||
call ezfio_get_pseudo_kmax(kmax)
|
call ezfio_get_pseudo_integrals_kmax(kmax)
|
||||||
!lmax plus one -> lmax
|
!lmax plus one -> lmax
|
||||||
lmax = lmax - 1
|
lmax = lmax - 1
|
||||||
|
|
||||||
allocate(n_kl(nucl_num,kmax,0:lmax), v_kl(nucl_num,kmax,0:lmax), dz_kl(nucl_num,kmax,0:lmax))
|
allocate(n_kl(nucl_num,kmax,0:lmax), v_kl(nucl_num,kmax,0:lmax), dz_kl(nucl_num,kmax,0:lmax))
|
||||||
|
|
||||||
call ezfio_get_pseudo_n_kl(n_kl)
|
call ezfio_get_pseudo_integrals_n_kl(n_kl)
|
||||||
call ezfio_get_pseudo_v_kl(v_kl)
|
call ezfio_get_pseudo_integrals_v_kl(v_kl)
|
||||||
call ezfio_get_pseudo_dz_kl(dz_kl)
|
call ezfio_get_pseudo_integrals_dz_kl(dz_kl)
|
||||||
|
|
||||||
|
|
||||||
!! Dump array
|
!! Dump array
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
pseudo
|
pseudo_integrals
|
||||||
klocmax integer
|
klocmax integer
|
||||||
v_k double precision (nuclei_nucl_num,pseudo_klocmax)
|
v_k double precision (nuclei_nucl_num,pseudo_integrals_klocmax)
|
||||||
n_k integer (nuclei_nucl_num,pseudo_klocmax)
|
n_k integer (nuclei_nucl_num,pseudo_integrals_klocmax)
|
||||||
dz_k double precision (nuclei_nucl_num,pseudo_klocmax)
|
dz_k double precision (nuclei_nucl_num,pseudo_integrals_klocmax)
|
||||||
lmaxpo integer
|
lmaxpo integer
|
||||||
kmax integer
|
kmax integer
|
||||||
v_kl double precision (nuclei_nucl_num,pseudo_kmax,pseudo_lmaxpo)
|
v_kl double precision (nuclei_nucl_num,pseudo_integrals_kmax,pseudo_integrals_lmaxpo)
|
||||||
n_kl integer (nuclei_nucl_num,pseudo_kmax,pseudo_lmaxpo)
|
n_kl integer (nuclei_nucl_num,pseudo_integrals_kmax,pseudo_integrals_lmaxpo)
|
||||||
dz_kl double precision (nuclei_nucl_num,pseudo_kmax,pseudo_lmaxpo)
|
dz_kl double precision (nuclei_nucl_num,pseudo_integrals_kmax,pseudo_integrals_lmaxpo)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user