Repository navigation
Add W_v output eigenvalues fix - #256
Conversation
|
Question on this - I believe Wv should be Hermitian, but can accumulate numerical errors (like Wp). In vacuum, it is forced Hermitian with If this breaks, perhaps another option is to use |
|
I agree with @jhalpern30 |
|
So not sure if this fixes the lsymz = false case. (i tested it with lsymz false and got similar output, so that means it's fine? The simple fix might just be using a new variable ev_real ? The versions i tested reinstate ev as COMPLEX(r8). From the outputs i test, the ev_real addition seems to work best. vs Test Script: Test outputs: |
|
@jhalpern30 please respond. Id like to merge or close this before releasing v1.6 |
|
Sorry all, this got lost in other Github notifications. I think this is fine - the |
jhalpern30
left a comment
There was a problem hiding this comment.
Looks like it just needs to pass the Fortran build checks
|
My agent (extremely powerful) was going through the code-base and made the following remark on the issue this PR is dealing with: " Fix (DCON is the same, plus ! rdcon/free.f, declarations
REAL(r8), DIMENSION(mpert) :: evr
! before the zheev call (replaces it)
lwork=2*mpert-1
CALL zheev('V','U',mpert,wv,mpert,evr,work,lwork,rwork,info)
ev=evrAll other outputs (Δ′, W_t, eigenvectors) are bit-identical on the DIII-D resistive example. I haven't fact checked it but thought I'd share regardless - seems like a few more call-sites need the fix |
|
@StuartBenjamin That does appear to be the case. I will go through all our zheev calls and make sure that this is fixed on this branch. |
|
OK @logan-nc @jhalpern30 @StuartBenjamin this problem is much larger than I thought, actually. I have found a couple other instances of problems with ZHEEV calls besides the one Stuart's agent found. That is going to be a much larger bugfix PR. I recommend merging this. I will open the bugfix PR once I make progress on that, which I will work on tonight. This also makes me wonder if there are any other instances of LAPACK/LSODE/ZVODE misuse. Since there is no interface for them the compiler doesn't check, unfortunately. I will look into if there is any way to check these things automatically. |
Potential Bug find and Fix.
Comparisons between W_t and reconstructed matrix from eigen values and vectors was not working.
Matrix reconstruction tests were done with this script. (both before and after changes are included in comments of script)
dcon_W_reconstruction_test.py
The changes to dcon/free.f and dcon/dcon_netcdf.f now reflect that 'ev' is defined as explicitly real eigenvalues.
This can be seen from the call to zheev line305, ev needs to be real zheev doc