10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-03 09:55:59 +02:00
quantum_package/ocaml/Input_ao_basis.ml

159 lines
4.2 KiB
OCaml
Raw Normal View History

2017-09-13 17:37:54 +02:00
(* =~=~ *)
(* Init *)
(* =~=~ *)
2014-10-17 22:25:45 +02:00
open Qptypes;;
open Qputils;;
2017-08-18 18:28:33 +02:00
open Core;;
2014-10-17 22:25:45 +02:00
module Ao_basis : sig
2017-09-13 17:37:54 +02:00
(* Generate type *)
type t =
{
threshold_overlap_ao_eigenvalues : Threshold.t;
} [@@deriving sexp]
;;
val read : unit -> t option
val write : t-> unit
2014-10-17 22:25:45 +02:00
val to_string : t -> string
2014-10-29 22:13:03 +01:00
val to_rst : t -> Rst_string.t
2017-09-13 17:37:54 +02:00
val of_rst : Rst_string.t -> t option
2014-10-17 22:25:45 +02:00
end = struct
2017-09-13 17:37:54 +02:00
(* Generate type *)
type t =
{
threshold_overlap_ao_eigenvalues : Threshold.t;
} [@@deriving sexp]
;;
2014-10-17 22:25:45 +02:00
2014-10-18 00:10:25 +02:00
let get_default = Qpackage.get_ezfio_default "ao_basis";;
2017-09-13 17:37:54 +02:00
(* =~=~=~=~=~=~==~=~=~=~=~=~ *)
(* Generate Special Function *)
(* =~=~=~==~=~~=~=~=~=~=~=~=~ *)
2014-10-17 22:25:45 +02:00
2017-09-13 17:37:54 +02:00
(* Read snippet for ao_cartesian *)
2016-01-27 00:19:08 +01:00
let read_ao_cartesian () =
if not (Ezfio.has_ao_basis_ao_cartesian ()) then
get_default "ao_cartesian"
|> Bool.of_string
|> Ezfio.set_ao_basis_ao_cartesian
;
Ezfio.get_ao_basis_ao_cartesian ()
;;
2017-09-13 17:37:54 +02:00
(* Write snippet for ao_cartesian *)
let write_ao_cartesian =
Ezfio.set_ao_basis_ao_cartesian
;;
2014-12-25 23:53:29 +01:00
2017-09-13 17:37:54 +02:00
(* Read snippet for ao_prim_num_max *)
let read_ao_prim_num_max () =
if not (Ezfio.has_ao_basis_ao_prim_num_max ()) then
get_default "ao_prim_num_max"
|> Int.of_string
|> Ezfio.set_ao_basis_ao_prim_num_max
;
Ezfio.get_ao_basis_ao_prim_num_max ()
2015-01-06 19:12:17 +01:00
;;
2017-09-13 17:37:54 +02:00
(* Write snippet for ao_prim_num_max *)
let write_ao_prim_num_max =
Ezfio.set_ao_basis_ao_prim_num_max
2015-01-06 19:12:17 +01:00
;;
2017-09-13 17:37:54 +02:00
(* Read snippet for integral_kinetic *)
let read_integral_kinetic () =
if not (Ezfio.has_ao_basis_integral_kinetic ()) then
get_default "integral_kinetic"
|> Float.of_string
|> Ezfio.set_ao_basis_integral_kinetic
;
Ezfio.get_ao_basis_integral_kinetic ()
2015-01-06 19:12:17 +01:00
;;
2017-09-13 17:37:54 +02:00
(* Write snippet for integral_kinetic *)
let write_integral_kinetic =
Ezfio.set_ao_basis_integral_kinetic
2014-12-25 23:53:29 +01:00
;;
2016-01-27 00:19:08 +01:00
2017-09-13 17:37:54 +02:00
(* Read snippet for integral_nuclear *)
let read_integral_nuclear () =
if not (Ezfio.has_ao_basis_integral_nuclear ()) then
get_default "integral_nuclear"
|> Float.of_string
|> Ezfio.set_ao_basis_integral_nuclear
;
Ezfio.get_ao_basis_integral_nuclear ()
2014-10-25 21:24:21 +02:00
;;
2017-09-13 17:37:54 +02:00
(* Write snippet for integral_nuclear *)
let write_integral_nuclear =
Ezfio.set_ao_basis_integral_nuclear
2014-11-03 22:24:40 +01:00
;;
2017-09-13 17:37:54 +02:00
(* Read snippet for integral_overlap *)
let read_integral_overlap () =
if not (Ezfio.has_ao_basis_integral_overlap ()) then
get_default "integral_overlap"
|> Float.of_string
|> Ezfio.set_ao_basis_integral_overlap
;
Ezfio.get_ao_basis_integral_overlap ()
;;
(* Write snippet for integral_overlap *)
let write_integral_overlap =
Ezfio.set_ao_basis_integral_overlap
2014-10-25 21:24:21 +02:00
;;
2014-10-17 22:25:45 +02:00
2017-09-13 17:37:54 +02:00
(* Read snippet for threshold_overlap_ao_eigenvalues *)
let read_threshold_overlap_ao_eigenvalues () =
if not (Ezfio.has_ao_basis_threshold_overlap_ao_eigenvalues ()) then
get_default "threshold_overlap_ao_eigenvalues"
|> Float.of_string
|> Ezfio.set_ao_basis_threshold_overlap_ao_eigenvalues
;
Ezfio.get_ao_basis_threshold_overlap_ao_eigenvalues ()
|> Threshold.of_float
;;
(* Write snippet for threshold_overlap_ao_eigenvalues *)
let write_threshold_overlap_ao_eigenvalues var =
Threshold.to_float var
|> Ezfio.set_ao_basis_threshold_overlap_ao_eigenvalues
;;
(* =~=~=~=~=~=~=~=~=~=~=~=~ *)
(* Generate Global Function *)
(* =~=~=~=~=~=~=~=~=~=~=~=~ *)
(* Read all *)
let read() =
Some
{
threshold_overlap_ao_eigenvalues = read_threshold_overlap_ao_eigenvalues ();
}
;;
(* Write all *)
let write{
threshold_overlap_ao_eigenvalues;
} =
write_threshold_overlap_ao_eigenvalues threshold_overlap_ao_eigenvalues;
;;
(* to_string*)
let to_string b =
Printf.sprintf "
threshold_overlap_ao_eigenvalues = %s
"
(Threshold.to_string b.threshold_overlap_ao_eigenvalues)
;;
(* to_rst*)
let to_rst b =
Printf.sprintf "
Threshold on the magnitude of the smallest eigenvalues of the overlap matrix in the AO basis ::
threshold_overlap_ao_eigenvalues = %s
"
(Threshold.to_string b.threshold_overlap_ao_eigenvalues)
|> Rst_string.of_string
;;
include Generic_input_of_rst;;
let of_rst = of_rst t_of_sexp;;
end