Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

verena-neufeld
Copy link
Contributor

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.

@tberkel
Copy link
Collaborator

tberkel commented Sep 11, 2023 via email

@verena-neufeld
Copy link
Contributor Author

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.

@tberkel
Copy link
Collaborator

tberkel commented Sep 11, 2023 via email

@fishjojo
Copy link
Collaborator

fishjojo commented Sep 11, 2023

try isinstance(mycc, DCSD) and make all (R-, U-, K-,) DCSD classes inherit from DCSD.
But I agree with Tim that a refactor of the cc module is cleaner.

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

Successfully merging this pull request may close these issues.

3 participants