Evaluation of basis functions over a grid and computation of overlap integrals

220 views
Skip to first unread message

Aleksandros Sobczyk

unread,
Mar 8, 2023, 6:57:02 AM3/8/23
to cp2k
Hello,

I have a set of atoms in real-space and the corresponding SZV basis sets.
I want to evaluate each basis function over a grid of points in the cell.
E.g., I have a grid of 3d points [r1, r2, ..., rk] and I want to evaluate each 
Φj(r1), Φj(r2), ... Φj(rk)
As a test, I tried to numerically integrate Φj * conj(Φj) over the grid that it was evaluated, and compare the result with the corresponding entry S[j, j] of the overlap matrix that
is returned by CP2K.
Unfortunately my integral differs substantially from the element S[j, j], so I am doing something wrong.

Can we find somewhere more detailed documentation on  the precise mathematical formulation of the basis sets, and also on the specific algorithms that are used by CP2K to compute the overlap integrals?
(So far I have followed as precisely as possible the following page: https://www.cp2k.org/basis_sets
but it is still missing information, e.g. are the coefficients normalized? do we assume that the spherical harmonics include the phase factor? etc.)

Thanks a lot in advance!
Aleksandros

Aleksandros Sobczyk

unread,
Mar 10, 2023, 8:26:42 AM3/10/23
to cp2k
Update: I have also calculated several overlap integrals analytically (for s-orbitals which are simpler), they still don't match the values of the S matrix.
Any feedback would be greatly appreciated.

Jürg Hutter

unread,
Mar 10, 2023, 9:18:28 AM3/10/23
to cp...@googlegroups.com
Hi

are you assuming normalized or un-normalized Gaussians?
The basis set input in CP2K uses (like all QC codes) normalized Gaussians.
Internally, CP2K works with un-normalized Cartesian Gaussians, i.e. the
coefficients are adapted at the beginning of the calculation.

I have attached a simple example where you can play with the basis set
in the input and the overlap matrix is printed.

regards
JH

________________________________________
From: cp...@googlegroups.com <cp...@googlegroups.com> on behalf of Aleksandros Sobczyk <sobcz...@gmail.com>
Sent: Friday, March 10, 2023 2:26 PM
To: cp2k
Subject: [CP2K:18530] Re: Evaluation of basis functions over a grid and computation of overlap integrals
--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com<mailto:cp2k+uns...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/fa61a2bc-2c9c-4771-8606-445d46af9148n%40googlegroups.com<https://groups.google.com/d/msgid/cp2k/fa61a2bc-2c9c-4771-8606-445d46af9148n%40googlegroups.com?utm_medium=email&utm_source=footer>.
h2.inp

Aleksandros Sobczyk

unread,
Mar 10, 2023, 12:35:28 PM3/10/23
to cp2k
Dear Prof. Hutter,

Thank you very much for your reply and for the example.
Let us investigate it with my colleagues and see if we can resolve our problem.

Best regards,
Aleksandros

Aleksandros Sobczyk

unread,
Mar 13, 2023, 6:00:04 AM3/13/23
to cp2k
Dear prof. Hutter and CP2K developers,

The example helped to figure out how to reproduce the overlap matrix for our systems. We had to apply the following two steps:

1) For the basis sets, we had to use the normalized coefficients that are found inside the output file of CP2K. The un-normalized coefficients from the original BASIS_SET file did not work (as you suggested). For now, we can directly use the CP2K output to derive these normalized coefficients for our experiments, but it would be also helpful to know how to reproduce them (i.e., what is the normalization procedure).

2) We also had to scale all the exponents of all the basis sets by a factor of (1/0.529)^2 (to convert Angstrom to atomic units). This was an arbitrary guess, but without it the overlaps do not match.

Could you confirm that this is the correct way to compute the orbital overlaps? (and if not, propose the correct way).
It would also be helpful if these details can be documented, e.g. in this page: https://www.cp2k.org/basis_sets

Best regards and thank you again for the feedback,
Aleksandros Sobczyk

Aleksandros Sobczyk

unread,
Mar 17, 2023, 11:54:28 AM3/17/23
to cp2k
Update on this:
There appear to be two (maybe more) normalization procedures for orbital coefficients:
The results of 1) seem to be closer to the output of cp2k (for s-orbitals). For p-orbitals it starts to diverge.

It would be great if someone can confirm which normalization method is used internally for contracted Gaussians.
(what is the goal of the normalization? are the primitive Gaussians normalized to integrate to 1? is it something more advanced?)

Best regards,
Aleksandros Sobczyk

Aleksandros Sobczyk

