mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-12-22 12:23:31 +01:00
Improved F12 Notebook
This commit is contained in:
parent
e3a0b4a6c0
commit
2e6ccb1770
@ -156,7 +156,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"let hf = HartreeFock.make ~guess:`Hcore simulation ;;\n",
|
||||
"let hf = HartreeFock.make ~guess:`Hcore ~max_scf:1 simulation ;;\n",
|
||||
"\n",
|
||||
"let mo_basis = MOBasis.of_hartree_fock hf"
|
||||
]
|
||||
@ -865,22 +865,20 @@
|
||||
"$i,j$ : orbital indices of MOs occupied in $|I\\rangle$.\n",
|
||||
"\n",
|
||||
"\\begin{align}\n",
|
||||
"\\sum_{a} \\left( \n",
|
||||
" \\sum_{i} \\sum_{j}\n",
|
||||
" \\left(h_{ia} + \\langle i j || a j \\rangle \\right) \n",
|
||||
" \\left(f_{ai} + \\left[ a j || i j \\right] \\right) + \n",
|
||||
" \\sum_{i} \\sum_{\\bar{j}}\n",
|
||||
" \\left(h_{ia} + \\langle i \\bar{j} | a \\bar{j} \\rangle \\right) \n",
|
||||
" \\left(f_{ai} + \\left[ a \\bar{j} | i \\bar{j} \\right] \\right) \n",
|
||||
" \\right) + \\\\\n",
|
||||
"\\sum_{\\bar{a}} \\left(\n",
|
||||
" \\sum_{\\bar{i}} \\sum_{\\bar{j}}\n",
|
||||
" \\left(h_{\\bar{i}\\bar{a}} + \\langle \\bar{i} \\bar{j} || \\bar{a} \\bar{j} \\rangle \\right) \n",
|
||||
" \\left(f_{\\bar{a}\\bar{i}} + \\left[ \\bar{a} \\bar{j} || \\bar{i} \\bar{j} \\right] \\right) + \n",
|
||||
" \\sum_{\\bar{i}} \\sum_{j}\n",
|
||||
" \\left(h_{\\bar{i}\\bar{a}} + \\langle \\bar{i} j | \\bar{a} j \\rangle \\right)\n",
|
||||
" \\left(f_{\\bar{a}\\bar{i}} + \\left[ \\bar{a} j | \\bar{i} j \\right] \\right) \n",
|
||||
" \\right) \n",
|
||||
"\\sum_{a} \\sum_{i}\n",
|
||||
" \\left( h_{ia} +\n",
|
||||
" \\sum_{j} \\langle i j || a j \\rangle +\n",
|
||||
" \\sum_{\\bar{j}} \\langle i \\bar{j} | a \\bar{j} \\rangle \\right) \n",
|
||||
" \\left( f_{ai} +\n",
|
||||
" \\sum_{j} \\left[ a j || i j \\right] + \n",
|
||||
" \\sum_{\\bar{j}} \\left[ a \\bar{j} | i \\bar{j} \\right] \\right) + \\\\\n",
|
||||
"\\sum_{\\bar{a}} \\sum_{\\bar{i}}\n",
|
||||
" \\left( h_{ia} +\n",
|
||||
" \\sum_{j} \\langle \\bar{i} j | \\bar{a} j \\rangle +\n",
|
||||
" \\sum_{\\bar{j}} \\langle \\bar{i} \\bar{j} || \\bar{a} \\bar{j} \\rangle \\right) \n",
|
||||
" \\left( f_{ai} +\n",
|
||||
" \\sum_{j} \\left[ \\bar{a} j | \\bar{i} j \\right] + \n",
|
||||
" \\sum_{\\bar{j}} \\left[ \\bar{a} \\bar{j} || \\bar{i} \\bar{j} \\right] \\right) \n",
|
||||
"\\end{align}"
|
||||
]
|
||||
},
|
||||
@ -893,29 +891,28 @@
|
||||
"let integral_value ki kj = \n",
|
||||
" (* Alpha-Beta *)\n",
|
||||
" let s, s' = Spin.(Alfa, Beta) in \n",
|
||||
" List.fold_left (fun accu j -> accu +. \n",
|
||||
" let mos_a, mos_b = mos_a ki, mos_b ki in\n",
|
||||
" List.fold_left (fun accu a -> accu +.\n",
|
||||
" List.fold_left (fun accu i -> accu +. \n",
|
||||
" List.fold_left (fun accu a ->\n",
|
||||
" accu +.( (h_one i a s +. h_two i j a j s s') *. \n",
|
||||
" (f_one a i s +. f_two a j i j s s') )\n",
|
||||
" +.( (h_one j a s' +. h_two i j i a s s') *. \n",
|
||||
" (f_one a j s' +. f_two i a i j s s') )\n",
|
||||
" ) 0. mos_cabs\n",
|
||||
" ) 0. (mos_a ki)\n",
|
||||
" ) 0. (mos_b ki)\n",
|
||||
" (h_one i a s +.\n",
|
||||
" List.fold_left (fun accu j -> accu +. h_two i j a j s s ) 0. mos_a +. \n",
|
||||
" List.fold_left (fun accu j -> accu +. h_two i j a j s s') 0. mos_b ) *. \n",
|
||||
" (f_one a i s +.\n",
|
||||
" List.fold_left (fun accu j -> accu +. f_two a j i j s s ) 0. mos_a +.\n",
|
||||
" List.fold_left (fun accu j -> accu +. f_two a j i j s s') 0. mos_b )\n",
|
||||
" ) 0. mos_a\n",
|
||||
" ) 0. mos_cabs\n",
|
||||
" +.\n",
|
||||
" (* Alpha-Alpha / Beta-Beta *)\n",
|
||||
" List.fold_left (fun accu (mos,s) -> \n",
|
||||
" let s' = s in accu +. \n",
|
||||
" List.fold_left (fun accu j -> accu +. \n",
|
||||
" List.fold_left (fun accu i -> accu +. \n",
|
||||
" List.fold_left (fun accu a -> \n",
|
||||
" accu +.( (h_one i a s +. h_two i j a j s s') *. \n",
|
||||
" (f_one a i s +. f_two a j i j s s') )\n",
|
||||
" ) 0. mos_cabs\n",
|
||||
" ) 0. mos\n",
|
||||
" ) 0. mos\n",
|
||||
" ) 0. [ (mos_a ki,Spin.Alfa) ; (mos_b ki,Spin.Beta)]\n",
|
||||
" List.fold_left (fun accu a -> accu +.\n",
|
||||
" List.fold_left (fun accu i -> accu +. \n",
|
||||
" (h_one i a s +.\n",
|
||||
" List.fold_left (fun accu j -> accu +. h_two i j a j s' s') 0. mos_b +. \n",
|
||||
" List.fold_left (fun accu j -> accu +. h_two i j a j s' s ) 0. mos_a ) *. \n",
|
||||
" (f_one a i s +.\n",
|
||||
" List.fold_left (fun accu j -> accu +. f_two a j i j s' s ) 0. mos_a +.\n",
|
||||
" List.fold_left (fun accu j -> accu +. f_two a j i j s' s') 0. mos_b )\n",
|
||||
" ) 0. mos_b\n",
|
||||
" ) 0. mos_cabs\n",
|
||||
" \n",
|
||||
"let _ =\n",
|
||||
" check 0 integral_value 0 1 1 1\n",
|
||||
@ -1110,7 +1107,7 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# 4. *1 1 11*"
|
||||
"# 4. 1 1 11"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -1131,12 +1128,11 @@
|
||||
"$j$ : orbital indices of MOs occupied both in $|I\\rangle$ and $|J\\rangle$.\n",
|
||||
"\n",
|
||||
"\\begin{align}\n",
|
||||
"\\sum_{a} \\sum_{j}\n",
|
||||
" \\left( h_{ia} + \\langle i j || a j \\rangle \\right)\n",
|
||||
" \\left( f_{ak} + \\left[ a j || k j \\right] \\right) + \n",
|
||||
"\\sum_{\\bar{j}}\n",
|
||||
" \\left( h_{ia} + \\langle i \\bar{j} | a \\bar{j} \\rangle \\right) \n",
|
||||
" \\left( f_{ak} + \\left[ a \\bar{j} | k \\bar{j} \\right] \\right)\n",
|
||||
" \\sum_{a} \n",
|
||||
" \\left( h_{ia} +\\sum_{j} \\langle i j || a j \\rangle +\n",
|
||||
" \\sum_{\\bar{j}} \\langle i \\bar{j} | a \\bar{j} \\rangle \\right)\n",
|
||||
" \\left( f_{ak} +\\sum_{j} \\left[ a j || k j \\right] + \n",
|
||||
" \\sum_{\\bar{j}} \\left[ a \\bar{j} | k \\bar{j} \\right]\\right) \n",
|
||||
"\\end{align}"
|
||||
]
|
||||
},
|
||||
@ -1154,31 +1150,27 @@
|
||||
" | _ -> assert false\n",
|
||||
" in\n",
|
||||
"\n",
|
||||
" let mos, mos' =\n",
|
||||
" let mos_i, mos_i' =\n",
|
||||
" match s with\n",
|
||||
" | Spin.Alfa -> mos_a ki, mos_b ki\n",
|
||||
" | Spin.Beta -> mos_b ki, mos_a ki\n",
|
||||
" in\n",
|
||||
" let mos_j, mos_j' =\n",
|
||||
" match s with\n",
|
||||
" | Spin.Alfa -> mos_a kj, mos_b kj\n",
|
||||
" | Spin.Beta -> mos_b kj, mos_a kj\n",
|
||||
" in\n",
|
||||
"\n",
|
||||
" let result = \n",
|
||||
" (* Alpha-Beta *)\n",
|
||||
" List.fold_left (fun accu j ->\n",
|
||||
" let s' = Spin.other s in\n",
|
||||
" accu +. List.fold_left (fun accu a ->\n",
|
||||
" accu +. (h_one i a s +. h_two i j a j s s')\n",
|
||||
" *. (f_one a k s +. f_two a j k j s s')\n",
|
||||
" ) 0. mos_cabs\n",
|
||||
" ) 0. mos'\n",
|
||||
" +.\n",
|
||||
" (* Alpha-Alpha / Beta-Beta *)\n",
|
||||
" List.fold_left (fun accu j ->\n",
|
||||
" if j = i then accu else\n",
|
||||
" let s' = s in\n",
|
||||
" accu +. List.fold_left (fun accu a ->\n",
|
||||
" accu +. (h_one i a s +. h_two i j a j s s')\n",
|
||||
" *. (f_one a k s +. f_two a j k j s s')\n",
|
||||
" ) 0. mos_cabs\n",
|
||||
" ) 0. mos\n",
|
||||
" let s' = Spin.other s in\n",
|
||||
" List.fold_left (fun accu a -> accu +.\n",
|
||||
" (h_one i a s +. \n",
|
||||
" (List.fold_left (fun accu j -> accu +. h_two i j a j s s ) 0. mos_i ) +.\n",
|
||||
" (List.fold_left (fun accu j -> accu +. h_two i j a j s s') 0. mos_i') ) *.\n",
|
||||
" (f_one a k s +. \n",
|
||||
" (List.fold_left (fun accu j -> accu +. f_two a j k j s s ) 0. mos_j ) +.\n",
|
||||
" (List.fold_left (fun accu j -> accu +. f_two a j k j s s') 0. mos_j') ) \n",
|
||||
" ) 0. mos_cabs\n",
|
||||
" in\n",
|
||||
" match phase with\n",
|
||||
" | Phase.Pos -> result\n",
|
||||
|
Loading…
Reference in New Issue
Block a user