BoothGroup / Vayesta

A Python package for wave function-based quantum embedding
Apache License 2.0
33 stars 8 forks source link

UFCI different norbs in spin channels #93

Closed cjcscott closed 1 year ago

cjcscott commented 1 year ago

This updates the UFCI solver to support clusters with different numbers of orbitals within the alpha and beta spin channels. This makes use of the dummy orbital construction contained within #92. However, implementation was complicated by the fact that neither pyscf's FCI and CASCI functionality support having different numbers of active orbitals in different spin channels, and that we use the associated FCI functions as a backend when calculating wavefunction properties within UFCI_WaveFunction.

To get around this, this PR implements an object UFCI_WaveFunction_w_dummy which represents a UFCI wavefunction with differing numbers of orbitals in the different spin channels via the wavefunction padded with dummy orbitals. These dummy orbitals are traced out of any expectation values before returning them, allowing us to avoid implementing a CI solver for this specific case. One this is done implementation of the actual solver is straightforward.

I think this is a reasonable, if slightly odd, approach but I thought it worth discussing separately to #92 for the sake of making sure others agree.

(Test failures are due to final commits of #92 not yet being incorporated into this branch; once that PR is stable I'll update this branch)

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 22.09% and project coverage change: -0.23 :warning:

Comparison is base (ed2f91f) 72.12% compared to head (a2ca460) 71.89%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #93 +/- ## ========================================== - Coverage 72.12% 71.89% -0.23% ========================================== Files 138 138 Lines 18476 18561 +85 Branches 2578 2592 +14 ========================================== + Hits 13325 13344 +19 - Misses 4420 4485 +65 - Partials 731 732 +1 ``` | [Impacted Files](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/93?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup) | Coverage Δ | | |---|---|---| | [vayesta/core/types/wf/fci.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/93?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9jb3JlL3R5cGVzL3dmL2ZjaS5weQ==) | `66.95% <17.39%> (-12.53%)` | :arrow_down: | | [vayesta/solver/fci.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/93?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9zb2x2ZXIvZmNpLnB5) | `74.11% <33.33%> (-8.74%)` | :arrow_down: | | [vayesta/core/qemb/scrcoulomb.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/93?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9jb3JlL3FlbWIvc2NyY291bG9tYi5weQ==) | `72.88% <100.00%> (ø)` | | | [vayesta/solver/hamiltonian.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/93?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9zb2x2ZXIvaGFtaWx0b25pYW4ucHk=) | `82.07% <100.00%> (+0.03%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/93/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.