-
-
Notifications
You must be signed in to change notification settings - Fork 645
Add DCSD #1858
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
base: master
Are you sure you want to change the base?
Add DCSD #1858
Conversation
For whatever it's worth, the existing standard for modified CC methods had
been to pass a kwarg (mbpt2 or cc2). Admittedly, I'm not sure I love this
choice, especially as more modifications get added to CC. Similarly, the
use of lots of `if` statements in CC to manage CC2, and now DCSD, is
beginning to feel clunky, although I appreciate that it prevents code
duplication. CC2 especially needs a refactor, since it doesn't require the
same integrals/intermediates as full CCSD.
…On Mon, Sep 11, 2023 at 11:07 AM Verena Neufeld ***@***.***> wrote:
This is a draft pull request allowing the CCSD equations to be slightly
modified into the DCSD equations if a DCSD class is chosen. kUDCSD is not
implemented (also not planned by me).
My questions are related to the style. I have made DCSD classes. Then
@Property
def dcsd(self):
return self.__class__.__name__[-4:] == "DCSD"
decides whether the corresponding CCSD equations should be modified based
on the last four letters of the DCSD class being "DCSD", e.g. RDCSD.
I know that this is not 100% ideal but it seemed cleanest. Please let me
know what suggestions you have about this and other aspects of this Wip PR.
------------------------------
You can view, comment on, or merge this pull request online at:
#1858
Commit Summary
- 057f550
<057f550>
add rDCSD to rccsd_slow
- 93a795a
<93a795a>
rccsd start making changes
- 9804eb9
<9804eb9>
start with CCSD. Test is failing.
- 0fcf38e
<0fcf38e>
t1 set to zero. Now CCSD and RCCSD agree.
- 24fbda7
<24fbda7>
fix bug in RCCSD (and slow) and update test
- 2985d53
<2985d53>
UDCSD
- 1dce9be
<1dce9be>
krdcsd
- ffb7388
<ffb7388>
renaming for clarity
- 4034230
<4034230>
move DCSD to their own classes
- 3da48c3
<3da48c3>
also in pbc class for DCSD
- eeb29dc
<eeb29dc>
fix flake issue
File Changes
(16 files <https://github.com/pyscf/pyscf/pull/1858/files>)
- *M* pyscf/cc/ccsd.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-a1d6d4b7d92f072e915462a5b62443ae6e6797361b4513f8e156f57f1e47329f>
(72)
- *A* pyscf/cc/dcsd.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-77a63bd2224bf10682edd791cc1c4751cd3373ad5f3c8ed0778eae7c5ea8e014>
(24)
- *M* pyscf/cc/rccsd.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-bc228c2f4314953907159dfa873b9bd2db2f8c83e99f64a40dbef3b2bab32af8>
(24)
- *M* pyscf/cc/rccsd_slow.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-86420696d2da662a3f5ddd12cc1b8f3bd7b0c6190aa74b881a5ad8ec59e9569c>
(41)
- *A* pyscf/cc/rdcsd.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-9e04c431d521853d9e9167cbc08f5a22bb3902942afe118cdcfd7bdabdf98caa>
(24)
- *M* pyscf/cc/rintermediates.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-eac9cfcb77a9a76c5d6d99e6a7b07dcfb811dbd3bde21f372f28f500e5c51690>
(31)
- *M* pyscf/cc/test/test_rccsd.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-c416fcfd7bb3a7b6520356e23d2d3257304713ee7e0f4d31c422b18190a8593d>
(16)
- *M* pyscf/cc/test/test_uccsd.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-1391e145ba61065f0a7f16a8de023b05a6ca6b06461219471fbbfc1e1ac5d9d2>
(8)
- *M* pyscf/cc/uccsd.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-a517466c30f950caec2bb291f61597754f6f41ba74bde4a0e54fca1cfb1eee82>
(133)
- *A* pyscf/cc/udcsd.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-aeef200312706c1c7be8716f2d30c56e3b3d4124b1b0235442b5d2d8c804dcb9>
(24)
- *M* pyscf/pbc/cc/__init__.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-ef2db07e8218a30648ac8462cd1a17514fd5e2813370e7563af8de94ca930bd5>
(22)
- *A* pyscf/pbc/cc/dcsd.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-464294893f01bd658c39c08fc63d02e09cb9def988bbba8dd398b58008bece28>
(25)
- *M* pyscf/pbc/cc/kccsd_rhf.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-c6ac05b8dd4888148e5d9125bbd5073e356c101e745a46be00fe5992813464e4>
(50)
- *A* pyscf/pbc/cc/kdcsd_rhf.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-24b6d9939d5f76661985d3b671dadbe619389ac942419cfb4170b4e8c82f86a0>
(23)
- *M* pyscf/pbc/cc/kintermediates_rhf.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-d1feba32b6572d1579b9c2cf5333d1400dca375f2d90dbf176aa9f70b2a5a0c9>
(43)
- *A* pyscf/pbc/cc/test/test_dcsd.py
<https://github.com/pyscf/pyscf/pull/1858/files#diff-762a3f86086acdfb1ace92f37e47ff270bc0f4622d80976fc7f3e084f9341fac>
(242)
Patch Links:
- https://github.com/pyscf/pyscf/pull/1858.patch
- https://github.com/pyscf/pyscf/pull/1858.diff
—
Reply to this email directly, view it on GitHub
<#1858>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADGAJCZZPR2RGC27WNXILTLXZ4SL7ANCNFSM6AAAAAA4TPRQYY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks Tim! DCSD is very similar to CCSD, so I'm hesitant to write new t amp update equations for it. I agree, some refactoring would be useful. We also have ccsd.py, rccsd.py, rccsd_slow.py, all implementing restricted CCSD which can get confusing (but that is another topic maybe). Do you have suggestions? If you prefer, I can keep passing dcsd as a bool variable immediately instead of inferring from the class name. |
I agree, for DCSD, it probably makes sense to keep it embedded in the CCSD
update. Rather than checking the class name, perhaps its better to be more
explicit and just have DCSD classes that inherit from CCSD classes but set
a "private" attribute like `self._dcsd = True` and then check this in the
update code? CC2 and MBPT2 probably need to be refactored, and we might do
that soon in our group. (Honestly, the whole cc module would benefit from a
refactor ... 😅)
…On Mon, Sep 11, 2023 at 11:32 AM Verena Neufeld ***@***.***> wrote:
Thanks Tim! DCSD is very similar to CCSD, so I'm hesitant to write new t
amp update equations for it. I agree, some refactoring would be useful. We
also have ccsd.py, rccsd.py, rccsd_slow.py, all implementing restricted
CCSD which can get confusing (but that is another topic maybe). Do you have
suggestions? If you prefer, I can keep passing dcsd as a bool variable
immediately instead of inferring from the class name.
—
Reply to this email directly, view it on GitHub
<#1858 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADGAJCY5FRRVLWSEIZT775DXZ4VHDANCNFSM6AAAAAA4TPRQYY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
try |
This is a draft pull request allowing the CCSD equations to be slightly modified into the DCSD equations if a DCSD class is chosen. kUDCSD is not implemented (also not planned by me).
My questions are related to the style. I have made DCSD classes. Then
decides whether the corresponding CCSD equations should be modified based on the last four letters of the DCSD class being "DCSD", e.g. RDCSD.
I know that this is not 100% ideal but it seemed cleanest. Please let me know what suggestions you have about this and other aspects of this Wip PR.