Work : correction Boys calcul alpha boucle
This commit is contained in:
parent
8910042833
commit
47b659829d
51
Work.ipynb
51
Work.ipynb
@ -1071,6 +1071,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
|
"(*\n",
|
||||||
"(* Fonction calcul alpha Boys *)\n",
|
"(* Fonction calcul alpha Boys *)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"let n_ao = Mat.dim1 m_C ;;\n",
|
"let n_ao = Mat.dim1 m_C ;;\n",
|
||||||
@ -1111,7 +1112,8 @@
|
|||||||
" 0.25 *. asin(m_b12.{i,j} /. sqrt((m_a12.{i,j}**2.) +. (m_b12.{i,j}**2.) )));;\n",
|
" 0.25 *. asin(m_b12.{i,j} /. sqrt((m_a12.{i,j}**2.) +. (m_b12.{i,j}**2.) )));;\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"m_alpha_boys multipoles;;\n"
|
"m_alpha_boys multipoles;;\n",
|
||||||
|
"*)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1634,7 +1636,7 @@
|
|||||||
"Mat.init_cols n_ao n_ao ( fun i j -> \n",
|
"Mat.init_cols n_ao n_ao ( fun i j -> \n",
|
||||||
" if i= j \n",
|
" if i= j \n",
|
||||||
" then 0. \n",
|
" then 0. \n",
|
||||||
" else 0.25 *. (acos(-. m_a12.{i,j} /. sqrt((m_a12.{i,j}**2.) +. (m_b12.{i,j}**2.)))));;\n",
|
" else 0.25 *. (acos(-. m_a12.{i,j} /. sqrt((m_a12.{i,j}**2.) +. (m_b12.{i,j}**2.)))));;\n",
|
||||||
"\n",
|
"\n",
|
||||||
"(*********************)\n",
|
"(*********************)\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -1669,7 +1671,7 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"(* Fonction calcul alpha Boys *)\n",
|
"(* Fonction calcul alpha Boys *)\n",
|
||||||
"let f_alpha_boys multipoles = \n",
|
"let f_alpha_boys mo_coef = \n",
|
||||||
"\n",
|
"\n",
|
||||||
" let phi_x_phi =\n",
|
" let phi_x_phi =\n",
|
||||||
" Multipole.matrix_x multipoles \n",
|
" Multipole.matrix_x multipoles \n",
|
||||||
@ -1697,12 +1699,14 @@
|
|||||||
" in\n",
|
" in\n",
|
||||||
" Mat.add (a12 phi_x_phi) ( Mat.add (a12 phi_y_phi) (a12 phi_z_phi))\n",
|
" Mat.add (a12 phi_x_phi) ( Mat.add (a12 phi_y_phi) (a12 phi_z_phi))\n",
|
||||||
" in\n",
|
" in\n",
|
||||||
" Mat.init_cols n_ao n_ao ( fun i j ->\n",
|
" Mat.init_cols n_ao n_ao ( fun i j -> \n",
|
||||||
" 0.25 *. acos( -. m_a12.{i,j} /. sqrt((m_a12.{i,j}**2.) +. (m_b12.{i,j}**2.) )));;\n",
|
" if i=j \n",
|
||||||
|
" then 0.\n",
|
||||||
|
" else 0.25 *. asin( m_b12.{i,j} /. sqrt((m_a12.{i,j}**2.) +. (m_b12.{i,j}**2.) )));;\n",
|
||||||
"\n",
|
"\n",
|
||||||
"(****************************)\n",
|
"(****************************)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"f_alpha_boys multipoles;;\n"
|
"f_alpha_boys m_C;;\n"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1713,7 +1717,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"(* Fonction de calcul de D Boys *)\n",
|
"(* Fonction de calcul de D Boys *)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"let d_boys multipoles = \n",
|
"let d_boys mo_coef = \n",
|
||||||
"\n",
|
"\n",
|
||||||
" let phi_x2_phi =\n",
|
" let phi_x2_phi =\n",
|
||||||
" Multipole.matrix_x2 multipoles \n",
|
" Multipole.matrix_x2 multipoles \n",
|
||||||
@ -1745,7 +1749,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"(*************************)\n",
|
"(*************************)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"d_boys multipoles;;"
|
"d_boys m_C;;"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1757,7 +1761,7 @@
|
|||||||
"(* Test méthode de calcul de alpha *)\n",
|
"(* Test méthode de calcul de alpha *)\n",
|
||||||
"let calcul_alpha_2 methode = \n",
|
"let calcul_alpha_2 methode = \n",
|
||||||
"\n",
|
"\n",
|
||||||
"let alpha_boys = f_alpha_boys multipoles\n",
|
"let alpha_boys = f_alpha_boys m_C\n",
|
||||||
"in\n",
|
"in\n",
|
||||||
"let alpha_er = f_alpha m_C\n",
|
"let alpha_er = f_alpha m_C\n",
|
||||||
"in\n",
|
"in\n",
|
||||||
@ -1791,7 +1795,7 @@
|
|||||||
"(* Test méthode de calcul du critère de convergence *)\n",
|
"(* Test méthode de calcul du critère de convergence *)\n",
|
||||||
"let calcul_cc methode = \n",
|
"let calcul_cc methode = \n",
|
||||||
"\n",
|
"\n",
|
||||||
"let b_boys = d_boys multipoles\n",
|
"let b_boys = d_boys m_C\n",
|
||||||
"in\n",
|
"in\n",
|
||||||
"let d_er = s_D m_C\n",
|
"let d_er = s_D m_C\n",
|
||||||
"in\n",
|
"in\n",
|
||||||
@ -1832,11 +1836,11 @@
|
|||||||
"d : float;\n",
|
"d : float;\n",
|
||||||
"}\n",
|
"}\n",
|
||||||
"\n",
|
"\n",
|
||||||
"let m_alpha_d methode m_C multipoles = \n",
|
"let m_alpha_d methode m_C = \n",
|
||||||
"\n",
|
"\n",
|
||||||
"let alpha_boys = f_alpha_boys multipoles\n",
|
"let alpha_boys = f_alpha_boys m_C\n",
|
||||||
"in\n",
|
"in\n",
|
||||||
"let d_boys = d_boys multipoles\n",
|
"let d_boys = d_boys m_C\n",
|
||||||
"in\n",
|
"in\n",
|
||||||
"let alpha_er = f_alpha m_C\n",
|
"let alpha_er = f_alpha m_C\n",
|
||||||
"in\n",
|
"in\n",
|
||||||
@ -2095,7 +2099,7 @@
|
|||||||
"(* Localisation de Edminstion ou de Boys *)\n",
|
"(* Localisation de Edminstion ou de Boys *)\n",
|
||||||
"let n_rec_alpha = 10;;\n",
|
"let n_rec_alpha = 10;;\n",
|
||||||
"(* Calcul de la nouvelle matrice des coefficient après n rotation d'orbitales *)\n",
|
"(* Calcul de la nouvelle matrice des coefficient après n rotation d'orbitales *)\n",
|
||||||
"let rec final_m_C m_C multipoles methode n =\n",
|
"let rec final_m_C m_C methode n =\n",
|
||||||
"\n",
|
"\n",
|
||||||
" Printf.printf \"%i\\n%!\" n;\n",
|
" Printf.printf \"%i\\n%!\" n;\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -2106,9 +2110,9 @@
|
|||||||
" else\n",
|
" else\n",
|
||||||
" \n",
|
" \n",
|
||||||
" (* Fonction de calcul de la nouvelle matrice de coef après rotation d'un angle alpha *)\n",
|
" (* Fonction de calcul de la nouvelle matrice de coef après rotation d'un angle alpha *)\n",
|
||||||
" let new_m_C m_C multipoles methode =\n",
|
" let new_m_C m_C methode =\n",
|
||||||
" \n",
|
" \n",
|
||||||
" let alphad = m_alpha_d methode m_C multipoles\n",
|
" let alphad = m_alpha_d methode m_C \n",
|
||||||
" in\n",
|
" in\n",
|
||||||
" \n",
|
" \n",
|
||||||
" (* D critère à maximiser *)\n",
|
" (* D critère à maximiser *)\n",
|
||||||
@ -2176,14 +2180,14 @@
|
|||||||
" (* Matrice après rotation *)\n",
|
" (* Matrice après rotation *)\n",
|
||||||
" Mat.add m_Psi_tilde m_interm\n",
|
" Mat.add m_Psi_tilde m_interm\n",
|
||||||
" in\n",
|
" in\n",
|
||||||
" let m_new_m_C = new_m_C m_C multipoles methode (* Fonction -> constante *)\n",
|
" let m_new_m_C = new_m_C m_C methode (* Fonction -> constante *)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"in\n",
|
"in\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Util.debug_matrix \"new_alpha_m\" (f_alpha m_C);\n",
|
"Util.debug_matrix \"new_alpha_m\" (f_alpha m_C);\n",
|
||||||
"Util.debug_matrix \"m_new_m_C\" m_new_m_C;\n",
|
"Util.debug_matrix \"m_new_m_C\" m_new_m_C;\n",
|
||||||
"\n",
|
"\n",
|
||||||
"final_m_C m_new_m_C multipoles methode (n-1);;"
|
"final_m_C m_new_m_C methode (n-1);;"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -2192,7 +2196,16 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"final_m_C m_C multipoles \"ER\" 10;;"
|
"final_m_C m_C \"ER\" 1;;"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"final_m_C m_C \"Boys\" 10;;"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user