Work : nocc, correction calcul D
This commit is contained in:
parent
a68d34aca0
commit
2fe18f3914
30
Work.ipynb
30
Work.ipynb
@ -329,7 +329,11 @@
|
||||
" Simulation.make ~charge:0 ~multiplicity:1 ~nuclei basis\n",
|
||||
" \n",
|
||||
"let ao_basis = \n",
|
||||
" Simulation.ao_basis simulation"
|
||||
" Simulation.ao_basis simulation\n",
|
||||
" \n",
|
||||
"let nocc =\n",
|
||||
" let elec = Simulation.electrons simulation in\n",
|
||||
" Electrons.n_alfa elec\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -630,9 +634,6 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"let nocc = 1 (* On a 10 electrons, donc 5 orbitales occupees. *)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"let c_of_h m_H = \n",
|
||||
" (* On exprime H dans la base orthonormale *)\n",
|
||||
" let m_Hmo =\n",
|
||||
@ -1648,7 +1649,7 @@
|
||||
" \n",
|
||||
" let m_b12 = Mat.init_cols n_mo n_mo (fun i j -> 0.) in\n",
|
||||
" let m_a12 = Mat.init_cols n_mo n_mo (fun i j -> 0.) in\n",
|
||||
" let m_d = Mat.init_cols n_mo n_mo (fun i j -> 0.) in\n",
|
||||
" let v_d = Vec.init n_mo (fun i -> 0.) in\n",
|
||||
" \n",
|
||||
" (* Tableaux temporaires *)\n",
|
||||
" let m_pqr =\n",
|
||||
@ -1707,14 +1708,12 @@
|
||||
" \n",
|
||||
" Array.iter (fun j ->\n",
|
||||
" Array.iter (fun i ->\n",
|
||||
" Array.iter (fun i ->\n",
|
||||
" m_b12.{i,j} <- m_b12.{i,j} +. m_C.{s,j} *. (m_ijk.{i,i,i} -. m_ijk.{j,i,j});\n",
|
||||
" m_a12.{i,j} <- m_a12.{i,j} +. m_ijk.{i,i,j} *. m_C.{s,j} -.\n",
|
||||
" 0.25 *. ( (m_ijk.{i,i,i} -. m_ijk.{j,i,j}) *. m_C.{s,i} +.\n",
|
||||
" (m_ijk.{j,j,j} -. m_ijk.{i,j,i}) *. m_C.{s,j});\n",
|
||||
" m_d.{i,j} <- m_d.{i,j} +. m_ijk.{i,i,j} *. m_C.{s,j}\n",
|
||||
" ) (Util.array_range 1 n_mo) \n",
|
||||
" ) (Util.array_range 1 n_mo)\n",
|
||||
" (m_ijk.{j,j,j} -. m_ijk.{i,j,i}) *. m_C.{s,j})\n",
|
||||
" ) (Util.array_range 1 n_mo);\n",
|
||||
" v_d.{j} <- v_d.{j} +. m_ijk.{j,j,j} *. m_C.{s,j}\n",
|
||||
" ) (Util.array_range 1 n_mo)\n",
|
||||
" ) (Util.array_range 1 n_ao);\n",
|
||||
" \n",
|
||||
@ -1723,20 +1722,17 @@
|
||||
" (Mat.init_cols n_mo n_mo ( fun i j ->\n",
|
||||
" if i= j then 0.\n",
|
||||
" else 0.25 *. (acos(-. m_a12.{i,j} /. sqrt((m_a12.{i,j}**2.) +. (m_b12.{i,j}**2. ))))\n",
|
||||
" ),Mat.init_cols n_mo n_mo ( fun i j -> m_d.{i,j}));;\n",
|
||||
" ),v_d);;\n",
|
||||
"\n",
|
||||
"(*********************)\n",
|
||||
"\n",
|
||||
"f_alpha m_C;;\n",
|
||||
"\n",
|
||||
"let m_alpha , m_d = f_alpha m_C;;\n",
|
||||
"let m_alpha , v_d = f_alpha m_C;;\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"let s_D m_C = \n",
|
||||
" let v_D = \n",
|
||||
" let n_mo = Mat.dim2 m_C\n",
|
||||
" in Vec.init n_mo ( fun i -> m_d.{i,i} )\n",
|
||||
"in Vec.sum v_D ;;\n",
|
||||
"Vec.sum v_d ;;\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"s_D m_C;;\n"
|
||||
@ -2281,7 +2277,7 @@
|
||||
"\n",
|
||||
"m_C;;\n",
|
||||
"\n",
|
||||
"let list_om = [1;2]\n",
|
||||
"let list_om = [1;3]\n",
|
||||
"\n",
|
||||
"let m_occ , m_vir = split_mat m_C list_om;;"
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user