Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reversed indices in parse_bands #96

Open
jywu20 opened this issue Oct 7, 2022 · 1 comment
Open

Reversed indices in parse_bands #96

jywu20 opened this issue Oct 7, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jywu20
Copy link

jywu20 commented Oct 7, 2022

Describe the bug
In this line in Outputs/PWscf.jl and the following line, the last two arguments of the reshape calls are switched.

To Reproduce

Just try this function on any output file of pw.x. The first k = line in the output file looks like

  k = 0.0000 0.0000 0.0000 (  5749 PWs)   bands (ev):

and when you run parse_bands on the content of that output file, you get

julia> parse_bands(scf_out_content)[1]
56×3 Matrix{Float64}:
 0.0     0.0     0.1588
 0.0     0.1538  0.0827
 0.0     0.0794  0.3077
 0.0     0.0827  0.2383
 0.0     0.1538  0.0
 0.0827  0.1588  0.3077
 0.0     0.0     0.2383
 0.0794  0.1538  0.0827
 0.0     0.1588  0.3846
 ⋮
 0.0827  0.0794  0.4615
 0.1538  0.0     0.1588
 0.0     0.3077  0.0827
 0.0     0.0794  0.4615
 0.1538  0.0827  0.2383
 0.0     0.3077  0.0
 0.0827  0.1588  0.4615
 0.1538  0.0     0.2383
 0.0794  0.3077  0.0827

So obviously the first line of parse_bands(scf_out_content)[1] isn't correct. If you look at the second $k$-point, it's

  k = 0.0000 0.0000 0.0827 (  5756 PWs)   bands (ev): 

Now you find it's actually in the first column, three elements later than the [0, 0, 0].

Expected behavior
I expect parse_bands(out_content)[1][:, 1] (or [1, :], depending on your convenion) to give the first $k$ point, and parse_bands(out_content)[2][:, 2] to give the energy levels on the first $k$ point.

Screenshots
If applicable, paste screenshots to help explain your problem.

@singularitti singularitti added the bug Something isn't working label Oct 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

Stale issue message

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2023
@singularitti singularitti reopened this Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants