2018-02-23 18:44:31 +01:00
|
|
|
type t =
|
|
|
|
{
|
2018-05-30 18:07:05 +02:00
|
|
|
guess : Guess.t;
|
|
|
|
eigenvectors : Lacaml.D.Mat.t ;
|
|
|
|
eigenvalues : Lacaml.D.Vec.t ;
|
|
|
|
nocc : int;
|
|
|
|
energy : float ;
|
|
|
|
nuclear_repulsion : float ;
|
|
|
|
kin_energy : float ;
|
|
|
|
eN_energy : float ;
|
|
|
|
coulomb_energy : float ;
|
|
|
|
exchange_energy : float ;
|
|
|
|
iterations : (float * float * float) array;
|
2018-02-23 18:44:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-30 18:07:05 +02:00
|
|
|
let to_string hf_calc =
|
|
|
|
let sprintf = Printf.sprintf in
|
|
|
|
"
|
|
|
|
=====================================================
|
|
|
|
Hartree-Fock
|
|
|
|
=====================================================
|
|
|
|
# HF energy Convergence HOMO-LUMO
|
|
|
|
---------------------------------------------------" ::
|
|
|
|
Array.to_list (Array.mapi (fun i (e, c, g) ->
|
|
|
|
sprintf " %5d %13.8f %11.4e %11.4f " (i+1) e c g) hf_calc.iterations)
|
|
|
|
|
|
|
|
@ [
|
|
|
|
" =====================================================";
|
|
|
|
sprintf "%20s energy %16.10f" "One-electron" (hf_calc.kin_energy +. hf_calc.eN_energy) ;
|
|
|
|
sprintf "%20s energy %16.10f" "Kinetic " hf_calc.kin_energy ;
|
|
|
|
sprintf "%20s energy %16.10f" "Potential" hf_calc.eN_energy ;
|
|
|
|
" ---------------------------------------------------";
|
|
|
|
sprintf "%20s energy %16.10f" "Two-electron" (hf_calc.coulomb_energy +. hf_calc.exchange_energy) ;
|
|
|
|
sprintf "%20s energy %16.10f" "Coulomb" hf_calc.coulomb_energy ;
|
|
|
|
sprintf "%20s energy %16.10f" "Exchange" hf_calc.exchange_energy ;
|
|
|
|
" ---------------------------------------------------";
|
|
|
|
sprintf "%20s energy %16.10f" "Electronic" (hf_calc.energy -. hf_calc.nuclear_repulsion);
|
|
|
|
sprintf "%17s repulsion %16.10f" "Nuclear" hf_calc.coulomb_energy ;
|
|
|
|
sprintf "%20s energy %16.10f" "Hartree-Fock" hf_calc.energy ;
|
|
|
|
" =====================================================" ]
|
|
|
|
|> String.concat "\n"
|
|
|
|
|
2018-02-23 18:44:31 +01:00
|
|
|
|