-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add possibility to print bvec. #176
Conversation
sponce24
commented
May 20, 2018
- new input variable to trigger the printing
- new test
This can then be used by EPW to compute velocities. A new input variable "write_bvec" has been introduced. A new test has been introduced.
Codecov Report
@@ Coverage Diff @@
## develop #176 +/- ##
===========================================
+ Coverage 57.95% 57.99% +0.04%
===========================================
Files 27 27
Lines 16031 16051 +20
===========================================
+ Hits 9290 9309 +19
- Misses 6741 6742 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
I just added a few comments, plus a couple of additional things: since you are adding a flag, could you add the respective documentation for the flag, and for the format of the output file, in the user guide?
- table of input flags: add near here:
wannier90/doc/user_guide/parameters.tex
Line 288 in da4b9bd
\new{\sc write\_rmn } & L & \new{Write the position operator in the WF basis} \\ - description of inputs: add near here:
wannier90/doc/user_guide/parameters.tex
Line 1378 in da4b9bd
\subsection[write\_rmn]{\tt logical :: write\_rmn} - description of the output file: add near here:
wannier90/doc/user_guide/files.tex
Line 553 in da4b9bd
\section{{\tt seedname\_r.dat}}
src/hamiltonian.F90
Outdated
! write_rmn = .true. | ||
! write_bvec = .true. | ||
if (write_bvec) then | ||
open(file_unit,file=trim(seedname)//'.bvec',form='formatted',status='unknown',err=101) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you point to a different error message mentioning the .bvec file? (Label 101 instead mentions _r
)
test.txt
Outdated
@@ -0,0 +1 @@ | |||
sdfs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove this file?
src/hamiltonian.F90
Outdated
! RM and SP - write to file vectors b and their weight wb for each k-point | ||
! This is used by EPW to compute the velocity. | ||
! Note that you need to put in your Wannier input: | ||
! write_hr = .true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of requiring all three flags to be set, could you put the code in a different function, and in plot_main
(plot.F90) you do, toward the end, below
if(wannier_plot) call plot_wannier
something like
if(write_bvec) call plot_bvec
Note that the file will be changed when merging #177, this automatically also remove the need of write_hr
(so you might want to work on top of those changes - in this case, add also the .or. write_bvec
at the top, where the header is printed).
num_wann = 4 | ||
num_iter = 20 | ||
|
||
write_hr = .true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make a test where only write_bvec
is set, and all other plotting options are removed (write_hr
, write_rmn
) - see also my other comment above.
test-suite/tests/jobconfig
Outdated
[testw90_bvec] | ||
program = WANNIER90_WOUT_OK | ||
inputs_args = ('lead.win', '') | ||
output = lead.wout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test shouldn't check the .wout, but rather we should add a new program
and a new parser
to check the check the new bvec
file (see e.g. what I did in #177 for a different file). You can then check with the parser, e.g., the number of bvecs or even all values.
as a note, now #177 has been merged, I updated your branch so you can work directly on that version (see my comments above). |
src/hamiltonian.F90
Outdated
write(file_unit,*) nntot | ||
do nkp = 1, num_kpts | ||
do nn = 1, nntot | ||
write (file_unit,'(4F12.6)') bk(:,nn,nkp), wb(nn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another request about the format of the file: could you add two header lines, as in most of the other files:
- first line as a comment, including a timestamp, in order to ease debug in case people regenerate many times the file and want to know if it was regenerated or not
- Second line with the size of the matrix (two integers,
num_kpts
andnntot
)
You can give a look to other files to see how the header looks like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @sponce24 !
Add possibility to print bvec. Fixes wannier-developers#178