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

lda unitialized #18

Closed
nikita-astronaut opened this issue Sep 27, 2020 · 5 comments
Closed

lda unitialized #18

nikita-astronaut opened this issue Sep 27, 2020 · 5 comments

Comments

@nikita-astronaut
Copy link

Dear mVMC developers,

as I tried to apply the GreenFuncN function I encountered several errors connected to invalid memory reads/writes. It seems like in the current mVMC release, in the src/mVMC/locgrn.c:325 function calculateNewPfMN_child the parameter lda is unitialized, which causes unexpected behavior of Pfaffian computation M_ZSKPFA(&uplo, &mthd, &n, mat, &lda, &pfaff, iwork, work, &lwork, rwork, &info);

Could you please comment on that? Should I set lda = 2 * n; somewhere before applying M_ZSKPFA?

It seems to me that this very function could not probably be used in a recent paper https://arxiv.org/pdf/2005.14142.pdf, at least since this bug (?) is present. Would mind to please commit the properly and surely working version?

Thanks a lot!

Best wishes,
Nikita

@xrq-phys
Copy link
Collaborator

I cannot ensure uncommenting lda = 2*n would make it work, but leading dimension for that matrix is indeed 2.

@nikita-astronaut
Copy link
Author

Dear RuQing,

thank you very much for clarifying this. Could you please tell, what are the all changes required to be done in calculateNewPfMN_child and perhaps in M_ZSKPFA to make everything work?

Could you please share the version of the src/mVMC/locgrn.c file used in obtaining the results of https://arxiv.org/pdf/2005.14142.pdf ?

Thanks a lot!

Best wishes,
Nikita

@tmisawa
Copy link
Collaborator

tmisawa commented Sep 27, 2020

Dear Nikita,

Because I and RuXing are not authors of the arXiv paper,
we do not know the details of the codes used in the arXiv paper.
If you want to use the code, please contact the authors of the arXiv paper.

By the way, on the GreenFuncN, it is used in the power Lanczos calculations.
For example, in lslocgrn.c, we calculate the 3-body and 4-body Green functions
using GreenFuncN.
Could you refer to the usages of GreenFuncN?

Best,
Takahiro Misawa

@nikita-astronaut
Copy link
Author

nikita-astronaut commented Sep 28, 2020

Dear Takahiro,

thanks a lot, this is a very good comment.

However, it is unclear to me how the function GreenFuncN can work properly in its current implementation.

As RuXing and me found out above, GreenFuncN calls calculateNewPfMN_child, where currently the parameter lda is uninitialized, and most likely during equals lda = 0 during execution (though this is not guaranteed).

Then pointer to lda is passed to M_ZSKPFA as 5th argument &lda, and I get an error from PFAPACK that 5th argument is invalid (note that LDA >= max(1, N)).

So, as I understand, in the lslocgrn.c file, where you calculate 3-body and 4-body GF, the execution of GreenFuncN never goes further line 254 (reduction stage, if some of the operators have matching indices).

I still believe that calculateNewPfMN_child in its currently commited way has an unexpected behavior.

Thanks for the advice, I will contact the authors of the very paper.

Best wishes,
Nikita

@nikita-astronaut
Copy link
Author

Dear all,

I have correctly modified calculateNewPfMN_child and checked the result by explicitly looking at the Pfaffians ratios. Now I have the working 4-point function. I thank you a lot for your assistance.

Closing this.

Best,
Nikita

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

No branches or pull requests

3 participants