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

More robust seedname.wout parser #1

Closed
AntimoMarrazzo opened this issue Jul 17, 2017 · 12 comments · Fixed by #78
Closed

More robust seedname.wout parser #1

AntimoMarrazzo opened this issue Jul 17, 2017 · 12 comments · Fixed by #78
Assignees

Comments

@AntimoMarrazzo
Copy link
Collaborator

We should use regular expression instead of split&strip to parse x y z and the spread at each iteration.

@giovannipizzi
Copy link
Member

I think it's a bit more complex than that... the problem is that sometimes there are no spaces between coordinates!! (for long numbers starting with a minus)

What about adding a new output to W90 (if it's not already in the tb_parameters) with the centers spreads etc instead of trying to parse the wout?

@greschd
Copy link
Member

greschd commented Oct 13, 2017

Is there a good library to produce structured output (csv, xml, json, yaml) from Fortran? If so, I would argue for using that when creating a new output file. Otherwise we'll have to write yet another output parser..

@giovannipizzi
Copy link
Member

Maybe things like YAML are simple enough to be written even without a library? (I hope...)

@greschd
Copy link
Member

greschd commented Oct 13, 2017

Or a CSV with just index, x, y, z, spread. Of course since it's per iteration it would also make sense to have a nested list, which is more suited for YAML.

giovannipizzi added a commit that referenced this issue Jan 31, 2018
after the comma (for many-digit numbers). Not perfect,
but good workaround (also for #1) that does not require to change
Wannier90.
@giovannipizzi
Copy link
Member

I would consider this issue more general, and improve the names and parsing of the output.
We can then move the issue of creating a more machine-readable file in the Wannier90 repository, and when the feature is released implement its parsing from here.

@giovannipizzi giovannipizzi added this to the Version 2.0 release milestone Nov 1, 2019
@giovannipizzi
Copy link
Member

@normarivano could you report here the table that we started discussing, with the suggested changes to the parser key names, for discussion with the others?

@normarivano normarivano self-assigned this Nov 8, 2019
@normarivano
Copy link
Collaborator

I attach hereafter the table for the parsing of the standard output file. We propose some changes for the keys' names to be implemented within this release. Can you give me some feedback as soon as possible? Thank´s a lot.
@greschd @giovannipizzi @AntimoMarrazzo @qiaojunfeng

Keys in raw_wout_parser (i.e. seedname.wout parsing)
Suggested parsed key Current key Description Where in the seedname.wout
warnings warnings List of warnings General
number_wfs number_wannier_functions Number of Wannier functions. MAIN
length_units length_units Units used to express the lengths, if not Ang we will have an additional warning in the list warnings¨. MAIN
output_verbosity output_verbosity Level of verbosity of the output from 0 (low) to 3 (high). Default value is 1 and parsing is supported only in this case. MAIN
convergence_tolerance wannierize_convergence_tolerance The convergence tolerance to find the final spread WANNIERIZE
r2_mn_writeout r2_nm_writeout Boolean variable. If true, a file seedname.r2mn is written. WANNIERIZE
xyz_wf_centres_writeout xyz_wf_center_writeout Boolean variable. If true, a file seedname_centres.xyz is written in xyz format for further visualization (jmol, vmd etc.). WANNIERIZE
Omega_I Omega_I Gauge invariant spread. Final State
Omega_D Omega_D Diagonal part of gauge-dependent spread. Final State
Omega_OD Omega_OD Off-diagonal port of gauge-dependent spread. Final State
Omega_total Omega_total Sum of the total gauge-dependent spread and gauge-invariant spread. Final State
wf_ids wannier_function List of ordinal numbers identifying each Wannier function. Final State
im_re_ratio im_re_ratio List of the ratio between the imaginary and real part of the each Wannier function in the same order given by wf_ids above. Final State
wf_centres coordinates List of the coordiantes (x,y,z) of the centres of each Wannier function in the same order given by wf_ids and im_re_ratio above. Final State
wf_spreads spread List of the spreads associated to each Wannier function in the same order given by wf_ids, im_re_ratio and wf_centres. Final State

@normarivano
Copy link
Collaborator

I´m also going to open an other issue (not in Milestones) in which we can discuss additional information to parse for the future. Me and @qiaojunfeng already started discussing that.
#70

@greschd
Copy link
Member

greschd commented Feb 11, 2020

Looks all good to me 👍

@giovannipizzi
Copy link
Member

Thanks a lot! Looks good to me as well. Very good also to go back to UK spelling considering this is what the W90 code uses.

Just a couple of comments of things I would change:

  • r2_mn_writeout -> r2mn_writeout (there is no underscore neither in the name of the flag in the w90 input (write_r2mn), neither in the file extension)
  • xyz_wf_centres_writeout -> xyz_writeout (similar reason as above, for consistency (e.g. the W90 flag is called simply write_xyz).

@AntimoMarrazzo
Copy link
Collaborator Author

All good for me - I close the issue.

@giovannipizzi
Copy link
Member

I reopen it - let's close it when we have the PR that changes the names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants