Band Structure Sets with cp2k_bs2csv.py

527 views
Skip to first unread message

Brian Day

unread,
Jun 22, 2020, 11:56:50 AM6/22/20
to cp2k
Could anybody explain to me the difference between all of the different 'material.bs-setN.csv' files generated by the cp2k_bs2csv.py code?

My understanding is that there is typically one per K-point set, but I'm a bit confused as to how I should be plotting the csv files. Should I only be plotting set 1? Or should I be plotting all the sets in a concatenated fashion, or taking the range between the k-points of that set, etc.?

Any clarification would be hugely appreciated - Thanks!

-Brian

Brian Day

unread,
Jun 22, 2020, 2:52:41 PM6/22/20
to cp2k
Answering my own question:

Each 'material.bs-setN.csv' file is the set of energies for all points between the corresponding set of k points, so in order to plot the full band structure between all k-point sets, each file needs to be loaded. 

One could make the argument for returning a single CSV file rather than multiple, but in the case of disjointed paths, distinct files is preferred. Hopefully this answers any questions future users might have.

-Brian

Dmitry Ryndyk

unread,
Dec 9, 2020, 5:15:12 PM12/9/20
to cp2k
Dear all,

as far as I can see, the format of the output file is changed in the developing version (or maybe earlier).
The cp2k_bs2csv.py script does not work anymore.
Did somebody modify it?

Best wishes,
Dmitry

Krack Matthias (PSI)

unread,
Dec 9, 2020, 6:33:50 PM12/9/20
to cp...@googlegroups.com

Hi Dmitry

 

the BS output in the development version was changed by me. I have been working on a python script to plot band structures based on the new output, but this work is delayed.

 

Matthias

--
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/817b82bf-95a0-4dd3-b6fc-0d1740eea246n%40googlegroups.com.

Tiziano Müller

unread,
Dec 10, 2020, 3:12:50 AM12/10/20
to 'Dmitry Ryndyk' via cp2k
Dear Dmitry,

you can find an updated version of the cp2k_bs2csv.py in the
cp2k-output-tools project here:


https://github.com/cp2k/cp2k-output-tools/blob/develop/cp2k_output_tools/scripts/bandstructure.py

Installation via pip is best:

pip install cp2k-output-tools

It should then be available as cp2k_bs2csv
Depending on your system you may have to use `pip3` instead of `pip` to
use Python 3, or call `pip` with `--user`: `pip install --user
cp2k-output-tools`, and/or add the directory `$HOME/.local/bin` to your
`$PATH`.

Best regards,
Tiziano
> --
> 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>.
> <https://groups.google.com/d/msgid/cp2k/817b82bf-95a0-4dd3-b6fc-0d1740eea246n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Tiziano Müller
University of Zurich
Department of Chemistry
Winterthurerstrasse 190
CH-8057 Zürich

Tel: +41 44 63 54234
www.chem.uzh.ch
tiziano...@chem.uzh.ch

Dmitry Ryndyk

unread,
Dec 10, 2020, 4:06:58 AM12/10/20
to cp2k
Dear Matthias and Tiziano,

thank you. I will have a look.

Dima

Dmitry Ryndyk

unread,
Dec 10, 2020, 4:21:17 AM12/10/20
to cp2k
It is an old version in
That is what I asked.
So, what we plan to do?

Dima

Tiziano Müller

unread,
Dec 10, 2020, 4:41:16 AM12/10/20
to 'Dmitry Ryndyk' via cp2k
Hi Dima,

I've updated the script there to work with CP2K as on May 5th and there
were no changes to the relevant output since then as far as I see?

Can you please test whether it works and if not make a bugreport on
https://github.com/cp2k/cp2k-output-tools/issues ?

Best,
Tiziano