unread,
Mar 17, 2023, 11:59:07 AM3/17/23
to cp2k
Below is the precise example we are using.
These un-normalized orbitals:
Sr SZV-MOLOPT-SR-GTH SZV-MOLOPT-SR-GTH-q10
1
2 0 1 6 2 1
     7.290111894735  0.069364270475 -0.016182746349  0.035659445929
     2.536776771327 -0.571246927373  0.158928639982 -0.195822349727
     1.283099546928  0.167836311459 -0.041157757852  0.260320252229
     0.532449841650  0.904733330629 -0.431882417196  0.555386362294
     0.211628059408  0.250907816117 -0.073959284415  0.267635587013
     0.050841303698  0.007135721199  0.825600560103  0.001214128781


after the normalization (cp2k output) become as follows:
Sr SZV-MOLOPT-SR-GTH SZV-MOLOPT-SR-GTH-q10
1
2 0 1 6 2 1
 7.290111894735       0.221325      -0.071449       0.684627
 2.536776771327      -0.825808       0.317914      -1.004793
 1.283099546928       0.145521      -0.049379       0.569764
 0.532449841650       0.405577      -0.267899       0.404860
 0.211628059408       0.056304      -0.022965       0.061570
 0.050841303698       0.000549       0.087969       0.000047


None of the two aforementioned normalization procedures can reproduce this.

Krack Matthias

unread,
Mar 17, 2023, 12:39:59 PM3/17/23
to cp...@googlegroups.com

Hi

 

You want to normalize a contracted Gaussian function (cgf) basis set, which is performed in two steps: (1) normalization of the primitive Cartesian Gaussian functions and thereafter (2) normalization of the contracted Gaussian functions as indicated in line 1075. This is all in Cartesian representation. For the spherical orbital representation, you will need a further Cartesian to spherical orbital transformation step. CP2K calculates integrals internally in the Cartesian representation, but the default printout, e.g. for the overlap integral matrix, is in spherical orbitals.

Firstly, I would try to reproduce the normalization for an uncontracted basis set (one primitive function per l only). In the next step, you can try two primitive functions. Normalization is required to keep for instance the electron count (trace of PS).

 

HTH

 

Matthias  

To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/073f7bb7-8358-47b8-ba7c-06fe5075ff6cn%40googlegroups.com.

Aleksandros Sobczyk

unread,
Mar 17, 2023, 1:17:43 PM3/17/23
to cp2k
Hi Matthias,

Thanks a lot for the response.
I will try to explain better my understanding and my confusion.
I am not sure what you mean by Cartesian representations and spherical representations (I have little experience with contracted GTO).

1) Let's take it a step back, to the cp2k definitions of the basis sets:
https://www.cp2k.org/basis_sets
The φ_i 's seem to be defined in spherical coordinates in that page, and so are the contraction coefficients.
I cannot see where the Cartesian representations come in.

2) Assuming that we consider everything to be in spherical coordinates, as defined in the basis_set page.
We now want to transform the contraction coefficients of the input file, to the "normalized" contraction coefficients that are reported in the output of cp2k.
Let's assume only the first orbital.
From what I understand from your explanation, I need to perform the following two steps:
(Step 1): For all pairs of exponents a_i and coefficients c_i for this orbital, we need to scale c_i such that the primitive Gaussian integral  
        \int exp(-a_I*r^2) dr,
will integrate to 1.
(Step 2):  After this scaling, apply yet another scaling to the coefficients c_i based on the procedure here 

After these two steps,  the coefficients that I will get out should match the coefficients that are reported in the output of cp2k.
Again, all of these are in spherical coordinates.

Thanks again for the response, let me know if I got something wrong.

Best,
Aleksandros

Krack Matthias

unread,
Mar 18, 2023, 1:19:31 PM3/18/23
to cp...@googlegroups.com

Hi Aleksandros

 

The basis set output in the top of the CP2K output is in Cartesian representation (i.e. not spherical coordinates) which you can easily recognize as soon as you have basis functions with l > 1 (d, f …), because there are 6 Cartesian d orbitals printed. I just wanted to note that the default output for integral matrices like the overlap matrix S, however, is in the spherical orbital representation (5 d orbitals d(-2) … d(+2)). Maybe, I confused you in that respect, since you are still trying to reproduce the initial basis set normalization.

I suggest to start exercising with a primitive basis set and a single He atom, e.g.

He

1 0 2 1 1 1 1

1.2  0.5  0.4  0.3

and then try a contracted basis set with two primitive Gaussian functions per l value

He

1 0 2 2 1 1 1

1.2  0.5  0.4  0.3

0.8  0.4  0.2  0.1

Here, I just selected exponents and coefficients randomly without testing or calculating anything in an exemplary manner.

Note, that Cartesian and spherical Gaussian functions have different normalization factors.

Aleksandros Sobczyk

unread,
Mar 19, 2023, 7:40:58 AM3/19/23
to cp2k
Thank you very much for the feedback (especially over weekend).
It is very helpful, I think it is slowly clarifying.
I also found this reference in the meantime: https://onlinelibrary.wiley.com/doi/10.1002/qua.560540202
But the link you shared seems more readable.
I will post our findings (...or more questions!)

Best regards,
Aleksandros

Reply all
Reply to author
Forward
0 new messages