From 65cef0f6e6d88312ac0d10a3d2fa0c0f5ad107e8 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 10 Apr 2014 22:26:42 +0200 Subject: [PATCH] Documented MOs --- src/Bitmask/README.rst | 2 +- src/MOs/README.rst | 13 +++++++++++++ src/MOs/mos.ezfio_config | 3 --- src/MOs/mos.irp.f | 38 +++++++++++--------------------------- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/Bitmask/README.rst b/src/Bitmask/README.rst index 091d8475..737eda9a 100644 --- a/src/Bitmask/README.rst +++ b/src/Bitmask/README.rst @@ -7,7 +7,7 @@ the constants that will be used to define on which kind of integer the bitmasks will be defined. In the program, when an integer ``X`` is used to represent a bit string (like a determinant -for example), it should be defined as, for example:: +for example), it should be defined as, for example: .. code-block:: fortran diff --git a/src/MOs/README.rst b/src/MOs/README.rst index bcbf0d95..87e9cf11 100644 --- a/src/MOs/README.rst +++ b/src/MOs/README.rst @@ -2,6 +2,19 @@ MOs Module ========== +Molecular orbitals are expressed as + +.. math:: + + \phi_k({\bf r}) = \sum_i C_{ik} \chi_k({\bf r}) + +The current set of molecular orbitals has a label ``mo_label``. +When the orbitals are modified, the label should also be updated to keep +everything consistent. + +When saving the MOs, the ``mo_basis`` directory of the EZFIO file is copied +in the ``save`` directory, named by the current ``mo_label``. + Needed Modules ============== diff --git a/src/MOs/mos.ezfio_config b/src/MOs/mos.ezfio_config index 292b7a94..a0eda491 100644 --- a/src/MOs/mos.ezfio_config +++ b/src/MOs/mos.ezfio_config @@ -1,8 +1,5 @@ mo_basis mo_tot_num integer mo_coef double precision (ao_basis_ao_num,mo_basis_mo_tot_num) - mo_energy double precision (mo_basis_mo_tot_num) - mo_occ double precision (mo_basis_mo_tot_num) - mo_symmetry character*(8) (mo_basis_mo_tot_num) mo_label character*(64) diff --git a/src/MOs/mos.irp.f b/src/MOs/mos.irp.f index 282fa840..494b157c 100644 --- a/src/MOs/mos.irp.f +++ b/src/MOs/mos.irp.f @@ -19,13 +19,21 @@ BEGIN_PROVIDER [ integer, mo_tot_num_align ] END_PROVIDER -BEGIN_PROVIDER [ character*(64), mo_label ] + BEGIN_PROVIDER [ double precision, mo_coef, (ao_num_align,mo_tot_num) ] +&BEGIN_PROVIDER [ character*(64), mo_label ] implicit none BEGIN_DOC - ! Label characterizing the MOS (local, canonical, natural, etc) + ! Molecular orbital coefficients on AO basis set + ! mo_coef(i,j) = coefficient of the ith ao on the jth mo + ! mo_label : Label characterizing the MOS (local, canonical, natural, etc) END_DOC + integer :: i, j + double precision, allocatable :: buffer(:,:) + !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: buffer logical :: exists PROVIDE ezfio_filename + + !Label call ezfio_has_mo_basis_mo_label(exists) if (exists) then call ezfio_get_mo_basis_mo_label(mo_label) @@ -33,32 +41,8 @@ BEGIN_PROVIDER [ character*(64), mo_label ] mo_label = 'no_label' call ezfio_set_mo_basis_mo_label(mo_label) endif - -END_PROVIDER - -BEGIN_PROVIDER [ double precision, mo_energy, (mo_tot_num) ] - implicit none - BEGIN_DOC - ! Fock diagonal elements - END_DOC - PROVIDE ezfio_filename - mo_energy = 0.d0 - call ezfio_get_mo_basis_mo_energy(mo_energy) -END_PROVIDER - - -BEGIN_PROVIDER [ double precision, mo_coef, (ao_num_align,mo_tot_num) ] - implicit none - BEGIN_DOC - ! Molecular orbital coefficients on AO basis set - ! mo_coef(i,j) = coefficient of the ith ao on the jth mo - END_DOC - integer :: i, j - double precision, allocatable :: buffer(:,:) - !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: buffer - - PROVIDE ezfio_filename + ! Coefs allocate(buffer(ao_num,mo_tot_num)) buffer = 0.d0 call ezfio_get_mo_basis_mo_coef(buffer)