Real space representation of S and KS matrices with k-points

15 views
Skip to first unread message

Dmitry Ryndyk

unread,
Oct 27, 2025, 8:38:16 PM (2 days ago) Oct 27
to cp2k
Dear developers,

I would greatly appreciate it if you could provide me with the reference to the exact description of the real space S and KS matrices, stored in qs_env%ks_env%matrix_ks_kp and qs_env%ks_env%matrix_s_kp.
I mean not the details of DBCSR matrices, but the way the matrix elements are placed inside the matrices.
My test calculations, as well as some code investigation, show that these matrix elements are mixed between space replicas ("images") used at k-point calculations, and some rearrangement is required to get normal symmetrical matrices, which depend on the atomic indices. 

Thank you,
Dmitry

Augustin Bussy

unread,
Oct 28, 2025, 5:57:55 AM (22 hours ago) Oct 28
to cp2k
Dear Dimitry,

Dealing with CP2K's real space matrices in k-point calculations can be quite challenging. In principle, it follows equations (10) and (11) of https://arxiv.org/pdf/2508.15559. Elements i of the qs_env%ks_env%matrix_s_kp array contains real space overlap matrix elements between AOs in the main cell, and AOs in periodic image with index i. The indexing of periodic images is that imposed by the neighbor lists.

For historical reasons, the KP overlap and KS matrices are stored as DBCSR symmetric types, even though they are not symmetric. That's where it gets complicated. Both the S and KS matrices are Hermitian, and they have the following symmetry: S_ij^b = S_ji^-b, where b denotes the translation from the main cell to a given periodic image.
If you have access to the upper diagonal of a real space matrix with one AO in a periodic cell shifted by b, and that of a real space matrix with an AO shifted by -b, then you can reconstruct the full, asymmetric, real space matrix at b.

In the code, this operation is done when performing Fourier transforms real space to k-space. For example here: https://github.com/cp2k/cp2k/blob/5f3bc36082e75c975caee6a92073f395a2af7674/src/kpoint_methods.F#L855-L864.

I hope that helps.
Best,
Augustin

Augustin Bussy

unread,
Oct 28, 2025, 6:11:38 AM (21 hours ago) Oct 28
to cp2k
For clarity: Both the S and KS matrices are Hermitian in k-space, but in real space, we have: S_ij^b = S_ji^-b

Dmitry Ryndyk

unread,
Oct 28, 2025, 6:13:35 AM (21 hours ago) Oct 28
to cp2k
Dear Augustin,

thank you for the fast answer. It helps me to understand what is going on!

Best wishes,
Dmitry
Reply all
Reply to author
Forward
0 new messages