mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-10 21:18:29 +01:00
Introduced 'cc-pvtz | 1,H:sto-3g | 3,O:6-31g'
This commit is contained in:
parent
7c8506386f
commit
ea86e8f62b
@ -21,6 +21,9 @@ let spec =
|
|||||||
~doc:" Compute AOs in the Cartesian basis set (6d, 10f, ...)"
|
~doc:" Compute AOs in the Cartesian basis set (6d, 10f, ...)"
|
||||||
+> anon ("(xyz_file|zmt_file)" %: file )
|
+> anon ("(xyz_file|zmt_file)" %: file )
|
||||||
|
|
||||||
|
type element =
|
||||||
|
| Element of Element.t
|
||||||
|
| Int_elem of (Nucl_number.t * Element.t)
|
||||||
|
|
||||||
(** Handle dummy atoms placed on bonds *)
|
(** Handle dummy atoms placed on bonds *)
|
||||||
let dummy_centers ~threshold ~molecule ~nuclei =
|
let dummy_centers ~threshold ~molecule ~nuclei =
|
||||||
@ -115,17 +118,14 @@ let run ?o b c d m p cart xyz_file =
|
|||||||
(* Open basis set channels *)
|
(* Open basis set channels *)
|
||||||
let basis_channel element =
|
let basis_channel element =
|
||||||
let key =
|
let key =
|
||||||
Element.to_string element
|
match element with
|
||||||
|
| Element e -> Element.to_string e
|
||||||
|
| Int_elem (i,e) -> Printf.sprintf "%d,%s" (Nucl_number.to_int i) (Element.to_string e)
|
||||||
in
|
in
|
||||||
match Hashtbl.find basis_table key with
|
match Hashtbl.find basis_table key with
|
||||||
| Some in_channel ->
|
| Some in_channel ->
|
||||||
in_channel
|
in_channel
|
||||||
| None ->
|
| None -> raise Not_found
|
||||||
let msg =
|
|
||||||
Printf.sprintf "%s is not defined in basis %s.%!"
|
|
||||||
(Element.to_long_string element) b ;
|
|
||||||
in
|
|
||||||
failwith msg
|
|
||||||
in
|
in
|
||||||
|
|
||||||
let temp_filename =
|
let temp_filename =
|
||||||
@ -189,12 +189,21 @@ let run ?o b c d m p cart xyz_file =
|
|||||||
| Some (key, basis) -> (*Aux basis *)
|
| Some (key, basis) -> (*Aux basis *)
|
||||||
begin
|
begin
|
||||||
let elem =
|
let elem =
|
||||||
Element.of_string key
|
try
|
||||||
|
Element (Element.of_string key)
|
||||||
|
with Element.ElementError _ ->
|
||||||
|
let result =
|
||||||
|
match (String.split ~on:',' key) with
|
||||||
|
| i :: k :: [] -> (Nucl_number.of_int @@ int_of_string i, Element.of_string k)
|
||||||
|
| _ -> failwith "Expected format is int,Element:basis"
|
||||||
|
in Int_elem result
|
||||||
and basis =
|
and basis =
|
||||||
String.lowercase basis
|
String.lowercase basis
|
||||||
in
|
in
|
||||||
let key =
|
let key =
|
||||||
Element.to_string elem
|
match elem with
|
||||||
|
| Element e -> Element.to_string e
|
||||||
|
| Int_elem (i,e) -> Printf.sprintf "%d,%s" (Nucl_number.to_int i) (Element.to_string e)
|
||||||
in
|
in
|
||||||
let new_channel =
|
let new_channel =
|
||||||
fetch_channel basis
|
fetch_channel basis
|
||||||
@ -202,7 +211,13 @@ let run ?o b c d m p cart xyz_file =
|
|||||||
begin
|
begin
|
||||||
match Hashtbl.add basis_table ~key:key ~data:new_channel with
|
match Hashtbl.add basis_table ~key:key ~data:new_channel with
|
||||||
| `Ok -> ()
|
| `Ok -> ()
|
||||||
| `Duplicate -> failwith ("Duplicate definition of basis for "^(Element.to_long_string elem))
|
| `Duplicate ->
|
||||||
|
let e =
|
||||||
|
match elem with
|
||||||
|
| Element e -> e
|
||||||
|
| Int_elem (_,e) -> e
|
||||||
|
in
|
||||||
|
failwith ("Duplicate definition of basis for "^(Element.to_long_string e))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
@ -537,7 +552,20 @@ let run ?o b c d m p cart xyz_file =
|
|||||||
| Element.X -> Element.H
|
| Element.X -> Element.H
|
||||||
| e -> e
|
| e -> e
|
||||||
in
|
in
|
||||||
Basis.read_element (basis_channel x.Atom.element) i e
|
let key =
|
||||||
|
Int_elem (i,x.Atom.element)
|
||||||
|
in
|
||||||
|
try
|
||||||
|
Basis.read_element (basis_channel key) i e
|
||||||
|
with Not_found ->
|
||||||
|
let key =
|
||||||
|
Element x.Atom.element
|
||||||
|
in
|
||||||
|
try
|
||||||
|
Basis.read_element (basis_channel key) i e
|
||||||
|
with Not_found ->
|
||||||
|
failwith (Printf.sprintf "Basis not found for atom %d (%s)" (Nucl_number.to_int i)
|
||||||
|
(Element.to_string x.Atom.element) )
|
||||||
with
|
with
|
||||||
| End_of_file -> failwith
|
| End_of_file -> failwith
|
||||||
("Element "^(Element.to_string x.Atom.element)^" not found in basis set.")
|
("Element "^(Element.to_string x.Atom.element)^" not found in basis set.")
|
||||||
|
Loading…
Reference in New Issue
Block a user