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

Ensure PSD operators are being optimized over proper space #600

Merged
merged 5 commits into from
May 31, 2024

Conversation

golanor
Copy link
Contributor

@golanor golanor commented May 29, 2024

Description

Fixes #431 - Replacing "PSD" with the Hermitian type, so we optimize over complex variables instead of real ones.
The "Symmetric Extension Hierarchy" tests currently do not pass.

Changes

  • Modify all uses of PSD in CVXPY to hermitian=True and ensure the variables are positive.
  • All tests pass

Checklist

  • Use ruff for errors related to code style and formatting.
  • Verify all previous and newly added unit tests pass in pytest.
  • Check the documentation build does not lead to any failures. Sphinx build can be checked locally for any failures related to your PR
  • Use linkcheck to check for broken links in the documentation
  • Use doctest to verify the examples in the function docstrings work as expected.

@golanor golanor marked this pull request as ready for review May 29, 2024 17:51
Copy link

codecov bot commented May 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.1%. Comparing base (220b94f) to head (f78e568).
Report is 272 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff           @@
##           master    #600   +/-   ##
======================================
  Coverage    98.1%   98.1%           
======================================
  Files         162     162           
  Lines        3108    3111    +3     
  Branches      760     759    -1     
======================================
+ Hits         3050    3053    +3     
  Misses         37      37           
  Partials       21      21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@purva-thakre purva-thakre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for 1 minor comment where the if else conditional is dropped.

We'll wait for @vprusso's feedback before merging this.

if is_real:
objective = cvxpy.Maximize(cvxpy.real(win))
else:
objective = cvxpy.Maximize(win)
objective = cvxpy.Maximize(cvxpy.real(win))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change related to this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - if both branches use cvxpy.real there there isn't really a need to have a conditional, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification. When I made my previous comment, I was trying to understand why Vincent had to use the if else block. But I get it now.

This shouldn't be a blocker for merging the PR.

Copy link
Owner

@vprusso vprusso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the help, @purva-thakre !

I'll go ahead and assign you to the issue for tracking, and MWR, @golanor !

@purva-thakre purva-thakre merged commit bfbf143 into vprusso:master May 31, 2024
17 of 18 checks passed
@purva-thakre
Copy link
Collaborator

Congrats on the bounty @golanor !

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.

Ensure PSD operators are being optimized over proper space
3 participants