diff --git a/docs/gaussian_integrals.html b/docs/gaussian_integrals.html index f6f56eb..77f6bcc 100644 --- a/docs/gaussian_integrals.html +++ b/docs/gaussian_integrals.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Gaussian integrals @@ -250,18 +250,18 @@ org_html_manager.setup(); // activate after the parameters are set

Table of Contents

-
-

1 Summary

+
+

1 Summary

Author: Anthony Scemama

-

Created: 2023-06-16 Fri 18:25

+

Created: 2023-06-26 Mon 15:31

Validate

diff --git a/docs/mo.html b/docs/mo.html index 42281fd..1cd527e 100644 --- a/docs/mo.html +++ b/docs/mo.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Molecular orbitals @@ -272,46 +272,46 @@ org_html_manager.setup(); // activate after the parameters are set

Table of Contents

-
-

1 Summary

+
+

1 Summary

-
-

2 Frozen core

+
+

2 Frozen core

Defines how the core electrons are frozen, for each atom.

-
-

2.1 Type

+
+

2.1 Type

-
type kind =
+
type kind =
   | All_electron
   | Small
   | Large
@@ -325,8 +325,8 @@ Defines how the core electrons are frozen, for each atom.
 
-
-

2.2 Creation

+
+

2.2 Creation

val make : kind -> Particles.Nuclei.t -> t
@@ -362,7 +362,7 @@ Defines how the core electrons are frozen, for each atom.
 
 
 
-
+
 let f = Frozen_core.(make Small nuclei) ;;
 val f : Frozen_core.t = [|0; 2; 2; 0|]
 
@@ -372,8 +372,8 @@ val f : Frozen_core.t = [|0; 2; 2; 0|]
 
-
-

2.3 Access

+
+

2.3 Access

val num_elec : t -> int
@@ -402,7 +402,7 @@ val f : Frozen_core.t = [|0; 2; 2; 0|]
 
 
 
-
+
 Frozen_core.num_elec f ;;
 - : int = 4
 
@@ -412,8 +412,8 @@ Frozen_core.num_mos f ;;
 
-
-

2.4 Printers

+
+

2.4 Printers

val pp : Format.formatter -> t -> unit
@@ -423,8 +423,8 @@ Frozen_core.num_mos f ;;
 
-
-

3 Orbital localization

+
+

3 Orbital localization

Molecular orbital localization function. @@ -440,11 +440,11 @@ Edmiston-Rudenberg:

-
-

3.1 Type

+
+

3.1 Type

-
open Linear_algebra
+
open Linear_algebra
 
 type localization_kind =
   | Edmiston
@@ -464,16 +464,16 @@ Edmiston-Rudenberg:
 
-
-

3.2 Edmiston-Rudenberg

+
+

3.2 Edmiston-Rudenberg

-
-

3.3 Boys

+
+

3.3 Boys

-
-

3.4 Access

+
+

3.4 Access

val kind         : t -> localization_kind
@@ -522,8 +522,8 @@ Edmiston-Rudenberg:
 
-
-

3.5 Printers

+
+

3.5 Printers

val pp : Format.formatter -> t -> unit
@@ -532,14 +532,14 @@ Edmiston-Rudenberg:
 
-
-

3.6 Tests

+
+

3.6 Tests

Author: Anthony Scemama

-

Created: 2021-10-19 Tue 16:20

+

Created: 2023-06-26 Mon 15:36

Validate

diff --git a/docs/top.html b/docs/top.html index da5be20..3077cea 100644 --- a/docs/top.html +++ b/docs/top.html @@ -3,12 +3,12 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + -Top-level Top-level +Top-level - + - @@ -307,29 +245,24 @@ for the JavaScript code in this tag. | HOME
-

Top-level Top-level

+

Top-level

Table of Contents

-
-

1 Summary

-
- -
-

2 Summary

+
+

1 Summary

-

Author: scemama

-

Created: 2023-06-17 Sat 00:26

-

Validate

+

Author: Anthony Scemama

+

Created: 2023-06-26 Mon 15:36

+

Validate

