diff --git a/configure b/configure index 90f52769..e87badbb 100755 --- a/configure +++ b/configure @@ -451,7 +451,7 @@ def create_ninja_and_rc(l_installed): 'export IRPF90={0}'.format(path_irpf90), 'export NINJA={0}'.format(path_ninja), 'export QP_PYTHON={0}'.format(":".join(l_python)), "", - 'export PYTHONPATH="${QP_PYTHON}":"${PYTHONPATH}"', + 'export PYTHONPATH="${QP_EZFIO}":"${QP_PYTHON}":"${PYTHONPATH}"', 'export PATH="${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml:"${PATH}"', 'export LD_LIBRARY_PATH="${QP_ROOT}"/lib:"${LD_LIBRARY_PATH}"', 'export LIBRARY_PATH="${QP_ROOT}"/lib:"${LIBRARY_PATH}"', "", diff --git a/plugins/Full_CI/.gitignore b/plugins/Full_CI/.gitignore index 2d978fa6..a806bcbc 100644 --- a/plugins/Full_CI/.gitignore +++ b/plugins/Full_CI/.gitignore @@ -22,7 +22,6 @@ Properties Pseudo Selectors_full Utils -exc_degree ezfio_interface.irp.f full_ci full_ci_no_skip diff --git a/plugins/Full_CI/README.rst b/plugins/Full_CI/README.rst index d94675eb..1af26ae6 100644 --- a/plugins/Full_CI/README.rst +++ b/plugins/Full_CI/README.rst @@ -4,164 +4,165 @@ Full_CI Module Performs a perturbatively selected Full-CI. -Documentation -============= - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -`full_ci `_ - Undocumented - - -`h_apply_fci `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_fci_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_fci_mono `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_fci_mono_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_fci_mono_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_fci_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_fci_no_skip `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_fci_no_skip_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_fci_no_skip_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_fci_pt2 `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_fci_pt2_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_fci_pt2_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_pt2_mono_delta_rho `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_pt2_mono_delta_rho_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_pt2_mono_delta_rho_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_pt2_mono_di_delta_rho `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_pt2_mono_di_delta_rho_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_pt2_mono_di_delta_rho_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_select_mono_delta_rho `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_select_mono_delta_rho_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_select_mono_delta_rho_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_select_mono_di_delta_rho `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_select_mono_di_delta_rho_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_select_mono_di_delta_rho_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`var_pt2_ratio_run `_ - Undocumented Needed Modules ============== - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + .. image:: tree_dependency.png -* `Perturbation `_ -* `Selectors_full `_ -* `Generators_full `_ +* `Perturbation `_ +* `Selectors_full `_ +* `Generators_full `_ + +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +`full_ci `_ + Undocumented + + +`h_apply_fci `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_fci_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_fci_mono `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_fci_mono_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_fci_mono_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_fci_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_fci_no_skip `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_fci_no_skip_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_fci_no_skip_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_fci_pt2 `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_fci_pt2_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_fci_pt2_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_pt2_mono_delta_rho `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_pt2_mono_delta_rho_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_pt2_mono_delta_rho_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_pt2_mono_di_delta_rho `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_pt2_mono_di_delta_rho_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_pt2_mono_di_delta_rho_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_select_mono_delta_rho `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_select_mono_delta_rho_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_select_mono_delta_rho_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_select_mono_di_delta_rho `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_select_mono_di_delta_rho_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_select_mono_di_delta_rho_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`var_pt2_ratio_run `_ + Undocumented diff --git a/plugins/Generators_full/README.rst b/plugins/Generators_full/README.rst index dc6965e8..c30193a2 100644 --- a/plugins/Generators_full/README.rst +++ b/plugins/Generators_full/README.rst @@ -5,42 +5,10 @@ Generators_full Module All the determinants of the wave function are generators. In this way, the Full CI space is explored. -Documentation -============= - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -`degree_max_generators `_ - Max degree of excitation (respect to HF) of the generators - - -`n_det_generators `_ - For Single reference wave functions, the number of generators is 1 : the - Hartree-Fock determinant - - -`psi_coef_generators `_ - For Single reference wave functions, the generator is the - Hartree-Fock determinant - - -`psi_det_generators `_ - For Single reference wave functions, the generator is the - Hartree-Fock determinant - - -`select_max `_ - Memo to skip useless selectors - - -`size_select_max `_ - Size of the select_max array - Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. .. image:: tree_dependency.png @@ -48,3 +16,46 @@ Needed Modules * `Determinants `_ * `Hartree_Fock `_ +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +.. image:: tree_dependency.png + +* `Determinants `_ +* `Hartree_Fock `_ + +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +`degree_max_generators `_ + Max degree of excitation (respect to HF) of the generators + + +`n_det_generators `_ + For Single reference wave functions, the number of generators is 1 : the + Hartree-Fock determinant + + +`psi_coef_generators `_ + For Single reference wave functions, the generator is the + Hartree-Fock determinant + + +`psi_det_generators `_ + For Single reference wave functions, the generator is the + Hartree-Fock determinant + + +`select_max `_ + Memo to skip useless selectors + + +`size_select_max `_ + Size of the select_max array + diff --git a/plugins/Hartree_Fock/README.rst b/plugins/Hartree_Fock/README.rst index 28b3aec1..345285ec 100644 --- a/plugins/Hartree_Fock/README.rst +++ b/plugins/Hartree_Fock/README.rst @@ -7,9 +7,20 @@ From the 140 molecules of the G2 set, only LiO, ONa don't converge well. Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `Integrals_Bielec `_ +* `MOGuess `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `Integrals_Bielec `_ @@ -17,61 +28,61 @@ Needed Modules Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. -`ao_bi_elec_integral_alpha `_ + +`ao_bi_elec_integral_alpha `_ Alpha Fock matrix in AO basis set -`ao_bi_elec_integral_beta `_ +`ao_bi_elec_integral_beta `_ Alpha Fock matrix in AO basis set -`create_guess `_ +`create_guess `_ Create an MO guess if no MOs are present in the EZFIO directory -`damping_scf `_ +`damping_scf `_ Undocumented -`diagonal_fock_matrix_mo `_ +`diagonal_fock_matrix_mo `_ Diagonal Fock matrix in the MO basis -`diagonal_fock_matrix_mo_sum `_ +`diagonal_fock_matrix_mo_sum `_ diagonal element of the fock matrix calculated as the sum over all the interactions with all the electrons in the RHF determinant diagonal_Fock_matrix_mo_sum(i) = sum_{j=1, N_elec} 2 J_ij -K_ij -`eigenvectors_fock_matrix_mo `_ +`eigenvectors_fock_matrix_mo `_ Diagonal Fock matrix in the MO basis -`fock_matrix_alpha_ao `_ +`fock_matrix_alpha_ao `_ Alpha Fock matrix in AO basis set -`fock_matrix_alpha_mo `_ +`fock_matrix_alpha_mo `_ Fock matrix on the MO basis -`fock_matrix_ao `_ +`fock_matrix_ao `_ Fock matrix in AO basis set -`fock_matrix_beta_ao `_ +`fock_matrix_beta_ao `_ Alpha Fock matrix in AO basis set -`fock_matrix_beta_mo `_ +`fock_matrix_beta_mo `_ Fock matrix on the MO basis -`fock_matrix_diag_mo `_ +`fock_matrix_diag_mo `_ Fock matrix on the MO basis. For open shells, the ROHF Fock Matrix is .br @@ -87,7 +98,7 @@ Documentation .br -`fock_matrix_mo `_ +`fock_matrix_mo `_ Fock matrix on the MO basis. For open shells, the ROHF Fock Matrix is .br @@ -103,53 +114,53 @@ Documentation .br -`fock_mo_to_ao `_ +`fock_mo_to_ao `_ Undocumented -`guess `_ +`guess `_ Undocumented -`hf_density_matrix_ao `_ +`hf_density_matrix_ao `_ S^-1 Density matrix in the AO basis S^-1 -`hf_density_matrix_ao_alpha `_ +`hf_density_matrix_ao_alpha `_ S^-1 x Alpha density matrix in the AO basis x S^-1 -`hf_density_matrix_ao_beta `_ +`hf_density_matrix_ao_beta `_ S^-1 Beta density matrix in the AO basis x S^-1 -`hf_energy `_ +`hf_energy `_ Hartree-Fock energy -`huckel_guess `_ +`huckel_guess `_ Build the MOs using the extended Huckel model -`mo_guess_type `_ +`mo_guess_type `_ Initial MO guess. Can be [ Huckel | HCore ] -`n_it_scf_max `_ +`n_it_scf_max `_ Maximum number of SCF iterations -`run `_ +`run `_ Run SCF calculation -`scf `_ +`scf `_ Produce `Hartree_Fock` MO orbital output: mo_basis.mo_tot_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ output: hartree_fock.energy optional: mo_basis.mo_coef -`thresh_scf `_ +`thresh_scf `_ Threshold on the convergence of the Hartree Fock energy diff --git a/plugins/Perturbation/README.rst b/plugins/Perturbation/README.rst index 9162e94b..3f77b2a2 100644 --- a/plugins/Perturbation/README.rst +++ b/plugins/Perturbation/README.rst @@ -67,115 +67,137 @@ Assumptions pt2_.... -Documentation -============= +Needed Modules +============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. -`do_pt2_end `_ +.. image:: tree_dependency.png + +* `Properties `_ +* `Hartree_Fock `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +.. image:: tree_dependency.png + +* `Properties `_ +* `Hartree_Fock `_ + +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +`do_pt2_end `_ If true, compute the PT2 at the end of the selection -`fill_h_apply_buffer_selection `_ +`fill_h_apply_buffer_selection `_ Fill the H_apply buffer with determiants for the selection -`max_exc_pert `_ +`max_exc_pert `_ Undocumented -`perturb_buffer_by_mono_delta_rho_one_point `_ +`perturb_buffer_by_mono_delta_rho_one_point `_ Applly pertubration ``delta_rho_one_point`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_dipole_moment_z `_ +`perturb_buffer_by_mono_dipole_moment_z `_ Applly pertubration ``dipole_moment_z`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_epstein_nesbet `_ +`perturb_buffer_by_mono_epstein_nesbet `_ Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_epstein_nesbet_2x2 `_ +`perturb_buffer_by_mono_epstein_nesbet_2x2 `_ Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_epstein_nesbet_sc2 `_ +`perturb_buffer_by_mono_epstein_nesbet_sc2 `_ Applly pertubration ``epstein_nesbet_sc2`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_epstein_nesbet_sc2_no_projected `_ +`perturb_buffer_by_mono_epstein_nesbet_sc2_no_projected `_ Applly pertubration ``epstein_nesbet_sc2_no_projected`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_epstein_nesbet_sc2_projected `_ +`perturb_buffer_by_mono_epstein_nesbet_sc2_projected `_ Applly pertubration ``epstein_nesbet_sc2_projected`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_h_core `_ +`perturb_buffer_by_mono_h_core `_ Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_by_mono_moller_plesset `_ +`perturb_buffer_by_mono_moller_plesset `_ Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_delta_rho_one_point `_ +`perturb_buffer_delta_rho_one_point `_ Applly pertubration ``delta_rho_one_point`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_dipole_moment_z `_ +`perturb_buffer_dipole_moment_z `_ Applly pertubration ``dipole_moment_z`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_epstein_nesbet `_ +`perturb_buffer_epstein_nesbet `_ Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_epstein_nesbet_2x2 `_ +`perturb_buffer_epstein_nesbet_2x2 `_ Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_epstein_nesbet_sc2 `_ +`perturb_buffer_epstein_nesbet_sc2 `_ Applly pertubration ``epstein_nesbet_sc2`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_epstein_nesbet_sc2_no_projected `_ +`perturb_buffer_epstein_nesbet_sc2_no_projected `_ Applly pertubration ``epstein_nesbet_sc2_no_projected`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_epstein_nesbet_sc2_projected `_ +`perturb_buffer_epstein_nesbet_sc2_projected `_ Applly pertubration ``epstein_nesbet_sc2_projected`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_h_core `_ +`perturb_buffer_h_core `_ Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine. -`perturb_buffer_moller_plesset `_ +`perturb_buffer_moller_plesset `_ Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine. -`pt2_delta_rho_one_point `_ +`pt2_delta_rho_one_point `_ compute the perturbatibe contribution to the Integrated Spin density at z = z_one point of one determinant .br for the various n_st states, at various level of theory. @@ -196,7 +218,7 @@ Documentation .br -`pt2_dipole_moment_z `_ +`pt2_dipole_moment_z `_ compute the perturbatibe contribution to the dipole moment of one determinant .br for the various n_st states, at various level of theory. @@ -217,7 +239,7 @@ Documentation .br -`pt2_epstein_nesbet `_ +`pt2_epstein_nesbet `_ compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution .br for the various N_st states. @@ -228,7 +250,7 @@ Documentation .br -`pt2_epstein_nesbet_2x2 `_ +`pt2_epstein_nesbet_2x2 `_ compute the Epstein-Nesbet 2x2 diagonalization coefficient and energetic contribution .br for the various N_st states. @@ -239,7 +261,7 @@ Documentation .br -`pt2_epstein_nesbet_sc2 `_ +`pt2_epstein_nesbet_sc2 `_ compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution .br for the various N_st states, but with the CISD_SC2 energies and coefficients @@ -250,7 +272,7 @@ Documentation .br -`pt2_epstein_nesbet_sc2_no_projected `_ +`pt2_epstein_nesbet_sc2_no_projected `_ compute the Epstein-Nesbet perturbative first order coefficient and second order energetic contribution .br for the various N_st states, @@ -274,7 +296,7 @@ Documentation H_pert_diag = c_pert -`pt2_epstein_nesbet_sc2_projected `_ +`pt2_epstein_nesbet_sc2_projected `_ compute the Epstein-Nesbet perturbative first order coefficient and second order energetic contribution .br for the various N_st states, @@ -298,7 +320,7 @@ Documentation H_pert_diag = c_pert -`pt2_h_core `_ +`pt2_h_core `_ compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution .br for the various N_st states. @@ -309,12 +331,12 @@ Documentation .br -`pt2_max `_ +`pt2_max `_ The selection process stops when the largest PT2 (for all the state) is lower than pt2_max in absolute value -`pt2_moller_plesset `_ +`pt2_moller_plesset `_ compute the standard Moller-Plesset perturbative first order coefficient and second order energetic contribution .br for the various n_st states. @@ -325,39 +347,28 @@ Documentation .br -`remove_small_contributions `_ +`remove_small_contributions `_ Remove determinants with small contributions. N_states is assumed to be provided. -`repeat_all_e_corr `_ +`repeat_all_e_corr `_ Undocumented -`selection_criterion `_ +`selection_criterion `_ Threshold to select determinants. Set by selection routines. -`selection_criterion_factor `_ +`selection_criterion_factor `_ Threshold to select determinants. Set by selection routines. -`selection_criterion_min `_ +`selection_criterion_min `_ Threshold to select determinants. Set by selection routines. -`var_pt2_ratio `_ +`var_pt2_ratio `_ The selection process stops when the energy ratio variational/(variational+PT2) is equal to var_pt2_ratio -Needed Modules -============== - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -.. image:: tree_dependency.png - -* `Properties `_ -* `Hartree_Fock `_ - diff --git a/plugins/Properties/README.rst b/plugins/Properties/README.rst index 5e5ab1cc..cd92ba14 100644 --- a/plugins/Properties/README.rst +++ b/plugins/Properties/README.rst @@ -2,47 +2,67 @@ Properties Module ================= -Documentation -============= +Needed Modules +============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. -`ao_integrated_delta_rho_all_points `_ +.. image:: tree_dependency.png + +* `Determinants `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +.. image:: tree_dependency.png + +* `Determinants `_ + +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +`ao_integrated_delta_rho_all_points `_ array of the overlap in x,y between the AO function and integrated between [z,z+dz] in the z axis for all the z points that are given (N_z_pts) -`ao_integrated_delta_rho_one_point `_ +`ao_integrated_delta_rho_one_point `_ array of the overlap in x,y between the AO function and integrated between [z,z+dz] in the z axis for one specific z point -`average_position `_ +`average_position `_ average_position(1) = average_position(2) = average_position(3) = -`average_spread `_ +`average_spread `_ average_spread(1) = average_spread(2) = average_spread(3) = -`delta_z `_ +`delta_z `_ Undocumented -`diag_o1_mat_elem `_ +`diag_o1_mat_elem `_ Computes -`diag_o1_mat_elem_alpha_beta `_ +`diag_o1_mat_elem_alpha_beta `_ Computes -`filter_connected_mono `_ +`filter_connected_mono `_ Filters out the determinants that are not connected through PURE .br MONO EXCITATIONS OPERATORS (a^{\dagger}j a_i) @@ -56,99 +76,89 @@ Documentation idx(0) is the number of determinants that interact with key1 -`get_average `_ +`get_average `_ computes the average value of a pure MONO ELECTRONIC OPERATOR whom integrals on the MO basis are stored in "array" and with the density is stored in "density" -`i_o1_j `_ +`i_o1_j `_ Returns where i and j are determinants and O1 is a ONE BODY OPERATOR array is the array of the mono electronic operator on the MO basis -`i_o1_j_alpha_beta `_ +`i_o1_j_alpha_beta `_ Returns where i and j are determinants and O1 is a ONE BODY OPERATOR array is the array of the mono electronic operator on the MO basis -`i_o1_psi `_ +`i_o1_psi `_ for the various Nstates and O1 is a ONE BODY OPERATOR array is the array of the mono electronic operator on the MO basis -`i_o1_psi_alpha_beta `_ +`i_o1_psi_alpha_beta `_ for the various Nstates and O1 is a ONE BODY OPERATOR array is the array of the mono electronic operator on the MO basis -`i_unit_integrated_delta_rho `_ +`i_unit_integrated_delta_rho `_ fortran unit for the writing of the integrated delta_rho -`integrated_delta_rho_all_points `_ +`integrated_delta_rho_all_points `_ .br integrated_rho(alpha,z) - integrated_rho(beta,z) for all the z points chosen .br -`integrated_delta_rho_one_point `_ +`integrated_delta_rho_one_point `_ .br integral (x,y) and (z,z+delta_z) of rho(alpha) - rho(beta) on the MO basis .br -`mo_integrated_delta_rho_one_point `_ +`mo_integrated_delta_rho_one_point `_ .br array of the integrals needed of integrated_rho(alpha,z) - integrated_rho(beta,z) for z = z_one_point on the MO basis .br -`n_z_pts `_ +`n_z_pts `_ Undocumented -`test_average_value `_ +`test_average_value `_ Undocumented -`test_average_value_alpha_beta `_ +`test_average_value_alpha_beta `_ Undocumented -`test_dm `_ +`test_dm `_ Undocumented -`z_max `_ +`z_max `_ Undocumented -`z_min `_ +`z_min `_ Undocumented -`z_one_point `_ +`z_one_point `_ z point on which the integrated delta rho is calculated -Needed Modules -============== - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -.. image:: tree_dependency.png - -* `Determinants `_ - diff --git a/plugins/Selectors_full/README.rst b/plugins/Selectors_full/README.rst index 33cbaf16..795234b4 100644 --- a/plugins/Selectors_full/README.rst +++ b/plugins/Selectors_full/README.rst @@ -2,183 +2,10 @@ Selectors_full Module ===================== -Documentation -============= - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -`coef_hf_selector `_ - energy of correlation per determinant respect to the Hartree Fock determinant - .br - for the all the double excitations in the selectors determinants - .br - E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation - .br - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - .br - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - -`delta_e_per_selector `_ - energy of correlation per determinant respect to the Hartree Fock determinant - .br - for the all the double excitations in the selectors determinants - .br - E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation - .br - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - .br - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - -`double_index_selectors `_ - degree of excitation respect to Hartree Fock for the wave function - .br - for the all the selectors determinants - .br - double_index_selectors = list of the index of the double excitations - .br - n_double_selectors = number of double excitations in the selectors determinants - - -`e_corr_double_only `_ - energy of correlation per determinant respect to the Hartree Fock determinant - .br - for the all the double excitations in the selectors determinants - .br - E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation - .br - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - .br - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - -`e_corr_per_selectors `_ - energy of correlation per determinant respect to the Hartree Fock determinant - .br - for the all the double excitations in the selectors determinants - .br - E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation - .br - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - .br - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - -`e_corr_second_order `_ - energy of correlation per determinant respect to the Hartree Fock determinant - .br - for the all the double excitations in the selectors determinants - .br - E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation - .br - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - .br - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - -`exc_degree_per_selectors `_ - degree of excitation respect to Hartree Fock for the wave function - .br - for the all the selectors determinants - .br - double_index_selectors = list of the index of the double excitations - .br - n_double_selectors = number of double excitations in the selectors determinants - - -`i_h_hf_per_selectors `_ - energy of correlation per determinant respect to the Hartree Fock determinant - .br - for the all the double excitations in the selectors determinants - .br - E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation - .br - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - .br - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - -`inv_selectors_coef_hf `_ - energy of correlation per determinant respect to the Hartree Fock determinant - .br - for the all the double excitations in the selectors determinants - .br - E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation - .br - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - .br - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - -`inv_selectors_coef_hf_squared `_ - energy of correlation per determinant respect to the Hartree Fock determinant - .br - for the all the double excitations in the selectors determinants - .br - E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation - .br - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - .br - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - -`n_det_selectors `_ - For Single reference wave functions, the number of selectors is 1 : the - Hartree-Fock determinant - - -`n_double_selectors `_ - degree of excitation respect to Hartree Fock for the wave function - .br - for the all the selectors determinants - .br - double_index_selectors = list of the index of the double excitations - .br - n_double_selectors = number of double excitations in the selectors determinants - - -`psi_selectors `_ - Determinants on which we apply for perturbation. - - -`psi_selectors_ab `_ - Determinants on which we apply . - They are sorted by the 3 highest electrons in the alpha part, - then by the 3 highest electrons in the beta part to accelerate - the research of connected determinants. - - -`psi_selectors_coef `_ - Determinants on which we apply for perturbation. - - -`psi_selectors_coef_ab `_ - Determinants on which we apply . - They are sorted by the 3 highest electrons in the alpha part, - then by the 3 highest electrons in the beta part to accelerate - the research of connected determinants. - - -`psi_selectors_diag_h_mat `_ - Diagonal elements of the H matrix for each selectors - - -`psi_selectors_next_ab `_ - Determinants on which we apply . - They are sorted by the 3 highest electrons in the alpha part, - then by the 3 highest electrons in the beta part to accelerate - the research of connected determinants. - - -`psi_selectors_size `_ - Undocumented - Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. .. image:: tree_dependency.png @@ -186,3 +13,187 @@ Needed Modules * `Determinants `_ * `Hartree_Fock `_ +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +.. image:: tree_dependency.png + +* `Determinants `_ +* `Hartree_Fock `_ + +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +`coef_hf_selector `_ + energy of correlation per determinant respect to the Hartree Fock determinant + .br + for the all the double excitations in the selectors determinants + .br + E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation + .br + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + .br + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + +`delta_e_per_selector `_ + energy of correlation per determinant respect to the Hartree Fock determinant + .br + for the all the double excitations in the selectors determinants + .br + E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation + .br + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + .br + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + +`double_index_selectors `_ + degree of excitation respect to Hartree Fock for the wave function + .br + for the all the selectors determinants + .br + double_index_selectors = list of the index of the double excitations + .br + n_double_selectors = number of double excitations in the selectors determinants + + +`e_corr_double_only `_ + energy of correlation per determinant respect to the Hartree Fock determinant + .br + for the all the double excitations in the selectors determinants + .br + E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation + .br + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + .br + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + +`e_corr_per_selectors `_ + energy of correlation per determinant respect to the Hartree Fock determinant + .br + for the all the double excitations in the selectors determinants + .br + E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation + .br + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + .br + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + +`e_corr_second_order `_ + energy of correlation per determinant respect to the Hartree Fock determinant + .br + for the all the double excitations in the selectors determinants + .br + E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation + .br + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + .br + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + +`exc_degree_per_selectors `_ + degree of excitation respect to Hartree Fock for the wave function + .br + for the all the selectors determinants + .br + double_index_selectors = list of the index of the double excitations + .br + n_double_selectors = number of double excitations in the selectors determinants + + +`i_h_hf_per_selectors `_ + energy of correlation per determinant respect to the Hartree Fock determinant + .br + for the all the double excitations in the selectors determinants + .br + E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation + .br + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + .br + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + +`inv_selectors_coef_hf `_ + energy of correlation per determinant respect to the Hartree Fock determinant + .br + for the all the double excitations in the selectors determinants + .br + E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation + .br + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + .br + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + +`inv_selectors_coef_hf_squared `_ + energy of correlation per determinant respect to the Hartree Fock determinant + .br + for the all the double excitations in the selectors determinants + .br + E_corr_per_selectors(i) = * c(D_i)/c(HF) if |D_i> is a double excitation + .br + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + .br + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + +`n_det_selectors `_ + For Single reference wave functions, the number of selectors is 1 : the + Hartree-Fock determinant + + +`n_double_selectors `_ + degree of excitation respect to Hartree Fock for the wave function + .br + for the all the selectors determinants + .br + double_index_selectors = list of the index of the double excitations + .br + n_double_selectors = number of double excitations in the selectors determinants + + +`psi_selectors `_ + Determinants on which we apply for perturbation. + + +`psi_selectors_ab `_ + Determinants on which we apply . + They are sorted by the 3 highest electrons in the alpha part, + then by the 3 highest electrons in the beta part to accelerate + the research of connected determinants. + + +`psi_selectors_coef `_ + Determinants on which we apply for perturbation. + + +`psi_selectors_coef_ab `_ + Determinants on which we apply . + They are sorted by the 3 highest electrons in the alpha part, + then by the 3 highest electrons in the beta part to accelerate + the research of connected determinants. + + +`psi_selectors_diag_h_mat `_ + Diagonal elements of the H matrix for each selectors + + +`psi_selectors_next_ab `_ + Determinants on which we apply . + They are sorted by the 3 highest electrons in the alpha part, + then by the 3 highest electrons in the beta part to accelerate + the research of connected determinants. + + +`psi_selectors_size `_ + Undocumented + diff --git a/scripts/compilation/qp_create_ninja.py b/scripts/compilation/qp_create_ninja.py index f2b261ad..0ff96f7e 100755 --- a/scripts/compilation/qp_create_ninja.py +++ b/scripts/compilation/qp_create_ninja.py @@ -23,12 +23,11 @@ except ImportError: "..", "..", "quantum_package.rc")) - print """ -Error: - source %s -""" % f + + print "\n".join(["", "Error:", "source %s" % f, ""]) sys.exit(1) + # __ # /__ | _ |_ _. | _. ._ o _. |_ | _ _ # \_| | (_) |_) (_| | \/ (_| | | (_| |_) | (/_ _> @@ -516,7 +515,7 @@ def ninja_readme_rule(): For not dealted the readme when ninja -t clean and the generator option """ l_string = ["rule build_readme", - " command = cd $module_abs ; update_README.py $module_root", + " command = qp_update_readme.py $module_abs --root_module $module_root", " description = update_README $module_rel", " generator = 1", ""] @@ -552,7 +551,8 @@ def ninja_readme_build(path_module, d_irp, dict_root_path): # / def get_binaries(path_module): """ - Return the list of binaries (Path= namedtuple('Path', ['abs', 'rel']) for a module + Return the list of binaries + (Path= namedtuple('Path', ['abs', 'rel']) for a module """ import subprocess @@ -666,20 +666,26 @@ def ninja_binaries_build(path_module, l_children, d_binaries): # s t r i n g # # ~#~#~#~#~#~ # - path_readme = os.path.join(path_module.abs, "README.rst") - path_png = os.path.join(path_module.abs, "tree_dependency.png") - l_string = ["build {0}: build_binaries {1} {2}".format(" ".join(l_abs_bin), EZFIO_LIB, ninja_module_path), " module_abs = {0}".format(path_module.abs), " module_rel = {0}".format(path_module.rel), ""] - l_string += ["build module_{0}: phony {1} {2} {3}".format(path_module.rel, - " ".join(l_abs_bin), - path_readme, - path_png - ), ""] + return l_string + + +def ninja_module_build(path_module, d_binaries): + + l_abs_bin = [binary.abs for binary in d_binaries[path_module]] + + path_readme = os.path.join(path_module.abs, "README.rst") + path_png = os.path.join(path_module.abs, "tree_dependency.png") + + l_string = ["build module_{0}: phony {1} {2} {3}".format(path_module.rel, + " ".join(l_abs_bin), + path_readme, + path_png), ""] return l_string @@ -723,7 +729,7 @@ def ninja_dot_tree_build(path_module, l_module): # |\/| _ _| | _ # | | (_) (_| |_| | (/_ # -def create_build_ninja_module(path_module): +def save_subninja_file(path_module): l_string = ["builddir = {0}".format(os.path.dirname(ROOT_BUILD_NINJA)), ""] @@ -732,17 +738,19 @@ def create_build_ninja_module(path_module): ""] l_string += ["rule make_local_binaries", - " command = ninja -f {0} module_{1}".format( - ROOT_BUILD_NINJA, path_module.rel), " pool = console", + " command = ninja -f {0} module_{1}".format(ROOT_BUILD_NINJA, path_module.rel), + " pool = console", " description = Compile only {0}".format(path_module.rel), ""] l_string += ["rule make_all_binaries", " command = ninja -f {0}".format(ROOT_BUILD_NINJA), - " pool = console", " description = Compiling all modules", + " pool = console", + " description = Compiling all modules", ""] - l_string += ["rule make_clean", " command = module_handler.py clean {0}".format(path_module.rel), + l_string += ["rule make_clean", + " command = module_handler.py clean {0}".format(path_module.rel), " description = Cleaning module {0}".format(path_module.rel), ""] @@ -766,7 +774,7 @@ def create_build_ninja_global(): " command = {0} update".format(__file__), ""] - l_string += ["rule make_all_binaries", + l_string += ["rule make_all", " command = ninja -f {0}".format(ROOT_BUILD_NINJA), " pool = console", " description = Compiling all modules", ""] @@ -777,7 +785,7 @@ def create_build_ninja_global(): l_string += ["build dummy_target: update_build_ninja_root", "", - "build all: make_all_binaries dummy_target", + "build all: make_all dummy_target", "default all", "", "build clean: make_clean dummy_target", @@ -921,9 +929,6 @@ if __name__ == "__main__": for module_to_compile in l_module: - if arguments["--development"]: - create_build_ninja_module(module_to_compile) - # ~#~#~#~#~#~#~#~ # # S y m l i n k # # ~#~#~#~#~#~#~#~ # @@ -941,8 +946,14 @@ if __name__ == "__main__": l_string += ninja_binaries_build(module_to_compile, l_children, d_binaries) - l_string += ninja_gitignore_build(module_to_compile, d_binaries, - l_symlink) + if arguments["--development"]: + + l_string += ninja_module_build(module_to_compile, d_binaries) + + l_string += ninja_gitignore_build(module_to_compile, d_binaries, + l_symlink) + + save_subninja_file(module_to_compile) # ~#~#~#~#~ # # S a v e s # diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index 9160a49d..1e3546df 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -23,16 +23,19 @@ import shutil try: from docopt import docopt - from qp_path import QP_SRC - from qp_path import QP_ROOT + from qp_path import QP_SRC, QP_ROOT, QP_PLUGINS except ImportError: print "source .quantum_package.rc" raise -# Canot cache for namedtuple are not hashable -def is_module(path_module): - return os.path.isfile(os.path.join(QP_SRC, path_module, +def is_module(path_module_rel): + return os.path.isfile(os.path.join(QP_SRC, path_module_rel, + "NEEDED_CHILDREN_MODULES")) + + +def is_plugin(path_module_rel): + return os.path.isfile(os.path.join(QP_PLUGINS, path_module_rel, "NEEDED_CHILDREN_MODULES")) @@ -180,13 +183,7 @@ class ModuleHandler(): basename = "tree_dependency" path = '{0}.png'.format(basename) - # Init - try: - from graphviz import Digraph - except: - with open(path, 'a'): - os.utime(path, None) - return + from graphviz import Digraph all_ready_done = [] @@ -209,7 +206,14 @@ class ModuleHandler(): graph.node(module, fontcolor="red") draw_module_edge(module, d_ref[module]) - graph.render(cleanup=True) + # Try to render the png + # If not just touch it + try: + graph.render(cleanup=True) + except: + with open(path, 'a'): + os.utime(path, None) + return if __name__ == '__main__': @@ -289,4 +293,3 @@ if __name__ == '__main__': l_text = l_dir + l_file + l_symlink + l_exe l_text.sort() f.write("\n".join(l_text)) - diff --git a/scripts/module/qp_install_module.py b/scripts/module/qp_install_module.py index 1c9911a6..99674e14 100755 --- a/scripts/module/qp_install_module.py +++ b/scripts/module/qp_install_module.py @@ -22,7 +22,7 @@ try: from docopt import docopt from module_handler import ModuleHandler, get_dict_child from module_handler import get_l_module_descendant - from update_README import Doc_key, Needed_key + from qp_update_readme import D_KEY from qp_path import QP_SRC, QP_PLUGINS, QP_ROOT except ImportError: print "Please check if you have sourced the .quantum_package.rc" @@ -56,8 +56,8 @@ def save_new_module(path, l_child): with open(os.path.join(path, "README.rst"), "w") as f: f.write(header + "\n") - f.write(Doc_key + "\n") - f.write(Needed_key + "\n") + f.write(D_KEY["needed_module"]) + f.write(D_KEY["documentation"]) if __name__ == '__main__': @@ -108,8 +108,9 @@ if __name__ == '__main__': save_new_module(path, l_child_reduce) print " [ OK ]" - print "If this was a plugins, you can install it normaly. Type:" + print "You can now install it normaly. Type:" print "` {0} install {1} `".format(os.path.basename(__file__), name) + print "And don't forgot to add this to the git if you want" elif arguments["download"]: pass diff --git a/scripts/module/qp_update_readme.py b/scripts/module/qp_update_readme.py new file mode 100755 index 00000000..9ff9603b --- /dev/null +++ b/scripts/module/qp_update_readme.py @@ -0,0 +1,205 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Updates the README.rst of a module +Usage: + qp_update_readme.py [...] [--root_module=] + +Options: + path_readme: All the absolute path you want to update. + By default is the cwd + --root_module: Is the path of the root module who containt the tags file. + By default is the cwd +""" + +import sys + +try: + from docopt import docopt + from module_handler import is_module, is_plugin +except: + print "Please check if you have sourced the .quantum_package.rc" + print "(`source .quantum_package.rc`)" + print sys.exit(1) + +import os +from collections import namedtuple +from collections import defaultdict + + +def header_format(str_): + + warning = "\n".join([".. Do not edit this section It was auto-generated", + ".. by the `update_README.py` script."]) + + return "{0}\n{1}\n{2}\n".format(str_, "=" * len(str_), warning) + +D_KEY = {"needed_module": header_format("Needed Modules"), + "documentation": header_format("Documentation")} + + +def get_url(path_module_rel): + if is_plugin(path_module_rel): + url = "http://github.com/LCPQ/quantum_package/tree/master/plugins" + elif is_module(path_module_rel): + url = "http://github.com/LCPQ/quantum_package/tree/master/src" + else: + print "{0} Is not a valide module nor plugin".format(path_module_rel) + sys.exit(1) + + return os.path.join(url, path_module_rel) + + +def fetch_splitted_data(d_readme, l_module_readme): + """Read the README.rst file and split it in strings: + * The documentation + * The needed modules + The result is given as a list of strings + """ + + sentinel = "@@$%&@@" + + for path_readme in l_module_readme: + with open(os.path.join(path_readme, "README.rst"), 'r') as f: + data = f.read() + + # Place sentinels + + for v in D_KEY.values(): + data = data.replace(v, sentinel + v) + + # Now Split data using the sentinels + d_readme[path_readme] = {"human": data.split(sentinel)[0]} + + +def update_needed(d_readme): + """Read the NEEDED_CHILDREN_MODULES file, and replace the data with it. + Create the links to the GitHub pages.""" + + header_image = ".. image:: tree_dependency.png" + + for path in d_readme: + + with open(os.path.join(path, 'NEEDED_CHILDREN_MODULES'), 'r') as f: + modules = f.read() + + if modules.strip(): + l_module = ['* `{0} <{1}>`_'.format(name, get_url(name)) + for name in modules.split()] + + l_module_section = [D_KEY["needed_module"], '', + header_image, '', + '\n'.join(l_module), '', ''] + else: + l_module_section = "" + + d_readme[path]["needed_module"] = "\n".join(l_module_section) + + +def extract_doc(root_module, provider): + """Extracts the documentation contained in IRPF90_man file""" + + path = os.path.join(root_module, "IRPF90_man/%s.l" % (provider)) + with open(path, 'r') as f: + l_line = f.readlines() + + result = [] + inside = False + for line in l_line: + if not inside: + inside = line.startswith(".SH Description") + else: + if line.startswith(".SH"): + break + result.append(" {0}".format(line.strip())) + + if not result: + result = [" Undocumented"] + + return "\n".join(result) + "\n" + + +def update_documentation(d_readmen, root_module): + """Reads the BEGIN_DOC ... END_DOC blocks and builds the documentation""" + + IRP_info = namedtuple('IRP_info', ["module", "file", "provider", "line"]) + + # If the file does not exist, don't do anything + path = os.path.join(root_module, "tags") + + with open(path, 'r') as f: + dump = f.readlines() + + d_info = defaultdict(list) + + for i in dump: + # i = + # output_cpu_time_0 Ezfio_files/output.irp.f 2 + provider, irp_file_raw, ligne = i.split() + + for path in d_readme: + + if root_module == path and "/" not in irp_file_raw: + d_info[path].append(IRP_info(os.path.basename(path), + irp_file_raw, + provider, + ligne)) + + elif "/" in irp_file_raw and os.path.dirname(irp_file_raw) in path: + + module, irp_file = os.path.split(irp_file_raw) + d_info[path].append(IRP_info(module, irp_file, provider, ligne)) + + for path in d_readme: + + l_doc = [] + + for irp in d_info[path]: + + url = os.path.join(get_url(os.path.basename(path)), irp.file) + doc = extract_doc(root_module, irp.provider) + + l_doc += ["`{0} <{1}#L{2}>`_".format(irp.provider, url, irp.line), + doc, + ""] + + l_doc_section = [D_KEY["documentation"], '', + "\n".join(l_doc)] + + d_readme[path]["documentation"] = "\n".join(l_doc_section) + +if __name__ == '__main__': + arguments = docopt(__doc__) + + if arguments["--root_module"]: + root_module = os.path.realpath(arguments["--root_module"]) + else: + root_module = os.getcwd() + + if not arguments[""]: + l_module_readme = [os.path.join(os.getcwd())] + else: + l_module_readme = arguments[""] + + # d[Path] ={humain, needed_module, documentation} + d_readme = defaultdict(dict) + + try: + fetch_splitted_data(d_readme, l_module_readme) + except IOError: + print l_module_readme, "is not a module and/or", + print "have not a `README.rst` file inside" + print "Abort..." + sys.exit(1) + + update_needed(d_readme) + update_documentation(d_readme, root_module) + + for path, d in d_readme.iteritems(): + + with open(os.path.join(path, "README.rst"), 'w') as f: + for k in ["human", + "needed_module", + "documentation"]: + + f.write(d[k]) diff --git a/scripts/module/update_README.py b/scripts/module/update_README.py deleted file mode 100755 index 8cc102c3..00000000 --- a/scripts/module/update_README.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/env python -"""Updates the README.rst file as the include directive is disabled on GitHub.""" -__date__ = "Thu Apr 3 23:06:18 CEST 2014" -__author__ = "Anthony Scemama & TApplencourt " - -README = "README.rst" -Assum_key = "Assumptions\n===========\n" -Needed_key = "Needed Modules\n==============\n" -Doc_key = "Documentation\n=============\n" -Sentinel = "@@$%&@@" -URL = "http://github.com/LCPQ/quantum_package/tree/master/src/" - -import os -import subprocess -from collections import namedtuple -import sys - -""" -NEED to call in a module -First arg can be the root parent -""" -try: - ROOT_module = os.path.realpath(sys.argv[1]) -except: - ROOT_module = os.getcwd() - -if ROOT_module != os.getcwd(): - change = True -else: - change = False - -MODULE_NAME = os.path.basename(os.getcwd()) - - -header = """ -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -""" - - -def fetch_splitted_data(): - """Read the README.rst file and split it in strings: - * The documentation - * The needed modules - The result is given as a list of strings - """ - - with open(README, 'r') as f: - data = f.read() - - # Place sentinels - data = data.replace(Doc_key, Sentinel + Doc_key) - data = data.replace(Needed_key, Sentinel + Needed_key) - - # Now Split data using the sentinels - result = data.split(Sentinel) - - return result - - -def update_needed(data): - """Read the NEEDED_CHILDREN_MODULES file, and replace the data with it. - Create the links to the GitHub pages.""" - - with open('NEEDED_CHILDREN_MODULES', 'r') as f: - modules = f.read() - - header_image = ".. image:: tree_dependency.png\n\n" - - if modules.strip(): - modules = ['* `{0} <{1}>`_'.format(name, os.path.join(URL, name)) - for name in modules.split()] - modules = "\n".join(modules) - modules = Needed_key + header + header_image + modules + '\n\n' - - has_modules = False - for i in range(len(data)): - if data[i].startswith(Needed_key): - has_modules = True - data[i] = modules - - if not has_modules: - data.append(modules) - - return data - - -def extract_doc(item): - """Extracts the documentation contained in IRPF90_man file""" - - path = os.path.join(ROOT_module, "IRPF90_man/%s.l" % (item)) - with open(path, 'r') as f: - l_line = f.readlines() - - result = [] - inside = False - for line in l_line: - if not inside: - inside = line.startswith(".SH Description") - else: - if line.startswith(".SH"): - break - result.append(" {0}".format(line.strip())) - - if not result: - result = [" Undocumented"] - - return "\n".join(result) + '\n' - - -def update_documentation(data): - """Reads the BEGIN_DOC ... END_DOC blocks and builds the documentation""" - - IRP_info = namedtuple('IRP_info', ["name", "file", "line"]) - - # If the file does not exist, don't do anything - - path = os.path.join(ROOT_module, "tags") - - with open(path, 'r') as f: - dump = f.readlines() - - l_info = [] - for i in dump: - name, f, ligne = i.split() - - if not change and "/" not in i: - l_info.append(IRP_info(name, f, ligne)) - elif change and MODULE_NAME in i: - l_info.append(IRP_info(name, f.split("/")[-1], ligne)) - - l_line = [] - - for irp in l_info: - url = os.path.join(URL, MODULE_NAME, irp.file) - doc = extract_doc(irp.name) - - l_line += ["`{0} <{1}#L{2}>`_".format(irp.name, url, irp.line), doc, - ""] - - documentation = Doc_key + header + "\n".join(l_line) - - has_doc = False - for i in range(len(data)): - if data[i].startswith(Doc_key): - has_doc = True - data[i] = documentation - - if not has_doc: - data.append(documentation) - - return data - - -def git_add(): - """Executes: - git add README.rst - throw an error if git is not precent""" - - try: - # pipe output to /dev/null for silence - null = open("/dev/null", "w") - subprocess.Popen("git add README.rst", stdout=null, stderr=null) - null.close() - - except OSError: - raise - - -def main(): - data = fetch_splitted_data() - - data = update_documentation(data) - data = update_needed(data) - output = ''.join(data) - - with open(README, 'w') as f: - f.write(output) - - try: - git_add() - except OSError: - pass - - -if __name__ == '__main__': - main() diff --git a/src/AO_Basis/README.rst b/src/AO_Basis/README.rst index 4a1aa1ef..e0a487fe 100644 --- a/src/AO_Basis/README.rst +++ b/src/AO_Basis/README.rst @@ -33,19 +33,29 @@ Assumptions Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `Nuclei `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `Nuclei `_ Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `ao_coef `_ AO Coefficients, read from input. Those should not be used directly, as the MOs are expressed on the basis of **normalized** AOs. diff --git a/src/Bitmask/README.rst b/src/Bitmask/README.rst index f8d44248..6f3696b4 100644 --- a/src/Bitmask/README.rst +++ b/src/Bitmask/README.rst @@ -37,19 +37,29 @@ Assumptions Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `MO_Basis `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `MO_Basis `_ Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `bitstring_to_hexa `_ Transform a bit string to a string in hexadecimal format for printing diff --git a/src/Determinants/README.rst b/src/Determinants/README.rst index 823cdd39..1c114a19 100644 --- a/src/Determinants/README.rst +++ b/src/Determinants/README.rst @@ -29,9 +29,20 @@ Assumptions Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `Integrals_Monoelec `_ +* `Integrals_Bielec `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `Integrals_Monoelec `_ @@ -39,10 +50,10 @@ Needed Modules Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `a_operator `_ Needed for diag_H_mat_elem diff --git a/src/Electrons/README.rst b/src/Electrons/README.rst index 5c785e4e..d1c342b5 100644 --- a/src/Electrons/README.rst +++ b/src/Electrons/README.rst @@ -21,19 +21,29 @@ Assumptions Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `Ezfio_files `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `Ezfio_files `_ Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `elec_alpha_num `_ Numbers of electrons alpha ("up") diff --git a/src/Integrals_Bielec/README.rst b/src/Integrals_Bielec/README.rst index eed456c4..b71d9c0d 100644 --- a/src/Integrals_Bielec/README.rst +++ b/src/Integrals_Bielec/README.rst @@ -13,9 +13,20 @@ MO integral, use ``get_mo_bielec_integral(i,j,k,l,mo_integrals_map)`` or Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `Pseudo `_ +* `Bitmask `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `Pseudo `_ @@ -23,10 +34,10 @@ Needed Modules Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `add_integrals_to_map `_ Adds integrals to tha MO map according to some bitmask diff --git a/src/Integrals_Monoelec/README.rst b/src/Integrals_Monoelec/README.rst index 98ec1331..13aceb0e 100644 --- a/src/Integrals_Monoelec/README.rst +++ b/src/Integrals_Monoelec/README.rst @@ -1,9 +1,20 @@ Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `MO_Basis `_ +* `Pseudo `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `MO_Basis `_ @@ -11,10 +22,10 @@ Needed Modules Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `ao_deriv2_x `_ second derivatives matrix elements in the ao basis .. math:: diff --git a/src/MOGuess/README.rst b/src/MOGuess/README.rst index d10b1ef5..86f352a9 100644 --- a/src/MOGuess/README.rst +++ b/src/MOGuess/README.rst @@ -5,19 +5,29 @@ MOGuess Module Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `Integrals_Monoelec `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `Integrals_Monoelec `_ Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `ao_ortho_lowdin_coef `_ matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos diff --git a/src/MO_Basis/README.rst b/src/MO_Basis/README.rst index 5cbe0165..87df08b1 100644 --- a/src/MO_Basis/README.rst +++ b/src/MO_Basis/README.rst @@ -33,9 +33,20 @@ ASSUMPTONS Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `AO_Basis `_ +* `Electrons `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `AO_Basis `_ @@ -43,10 +54,10 @@ Needed Modules Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `ao_to_mo `_ Transform A from the AO basis to the MO basis diff --git a/src/Nuclei/README.rst b/src/Nuclei/README.rst index 9f0b15d9..bf7e6f52 100644 --- a/src/Nuclei/README.rst +++ b/src/Nuclei/README.rst @@ -9,9 +9,20 @@ The coordinates are expressed in atomic units. Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `Ezfio_files `_ +* `Utils `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `Ezfio_files `_ @@ -19,10 +30,10 @@ Needed Modules Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `element_name `_ Array of the name of element, sorted by nuclear charge (integer) diff --git a/src/Pseudo/README.rst b/src/Pseudo/README.rst index 84a555da..062a9465 100644 --- a/src/Pseudo/README.rst +++ b/src/Pseudo/README.rst @@ -5,19 +5,29 @@ Pseudo Module Needed Modules ============== -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. +.. image:: tree_dependency.png + +* `Nuclei `_ + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + .. image:: tree_dependency.png * `Nuclei `_ Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `do_pseudo `_ Using pseudo potential integral of not diff --git a/src/Utils/README.rst b/src/Utils/README.rst index 104705a4..e3c36e71 100644 --- a/src/Utils/README.rst +++ b/src/Utils/README.rst @@ -6,10 +6,10 @@ Contains general purpose utilities. Documentation ============= - -.. Do not edit this section. It was auto-generated from the +.. Do not edit this section It was auto-generated .. by the `update_README.py` script. + `a_coef `_ Undocumented @@ -634,4 +634,3 @@ Documentation `write_git_log `_ Write the last git commit in file iunit. -