Skip to content

Conversation

user202729
Copy link
Contributor

@user202729 user202729 commented Aug 31, 2025

Fixes #40733.

The cause of the linked issue is that crosses_log_branch_cut() == False does not imply it's safe to compute argument(), since a line crossing zero does not cross the log branch cut, yet its argument is indeterminate.

Whether this is the correct definition of the log branch cut is debatable (zero should be included in the branch cut too), but anyway there's another subtle bug in the other branch (just because val crosses the branch cut and we know x is nonzero (because of the if not x: check at the very start) doesn't mean x is in fact negative). I just rewrote the logic entirely.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Copy link

github-actions bot commented Aug 31, 2025

Documentation preview for this PR (built with commit 90f0cb2; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@user202729 user202729 force-pushed the fix-qqbar-pow-rational branch from 6d046a2 to aa5c925 Compare August 31, 2025 10:44
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.

QR decomposition fails for qqbar matrix
1 participant