Queries about input and output files, running specific calculations, etc.
Moderators: Global Moderator, Moderator
-
yujia_teng
- Newbie

- Posts: 49
- Joined: Thu May 25, 2023 6:24 pm
#1
Post
by yujia_teng » Tue Oct 07, 2025 11:58 pm
I can get the projected band for usual band calculation but can't for mBJ band calculation (used with KPOINTS_OPT method). I'm not sure why. I've checked the document and searched in the forum but couldn't find a solution. Chatgpt is also not helpful on this. Below is relevant code:
Code: Select all
mport py4vasp as pv
import numpy as np
calc = pv.Calculation.from_path(".")
fig = calc.band.to_plotly("kpoints_opt","f(Ho)")
fig.write_image("band.png")
For usual band, just remove the "kpoints_opt".
-
martin.schlipf
- Global Moderator

- Posts: 639
- Joined: Fri Nov 08, 2019 7:18 am
#2
Post
by martin.schlipf » Thu Oct 09, 2025 7:52 am
Note that there is a slight error in your function call. Does this resolve the issue?
fig = calc.band.to_plotly("kpoints_opt(f(Ho))")
Also if you only want to produce the image and never look at the plot interactively, you can also directly call
calc.band.to_image("kpoints_opt(f(Ho))")
Martin Schlipf
VASP developer
-
yujia_teng
- Newbie

- Posts: 49
- Joined: Thu May 25, 2023 6:24 pm
#3
Post
by yujia_teng » Thu Oct 09, 2025 6:10 pm
It works now, thanks very much for the help.