diff --git a/mo/lib/guess.ml b/mo/lib/guess.ml index 17af71b..1f28fa0 100644 --- a/mo/lib/guess.ml +++ b/mo/lib/guess.ml @@ -5,6 +5,7 @@ type mo = Mo_dim.t type guess = | Hcore of (ao,ao) Matrix.t +| GWH of (ao,ao) Matrix.t | Huckel of (ao,ao) Matrix.t | Matrix of (ao,mo) Matrix.t @@ -12,38 +13,40 @@ type t = guess module El = Particles.Electrons -let hcore_guess ao_basis = +let hcore_guess ao_basis = let eN_ints = Ao.Basis.eN_ints ao_basis and kin_ints = Ao.Basis.kin_ints ao_basis in Matrix.add eN_ints kin_ints -let huckel_guess ao_basis = +let gwh_guess ao_basis = let c = 0.5 *. 1.75 in - let eN_ints = Ao.Basis.eN_ints ao_basis - and kin_ints = Ao.Basis.kin_ints ao_basis - in - let m_F = Matrix.add eN_ints kin_ints in let ao_num = Ao.Basis.size ao_basis and overlap = Ao.Basis.overlap ao_basis in + let m_F = hcore_guess ao_basis in let diag = Vector.init ao_num (fun i -> m_F%:(i,i) ) in - - function - | 0 -> invalid_arg "Huckel guess needs a non-zero number of occupied MOs." - | _nocc -> - Matrix.init_cols ao_num ao_num (fun i j -> + Matrix.init_cols ao_num ao_num (fun i j -> if (i<>j) then - c *. (overlap%:(i,j)) /. ((overlap%:(i,i)) *. (overlap%:(j,j)) ) *. (diag%.(i) +. diag%.(j)) + c *. (overlap%:(i,j)) /. ((overlap%:(i,i)) *. (overlap%:(j,j)) ) *. (diag%.(i) +. diag%.(j)) else - diag%.(i) + diag%.(i) ) -let make ?(nocc=0) ~guess ao_basis = +let huckel_guess ao_basis = + function + | 0 -> invalid_arg "Huckel guess needs a non-zero number of occupied MOs." + | _nocc -> + let m_F = gwh_guess ao_basis in + (*TODO: F(l,l) = F_gwh(l,l) + \sum{mu,nu} P_{mu,nu} (mu nu| l l) *) + m_F + +let make ?(nocc=0) ~guess ao_basis = match guess with | `Hcore -> Hcore (hcore_guess ao_basis) + | `GWH -> Hcore (gwh_guess ao_basis) | `Huckel -> Huckel (huckel_guess ao_basis nocc) | `Matrix m -> Matrix m diff --git a/mo/lib/guess.mli b/mo/lib/guess.mli index 967a611..77f6690 100644 --- a/mo/lib/guess.mli +++ b/mo/lib/guess.mli @@ -1,12 +1,15 @@ open Linear_algebra -(** Guess for Hartree-Fock calculations. *) +(** Guess for Hartree-Fock calculations. +Ref: https://pubs.acs.org/doi/10.1021/acs.jctc.8b01089 +*) type ao = Ao.Ao_dim.t type mo = Mo_dim.t type guess = | Hcore of (ao,ao) Matrix.t (* Core Hamiltonian Matrix *) +| GWH of (ao,ao) Matrix.t (* Generalized Wolfsberg-Helmholtz (GWH) *) | Huckel of (ao,ao) Matrix.t (* Huckel Hamiltonian Matrix *) | Matrix of (ao,mo) Matrix.t (* Guess Eigenvectors *) @@ -15,6 +18,6 @@ type t = guess val make : ?nocc:int -> - guess:[ `Hcore | `Huckel | `Matrix of (ao,mo) Matrix.t ] -> + guess:[ `Hcore | `GWH | `Huckel | `Matrix of (ao,mo) Matrix.t ] -> Ao.Basis.t -> t diff --git a/mo/lib/hartree_fock.ml b/mo/lib/hartree_fock.ml index 3ac4b5d..4be7271 100644 --- a/mo/lib/hartree_fock.ml +++ b/mo/lib/hartree_fock.ml @@ -188,7 +188,7 @@ let exchange_energy t = let make ?kind - ?guess:(guess=`Huckel) + ?guess:(guess=`GWH) ?max_scf:(max_scf=64) ?level_shift:(level_shift=0.2) ?threshold_SCF:(threshold_SCF=1.e-8) @@ -249,6 +249,7 @@ let make in match guess with | Guess.Hcore m_H -> c_of_h m_H + | Guess.GWH m_H -> c_of_h m_H | Guess.Huckel m_H -> c_of_h m_H | Guess.Matrix m_C -> m_C in diff --git a/mo/lib/hartree_fock.mli b/mo/lib/hartree_fock.mli index 0c2f6cb..3e8b2f0 100644 --- a/mo/lib/hartree_fock.mli +++ b/mo/lib/hartree_fock.mli @@ -43,11 +43,11 @@ val kin_energy : t -> float val eN_energy : t -> float (** Electron-nucleus potential energy *) - -val coulomb_energy : t -> float + +val coulomb_energy : t -> float (** Electron-Electron potential energy *) -val exchange_energy : t -> float +val exchange_energy : t -> float (** Exchange energy *) val nocc : t -> int @@ -59,7 +59,7 @@ val empty: hartree_fock_data val make : ?kind:hartree_fock_kind -> - ?guess:[ `Hcore | `Huckel | `Matrix of (ao,mo) Matrix.t ] -> + ?guess:[ `Hcore | `GWH | `Huckel | `Matrix of (ao,mo) Matrix.t ] -> ?max_scf:int -> ?level_shift:float -> ?threshold_SCF:float -> Simulation.t -> t