10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-05 05:33:56 +01:00
quantum_package/ocaml/test_gto.ml

49 lines
1.4 KiB
OCaml
Raw Normal View History

2017-08-18 18:28:33 +02:00
open Core
open Qptypes
2014-08-13 17:54:32 +02:00
let test_prim () =
let p =
{ GaussianPrimitive.sym = Symmetry.P ;
GaussianPrimitive.expo = AO_expo.of_float 0.15} in
GaussianPrimitive.to_string p
2014-08-13 17:54:32 +02:00
|> print_string
2014-08-13 17:54:32 +02:00
let test_gto_1 () =
2014-08-27 16:38:13 +02:00
let in_channel = open_in "/home/scemama/quantum_package/data/basis/cc-pvdz" in
2014-08-13 17:54:32 +02:00
ignore (input_line in_channel);
let gto = Gto.read_one in_channel in
2014-10-26 12:46:17 +01:00
print_endline (Gto.to_string gto);
In_channel.seek in_channel 0L;
ignore (input_line in_channel);
let gto2 = Gto.read_one in_channel in
print_endline (Gto.to_string gto2);
let gto3 = Gto.read_one in_channel in
print_endline (Gto.to_string gto3);
if (gto2 = gto) then
print_endline "gto2 = gto";
if (gto3 = gto) then
print_endline "gto3 = gto";
if (gto3 = gto3) then
print_endline "gto3 = gto3";
let test_gto_2 () =
2014-08-27 16:38:13 +02:00
let in_channel = open_in "/home/scemama/quantum_package/data/basis/cc-pvdz" in
ignore (input_line in_channel);
2014-10-23 14:42:14 +02:00
let basis = Basis.read in_channel (Nucl_number.of_int 1) in
List.iter basis ~f:(fun (x,n)-> Printf.printf "%d:%s\n" (Nucl_number.to_int n) (Gto.to_string x))
let test_gto () =
2014-08-27 16:38:13 +02:00
let in_channel = open_in "/home/scemama/quantum_package/data/basis/cc-pvdz" in
2014-10-23 14:42:14 +02:00
let basis = Basis.read_element in_channel (Nucl_number.of_int 1) Element.C in
List.iter basis ~f:(fun (x,n)-> Printf.printf "%d:%s\n" (Nucl_number.to_int n) (Gto.to_string x))
2014-08-13 17:54:32 +02:00
let test_module () =
2014-10-26 12:46:17 +01:00
test_gto_1()
2014-08-13 17:54:32 +02:00
test_module ()