BoothGroup / Vayesta

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

Adds option to calculate in-cluster CCSD and FCI moments via Dyson #103

Closed basilib closed 1 year ago

obackhouse commented 1 year ago

Nice stuff - can you make sure to add dyson as an optional dependency in __init__.py, and once #97 is merged, in the pyproject.toml? Thanks

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 37.14% and project coverage change: +0.25 :tada:

Comparison is base (10db358) 71.99% compared to head (1e92142) 72.24%.

:exclamation: Current head 1e92142 differs from pull request most recent head 600c057. Consider uploading reports for the commit 600c057 to get more accurate results

: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 #103 +/- ## ========================================== + Coverage 71.99% 72.24% +0.25% ========================================== Files 138 138 Lines 18402 18437 +35 Branches 2578 2582 +4 ========================================== + Hits 13248 13320 +72 + Misses 4424 4375 -49 - Partials 730 742 +12 ``` | [Impacted Files](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/103?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup) | Coverage Δ | | |---|---|---| | [vayesta/core/qemb/qemb.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/103?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9jb3JlL3FlbWIvcWVtYi5weQ==) | `72.89% <ø> (ø)` | | | [vayesta/solver/fci.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/103?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9zb2x2ZXIvZmNpLnB5) | `74.07% <18.18%> (-8.79%)` | :arrow_down: | | [vayesta/solver/ccsd.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/103?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9zb2x2ZXIvY2NzZC5weQ==) | `54.90% <20.00%> (-2.45%)` | :arrow_down: | | [vayesta/\_\_init\_\_.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/103?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9fX2luaXRfXy5weQ==) | `73.83% <44.44%> (-2.70%)` | :arrow_down: | | [vayesta/core/qemb/fragment.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/103?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9jb3JlL3FlbWIvZnJhZ21lbnQucHk=) | `75.84% <100.00%> (+0.04%)` | :arrow_up: | | [vayesta/ewf/fragment.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/103?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9ld2YvZnJhZ21lbnQucHk=) | `66.31% <100.00%> (+0.23%)` | :arrow_up: | | [vayesta/solver/solver.py](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/103?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BoothGroup#diff-dmF5ZXN0YS9zb2x2ZXIvc29sdmVyLnB5) | `86.91% <100.00%> (+0.24%)` | :arrow_up: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/BoothGroup/Vayesta/pull/103/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.

obackhouse commented 1 year ago

FYI until #97 and #104 are merged, dyson isn't being imported in the CI - so these tests are not being hit on this PR. I'll push a hacky fix for now, and we will try to get #97 and #104 merged ASAP

obackhouse commented 1 year ago

One of the tests is failing @basilib

obackhouse commented 1 year ago

You can merge master and overwrite 1e92142, 43aa945, 600c057

basilib commented 1 year ago

You can merge master and overwrite 1e92142, 43aa945, 600c057

Thanks!

I haven't managed to figure out the issue with the CCSD tests. I might just need to set the equality tolerance to 1e-5 or something.

obackhouse commented 1 year ago

Thanks!

I haven't managed to figure out the issue with the CCSD tests. I might just need to set the equality tolerance to 1e-5 or something.

Those errors are pretty high - should they be numerically exact?

basilib commented 1 year ago

Those errors are pretty high - should they be numerically exact?

I think so, the FCI tests is almost identical and passes. They both calculate the moments via dyson with from the MF reference and with vayesta with a complete bath space for each fragment.

Moreover, both pass on zombie.

obackhouse commented 1 year ago

I think so, the FCI tests is almost identical and passes. They both calculate the moments via dyson with from the MF reference and with vayesta with a complete bath space for each fragment.

Moreover, both pass on zombie.

Yeah that's concerning then and shouldn't be looked over - I can take a look on my zombie config

basilib commented 1 year ago

Yeah that's concerning then and shouldn't be looked over - I can take a look on my zombie config

Thanks, that would be useful. The test is in vayesta/tests/ewf/test_moments.py.

obackhouse commented 1 year ago

They pass for me - what is your configuration?

[DEBUG]   |  Required packages:
[DEBUG]   |    * NumPy       v1.21.6    location: /home/olli/psi4conda/envs/py37/lib/python3.7/site-packages/numpy
[DEBUG]   |    * SciPy       v1.5.3     location: /home/olli/psi4conda/envs/py37/lib/python3.7/site-packages/scipy
[DEBUG]   |    * h5py        v3.0.0     location: /home/olli/psi4conda/envs/py37/lib/python3.7/site-packages/h5py
[DEBUG]   |    * PySCF       v2.1.1     location: /home/olli/git/pyscf/pyscf
[DEBUG]   |    * mpi4py      v3.0.3     location: /home/olli/psi4conda/envs/py37/lib/python3.7/site-packages/mpi4py
[DEBUG]   |    * cvxpy       v1.1.15    location: /home/olli/psi4conda/envs/py37/lib/python3.7/site-packages/cvxpy
[DEBUG]   |    * dyson       v0.0.0     location: /home/olli/git/dyson/dyson
[DEBUG]   |    * ebcc        v1.2.0     location: /home/olli/git/ebcc/ebcc
[DEBUG]   |  Git hashes:
[DEBUG]   |    * Vayesta:  de7e234
[DEBUG]   |    * PySCF:    f0beff0
[DEBUG]   |    * Dyson:    3f73862
[DEBUG]   |    * EBCC:     4600cea
[DEBUG]   |  System:  node= zombie  processor= x86_64
[DEBUG]   |  Environment variables:
[DEBUG]   |    OMP_NUM_THREADS= 1
obackhouse commented 1 year ago

Oh sorry, they pass for you too but not on the CI, ignore me