Skip to content

Reversed indices in parse_bands #96

@jywu20

Description

@jywu20

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions