Skip to content

Fix sum_squares_lin canonicalization#4

Merged
SteveDiamond merged 3 commits intocvxpy:mainfrom
haozhu10015:fix-sum-squares
Apr 8, 2026
Merged

Fix sum_squares_lin canonicalization#4
SteveDiamond merged 3 commits intocvxpy:mainfrom
haozhu10015:fix-sum-squares

Conversation

@haozhu10015
Copy link
Copy Markdown
Contributor

This PR fixes sum_squares canonicalization for affine expressions in objective.

The old sum_squares_lin only handles the trivial case $|x|_2^2$ in the objective as a QP. Everything else fell through to the SOC epigraph reformulation, which causes the solver to actually minimize $|Ax + c|_2$ instead of $|Ax + c|_2^2$ for such expressions. This fix generalizes the QP path to handle the full affine case $|Ax + c|_2^2$ by expanding it analytically.

Copy link
Copy Markdown
Collaborator

@SteveDiamond SteveDiamond left a comment

Choose a reason for hiding this comment

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

Thanks! Sorry for the slow response.

@SteveDiamond SteveDiamond merged commit 527133a into cvxpy:main Apr 8, 2026
10 checks passed
@haozhu10015 haozhu10015 deleted the fix-sum-squares branch April 9, 2026 06:04
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.

2 participants