Skip to content

marm314/standalone_noft

Repository files navigation

This is a standalone version of the DoNOF code for running RDMFT (NOFT) calculations.

Developed by Dr. M. Rodriguez-Mayorga
     email: marm3.14@gmail.com 

 First version: 28/02/2021 VU Amsterdam 2022

License:

######################################################################################
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
######################################################################################

This module is written in Fortran (using ABINIT code structure to define procedures and objects, etc).
It is based on the DoNOF code developed by Prof. Dr. M. Piris and Dr. I. Mitxelena
(See https://github.com/DoNOF/DoNOFsw for more details). It is also able to perform range-sep NOFT calculations.

Compilation:  

Its compilation will require LAPACK (or MKL for ifort). The order to follow when compilating all files can be found in the Makefile.
Notice that initially the script gitversion.sh must be run (see the Makefile) to produce the m_gitver.F90 source file. 

Initialization: 

By calling the subroutine run_noft 

      subroutine run_noft(INOF,Ista,NBF_tot,NBF_occ,Nfrozen,Npairs,&
      &  Ncoupled,Nbeta_elect,Nalpha_elect,iERItyp,imethocc,imethorb,itermax,iprintdmn,iprintints,&
      &  itolLambda,ndiis,Enof,tolE,Vnn,AOverlap,Occ,mo_ints,ofile_name,NO_COEF,NO_COEFc,&
      &  lowmemERI,restart,ireadGAMMAS,ireadOCC,ireadCOEF,ireadFdiag)   ! Optional

the initialization parameters are

    INOF=PNOFi functional to use (HF=0, Muller[using pairing]=100, POWER=101, CA=102, CGA=103, GU=104, PNOF5=5, and PNOF7=7)
    Ista=Use PNOF7 (Ista=0) or PNOF7s (Ista=1)
    NBF_occ=Number of orbitals that are occupied
    Nfrozen=Number of frozen orbitals that remain with occ=2.0 
    Npairs=Number of electron pairs
    Ncoupled=Number of 'virtual' coupled orbitals per electron pair
    Nbeta_elect=Number of beta electrons (N/2 for spin compensated systems)
    Nalpha_elect=Number of beta electrons (N/2 for spin compensated systems)
    iERItyp=Index organization used to decide the electron rep. integrals (ERIs) type ({ij|lk}, <ij|kl>, and (ik|jl))
    imethocc=Method used for OCC opt. L-BFGS (1)
    imethorb=Method used to opt. orbs. currently only F_diag (1)
    itermax=Max. number of global iters
    iprintdmn=Print opt. 1,2-DMNs 
    iprintints=Print ERIs in MO basis
    itolLambda=Tol for Lambda_pq - Lambda_qp* is 10**-itolLambda
    ndiis=Numb. of iter. used in orb. opt. to call DIIS
    tolE=Tolerance on energy convergence
    Vnn=Fixed nuclear-nuclear interaction energy
    NO_COEF=Guess NO coefs (probably HF ones). In the end, the optimized orbitals (real 'optional'). Incompatible with NO_COEFc.
    NO_COEFc=Guess NO coefs (probably HF ones). In the end, the optimized orbitals (complex 'optional'). Incompatible with NO_COEF.
    AOverlap=Overlap of atomic orbs. (matrix)
    Occ=Optimized occ numbers. 
    mo_ints=External subroutine that for given NO_COEF updates the hCORE and ERImol matrices
    ofile_name=Name of the output file (recommended res.noft)
    lowmemERI=Logical parameter to decided whether to store only (NBF_tot,NBF_occ,NBF_occ,NBF_occ) part of the nat. orb. ERIs
    restart=Logical parameter to decided if this is a restart from previuos calc.
    ireadGAMMAS,ireadOCC,ireadCOEF,ireadFdiag,iNOTupdateOCC,iNOTupdateORB=Integer restart parameters that control the read of checkpoint files 
                                                                          and the optimization of OCCs and/or ORBs (true=1)    
It is recommended to set at least itolLambda=5, and tolE=1e-9. The files m_rdmd.F90 and m_integd.F90 contain most of these parameters,
and some recommended initial values. By default the module uses a perfect pairing approximation, which can be tuned with the Ncoupled parameter. 

Important! A subroutine called mo_ints must also be provided by the user. This subroutine is called by this module several times
with a set of nat. orbs. coefs. (NO_COEF). The mo_ints subroutine updates the ONEBODY and ERI arrays (in the molecular/natural orb. basis). 
This subroutine takes the following parameters 

  subroutine mo_ints(NBF_tot,NBF_occ,NBF_jkl,Occ,NO_COEF,ONEBODY,ERI)

where all parameters were explained above except NBF_jkl. The NBF_jkl=NBF_tot if the ERI array uses (NBF_tot,NBF_tot,NBF_tot,NBF_tot), or
NBF_jkl=NBF_occ if lowmemERI=TRUE and the size of the ERI array is only (NBF_tot,NBF_occ,NBF_occ,NBF_occ). Occ is the vector with occ numbers.

This module runs the whole optimization procedure and prints all the details on the file: ofile_name.

Example: 
 
 See the test included. There we use test this module using the Hubbard model; we illustrate how to initialize the module and
 how to build a mo_ints subroutine and use restart.

Warning: 

  The current version does not support spin-uncompensated systems (under development).

Releases

No releases published

Packages

No packages published

Languages