plotting band structure

209 views
Skip to first unread message

Elaheh Akhoundi

unread,
Feb 4, 2021, 5:31:45 AM2/4/21
to cp2k
Hi all,
I am trying to plot the band structure myself using Hamiltonian and overlap matrices generated by "AO_matrices>>KOHN_SHAM_MATRIX/OVERLAP" keyword. If I'm not mistaken, each block of Hamiltonian in this file corresponds to a certain neighboring cell and theses parameters are printed without K integration. it means that Hamiltonian blocks haven't been multiplied by exp(i*k.r) yet. I print the block_cell indec map myself. However the band structure that I plot using a python script and theses cp2k generated matrices are wrong and only are correct in Gamma point. I don't want to use "%PRINT%KS_CSR_WRITE" because I want to do transport simulations afterwards.
I think my understanding of theses Hamiltonian parameters can be wrong. Especially since blocks corresponding to mirroring cell (for example 1 0 0 and -1 0 0 cells) should be transpose of each other, if the values are raw Hamiltonian. but they are not.  
I would greatly appreciate any advice,
Kind regards,
Elaheh Akhoundi

hut...@chem.uzh.ch

unread,
Feb 4, 2021, 7:37:24 AM2/4/21
to cp...@googlegroups.com
Hi

if you run a k-point calculation the output will be all
real space matrices of the type

< a0 | op | bL >

where a0 and bL are basis functions a and b in computational cells
0 and L, respectively.
All matrices with different L (within a cutoff) will be printed.
Symmetry is used only for L <-> -L, meaning -L is not printed.

Unfortunately, what you are missing is the information on L for
the printed matrices. I don't see any other way to get that information
currently, then adding print statements in the source code.
index_to_cell mapping.

regards

Juerg Hutter
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491
Institut für Chemie C FAX : ++41 44 635 6838
Universität Zürich E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----
To: "cp2k" <cp...@googlegroups.com>
From: "Elaheh Akhoundi"
Sent by: cp...@googlegroups.com
Date: 02/04/2021 11:31AM
Subject: [CP2K:14682] plotting band structure
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/0c261020-a3db-4923-828c-eae7a647a899n%40googlegroups.com.

Elaheh Akhoundi

unread,
Feb 4, 2021, 8:06:14 AM2/4/21
to cp2k
Hi Juerg Hutter, 
Thank you very much for your help. I have already printed index to cell mapping by changing the source code. I used a neighbor_list iterator and printed cell(1:3) and also cell_to_index values.   It looks something like this:
index=          -2           0           0
 block #           6
 -----------
 -----------
 index=          -1           0           0
 block #           2
 -----------
 -----------
 index=           0           0           0
 block #           1
 -----------
 -----------
 index=           1           0           0
 block #           3
 -----------
 -----------
 but I am noticing that -L cells are also printed, you can see in the indices file that 100 and -100 both exist. also when I get the Kohn Sham Hamltonian 85 blocks are printed. which is consistent with what I get from the cell to index map. so it seems like L and -L computational cell Hamiltonians are both being printed? even though in the Hamiltonian file they aren't transpose of each other, which I think may be wrong.
Could you possibly give me some advice?
Many thanks,
Elaheh

hut...@chem.uzh.ch

unread,
Feb 4, 2021, 8:27:28 AM2/4/21
to cp...@googlegroups.com
Hi

you did it the wrong way round. You need to loop over the number
of indices and then print index_to_cell.

1 -> 0 0 0
2 -> 0 0 1
...

Index is now the position of the matrix in the output (0||i)
and there will be no L, -L pair.

regards

Juerg Hutter
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491
Institut für Chemie C FAX : ++41 44 635 6838
Universität Zürich E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----
To: "cp2k" <cp...@googlegroups.com>
From: "Elaheh Akhoundi"
Sent by: cp...@googlegroups.com
Date: 02/04/2021 02:06PM
Subject: Re: [CP2K:14687] plotting band structure
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/6833475d-5d54-4066-84bb-4f0f4b17b88en%40googlegroups.com.

Elaheh Akhoundi

unread,
Feb 5, 2021, 3:12:33 AM2/5/21
to cp2k
Hi Juerg Hutter,
Thank you very much for your reply. I did a quick test for a simple 1D structure, I created the list of indices myself, as there were only two neighboring computational cells. I took into account the L --> -L symmetry by considering , the Hamiltonian/overlap matrix  of -1 0 0 to be the transpose of those of 1 0 0. It still gave wrong results and now even gamma point eigen values are wrong too. before, by using the map with negative L , I was getting the right values for the gamma point for every material I tested. I am using CP2K V. 7.1. 
Many thanks,
Elaheh

hut...@chem.uzh.ch

unread,
Feb 5, 2021, 6:43:22 AM2/5/21
to cp...@googlegroups.com
Hi

I don't understand what you did. You need the index to cell matching
from the code. If you create the list yourself, how do you know
it is the same?
I can definitely confirm that the L <-> -L symmetry is used and that
the Fourier transform of the real space matrices to k space works.

regards

Juerg Hutter
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491
Institut für Chemie C FAX : ++41 44 635 6838
Universität Zürich E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----
To: "cp2k" <cp...@googlegroups.com>
From: "Elaheh Akhoundi"
Sent by: cp...@googlegroups.com
Date: 02/05/2021 09:12AM
Subject: Re: [CP2K:14697] plotting band structure

Hi Juerg Hutter,Thank you very much for your reply. I did a quick test for a simple 1D structure, I created the list of indices myself, as there were only two neighboring computational cells. I took into account the L --> -L symmetry by considering , the Hamiltonian/overlap matrix of -1 0 0 to be the transpose of those of 1 0 0. It still gave wrong results and now even gamma point eigen values are wrong too. before, by using the map with negative L , I was getting the right values for the gamma point for every material I tested. I am using CP2K V. 7.1.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/e56735c2-fc66-4896-97d8-38c28051fb49n%40googlegroups.com.

Elaheh Akhoundi

unread,
Feb 5, 2021, 6:57:33 AM2/5/21
to cp2k
Dear Prof.  Hutter,
I picked a small one-dimensional structure, and used a short range basis which is sufficient for the band structure (I checked). in that case, there will be only two neighboring computational cells with significant contributions. so only two possibilities for the index to cell matching map. 
1-> 1 0 0
2-> 2 0 0
or
1-> 2 0 0 
2-> 1 0 0 
that's how I created a map just to do a test to make sure I'll get the right structure. then I'll proceed to create the map with the source code. 
Thank you very much, I will double check everything, hopefully I find the problem.
Thank you again,
Elaheh Akhoundi

Elaheh Akhoundi

unread,
Feb 5, 2021, 6:59:59 AM2/5/21
to cp2k
and it goes without saying that first block is the Hamiltonian for <0|OP|0> with onsite values.so
1->0 0 0 
2-> 1 0 0 
3->2 0 0 
Kind regards,
Elaheh Akhoundi

fabia...@gmail.com

unread,
Apr 30, 2021, 2:15:07 PM4/30/21
to cp2k
Hi Elaheh,

The trunk version of cp2k now has a switch REAL_SPACE in DFT%PRINT%S_CSR_WRITE and DFT%PRINT%KS_CSR_WRITE to print the real space representation of the overlap and KS matrix.This key word also activates the printing of the cell indices.

Cheers,
Fabian
Reply all
Reply to author
Forward
0 new messages