Skip to content
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

Fix the AngularMomentum (again) (backport #1292) #1297

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Dec 4, 2023

This is an automatic backport of pull request #1292 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

* fix: use the symmetric formula for S^2

Prior to this fix, the `AngularMomentum` operator was working on the
assumption that the number of alpha-spin particles would always exceed
the number of beta-spin particles (for non-singlet systems). However,
this is not guaranteed to be the case. This commit fixes this problem by
using a symmetric formula for S^2 which is the average of the two cases
(alpha- vs. beta-spin particles exceeding the other).

* feat: log a warning when the alpha-beta overlap is non-unitary

When dealing with active spaces obtained from unrestricted-spin
orbitals, the alpha-beta overlap matrix which is used to construct the
S^2 operator can become non-unitary (for example, when the active set of
alpha- and beta-spin orbitals do not span the same space). This can
result in an <S^2> value measured on the active space that is largely
different from (e.g.) the UHF <S^2> value. More importantly, when this
is the case, the difference between these two <S^2> values is "hidden"
in the inactive+inactive and inactive+active interactions. Especially
when spin contamination is present, this can lead to vastly unexpected
results and may indicate a poor choice of active space.

* Add reno

* test: add a regression test

* fix: update warning tolerance

* Linting and formatting

* docs: fix verbatim in RST

(cherry picked from commit 55e6776)
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7083986561

  • 19 of 19 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 86.801%

Totals Coverage Status
Change from base Build 7020936187: 0.03%
Covered Lines: 8786
Relevant Lines: 10122

💛 - Coveralls

@mergify mergify bot merged commit 945f52d into stable/0.7 Dec 4, 2023
17 checks passed
@mergify mergify bot deleted the mergify/bp/stable/0.7/pr-1292 branch December 4, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants