From 5efd47339a4e590120a1df64299edb662ad88ffa Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 2 Sep 2019 15:55:44 +0200 Subject: [PATCH] Checking number of electrons in MOs --- ocaml/Input_mo_basis.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ocaml/Input_mo_basis.ml b/ocaml/Input_mo_basis.ml index 1402845f..12654aad 100644 --- a/ocaml/Input_mo_basis.ml +++ b/ocaml/Input_mo_basis.ml @@ -65,8 +65,15 @@ end = struct let read_mo_num () = - Ezfio.get_mo_basis_mo_num () - |> MO_number.of_int + let elec_alpha_num = + Ezfio.get_electrons_elec_alpha_num () + in + let result = + Ezfio.get_mo_basis_mo_num () + in + if result < elec_alpha_num then + failwith "More alpha electrons than MOs"; + MO_number.of_int result let read_mo_class () =