mirror of
https://github.com/LCPQ/quantum_package
synced 2024-11-03 20:54:00 +01:00
Add EZFIO.cfg to Hartree_fock
This commit is contained in:
parent
1cb8a7bdd9
commit
53f473cfae
@ -1,4 +0,0 @@
|
||||
hartree_fock
|
||||
n_it_scf_max 200
|
||||
thresh_scf 1.e-10
|
||||
guess "Huckel"
|
@ -1,128 +0,0 @@
|
||||
open Qptypes;;
|
||||
open Qputils;;
|
||||
open Core.Std;;
|
||||
|
||||
module Hartree_fock : sig
|
||||
type t =
|
||||
{ n_it_scf_max : Strictly_positive_int.t;
|
||||
thresh_scf : Threshold.t;
|
||||
guess : MO_guess.t;
|
||||
} with sexp
|
||||
;;
|
||||
val read : unit -> t option
|
||||
val write : t -> unit
|
||||
val to_string : t -> string
|
||||
val to_rst : t -> Rst_string.t
|
||||
val of_rst : Rst_string.t -> t option
|
||||
end = struct
|
||||
type t =
|
||||
{ n_it_scf_max : Strictly_positive_int.t;
|
||||
thresh_scf : Threshold.t;
|
||||
guess : MO_guess.t;
|
||||
} with sexp
|
||||
;;
|
||||
|
||||
let get_default = Qpackage.get_ezfio_default "hartree_fock";;
|
||||
|
||||
let read_n_it_scf_max () =
|
||||
if not (Ezfio.has_hartree_fock_n_it_scf_max ()) then
|
||||
get_default "n_it_scf_max"
|
||||
|> Int.of_string
|
||||
|> Ezfio.set_hartree_fock_n_it_scf_max
|
||||
;
|
||||
Ezfio.get_hartree_fock_n_it_scf_max ()
|
||||
|> Strictly_positive_int.of_int
|
||||
;;
|
||||
|
||||
let write_n_it_scf_max n_it_scf_max =
|
||||
Strictly_positive_int.to_int n_it_scf_max
|
||||
|> Ezfio.set_hartree_fock_n_it_scf_max
|
||||
;;
|
||||
|
||||
let read_thresh_scf () =
|
||||
if not (Ezfio.has_hartree_fock_thresh_scf()) then
|
||||
get_default "thresh_scf"
|
||||
|> Float.of_string
|
||||
|> Ezfio.set_hartree_fock_thresh_scf
|
||||
;
|
||||
Ezfio.get_hartree_fock_thresh_scf ()
|
||||
|> Threshold.of_float
|
||||
;;
|
||||
|
||||
let write_thresh_scf thresh_scf =
|
||||
Threshold.to_float thresh_scf
|
||||
|> Ezfio.set_hartree_fock_thresh_scf
|
||||
;;
|
||||
|
||||
let read_guess () =
|
||||
if not (Ezfio.has_hartree_fock_guess ()) then
|
||||
get_default "guess"
|
||||
|> String.strip ~drop:(fun x -> x = '"')
|
||||
|> Ezfio.set_hartree_fock_guess
|
||||
;
|
||||
Ezfio.get_hartree_fock_guess ()
|
||||
|> MO_guess.of_string
|
||||
;;
|
||||
|
||||
let write_guess guess =
|
||||
MO_guess.to_string guess
|
||||
|> Ezfio.set_hartree_fock_guess
|
||||
;;
|
||||
|
||||
let read () =
|
||||
Some
|
||||
{ n_it_scf_max = read_n_it_scf_max ();
|
||||
thresh_scf = read_thresh_scf ();
|
||||
guess = read_guess ();
|
||||
}
|
||||
;;
|
||||
|
||||
|
||||
let write { n_it_scf_max ;
|
||||
thresh_scf ;
|
||||
guess ;
|
||||
} =
|
||||
write_n_it_scf_max n_it_scf_max;
|
||||
write_thresh_scf thresh_scf;
|
||||
write_guess guess
|
||||
;;
|
||||
|
||||
|
||||
let to_string b =
|
||||
Printf.sprintf "
|
||||
n_it_scf_max = %s
|
||||
thresh_scf = %s
|
||||
guess = %s
|
||||
"
|
||||
(Strictly_positive_int.to_string b.n_it_scf_max)
|
||||
(Threshold.to_string b.thresh_scf)
|
||||
(MO_guess.to_string b.guess)
|
||||
;;
|
||||
|
||||
let to_rst b =
|
||||
Printf.sprintf "
|
||||
Type of MO guess [ Huckel | HCore ] ::
|
||||
|
||||
guess = %s
|
||||
|
||||
Max number of SCF iterations ::
|
||||
|
||||
n_it_scf_max = %s
|
||||
|
||||
SCF convergence criterion (on energy) ::
|
||||
|
||||
thresh_scf = %s
|
||||
|
||||
"
|
||||
(MO_guess.to_string b.guess)
|
||||
(Strictly_positive_int.to_string b.n_it_scf_max)
|
||||
(Threshold.to_string b.thresh_scf)
|
||||
|> Rst_string.of_string
|
||||
;;
|
||||
|
||||
include Generic_input_of_rst;;
|
||||
let of_rst = of_rst t_of_sexp;;
|
||||
|
||||
end
|
||||
|
||||
|
@ -108,9 +108,9 @@ def get_type_dict():
|
||||
fancy_type['logical'] = Type(None, "bool", "logical")
|
||||
fancy_type['bool'] = Type(None, "bool", "logical")
|
||||
|
||||
fancy_type['character*32'] = Type(None, "string", "character*32")
|
||||
fancy_type['character*60'] = Type(None, "string", "character*60")
|
||||
fancy_type['character*256'] = Type(None, "string", "character*256")
|
||||
fancy_type['character*(32)'] = Type(None, "string", "character*(32)")
|
||||
fancy_type['character*(60)'] = Type(None, "string", "character*(60)")
|
||||
fancy_type['character*(256)'] = Type(None, "string", "character*(256)")
|
||||
|
||||
# ~#~#~#~#~#~#~#~ #
|
||||
# q p _ t y p e s #
|
||||
@ -457,7 +457,7 @@ def save_ezfio_default(module_lower, str_ezfio_default):
|
||||
f.write(str_ezfio_default)
|
||||
|
||||
|
||||
def create_ocaml_input(dict_ezfio_cfg):
|
||||
def create_ocaml_input(dict_ezfio_cfg,module_lower):
|
||||
|
||||
# ~#~#~#~# #
|
||||
# I n i t #
|
||||
@ -492,7 +492,7 @@ def create_ocaml_input(dict_ezfio_cfg):
|
||||
"open Qputils;;",
|
||||
"open Core.Std;;",
|
||||
"",
|
||||
"module Full_ci : sig"]
|
||||
"module {0} : sig".format(module_lower.capitalize())]
|
||||
|
||||
template += [e_glob.create_type()]
|
||||
|
||||
@ -612,7 +612,7 @@ def main():
|
||||
# O c a m l #
|
||||
# ~#~#~#~#~#~#
|
||||
|
||||
str_ocaml_input = create_ocaml_input(dict_ezfio_cfg)
|
||||
str_ocaml_input = create_ocaml_input(dict_ezfio_cfg, module_lower)
|
||||
save_ocaml_input(module_lower, str_ocaml_input)
|
||||
|
||||
# ~#~#~#~#~#~#~#~#
|
||||
|
22
src/Hartree_Fock/EZFIO.cfg
Normal file
22
src/Hartree_Fock/EZFIO.cfg
Normal file
@ -0,0 +1,22 @@
|
||||
[thresh_SCF]
|
||||
type: Threshold
|
||||
doc: Threshold on the convergence of the Hartree Fock energy
|
||||
interface: input
|
||||
default: 1.e-10
|
||||
|
||||
[n_it_scf_max]
|
||||
type: Strictly_positive_int
|
||||
doc: Maximum number of SCF iterations
|
||||
interface: input
|
||||
default: 200
|
||||
|
||||
[mo_guess_type]
|
||||
type: character*(32)
|
||||
doc: Initial MO guess. Can be [ Huckel | HCore ]
|
||||
interface: input
|
||||
default: Huckel
|
||||
|
||||
[energy]
|
||||
type: double precision
|
||||
doc: "Calculated HF energy"
|
||||
interface: output
|
@ -1,6 +0,0 @@
|
||||
hartree_fock
|
||||
thresh_scf double precision
|
||||
n_it_scf_max integer
|
||||
energy double precision
|
||||
guess character*(32)
|
||||
|
@ -1,35 +0,0 @@
|
||||
BEGIN_SHELL [ /usr/bin/python ]
|
||||
from ezfio_with_default import EZFIO_Provider
|
||||
T = EZFIO_Provider()
|
||||
T.set_type ( "double precision" )
|
||||
T.set_name ( "thresh_SCF" )
|
||||
T.set_doc ( "Threshold on the convergence of the Hartree Fock energy" )
|
||||
T.set_ezfio_dir ( "Hartree_Fock" )
|
||||
T.set_ezfio_name( "thresh_SCF" )
|
||||
T.set_output ( "output_Hartree_Fock" )
|
||||
print T
|
||||
|
||||
T = EZFIO_Provider()
|
||||
T.set_type ( "integer" )
|
||||
T.set_name ( "n_it_scf_max" )
|
||||
T.set_doc ( "Maximum number of SCF iterations" )
|
||||
T.set_ezfio_dir ( "Hartree_Fock" )
|
||||
T.set_ezfio_name( "n_it_scf_max" )
|
||||
T.set_output ( "output_Hartree_Fock" )
|
||||
print T
|
||||
|
||||
T = EZFIO_Provider()
|
||||
T.set_type ( "character*(32)" )
|
||||
T.set_name ( "mo_guess_type" )
|
||||
T.set_doc ( "Initial MO guess. Can be [ Huckel | HCore ]" )
|
||||
T.set_ezfio_dir ( "Hartree_Fock" )
|
||||
T.set_ezfio_name( "guess" )
|
||||
T.set_output ( "output_Hartree_Fock" )
|
||||
print T
|
||||
|
||||
|
||||
END_SHELL
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user