From 0f9c1e6cb3523a52cb8f19ea6843f82efa113e65 Mon Sep 17 00:00:00 2001 From: v1j4y Date: Thu, 28 Jan 2021 02:14:59 +0100 Subject: [PATCH] Working on building the prototype matrix AIJpq #143. --- src/determinants/configurations.org | 85 +++++++++++++++++++ .../configurations_sigma_vector.irp.f | 10 +++ 2 files changed, 95 insertions(+) create mode 100644 src/determinants/configurations.org create mode 100644 src/determinants/configurations_sigma_vector.irp.f diff --git a/src/determinants/configurations.org b/src/determinants/configurations.org new file mode 100644 index 00000000..f6b3e711 --- /dev/null +++ b/src/determinants/configurations.org @@ -0,0 +1,85 @@ +# -*- mode:org -*- +#+TITLE: CFG-CI +#+AUTHOR: Vijay Gopal Chilkuri +#+FILE: configurations.org +#+EMAIL: vijay.gopal.c@gmail.com +#+OPTIONS: toc:t +#+LATEX_CLASS: article +#+LATEX_HEADER: \usepackage{tabularx} +#+LATEX_HEADER: \usepackage{braket} +#+LATEX_HEADER: \usepackage{minted} + +* Configuration based CI + +Here we write the main functions that perform the functions necessary for +the Configuration based CI. + +There are three main functions required for doing the CI + +- Convert wavefunction from determinant basis to configuration state function (CSF) basis + +- Apply the Hamiltonian to the wavefunction in CSF basis + +- Convert the converged wavefunction back to determinant basis + +** TODO[0/3] Convert basis from DET to CSF + +The conversion of basis is done by going via bonded functions (BFs). +Importantly, all the CSFs of a chosen configuration (CFG) are kept. + +The advantage is that the sigma-vector can be performed efficiently +via BLAS level 3 operations. + + +- [ ] Write a function to calculate the maximum dimensions required + + Prototype array contains the \( \) for all possible + CFGs \( I, J\) and all \(4\) types of excitations for all possible model + orbitals \(p,q\). Note that the orbital ids \(p,q\) here do not refer to + the actual MO ids, they simply refer to the orbitals involved in that spefcific + SOMO, for e.g. an excitation of the type [2 2 2 1 1 1 1 0] -> [ 2 2 1 1 1 1 1] + implies an excitation from orbital \(3\) to orbital \(8\) which are the real MO ids. + However, the prototype only concerns the SOMOs like so [2 1 1 1 1 0] -> [ 1 1 1 1 1 1] + therefore \(p,q\) are model space ids \(1,6\). + + #+begin_src f90 :main no :tangle configurations_sigma_vector.irp.f + + BEGIN_PROIDER[ integer, NSOMOMax] + implicit none + BEGIN_DOC + ! Documentation for NSOMOMax + ! The maximum number of SOMOs for the current calculation. + ! required for the calculation of prototype arrays. + END_DOC + NSOMOMax = 8 + NCSFMAx = 14 ! TODO: NCSFs for MS=0 + END_PROVIDER + #+end_src + + The prototype matrix AIJpqMatrixList has the following dimensions + ,,\(\left(NSOMOMax, NSOMOMax, 4, NSOMOMax, NSOMOMax,NCSFMAx,NCSFMax\right)\) where the first two + indices represent the somos in \(I,J\) followed by the type of excitation and + finally the two model space orbitals \(p,q\). + +- [ ] Read the transformation matrix based on the number of SOMOs + + #+begin_src f90 :main no + BEGIN_PROIDER[ double precision, AIJpqMatrixList, (NSOMOMax,NSOMOMax,4,NSOMOMax,NSOMOMax,NCSFMax,NCSFMax)] + implicit none + BEGIN_DOC + ! Documentation for AIJpqMatrixList + ! The prototype matrix containing the + ! matrices for each I,J somo pair and orb ids. + END_DOC + do i = 1,NSOMOMax + do j = i-1,i+1 + if(j > NSOMOMax || j ==0) then + continue + end if + end do + end do + END_PROVIDER + + #+end_src + +- [ ] Perform the conversion by matrix-vector BLAS level 2 call diff --git a/src/determinants/configurations_sigma_vector.irp.f b/src/determinants/configurations_sigma_vector.irp.f new file mode 100644 index 00000000..a2913af3 --- /dev/null +++ b/src/determinants/configurations_sigma_vector.irp.f @@ -0,0 +1,10 @@ + BEGIN_PROIDER[ integer, NSOMOMax] + implicit none + BEGIN_DOC + ! Documentation for NSOMOMax + ! The maximum number of SOMOs for the current calculation. + ! required for the calculation of prototype arrays. + END_DOC + NSOMOMax = 8 + NCSFMAx = 14 ! TODO: NCSFs for MS=0 + END_PROVIDER