On 12/10/20 10:21 AM, 'Dmitry Ryndyk' via cp2k wrote:
> It is an old version in
> https://github.com/cp2k/cp2k-output-tools/blob/develop/cp2k_output_tools
> <https://github.com/cp2k/cp2k-output-tools/blob/develop/cp2k_output_tools/scripts/bandstructure.py>
> <https://groups.google.com/d/msgid/cp2k/817b82bf-95a0-4dd3-b6fc-0d1740eea246n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/cp2k/817b82bf-95a0-4dd3-b6fc-0d1740eea246n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> Tiziano Müller
> University of Zurich
> Department of Chemistry
> Winterthurerstrasse 190
> CH-8057 Zürich
>
> Tel: +41 44 63 54234
> www.chem.uzh.ch <http://www.chem.uzh.ch>
> tiziano...@chem.uzh.ch
>
> --
> 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/7a7f08cd-e066-451b-89cc-2fe4621daca6n%40googlegroups.com
> <https://groups.google.com/d/msgid/cp2k/7a7f08cd-e066-451b-89cc-2fe4621daca6n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Message has been deleted

Dmitry Ryndyk

unread,
Dec 10, 2020, 5:02:54 AM12/10/20
to cp2k
Sorry, I found changes now! Should work!

Dmitry Ryndyk

unread,
Dec 10, 2020, 5:22:36 AM12/10/20
to cp2k
So. Finally, it really works.
But I was not able to find it quickly without your help. And the script in exercises is outdated.
I think it is a good idea to make tools like it more visible at cp2k.org.

Dima 

Alexander Kramarenko

unread,
Mar 16, 2021, 12:42:51 PM3/16/21
to cp2k
Hello, Dmitry

Could you please provide the working script? or give an idea how you found a solution for the problem.
thank you in advance.

Best regards, Alexander 

Dmitry Ryndyk

unread,
Mar 16, 2021, 1:09:37 PM3/16/21
to cp2k
Hi Alexander,

first of all install 

it will transfer .bs file to .csv file ready for figure.
If you get .csv, I can try my second script to make a figure.
But you need to edit this script by hand, I hope to make better script later.
Ask me for details.

cp2ktools_plotbands.py

Alexander Kramarenko

unread,
Mar 17, 2021, 8:40:17 AM3/17/21
to cp2k
Hi Dmitry
Thank you so much for your reply!
But the problem is that script from the link you provided doesn't work for me and i don't understand why.
it just does nothing. I thought you did some corrections in the code.   

Dmitry Ryndyk

unread,
Mar 17, 2021, 8:50:36 AM3/17/21
to cp2k
If you write "cp2k_bs2csv" do you see:

$ cp2k_bs2csv
usage: cp2k_bs2csv [-h] [-p OUTPUT_PATTERN] <bandstructure-file>
cp2k_bs2csv: error: the following arguments are required: <bandstructure-file>

Alexander Kramarenko

unread,
Mar 17, 2021, 8:57:52 AM3/17/21
to cp2k
Yeah! it works! i did some mistakes
thank you for your help

Anjali ganai

unread,
Jun 28, 2022, 1:58:34 AM6/28/22
to cp2k
Dear all,

as far as I can see, the format of the output file is changed in the developing version (or maybe earlier).
Can anyone suggest me something please? (.bs attached)

Best wishes,
Anjali
WO3.bs

Krack Matthias (PSI)

unread,
Jun 28, 2022, 5:24:35 AM6/28/22
to cp...@googlegroups.com

Hi Anjali

 

You refer to a forked cp2k-output-tools repository which is not up-to-date. Try the original master https://github.com/cp2k/cp2k-output-tools instead of that fork.

 

Best

 

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/ff18353f-4ce9-4e7b-8f8d-9cb60d9beee7n%40googlegroups.com.

Anjali ganai

unread,
Jun 28, 2022, 6:39:30 AM6/28/22
to cp...@googlegroups.com
Thank you for the reply but I'm quite confused about which script you are talking of. I went to this page 
and I'm quite confused about which python script to use. Should I use cli.py or bandstructure_parser.py? Could you please guide me through this

Krack Matthias (PSI)

unread,
Jun 28, 2022, 7:45:10 AM6/28/22
to cp...@googlegroups.com

You can use pip to install the cp2k-output-tools like the cp2k-input-tools: pip install cp2k-output-tools

Alternatively, you can run in the folder cp2k-output-tools “pip install .”

After a successful installation (note the requirements) the command “cp2k_bs2csv” should be available.

Anjali ganai

unread,
Jun 29, 2022, 3:36:34 AM6/29/22
to cp2k
Thank you very much. It worked.
Regards
Anjali

Reply all
Reply to author
Forward
0 new messages