10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-07-11 22:03:37 +02:00
QCaml/run_hartree_fock.ml

59 lines
1.4 KiB
OCaml
Raw Normal View History

2019-02-25 14:36:59 +01:00
let () =
let open Command_line in
begin
set_header_doc (Sys.argv.(0) ^ " - QCaml command");
set_description_doc "Runs a Hartree-Fock calculation";
set_specs
[ { short='b' ; long="basis" ; opt=Mandatory;
arg=With_arg "<string>";
doc="Name of the file containing the basis set"; } ;
{ short='x' ; long="xyz" ; opt=Mandatory;
arg=With_arg "<string>";
doc="Name of the file containing the nuclear coordinates in xyz format"; } ;
{ short='m' ; long="multiplicity" ; opt=Optional;
arg=With_arg "<int>";
doc="Spin multiplicity (2S+1). Default is singlet"; } ;
{ short='c' ; long="charge" ; opt=Optional;
arg=With_arg "<int>";
doc="Total charge of the molecule. Default is 0"; } ;
]
end;
(* Handle options *)
let basis_file =
match Command_line.get "basis" with
2018-02-23 18:44:31 +01:00
| Some x -> x
2019-02-25 14:36:59 +01:00
| None -> assert false
in
let nuclei_file =
match Command_line.get "xyz" with
2018-02-23 18:44:31 +01:00
| Some x -> x
2019-02-25 14:36:59 +01:00
| None -> assert false
in
let charge =
match Command_line.get "charge" with
| Some x -> int_of_string x
| None -> 0
in
let multiplicity =
match Command_line.get "multiplicity" with
| Some x -> int_of_string x
| None -> 1
2018-02-23 18:44:31 +01:00
in
let s =
2018-10-23 13:39:06 +02:00
Simulation.of_filenames ~charge ~multiplicity ~nuclei:nuclei_file basis_file
2018-02-23 18:44:31 +01:00
in
2018-05-30 18:07:05 +02:00
HartreeFock.make s
|> HartreeFock.to_string
|> print_endline
2018-02-23 18:44:31 +01:00