9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 03:23:29 +01:00

minor modifs to merge
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
eginer 2022-09-30 16:22:18 +02:00
parent 7c1c761ea8
commit d09e3e7308
4 changed files with 51 additions and 121 deletions

View File

@ -277,6 +277,16 @@ let run ?o b au c d m p cart xyz_file =
) nuclei
in
let z_core =
List.map (fun x ->
Positive_int.to_int x.Pseudo.n_elec
|> float_of_int
) pseudo
in
let nucl_num = (List.length z_core) in
Ezfio.set_pseudo_nucl_charge_remove (Ezfio.ezfio_array_of_list
~rank:1 ~dim:[| nucl_num |] ~data:z_core);
let molecule =
let n_elec_to_remove =
List.fold_left (fun accu x ->
@ -585,12 +595,16 @@ let run ?o b au c d m p cart xyz_file =
let shell_prim_num =
list_map List.length lc
in
let shell_prim_idx =
let shell_idx =
let rec make_list n accu = function
| 0 -> accu
| i -> make_list n (n :: accu) (i-1)
in
let rec aux count accu = function
| [] -> List.rev accu
| l::rest ->
let newcount = count+(List.length l) in
aux newcount (count::accu) rest
let new_l = make_list count accu (List.length l) in
aux (count+1) new_l rest
in
aux 1 [] lc
in
@ -602,20 +616,12 @@ let run ?o b au c d m p cart xyz_file =
~rank:1 ~dim:[| shell_num |] ~data:shell_prim_num);
Ezfio.set_basis_shell_ang_mom (Ezfio.ezfio_array_of_list
~rank:1 ~dim:[| shell_num |] ~data:ang_mom ) ;
Ezfio.set_basis_shell_prim_index (Ezfio.ezfio_array_of_list
~rank:1 ~dim:[| shell_num |] ~data:shell_prim_idx) ;
Ezfio.set_basis_shell_index (Ezfio.ezfio_array_of_list
~rank:1 ~dim:[| prim_num |] ~data:shell_idx) ;
Ezfio.set_basis_basis_nucleus_index (Ezfio.ezfio_array_of_list
~rank:1 ~dim:[| nucl_num |]
~data:(
list_map (fun (_,n) -> Nucl_number.to_int n) basis
|> List.fold_left (fun accu i ->
match accu with
| [] -> []
| (h,j) :: rest -> if j == i then ((h+1,j)::rest) else ((h+1,i)::(h+1,j)::rest)
) [(0,0)]
|> List.rev
|> List.map fst
)) ;
~rank:1 ~dim:[| shell_num |]
~data:( list_map (fun (_,n) -> Nucl_number.to_int n) basis)
) ;
Ezfio.set_basis_nucleus_shell_num(Ezfio.ezfio_array_of_list
~rank:1 ~dim:[| nucl_num |]
~data:(
@ -675,10 +681,8 @@ let () =
let open Command_line in
begin
"Creates an EZFIO directory from a standard xyz file or from a z-matrix file in Gaussian format. The basis set is defined as a single string if all the atoms are taken from the same basis set, otherwise specific elements can be defined as follows:
-b \"cc-pcvdz | H:cc-pvdz | C:6-31g\"
-b \"cc-pvtz | 1,H:sto-3g | 3,H:6-31g\"
If a file with the same name as the basis set exists, this file will be read. Otherwise, the basis set is obtained from the database.
" |> set_description_doc ;
set_header_doc (Sys.argv.(0) ^ " - Quantum Package command");

View File

@ -37,16 +37,16 @@ doc: Number of primitives in a shell
size: (basis.shell_num)
interface: ezfio, provider
[shell_prim_index]
[shell_index]
type: integer
doc: Max number of primitives in a shell
size: (basis.shell_num)
doc: Index of the shell for each primitive
size: (basis.prim_num)
interface: ezfio, provider
[basis_nucleus_index]
type: integer
doc: Index of the nucleus on which the shell is centered
size: (nuclei.nucl_num)
doc: Nucleus on which the shell is centered
size: (basis.shell_num)
interface: ezfio, provider
[prim_normalization_factor]

View File

@ -16,9 +16,3 @@ doc: If |true|, don't use denominator
default: False
interface: ezfio,provider,ocaml
[threshold_nonsym_davidson]
type: Threshold
doc: Thresholds of non-symetric Davidson's algorithm
interface: ezfio,provider,ocaml
default: 1.e-12

View File

@ -652,74 +652,6 @@ subroutine save_wavefunction_general_unormalized(ndet,nstates,psidet,dim_psicoef
end
subroutine save_wavefunction_general_unormalized(ndet,nstates,psidet,dim_psicoef,psicoef)
implicit none
BEGIN_DOC
! Save the wave function into the |EZFIO| file
END_DOC
use bitmasks
include 'constants.include.F'
integer, intent(in) :: ndet,nstates,dim_psicoef
integer(bit_kind), intent(in) :: psidet(N_int,2,ndet)
double precision, intent(in) :: psicoef(dim_psicoef,nstates)
integer*8, allocatable :: psi_det_save(:,:,:)
double precision, allocatable :: psi_coef_save(:,:)
double precision :: accu_norm
integer :: i,j,k, ndet_qp_edit
if (mpi_master) then
ndet_qp_edit = min(ndet,N_det_qp_edit)
call ezfio_set_determinants_N_int(N_int)
call ezfio_set_determinants_bit_kind(bit_kind)
call ezfio_set_determinants_N_det(ndet)
call ezfio_set_determinants_N_det_qp_edit(ndet_qp_edit)
call ezfio_set_determinants_n_states(nstates)
call ezfio_set_determinants_mo_label(mo_label)
allocate (psi_det_save(N_int,2,ndet))
do i=1,ndet
do j=1,2
do k=1,N_int
psi_det_save(k,j,i) = transfer(psidet(k,j,i),1_8)
enddo
enddo
enddo
call ezfio_set_determinants_psi_det(psi_det_save)
call ezfio_set_determinants_psi_det_qp_edit(psi_det_save)
deallocate (psi_det_save)
allocate (psi_coef_save(ndet,nstates))
do k=1,nstates
do i=1,ndet
psi_coef_save(i,k) = psicoef(i,k)
enddo
enddo
call ezfio_set_determinants_psi_coef(psi_coef_save)
deallocate (psi_coef_save)
allocate (psi_coef_save(ndet_qp_edit,nstates))
do k=1,nstates
do i=1,ndet_qp_edit
psi_coef_save(i,k) = psicoef(i,k)
enddo
enddo
call ezfio_set_determinants_psi_coef_qp_edit(psi_coef_save)
deallocate (psi_coef_save)
call write_int(6,ndet,'Saved determinants')
endif
end
subroutine save_wavefunction_specified(ndet,nstates,psidet,psicoef,ndetsave,index_det_save)
implicit none
BEGIN_DOC