-
Notifications
You must be signed in to change notification settings - Fork 13
DOCI 3RDM implementation #83
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
Conversation
msricher
left a comment
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.
This looks good.
Can you make your compute_rdms function separate from the old one? It's good to have one that only compute 1,2-RDMs, and then one that also computes the 3,4-RDMs.
You also need to add some tests. And make sure that you use very small test cases with your 3,4-RDM tests! Currently, the existing tests fail because it tries to allocate 400GB of memory to compute the 4-RDM of the test system. I would recommend adding a test FCIDUMP file for H2 or He in a minimal basis (sto-3g).
|
Sure, I can do the changes you mention. However let me ask you something about it First, how should I call the new function compute_rdms, because since it will have the same inputs as the old one (the DOCI wave function and the coefficients) I think I can not just overload the function (am I wrong?), so I will have to create a new one. |
Yeah, make new C++ functions. Maybe Yep, you can maybe use Be and B in minimal basis set as test cases. My bad, I forgot it was 3/4 RDMS. |
|
Hi, I already created the new function compute_rdms_34 and made all the bindings with python. However, the problems with the test persisted. Taking a look into the problems, its seems that the problems are coming from the function spinze_rdms in utility.py. In the line that I try to allocate memory for the 3rdm it crashes since is too much memory. |
|
I have implemented what I said in the last comment. I create a new function spinize_rdms_34 that only works for DOCI wave functions. I leave the function spinize_rdms as it was. I also added a new test function. In this test I check the 3RDM trace, the traces of its blocks, and it also checks that tracing over two indices of the 3RDM gives the 2RDM (for all the blocks). As far as I tested, all the tests were working perfectly. SideNote: Just to be clear, this PR is only for the implementation of the 3RDM, I haven't implemented the 4RDM yet, although it would be pretty straightforward with this code, as the 4 RDM only has two new sets of elements, the rest would be obtained re using the 3rdm and 2rdm elements. The tricky part on the 4RDM (as it was for the 3RDM) is the symmetrization, the C++ code for the implementation I already have it (I believe). The 4RDM has a bunch of symmetries, and one has to be careful when adding all those symmetries. |
|
This looks OK to me! I just have a few minor requests.
Otherwise, the tests pass (under the Checks tab on this page), and the code is good. You can fix it up a bit and then squash merge with a descriptive commit msg it if the tests pass again. |
|
Sure! I'll implement those changes right away |
In this PR I went address the issue #58 . I implemented the 3RDM computation for DOCI wave functions. Here I list the changes done:
I tested all the functions with BH, H10 and H6, they all behaved correctly. The tested I did were the following:
I did not include any function in the module test because I am not sure where to put it, however if you give me some guidelines on how you want it implemented I can try to do it.
If not, I can pass the jupyter notebook where I was running the test such that anyone can test the implementation easily