mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-22 12:23:48 +01:00
Add Read / Write for Nuclear Repulsion (usefull for PBC)
This commit is contained in:
parent
cd4ea7dd54
commit
414aa32463
@ -7,5 +7,5 @@ include Input_bitmasks;;
|
|||||||
include Input_determinants_by_hand;;
|
include Input_determinants_by_hand;;
|
||||||
include Input_electrons;;
|
include Input_electrons;;
|
||||||
include Input_mo_basis;;
|
include Input_mo_basis;;
|
||||||
include Input_nuclei;;
|
include Input_nuclei_by_hand;;
|
||||||
include Input_auto_generated;;
|
include Input_auto_generated;;
|
||||||
|
@ -2,7 +2,7 @@ open Qptypes;;
|
|||||||
open Qputils;;
|
open Qputils;;
|
||||||
open Core.Std;;
|
open Core.Std;;
|
||||||
|
|
||||||
module Nuclei : sig
|
module Nuclei_by_hand : sig
|
||||||
type t =
|
type t =
|
||||||
{ nucl_num : Nucl_number.t ;
|
{ nucl_num : Nucl_number.t ;
|
||||||
nucl_label : Element.t array;
|
nucl_label : Element.t array;
|
@ -20,7 +20,7 @@ type keyword =
|
|||||||
| Determinants_by_hand
|
| Determinants_by_hand
|
||||||
| Electrons
|
| Electrons
|
||||||
| Mo_basis
|
| Mo_basis
|
||||||
| Nuclei
|
| Nuclei_by_hand
|
||||||
{keywords}
|
{keywords}
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ let keyword_to_string = function
|
|||||||
| Determinants_by_hand -> "Determinants_by_hand"
|
| Determinants_by_hand -> "Determinants_by_hand"
|
||||||
| Electrons -> "Electrons"
|
| Electrons -> "Electrons"
|
||||||
| Mo_basis -> "MO basis"
|
| Mo_basis -> "MO basis"
|
||||||
| Nuclei -> "Molecule"
|
| Nuclei_by_hand -> "Molecule"
|
||||||
{keywords_to_string}
|
{keywords_to_string}
|
||||||
|
|
||||||
|
|
||||||
@ -74,8 +74,8 @@ let get s =
|
|||||||
f Mo_basis.(read, to_rst)
|
f Mo_basis.(read, to_rst)
|
||||||
| Electrons ->
|
| Electrons ->
|
||||||
f Electrons.(read, to_rst)
|
f Electrons.(read, to_rst)
|
||||||
| Nuclei ->
|
| Nuclei_by_hand ->
|
||||||
f Nuclei.(read, to_rst)
|
f Nuclei_by_hand.(read, to_rst)
|
||||||
| Ao_basis ->
|
| Ao_basis ->
|
||||||
f Ao_basis.(read, to_rst)
|
f Ao_basis.(read, to_rst)
|
||||||
| Determinants_by_hand ->
|
| Determinants_by_hand ->
|
||||||
@ -121,7 +121,7 @@ let set str s =
|
|||||||
{write}
|
{write}
|
||||||
| Electrons -> write Electrons.(of_rst, write) s
|
| Electrons -> write Electrons.(of_rst, write) s
|
||||||
| Determinants_by_hand -> write Determinants_by_hand.(of_rst, write) s
|
| Determinants_by_hand -> write Determinants_by_hand.(of_rst, write) s
|
||||||
| Nuclei -> write Nuclei.(of_rst, write) s
|
| Nuclei_by_hand -> write Nuclei_by_hand.(of_rst, write) s
|
||||||
| Ao_basis -> () (* TODO *)
|
| Ao_basis -> () (* TODO *)
|
||||||
| Mo_basis -> () (* TODO *)
|
| Mo_basis -> () (* TODO *)
|
||||||
end
|
end
|
||||||
@ -184,7 +184,7 @@ let run check_only ?ndet ?state ezfio_filename =
|
|||||||
*)
|
*)
|
||||||
|
|
||||||
let tasks = [
|
let tasks = [
|
||||||
Nuclei ;
|
Nuclei_by_hand ;
|
||||||
Ao_basis;
|
Ao_basis;
|
||||||
Electrons ;
|
Electrons ;
|
||||||
{tasks}
|
{tasks}
|
||||||
|
@ -19,4 +19,15 @@ interface: ezfio, provider
|
|||||||
doc: Nuclear coordinates in the format (:, {x,y,z})
|
doc: Nuclear coordinates in the format (:, {x,y,z})
|
||||||
type: double precision
|
type: double precision
|
||||||
size: (nuclei.nucl_num,3)
|
size: (nuclei.nucl_num,3)
|
||||||
interface: ezfio
|
interface: ezfio
|
||||||
|
|
||||||
|
[disk_access_nuclear_repulsion]
|
||||||
|
doc: Read/Write Nuclear Repulsion from/to disk [ Write | Read | None ]
|
||||||
|
type: Disk_access
|
||||||
|
interface: ezfio,provider,ocaml
|
||||||
|
default: None
|
||||||
|
|
||||||
|
[nuclear_repulsion]
|
||||||
|
doc: Nuclear repulsion (Computed automaticaly or Read in the EZFIO)
|
||||||
|
type:double precision
|
||||||
|
interface: ezfio
|
||||||
|
@ -141,34 +141,53 @@ BEGIN_PROVIDER [ double precision, positive_charge_barycentre,(3)]
|
|||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, nuclear_repulsion ]
|
BEGIN_PROVIDER [ double precision, nuclear_repulsion ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Nuclear repulsion energy
|
! Nuclear repulsion energy
|
||||||
END_DOC
|
END_DOC
|
||||||
integer :: k,l
|
|
||||||
double precision :: Z12, r2, x(3)
|
IF (disk_access_nuclear_repulsion.EQ.'Read') THEN
|
||||||
nuclear_repulsion = 0.d0
|
print*, 'nuclear_repulsion read from disk'
|
||||||
do l = 1, nucl_num
|
LOGICAL :: has
|
||||||
do k = 1, nucl_num
|
call ezfio_has_nuclei_nuclear_repulsion(has)
|
||||||
if(k == l) then
|
if (has) then
|
||||||
cycle
|
call ezfio_get_nuclei_nuclear_repulsion(nuclear_repulsion)
|
||||||
endif
|
else
|
||||||
Z12 = nucl_charge(k)*nucl_charge(l)
|
print *, 'nuclei/nuclear_repulsion not found in EZFIO file'
|
||||||
x(1) = nucl_coord(k,1) - nucl_coord(l,1)
|
stop 1
|
||||||
x(2) = nucl_coord(k,2) - nucl_coord(l,2)
|
endif
|
||||||
x(3) = nucl_coord(k,3) - nucl_coord(l,3)
|
|
||||||
r2 = x(1)*x(1) + x(2)*x(2) + x(3)*x(3)
|
ELSE
|
||||||
nuclear_repulsion += Z12/dsqrt(r2)
|
|
||||||
enddo
|
integer :: k,l
|
||||||
enddo
|
double precision :: Z12, r2, x(3)
|
||||||
nuclear_repulsion *= 0.5d0
|
nuclear_repulsion = 0.d0
|
||||||
|
do l = 1, nucl_num
|
||||||
|
do k = 1, nucl_num
|
||||||
|
if(k == l) then
|
||||||
|
cycle
|
||||||
|
endif
|
||||||
|
Z12 = nucl_charge(k)*nucl_charge(l)
|
||||||
|
x(1) = nucl_coord(k,1) - nucl_coord(l,1)
|
||||||
|
x(2) = nucl_coord(k,2) - nucl_coord(l,2)
|
||||||
|
x(3) = nucl_coord(k,3) - nucl_coord(l,3)
|
||||||
|
r2 = x(1)*x(1) + x(2)*x(2) + x(3)*x(3)
|
||||||
|
nuclear_repulsion += Z12/dsqrt(r2)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
nuclear_repulsion *= 0.5d0
|
||||||
|
END IF
|
||||||
|
|
||||||
call write_time(output_Nuclei)
|
call write_time(output_Nuclei)
|
||||||
call write_double(output_Nuclei,nuclear_repulsion, &
|
call write_double(output_Nuclei,nuclear_repulsion, &
|
||||||
'Nuclear repulsion energy')
|
'Nuclear repulsion energy')
|
||||||
|
|
||||||
|
IF (disk_access_nuclear_repulsion.EQ.'Write') THEN
|
||||||
|
call ezfio_set_nuclei_nuclear_repulsion(nuclear_repulsion)
|
||||||
|
END IF
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ character*(128), element_name, (78)]
|
BEGIN_PROVIDER [ character*(128), element_name, (78)]
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Array of the name of element, sorted by nuclear charge (integer)
|
! Array of the name of element, sorted by nuclear charge (integer)
|
||||||
|
Loading…
Reference in New Issue
Block a user